[libjogl2-java] 03/58: Imported Upstream version 2.0-rc2

Tony Mancill tmancill at moszumanska.debian.org
Thu Sep 4 03:59:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

tmancill pushed a commit to branch master
in repository libjogl2-java.

commit 164f8725c00547f12ef859505e185cf3c786fc38
Author: tony mancill <tmancill at debian.org>
Date:   Fri Aug 29 18:42:41 2014 -0700

    Imported Upstream version 2.0-rc2
---
 .classpath                                         |   35 +
 .externalToolBuilders/jogl builder.launch          |   18 +
 .../org.eclipse.jdt.core.javabuilder.launch        |    7 +
 .project                                           |   31 +
 LICENSE.txt                                        |    8 +
 doc/NEWT.txt                                       |   30 +
 doc/TODO.txt                                       |   17 +-
 etc/profile.jogl                                   |   29 +
 jnlp-files/applet-version-jnlp.html                |   41 +
 jnlp-files/applet-version-lancheronly.html         |   39 +
 jnlp-files/applet-version.jnlp                     |   24 +
 jnlp-files/application-version.jnlp                |   19 +
 jnlp-files/javaws-version.jnlp                     |   19 +
 jnlp-files/jogl-all-awt.jnlp                       |    2 +-
 jnlp-files/jogl-all-noawt.jnlp                     |    2 +-
 jnlp-files/jogl-awt.jnlp                           |    2 +-
 jnlp-files/jogl-core.jnlp                          |    4 +-
 jnlp-files/jogl-gl2es12.jnlp                       |   48 -
 jnlp-files/nativewindow-all-awt.jnlp               |    6 +-
 jnlp-files/nativewindow-awt.jnlp                   |    6 +-
 jnlp-files/nativewindow.jnlp                       |   30 +-
 jnlp-files/newt-all-awt.jnlp                       |    4 +-
 jnlp-files/newt-all-noawt.jnlp                     |    4 +-
 jnlp-files/newt-awt.jnlp                           |    4 +-
 jnlp-files/newt-jogl.jnlp                          |    4 +-
 jnlp-files/newt.jnlp                               |   32 +-
 jogl.iml                                           |    1 -
 make/build-common.xml                              |  165 +-
 make/build-jogl.xml                                |  429 ++--
 make/build-junit.xml                               |  280 ---
 make/build-nativewindow.xml                        |  258 +--
 make/build-newt.xml                                |  302 +--
 make/build-staticglgen.xml                         |    6 +-
 make/build-test.xml                                |  487 ++++
 make/build.xml                                     |   57 +-
 make/config/jogl/cg-common-CustomJavaCode.java     |    6 +-
 make/config/jogl/cg-common.cfg                     |    2 +-
 make/config/jogl/cgl-macosx.cfg                    |    2 +-
 make/config/jogl/cglext.cfg                        |    4 +-
 make/config/jogl/egl-common.cfg                    |    2 +-
 make/config/jogl/egl.cfg                           |    2 +-
 make/config/jogl/eglext.cfg                        |    6 +-
 make/config/jogl/gl-common.cfg                     |    4 +-
 make/config/jogl/gl-es1.cfg                        |    2 +-
 make/config/jogl/gl-es2.cfg                        |    2 +-
 make/config/jogl/gl-gl4bc.cfg                      |    2 +-
 make/config/jogl/gl-if-gl3.cfg                     |    2 +-
 make/config/jogl/gl-impl-CustomCCode-gl4bc.c       |   12 +-
 make/config/jogl/gl-impl-CustomCCode-gles1.c       |    8 +-
 make/config/jogl/gl-impl-CustomCCode-gles2.c       |    8 +-
 make/config/jogl/glu-CustomJavaCode-base.java      |    4 +-
 make/config/jogl/glu-CustomJavaCode-gl2es1.java    |    2 +-
 make/config/jogl/glu-base.cfg                      |    4 +-
 make/config/jogl/glu-common.cfg                    |    6 +-
 make/config/jogl/glu-gl2.cfg                       |   12 +-
 make/config/jogl/glu-gl2es1.cfg                    |    2 +-
 make/config/jogl/glx-CustomCCode.c                 |   22 +-
 make/config/jogl/glx-CustomJavaCode.java           |    2 +-
 make/config/jogl/glx-x11.cfg                       |    4 +-
 make/config/jogl/glxext.cfg                        |    8 +-
 make/config/jogl/wgl-win32.cfg                     |    2 +-
 make/config/jogl/wglext.cfg                        |    4 +-
 .../jawt-DrawingSurfaceInfo-CustomJavaCode.java    |    6 +-
 make/config/nativewindow/jawt-common.cfg           |    4 +-
 make/config/nativewindow/jawt-macosx.cfg           |    2 +-
 make/config/nativewindow/jawt-win32.cfg            |    2 +-
 make/config/nativewindow/jawt-x11.cfg              |    2 +-
 make/config/nativewindow/win32-CustomJavaCode.java |   58 +-
 make/config/nativewindow/win32-lib.cfg             |    7 +-
 make/config/nativewindow/x11-CustomJavaCode.java   |    2 +-
 make/config/nativewindow/x11-lib.cfg               |    2 +-
 make/createTagletProps.sh                          |   34 +
 make/doc/jogl/spec-overview.html                   |  177 +-
 make/jogl_wince6_vs9/gluegen-rt/gluegen-rt.vcproj  |    2 +-
 make/jogl_wince6_vs9/jogl_es1/jogl_es1.vcproj      |    2 +-
 make/jogl_wince6_vs9/jogl_es2/jogl_es2.vcproj      |    2 +-
 make/jogl_wince6_vs9/newt/newt.vcproj              |    2 +-
 make/joglversion-cdc                               |   12 -
 make/lib/swt/LICENSE.txt                           |   16 +
 make/lib/swt/README.txt                            |    1 +
 make/lib/swt/cocoa-macosx-x86_64/about.html        |  205 ++
 .../swt/cocoa-macosx-x86_64/about_files/IJG_README |  385 +++
 .../cocoa-macosx-x86_64/about_files/mpl-v11.txt    |  470 ++++
 make/lib/swt/cocoa-macosx-x86_64/swt-debug.jar     |  Bin 0 -> 2110655 bytes
 make/lib/swt/cocoa-macosx/about.html               |  218 ++
 make/lib/swt/cocoa-macosx/about_files/IJG_README   |  385 +++
 make/lib/swt/cocoa-macosx/about_files/mpl-v11.txt  |  470 ++++
 make/lib/swt/cocoa-macosx/swt-debug.jar            |  Bin 0 -> 2197872 bytes
 make/lib/swt/epl-v10.html                          |  261 +++
 make/lib/swt/gtk-linux-x86/about.html              |  301 +++
 make/lib/swt/gtk-linux-x86/about_files/IJG_README  |  385 +++
 .../swt/gtk-linux-x86/about_files/about_cairo.html |   48 +
 .../lib/swt/gtk-linux-x86/about_files/lgpl-v21.txt |  506 ++++
 make/lib/swt/gtk-linux-x86/about_files/mpl-v11.txt |  470 ++++
 .../gtk-linux-x86/about_files/pixman-licenses.txt  |   92 +
 .../swt/gtk-linux-x86/about_files/webkit-bsd.txt   |   20 +
 make/lib/swt/gtk-linux-x86/swt-debug.jar           |  Bin 0 -> 2097107 bytes
 make/lib/swt/gtk-linux-x86_64/about.html           |  301 +++
 .../swt/gtk-linux-x86_64/about_files/IJG_README    |  385 +++
 .../gtk-linux-x86_64/about_files/about_cairo.html  |   48 +
 .../swt/gtk-linux-x86_64/about_files/lgpl-v21.txt  |  506 ++++
 .../swt/gtk-linux-x86_64/about_files/mpl-v11.txt   |  470 ++++
 .../about_files/pixman-licenses.txt                |   92 +
 .../gtk-linux-x86_64/about_files/webkit-bsd.txt    |   20 +
 make/lib/swt/gtk-linux-x86_64/swt-debug.jar        |  Bin 0 -> 2259562 bytes
 make/lib/swt/notice.html                           |  107 +
 make/lib/swt/win32-win32-x86/about.html            |  184 ++
 .../lib/swt/win32-win32-x86/about_files/IJG_README |  385 +++
 .../swt/win32-win32-x86/about_files/mpl-v11.txt    |  470 ++++
 make/lib/swt/win32-win32-x86/swt-debug.jar         |  Bin 0 -> 2402240 bytes
 make/lib/swt/win32-win32-x86_64/about.html         |  171 ++
 .../swt/win32-win32-x86_64/about_files/IJG_README  |  385 +++
 .../swt/win32-win32-x86_64/about_files/mpl-v11.txt |  470 ++++
 make/lib/swt/win32-win32-x86_64/swt-debug.jar      |  Bin 0 -> 2425896 bytes
 make/native-taglet.properties                      |  832 ++++---
 make/nativewindowversion-cdc                       |   12 -
 make/newtversion-cdc                               |   12 -
 make/scripts/cmpOld2New.sh                         |    0
 make/scripts/count-lock.sh                         |    0
 make/scripts/cpp-gluegen-test.sh                   |    0
 make/scripts/java-win32-dbg.bat                    |   11 +-
 make/scripts/java-win32.bat                        |    8 +-
 make/scripts/java-win64-dbg.bat                    |   15 +-
 make/scripts/java-win64.bat                        |    8 +-
 make/scripts/junit-singletest-x64.bat              |    1 +
 make/scripts/junit-singletest-x64.sh               |    1 +
 make/scripts/lstjars.sh                            |   29 +-
 make/scripts/make-runtime-properties.sh            |    0
 make/scripts/make.jogl.all.linux-x86.sh            |    3 -
 make/scripts/make.jogl.all.linux-x86_64.sh         |    4 -
 make/scripts/make.jogl.all.macosx.sh               |    6 +-
 make/scripts/make.jogl.all.win32.bat               |    9 +-
 make/scripts/make.jogl.all.win64.bat               |    9 +-
 make/scripts/make.jogl.cdcfp.linux-x86.sh          |   38 -
 make/scripts/make.jogl.cdcfp.macosx.sh             |   27 -
 make/scripts/make.jogl.doc.all.x86_64.sh           |    1 -
 make/scripts/make.jogl.doc.x86_64.sh               |    1 -
 make/scripts/setenv-jogl.sh                        |    5 +-
 make/scripts/setvc9-jogl.bat                       |    4 +-
 make/scripts/tests-javaws-x64.bat                  |   18 +
 make/scripts/tests-javaws.sh                       |   16 +
 make/scripts/tests-osx.sh                          |    7 +
 make/scripts/tests-x32.bat                         |   59 +-
 make/scripts/tests-x32.sh                          |    7 +
 make/scripts/tests-x64.bat                         |   87 +-
 make/scripts/tests-x64.sh                          |    7 +
 make/scripts/tests.sh                              |  196 +-
 make/stub_includes/win32/windows.h                 |   13 +-
 make/stub_includes/win32/wingdi.h                  |   31 +-
 nativewindow.iml                                   |    1 -
 nbproject/ide-file-targets.xml                     |    4 +-
 nbproject/project.xml                              |   34 +-
 .../gluegen/opengl/BuildComposablePipeline.java    |    2 +-
 .../classes/com/jogamp/opengl/JoglVersion.java     |   38 +-
 .../opengl/cg/CgDynamicLibraryBundleInfo.java      |    5 -
 src/jogl/classes/com/jogamp/opengl/impl/Debug.java |  140 --
 .../impl/DesktopGLDynamicLibraryBundleInfo.java    |   58 -
 .../opengl/impl/DesktopGLDynamicLookupHelper.java  |   68 -
 .../opengl/impl/ExtensionAvailabilityCache.java    |  218 --
 .../jogamp/opengl/impl/GLBufferSizeTracker.java    |  214 --
 .../jogamp/opengl/impl/GLBufferStateTracker.java   |  157 --
 .../com/jogamp/opengl/impl/GLContextImpl.java      | 1224 ----------
 .../com/jogamp/opengl/impl/GLContextLock.java      |  157 --
 .../com/jogamp/opengl/impl/GLContextShareSet.java  |  293 ---
 .../jogamp/opengl/impl/GLDrawableFactoryImpl.java  |  433 ----
 .../com/jogamp/opengl/impl/GLDrawableHelper.java   |  379 ---
 .../com/jogamp/opengl/impl/GLDrawableImpl.java     |  221 --
 .../opengl/impl/GLDynamicLibraryBundleInfo.java    |   54 -
 .../jogamp/opengl/impl/GLDynamicLookupHelper.java  |   50 -
 .../com/jogamp/opengl/impl/GLJNILibLoader.java     |   63 -
 .../com/jogamp/opengl/impl/GLPbufferImpl.java      |  350 ---
 .../com/jogamp/opengl/impl/GLRunnableTask.java     |   89 -
 .../com/jogamp/opengl/impl/GLStateTracker.java     |  179 --
 .../com/jogamp/opengl/impl/GLWorkerThread.java     |  275 ---
 .../com/jogamp/opengl/impl/MemoryObject.java       |  142 --
 .../com/jogamp/opengl/impl/ProjectFloat.java       | 1058 ---------
 .../opengl/impl/SystemUtil.java.javame_cdc_fp      |   10 -
 .../com/jogamp/opengl/impl/SystemUtil.java.javase  |   18 -
 .../com/jogamp/opengl/impl/ThreadingImpl.java      |  240 --
 .../com/jogamp/opengl/impl/ThreadingPlugin.java    |   62 -
 .../jogamp/opengl/impl/awt/AWTThreadingPlugin.java |  126 -
 .../com/jogamp/opengl/impl/awt/AWTUtil.java        |  120 -
 .../classes/com/jogamp/opengl/impl/awt/Java2D.java |  569 -----
 .../jogamp/opengl/impl/awt/Java2DGLContext.java    |   52 -
 .../com/jogamp/opengl/impl/egl/EGLContext.java     |  275 ---
 .../com/jogamp/opengl/impl/egl/EGLDrawable.java    |  232 --
 .../jogamp/opengl/impl/egl/EGLDrawableFactory.java |  193 --
 .../impl/egl/EGLDynamicLibraryBundleInfo.java      |   73 -
 .../impl/egl/EGLES1DynamicLibraryBundleInfo.java   |   73 -
 .../impl/egl/EGLES2DynamicLibraryBundleInfo.java   |   73 -
 .../jogamp/opengl/impl/egl/EGLExternalContext.java |   90 -
 .../opengl/impl/egl/EGLGraphicsConfiguration.java  |  302 ---
 .../impl/egl/EGLGraphicsConfigurationFactory.java  |  327 ---
 .../jogamp/opengl/impl/egl/EGLOnscreenContext.java |   59 -
 .../opengl/impl/egl/EGLOnscreenDrawable.java       |   64 -
 .../jogamp/opengl/impl/egl/EGLPbufferContext.java  |   62 -
 .../jogamp/opengl/impl/egl/EGLPbufferDrawable.java |  102 -
 .../com/jogamp/opengl/impl/gl2/ProjectDouble.java  | 1042 ---------
 .../classes/com/jogamp/opengl/impl/gl2/Util.java   |  244 --
 .../opengl/impl/gl2/fixme/GLObjectTracker.java     |  835 -------
 .../com/jogamp/opengl/impl/glu/GLUquadricImpl.java | 1212 ----------
 .../classes/com/jogamp/opengl/impl/glu/Glue.java   |  114 -
 .../com/jogamp/opengl/impl/glu/error/Error.java    |  100 -
 .../opengl/impl/glu/gl2/nurbs/GL2Backend.java      |   49 -
 .../impl/glu/gl2/nurbs/GL2CurveEvaluator.java      |  205 --
 .../impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java    |  217 --
 .../opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java |  862 -------
 .../jogamp/opengl/impl/glu/mipmap/BuildMipmap.java | 1597 -------------
 .../com/jogamp/opengl/impl/glu/mipmap/Extract.java |   56 -
 .../opengl/impl/glu/mipmap/Extract1010102.java     |   97 -
 .../opengl/impl/glu/mipmap/Extract1555rev.java     |   97 -
 .../opengl/impl/glu/mipmap/Extract2101010rev.java  |   97 -
 .../opengl/impl/glu/mipmap/Extract233rev.java      |   85 -
 .../jogamp/opengl/impl/glu/mipmap/Extract332.java  |   84 -
 .../jogamp/opengl/impl/glu/mipmap/Extract4444.java |   96 -
 .../opengl/impl/glu/mipmap/Extract4444rev.java     |   97 -
 .../jogamp/opengl/impl/glu/mipmap/Extract5551.java |   97 -
 .../jogamp/opengl/impl/glu/mipmap/Extract565.java  |   92 -
 .../opengl/impl/glu/mipmap/Extract565rev.java      |   92 -
 .../jogamp/opengl/impl/glu/mipmap/Extract8888.java |   97 -
 .../opengl/impl/glu/mipmap/Extract8888rev.java     |   97 -
 .../opengl/impl/glu/mipmap/ExtractFloat.java       |   74 -
 .../opengl/impl/glu/mipmap/ExtractPrimitive.java   |   56 -
 .../opengl/impl/glu/mipmap/ExtractSByte.java       |   69 -
 .../jogamp/opengl/impl/glu/mipmap/ExtractSInt.java |   76 -
 .../opengl/impl/glu/mipmap/ExtractSShort.java      |   76 -
 .../opengl/impl/glu/mipmap/ExtractUByte.java       |   70 -
 .../jogamp/opengl/impl/glu/mipmap/ExtractUInt.java |   76 -
 .../opengl/impl/glu/mipmap/ExtractUShort.java      |   76 -
 .../jogamp/opengl/impl/glu/mipmap/HalveImage.java  | 1533 ------------
 .../com/jogamp/opengl/impl/glu/mipmap/Image.java   | 1413 -----------
 .../com/jogamp/opengl/impl/glu/mipmap/Mipmap.java  |  868 -------
 .../opengl/impl/glu/mipmap/PixelStorageModes.java  |  426 ----
 .../opengl/impl/glu/mipmap/ScaleInternal.java      | 2447 --------------------
 .../jogamp/opengl/impl/glu/mipmap/Type_Widget.java |  224 --
 .../com/jogamp/opengl/impl/glu/nurbs/Arc.java      |  258 ---
 .../opengl/impl/glu/nurbs/ArcSdirSorter.java       |   63 -
 .../opengl/impl/glu/nurbs/ArcTdirSorter.java       |   60 -
 .../opengl/impl/glu/nurbs/ArcTesselator.java       |   90 -
 .../com/jogamp/opengl/impl/glu/nurbs/Backend.java  |  217 --
 .../jogamp/opengl/impl/glu/nurbs/BezierArc.java    |   44 -
 .../com/jogamp/opengl/impl/glu/nurbs/Bin.java      |  155 --
 .../com/jogamp/opengl/impl/glu/nurbs/Breakpt.java  |   59 -
 .../jogamp/opengl/impl/glu/nurbs/CArrayOfArcs.java |  194 --
 .../opengl/impl/glu/nurbs/CArrayOfBreakpts.java    |  130 --
 .../opengl/impl/glu/nurbs/CArrayOfFloats.java      |  195 --
 .../opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java  |  160 --
 .../com/jogamp/opengl/impl/glu/nurbs/Curve.java    |  238 --
 .../opengl/impl/glu/nurbs/CurveEvaluator.java      |   86 -
 .../jogamp/opengl/impl/glu/nurbs/Curvelist.java    |  121 -
 .../jogamp/opengl/impl/glu/nurbs/DisplayList.java  |   56 -
 .../com/jogamp/opengl/impl/glu/nurbs/Flist.java    |  130 --
 .../com/jogamp/opengl/impl/glu/nurbs/Knotspec.java |  557 -----
 .../jogamp/opengl/impl/glu/nurbs/Knotvector.java   |  179 --
 .../com/jogamp/opengl/impl/glu/nurbs/Mapdesc.java  |  442 ----
 .../com/jogamp/opengl/impl/glu/nurbs/Maplist.java  |  122 -
 .../jogamp/opengl/impl/glu/nurbs/NurbsConsts.java  |  184 --
 .../com/jogamp/opengl/impl/glu/nurbs/O_curve.java  |   63 -
 .../jogamp/opengl/impl/glu/nurbs/O_nurbscurve.java |   80 -
 .../opengl/impl/glu/nurbs/O_nurbssurface.java      |   79 -
 .../jogamp/opengl/impl/glu/nurbs/O_pwlcurve.java   |   44 -
 .../jogamp/opengl/impl/glu/nurbs/O_surface.java    |   52 -
 .../com/jogamp/opengl/impl/glu/nurbs/O_trim.java   |   44 -
 .../com/jogamp/opengl/impl/glu/nurbs/Patch.java    |   54 -
 .../jogamp/opengl/impl/glu/nurbs/Patchlist.java    |  145 --
 .../com/jogamp/opengl/impl/glu/nurbs/Property.java |   75 -
 .../com/jogamp/opengl/impl/glu/nurbs/Pspec.java    |   47 -
 .../com/jogamp/opengl/impl/glu/nurbs/PwlArc.java   |   71 -
 .../com/jogamp/opengl/impl/glu/nurbs/Quilt.java    |  282 ---
 .../jogamp/opengl/impl/glu/nurbs/Quiltspec.java    |   85 -
 .../jogamp/opengl/impl/glu/nurbs/Renderhints.java  |  128 -
 .../jogamp/opengl/impl/glu/nurbs/Splinespec.java   |  204 --
 .../jogamp/opengl/impl/glu/nurbs/Subdivider.java   | 1167 ----------
 .../opengl/impl/glu/nurbs/SurfaceEvaluator.java    |  111 -
 .../jogamp/opengl/impl/glu/nurbs/TrimVertex.java   |   56 -
 .../jogamp/opengl/impl/glu/registry/Registry.java  |   79 -
 .../opengl/impl/glu/tessellator/ActiveRegion.java  |   69 -
 .../opengl/impl/glu/tessellator/CachedVertex.java  |   58 -
 .../jogamp/opengl/impl/glu/tessellator/Dict.java   |  140 --
 .../opengl/impl/glu/tessellator/DictNode.java      |   59 -
 .../opengl/impl/glu/tessellator/GLUface.java       |   65 -
 .../opengl/impl/glu/tessellator/GLUhalfEdge.java   |   71 -
 .../opengl/impl/glu/tessellator/GLUmesh.java       |   60 -
 .../impl/glu/tessellator/GLUtessellatorImpl.java   |  646 ------
 .../opengl/impl/glu/tessellator/GLUvertex.java     |   65 -
 .../jogamp/opengl/impl/glu/tessellator/Geom.java   |  338 ---
 .../jogamp/opengl/impl/glu/tessellator/Mesh.java   |  734 ------
 .../jogamp/opengl/impl/glu/tessellator/Normal.java |  288 ---
 .../opengl/impl/glu/tessellator/PriorityQ.java     |  100 -
 .../opengl/impl/glu/tessellator/PriorityQHeap.java |  262 ---
 .../opengl/impl/glu/tessellator/PriorityQSort.java |  278 ---
 .../jogamp/opengl/impl/glu/tessellator/Render.java |  557 -----
 .../jogamp/opengl/impl/glu/tessellator/Sweep.java  | 1353 -----------
 .../opengl/impl/glu/tessellator/TessMono.java      |  241 --
 .../opengl/impl/glu/tessellator/TessState.java     |   59 -
 .../opengl/impl/macosx/cgl/MacOSXCGLContext.java   |  331 ---
 .../opengl/impl/macosx/cgl/MacOSXCGLDrawable.java  |   99 -
 .../impl/macosx/cgl/MacOSXCGLDrawableFactory.java  |  209 --
 .../cgl/MacOSXCGLDynamicLibraryBundleInfo.java     |   72 -
 .../macosx/cgl/MacOSXCGLGraphicsConfiguration.java |  233 --
 .../cgl/MacOSXCGLGraphicsConfigurationFactory.java |   86 -
 .../impl/macosx/cgl/MacOSXExternalCGLContext.java  |  193 --
 .../impl/macosx/cgl/MacOSXOffscreenCGLContext.java |   64 -
 .../macosx/cgl/MacOSXOffscreenCGLDrawable.java     |   57 -
 .../impl/macosx/cgl/MacOSXOnscreenCGLContext.java  |   89 -
 .../impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java |   93 -
 .../impl/macosx/cgl/MacOSXPbufferCGLContext.java   |  366 ---
 .../impl/macosx/cgl/MacOSXPbufferCGLDrawable.java  |  252 --
 .../cgl/awt/MacOSXAWTCGLDrawableFactory.java       |   60 -
 .../MacOSXAWTCGLGraphicsConfigurationFactory.java  |  116 -
 .../macosx/cgl/awt/MacOSXJava2DCGLContext.java     |  135 --
 .../impl/windows/wgl/WindowsDummyWGLDrawable.java  |  112 -
 .../windows/wgl/WindowsExternalWGLContext.java     |  149 --
 .../windows/wgl/WindowsExternalWGLDrawable.java    |   98 -
 .../windows/wgl/WindowsOffscreenWGLContext.java    |   64 -
 .../windows/wgl/WindowsOffscreenWGLDrawable.java   |  145 --
 .../windows/wgl/WindowsOnscreenWGLContext.java     |   53 -
 .../windows/wgl/WindowsOnscreenWGLDrawable.java    |   56 -
 .../impl/windows/wgl/WindowsPbufferWGLContext.java |  147 --
 .../windows/wgl/WindowsPbufferWGLDrawable.java     |  339 ---
 .../opengl/impl/windows/wgl/WindowsWGLContext.java |  447 ----
 .../impl/windows/wgl/WindowsWGLDrawable.java       |  107 -
 .../windows/wgl/WindowsWGLDrawableFactory.java     |  368 ---
 .../wgl/WindowsWGLDynamicLibraryBundleInfo.java    |   58 -
 .../wgl/WindowsWGLGraphicsConfiguration.java       |  748 ------
 .../WindowsWGLGraphicsConfigurationFactory.java    |  426 ----
 .../WindowsAWTWGLGraphicsConfigurationFactory.java |  119 -
 .../com/jogamp/opengl/impl/x11/glx/GLXUtil.java    |  102 -
 .../opengl/impl/x11/glx/X11DummyGLXDrawable.java   |   89 -
 .../opengl/impl/x11/glx/X11ExternalGLXContext.java |  141 --
 .../impl/x11/glx/X11ExternalGLXDrawable.java       |  105 -
 .../jogamp/opengl/impl/x11/glx/X11GLXContext.java  |  556 -----
 .../jogamp/opengl/impl/x11/glx/X11GLXDrawable.java |   74 -
 .../opengl/impl/x11/glx/X11GLXDrawableFactory.java |  639 -----
 .../x11/glx/X11GLXDynamicLibraryBundleInfo.java    |   84 -
 .../impl/x11/glx/X11GLXGraphicsConfiguration.java  |  435 ----
 .../glx/X11GLXGraphicsConfigurationFactory.java    |  423 ----
 .../impl/x11/glx/X11OffscreenGLXContext.java       |   70 -
 .../impl/x11/glx/X11OffscreenGLXDrawable.java      |  137 --
 .../opengl/impl/x11/glx/X11OnscreenGLXContext.java |   48 -
 .../impl/x11/glx/X11OnscreenGLXDrawable.java       |   97 -
 .../opengl/impl/x11/glx/X11PbufferGLXContext.java  |   64 -
 .../opengl/impl/x11/glx/X11PbufferGLXDrawable.java |  145 --
 .../awt/X11AWTGLXGraphicsConfigurationFactory.java |  178 --
 .../com/jogamp/opengl/util/AWTAnimatorImpl.java    |    8 +-
 .../classes/com/jogamp/opengl/util/Animator.java   |   31 +-
 .../com/jogamp/opengl/util/AnimatorBase.java       |    4 +-
 .../jogamp/opengl/util/DefaultAnimatorImpl.java    |    4 +-
 .../com/jogamp/opengl/util/FPSAnimator.java        |   10 +-
 .../com/jogamp/opengl/util/GLArrayDataClient.java  |    2 +-
 .../com/jogamp/opengl/util/GLArrayDataWrapper.java |    2 +-
 src/jogl/classes/com/jogamp/opengl/util/Gamma.java |    2 +-
 .../classes/com/jogamp/opengl/util/PMVMatrix.java  |    2 +-
 .../com/jogamp/opengl/util/awt/TextRenderer.java   |   61 +-
 .../jogamp/opengl/util/awt/TextureRenderer.java    |    3 +-
 .../com/jogamp/opengl/util/glsl/ShaderCode.java    |    2 +-
 .../com/jogamp/opengl/util/glsl/ShaderState.java   |    2 +-
 .../opengl/util/glsl/fixedfunc/FixedFuncUtil.java  |    2 +-
 .../util/glsl/fixedfunc/impl/FixedFuncHook.java    |  331 ---
 .../glsl/fixedfunc/impl/FixedFuncPipeline.java     |  554 -----
 .../com/jogamp/opengl/util/texture/Texture.java    |    2 +-
 .../com/jogamp/opengl/util/texture/TextureIO.java  | 1258 ++++++++++
 .../util/texture/TextureIO.java.javame_cdc_fp      | 1256 ----------
 .../opengl/util/texture/TextureIO.java.javase      | 1258 ----------
 .../spi/{DDSImage.java.javase => DDSImage.java}    |    0
 .../util/texture/spi/DDSImage.java.javame_cdc_fp   |  889 -------
 .../spi/{TGAImage.java.javase => TGAImage.java}    |    0
 .../util/texture/spi/TGAImage.java.javame_cdc_fp   |  417 ----
 .../util/texture/spi/awt/IIOTextureProvider.java   |    2 +-
 .../classes/com/jogamp/openmax/OMXInstance.java    |    8 +-
 .../media/opengl/DefaultGLCapabilitiesChooser.java |   76 +-
 .../javax/media/opengl/GLAnimatorControl.java      |   16 +-
 .../classes/javax/media/opengl/GLAutoDrawable.java |    2 +-
 .../classes/javax/media/opengl/GLCapabilities.java |  133 +-
 src/jogl/classes/javax/media/opengl/GLContext.java |   66 +-
 .../javax/media/opengl/GLDrawableFactory.java      |  204 +-
 .../javax/media/opengl/GLPipelineFactory.java      |    2 +-
 src/jogl/classes/javax/media/opengl/GLProfile.java |  252 +-
 src/jogl/classes/javax/media/opengl/Threading.java |    2 +-
 .../javax/media/opengl/awt/AWTGLAutoDrawable.java  |    1 -
 .../classes/javax/media/opengl/awt/GLCanvas.java   |  557 +++--
 .../classes/javax/media/opengl/awt/GLJPanel.java   |  140 +-
 .../media/opengl/glu/GLUtessellatorCallback.java   |    2 +-
 .../opengl/glu/GLUtessellatorCallbackAdapter.java  |    2 +-
 src/jogl/classes/jogamp/opengl/Debug.java          |  140 ++
 .../opengl/DesktopGLDynamicLibraryBundleInfo.java  |   58 +
 .../opengl/DesktopGLDynamicLookupHelper.java       |   63 +
 .../jogamp/opengl/ExtensionAvailabilityCache.java  |  218 ++
 .../classes/jogamp/opengl/GLBufferSizeTracker.java |  214 ++
 .../jogamp/opengl/GLBufferStateTracker.java        |  157 ++
 src/jogl/classes/jogamp/opengl/GLContextImpl.java  | 1044 +++++++++
 src/jogl/classes/jogamp/opengl/GLContextLock.java  |  157 ++
 .../classes/jogamp/opengl/GLContextShareSet.java   |  293 +++
 .../jogamp/opengl/GLDrawableFactoryImpl.java       |  467 ++++
 .../classes/jogamp/opengl/GLDrawableHelper.java    |  387 ++++
 src/jogl/classes/jogamp/opengl/GLDrawableImpl.java |  221 ++
 .../jogamp/opengl/GLDynamicLibraryBundleInfo.java  |   54 +
 .../jogamp/opengl/GLDynamicLookupHelper.java       |   44 +
 .../opengl/GLGraphicsConfigurationFactory.java     |   97 +
 .../jogamp/opengl/GLGraphicsConfigurationUtil.java |  147 ++
 src/jogl/classes/jogamp/opengl/GLPbufferImpl.java  |  299 +++
 src/jogl/classes/jogamp/opengl/GLRunnableTask.java |   89 +
 src/jogl/classes/jogamp/opengl/GLStateTracker.java |  179 ++
 .../classes/jogamp/opengl/GLVersionNumber.java     |  123 +
 src/jogl/classes/jogamp/opengl/GLWorkerThread.java |  276 +++
 src/jogl/classes/jogamp/opengl/MemoryObject.java   |  142 ++
 src/jogl/classes/jogamp/opengl/ProjectFloat.java   | 1058 +++++++++
 .../jogamp/opengl/SharedResourceRunner.java        |  249 ++
 src/jogl/classes/jogamp/opengl/SystemUtil.java     |   18 +
 src/jogl/classes/jogamp/opengl/ThreadingImpl.java  |  234 ++
 .../classes/jogamp/opengl/ThreadingPlugin.java     |   62 +
 .../jogamp/opengl/awt/AWTThreadingPlugin.java      |  120 +
 src/jogl/classes/jogamp/opengl/awt/AWTUtil.java    |  119 +
 src/jogl/classes/jogamp/opengl/awt/Java2D.java     |  569 +++++
 .../classes/jogamp/opengl/awt/Java2DGLContext.java |   52 +
 src/jogl/classes/jogamp/opengl/egl/EGLContext.java |  279 +++
 .../classes/jogamp/opengl/egl/EGLDrawable.java     |  232 ++
 .../jogamp/opengl/egl/EGLDrawableFactory.java      |  254 ++
 .../opengl/egl/EGLDynamicLibraryBundleInfo.java    |   73 +
 .../opengl/egl/EGLES1DynamicLibraryBundleInfo.java |   73 +
 .../opengl/egl/EGLES2DynamicLibraryBundleInfo.java |   73 +
 .../jogamp/opengl/egl/EGLExternalContext.java      |   86 +
 .../jogamp/opengl/egl/EGLGLCapabilities.java       |   96 +
 .../opengl/egl/EGLGraphicsConfiguration.java       |  313 +++
 .../egl/EGLGraphicsConfigurationFactory.java       |  343 +++
 .../jogamp/opengl/egl/EGLOnscreenContext.java      |   59 +
 .../jogamp/opengl/egl/EGLOnscreenDrawable.java     |   64 +
 .../jogamp/opengl/egl/EGLPbufferContext.java       |   62 +
 .../jogamp/opengl/egl/EGLPbufferDrawable.java      |  102 +
 .../classes/jogamp/opengl/gl2/ProjectDouble.java   | 1042 +++++++++
 src/jogl/classes/jogamp/opengl/gl2/Util.java       |  244 ++
 .../jogamp/opengl/gl2/fixme/GLObjectTracker.java   |  835 +++++++
 .../classes/jogamp/opengl/glu/GLUquadricImpl.java  | 1212 ++++++++++
 src/jogl/classes/jogamp/opengl/glu/Glue.java       |  114 +
 .../classes/jogamp/opengl/glu/error/Error.java     |  100 +
 .../jogamp/opengl/glu/gl2/nurbs/GL2Backend.java    |   49 +
 .../opengl/glu/gl2/nurbs/GL2CurveEvaluator.java    |  205 ++
 .../opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java  |  217 ++
 .../opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java      |  862 +++++++
 .../jogamp/opengl/glu/mipmap/BuildMipmap.java      | 1597 +++++++++++++
 .../classes/jogamp/opengl/glu/mipmap/Extract.java  |   56 +
 .../jogamp/opengl/glu/mipmap/Extract1010102.java   |   97 +
 .../jogamp/opengl/glu/mipmap/Extract1555rev.java   |   97 +
 .../opengl/glu/mipmap/Extract2101010rev.java       |   97 +
 .../jogamp/opengl/glu/mipmap/Extract233rev.java    |   85 +
 .../jogamp/opengl/glu/mipmap/Extract332.java       |   84 +
 .../jogamp/opengl/glu/mipmap/Extract4444.java      |   96 +
 .../jogamp/opengl/glu/mipmap/Extract4444rev.java   |   97 +
 .../jogamp/opengl/glu/mipmap/Extract5551.java      |   97 +
 .../jogamp/opengl/glu/mipmap/Extract565.java       |   92 +
 .../jogamp/opengl/glu/mipmap/Extract565rev.java    |   92 +
 .../jogamp/opengl/glu/mipmap/Extract8888.java      |   97 +
 .../jogamp/opengl/glu/mipmap/Extract8888rev.java   |   97 +
 .../jogamp/opengl/glu/mipmap/ExtractFloat.java     |   74 +
 .../jogamp/opengl/glu/mipmap/ExtractPrimitive.java |   56 +
 .../jogamp/opengl/glu/mipmap/ExtractSByte.java     |   69 +
 .../jogamp/opengl/glu/mipmap/ExtractSInt.java      |   76 +
 .../jogamp/opengl/glu/mipmap/ExtractSShort.java    |   76 +
 .../jogamp/opengl/glu/mipmap/ExtractUByte.java     |   70 +
 .../jogamp/opengl/glu/mipmap/ExtractUInt.java      |   76 +
 .../jogamp/opengl/glu/mipmap/ExtractUShort.java    |   76 +
 .../jogamp/opengl/glu/mipmap/HalveImage.java       | 1533 ++++++++++++
 .../classes/jogamp/opengl/glu/mipmap/Image.java    | 1413 +++++++++++
 .../classes/jogamp/opengl/glu/mipmap/Mipmap.java   |  868 +++++++
 .../opengl/glu/mipmap/PixelStorageModes.java       |  426 ++++
 .../jogamp/opengl/glu/mipmap/ScaleInternal.java    | 2447 ++++++++++++++++++++
 .../jogamp/opengl/glu/mipmap/Type_Widget.java      |  226 ++
 src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java  |  258 +++
 .../jogamp/opengl/glu/nurbs/ArcSdirSorter.java     |   63 +
 .../jogamp/opengl/glu/nurbs/ArcTdirSorter.java     |   60 +
 .../jogamp/opengl/glu/nurbs/ArcTesselator.java     |   90 +
 .../classes/jogamp/opengl/glu/nurbs/Backend.java   |  217 ++
 .../classes/jogamp/opengl/glu/nurbs/BezierArc.java |   44 +
 src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java  |  155 ++
 .../classes/jogamp/opengl/glu/nurbs/Breakpt.java   |   59 +
 .../jogamp/opengl/glu/nurbs/CArrayOfArcs.java      |  194 ++
 .../jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java  |  130 ++
 .../jogamp/opengl/glu/nurbs/CArrayOfFloats.java    |  195 ++
 .../opengl/glu/nurbs/CArrayOfQuiltspecs.java       |  160 ++
 .../classes/jogamp/opengl/glu/nurbs/Curve.java     |  238 ++
 .../jogamp/opengl/glu/nurbs/CurveEvaluator.java    |   86 +
 .../classes/jogamp/opengl/glu/nurbs/Curvelist.java |  121 +
 .../jogamp/opengl/glu/nurbs/DisplayList.java       |   56 +
 .../classes/jogamp/opengl/glu/nurbs/Flist.java     |  130 ++
 .../classes/jogamp/opengl/glu/nurbs/Knotspec.java  |  557 +++++
 .../jogamp/opengl/glu/nurbs/Knotvector.java        |  179 ++
 .../classes/jogamp/opengl/glu/nurbs/Mapdesc.java   |  442 ++++
 .../classes/jogamp/opengl/glu/nurbs/Maplist.java   |  122 +
 .../jogamp/opengl/glu/nurbs/NurbsConsts.java       |  184 ++
 .../classes/jogamp/opengl/glu/nurbs/O_curve.java   |   63 +
 .../jogamp/opengl/glu/nurbs/O_nurbscurve.java      |   80 +
 .../jogamp/opengl/glu/nurbs/O_nurbssurface.java    |   79 +
 .../jogamp/opengl/glu/nurbs/O_pwlcurve.java        |   44 +
 .../classes/jogamp/opengl/glu/nurbs/O_surface.java |   52 +
 .../classes/jogamp/opengl/glu/nurbs/O_trim.java    |   44 +
 .../classes/jogamp/opengl/glu/nurbs/Patch.java     |   54 +
 .../classes/jogamp/opengl/glu/nurbs/Patchlist.java |  145 ++
 .../classes/jogamp/opengl/glu/nurbs/Property.java  |   75 +
 .../classes/jogamp/opengl/glu/nurbs/Pspec.java     |   47 +
 .../classes/jogamp/opengl/glu/nurbs/PwlArc.java    |   71 +
 .../classes/jogamp/opengl/glu/nurbs/Quilt.java     |  282 +++
 .../classes/jogamp/opengl/glu/nurbs/Quiltspec.java |   85 +
 .../impl => jogamp/opengl}/glu/nurbs/README.txt    |    0
 .../jogamp/opengl/glu/nurbs/Renderhints.java       |  128 +
 .../jogamp/opengl/glu/nurbs/Splinespec.java        |  204 ++
 .../jogamp/opengl/glu/nurbs/Subdivider.java        | 1167 ++++++++++
 .../jogamp/opengl/glu/nurbs/SurfaceEvaluator.java  |  111 +
 .../jogamp/opengl/glu/nurbs/TrimVertex.java        |   56 +
 .../jogamp/opengl/glu/registry/Registry.java       |   79 +
 .../opengl/glu/tessellator/ActiveRegion.java       |   69 +
 .../opengl/glu/tessellator/CachedVertex.java       |   58 +
 .../jogamp/opengl/glu/tessellator/Dict.java        |  140 ++
 .../jogamp/opengl/glu/tessellator/DictNode.java    |   59 +
 .../jogamp/opengl/glu/tessellator/GLUface.java     |   65 +
 .../jogamp/opengl/glu/tessellator/GLUhalfEdge.java |   71 +
 .../jogamp/opengl/glu/tessellator/GLUmesh.java     |   60 +
 .../opengl/glu/tessellator/GLUtessellatorImpl.java |  646 ++++++
 .../jogamp/opengl/glu/tessellator/GLUvertex.java   |   65 +
 .../jogamp/opengl/glu/tessellator/Geom.java        |  338 +++
 .../jogamp/opengl/glu/tessellator/Mesh.java        |  734 ++++++
 .../jogamp/opengl/glu/tessellator/Normal.java      |  288 +++
 .../jogamp/opengl/glu/tessellator/PriorityQ.java   |  100 +
 .../opengl/glu/tessellator/PriorityQHeap.java      |  262 +++
 .../opengl/glu/tessellator/PriorityQSort.java      |  278 +++
 .../jogamp/opengl/glu/tessellator/Render.java      |  557 +++++
 .../jogamp/opengl/glu/tessellator/Sweep.java       | 1353 +++++++++++
 .../jogamp/opengl/glu/tessellator/TessMono.java    |  241 ++
 .../jogamp/opengl/glu/tessellator/TessState.java   |   59 +
 .../jogamp/opengl/macosx/cgl/MacOSXCGLContext.java |  328 +++
 .../opengl/macosx/cgl/MacOSXCGLDrawable.java       |   99 +
 .../macosx/cgl/MacOSXCGLDrawableFactory.java       |  230 ++
 .../cgl/MacOSXCGLDynamicLibraryBundleInfo.java     |   72 +
 .../macosx/cgl/MacOSXCGLGraphicsConfiguration.java |  233 ++
 .../cgl/MacOSXCGLGraphicsConfigurationFactory.java |   87 +
 .../macosx/cgl/MacOSXExternalCGLContext.java       |  194 ++
 .../macosx/cgl/MacOSXOffscreenCGLContext.java      |   64 +
 .../macosx/cgl/MacOSXOffscreenCGLDrawable.java     |   57 +
 .../macosx/cgl/MacOSXOnscreenCGLContext.java       |   90 +
 .../macosx/cgl/MacOSXOnscreenCGLDrawable.java      |   91 +
 .../opengl/macosx/cgl/MacOSXPbufferCGLContext.java |  366 +++
 .../macosx/cgl/MacOSXPbufferCGLDrawable.java       |  252 ++
 .../cgl/awt/MacOSXAWTCGLDrawableFactory.java       |   60 +
 .../MacOSXAWTCGLGraphicsConfigurationFactory.java  |  117 +
 .../macosx/cgl/awt/MacOSXJava2DCGLContext.java     |  135 ++
 .../opengl/util/glsl/fixedfunc/FixedFuncHook.java  |  331 +++
 .../util/glsl/fixedfunc/FixedFuncPipeline.java     |  554 +++++
 .../util/glsl/fixedfunc}/shaders/FixedFuncColor.fp |    0
 .../util/glsl/fixedfunc}/shaders/FixedFuncColor.vp |    0
 .../glsl/fixedfunc}/shaders/FixedFuncColorLight.vp |    0
 .../fixedfunc}/shaders/FixedFuncColorTexture.fp    |    0
 .../shaders/bin/nvidia/FixedFuncColor.bfp          |  Bin
 .../shaders/bin/nvidia/FixedFuncColor.bvp          |  Bin
 .../shaders/bin/nvidia/FixedFuncColorLight.bvp     |  Bin
 .../shaders/bin/nvidia/FixedFuncColorTexture.bfp   |  Bin
 .../util/glsl/fixedfunc}/shaders/es_precision.glsl |    0
 .../glsl/fixedfunc}/shaders/mgl_attribute.glsl     |    0
 .../util/glsl/fixedfunc}/shaders/mgl_const.glsl    |    0
 .../util/glsl/fixedfunc}/shaders/mgl_lightdef.glsl |    0
 .../glsl/fixedfunc}/shaders/mgl_settexcoord.vp     |    0
 .../util/glsl/fixedfunc}/shaders/mgl_uniform.glsl  |    0
 .../glsl/fixedfunc}/shaders/mgl_uniform_light.glsl |    0
 .../util/glsl/fixedfunc}/shaders/mgl_varying.glsl  |    0
 .../shaders/scripts/nvidia-apx/glslc-ff.bat        |    0
 .../shaders/scripts/nvidia-apx/glslc.bat           |    0
 .../opengl/windows/wgl/WGLGLCapabilities.java      |  243 ++
 .../windows/wgl/WindowsBitmapWGLContext.java       |   64 +
 .../windows/wgl/WindowsBitmapWGLDrawable.java      |  175 ++
 .../windows/wgl/WindowsDummyWGLDrawable.java       |  103 +
 .../windows/wgl/WindowsExternalWGLContext.java     |  155 ++
 .../windows/wgl/WindowsExternalWGLDrawable.java    |   92 +
 .../windows/wgl/WindowsOnscreenWGLContext.java     |   53 +
 .../windows/wgl/WindowsOnscreenWGLDrawable.java    |   56 +
 .../windows/wgl/WindowsPbufferWGLContext.java      |  147 ++
 .../windows/wgl/WindowsPbufferWGLDrawable.java     |  266 +++
 .../opengl/windows/wgl/WindowsWGLContext.java      |  478 ++++
 .../opengl/windows/wgl/WindowsWGLDrawable.java     |  107 +
 .../windows/wgl/WindowsWGLDrawableFactory.java     |  539 +++++
 .../wgl/WindowsWGLDynamicLibraryBundleInfo.java    |   58 +
 .../wgl/WindowsWGLGraphicsConfiguration.java       |  693 ++++++
 .../WindowsWGLGraphicsConfigurationFactory.java    |  471 ++++
 .../WindowsAWTWGLGraphicsConfigurationFactory.java |  173 ++
 .../classes/jogamp/opengl/x11/glx/GLXUtil.java     |  102 +
 .../jogamp/opengl/x11/glx/X11DummyGLXDrawable.java |   90 +
 .../opengl/x11/glx/X11ExternalGLXContext.java      |  137 ++
 .../opengl/x11/glx/X11ExternalGLXDrawable.java     |  105 +
 .../jogamp/opengl/x11/glx/X11GLCapabilities.java   |  124 +
 .../jogamp/opengl/x11/glx/X11GLXContext.java       |  587 +++++
 .../jogamp/opengl/x11/glx/X11GLXDrawable.java      |   74 +
 .../opengl/x11/glx/X11GLXDrawableFactory.java      |  552 +++++
 .../x11/glx/X11GLXDynamicLibraryBundleInfo.java    |   84 +
 .../x11/glx/X11GLXGraphicsConfiguration.java       |  447 ++++
 .../glx/X11GLXGraphicsConfigurationFactory.java    |  378 +++
 .../opengl/x11/glx/X11OnscreenGLXContext.java      |   48 +
 .../opengl/x11/glx/X11OnscreenGLXDrawable.java     |   97 +
 .../opengl/x11/glx/X11PbufferGLXContext.java       |   64 +
 .../opengl/x11/glx/X11PbufferGLXDrawable.java      |  145 ++
 .../jogamp/opengl/x11/glx/X11PixmapGLXContext.java |   70 +
 .../opengl/x11/glx/X11PixmapGLXDrawable.java       |  137 ++
 .../awt/X11AWTGLXGraphicsConfigurationFactory.java |  173 ++
 .../test/junit/jogl/acore/TestGLProfile01NEWT.java |  161 --
 .../jogamp/test/junit/jogl/awt/TestAWT01GLn.java   |  143 --
 .../junit/jogl/awt/TestAWT02WindowClosing.java     |  111 -
 .../test/junit/jogl/awt/TestSwingAWT01GLn.java     |  153 --
 .../test/junit/jogl/caps/MultisampleChooser01.java |   66 -
 .../test/junit/jogl/caps/MultisampleDemo01.java    |  138 --
 .../test/junit/jogl/caps/TestMultisampleAWT.java   |  122 -
 .../test/junit/jogl/caps/TestMultisampleNEWT.java  |  100 -
 .../test/junit/jogl/demos/es1/RedSquare.java       |  169 --
 .../test/junit/jogl/demos/es2/RedSquare0.java      |  198 --
 .../jogl/demos/es2/shader/RedSquareShader.java     |   68 -
 .../test/junit/jogl/demos/gl2/gears/Gears.java     |  316 ---
 .../junit/jogl/demos/gl2/gears/TestGearsAWT.java   |  122 -
 .../jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java |  130 --
 .../jogl/demos/gl2/gears/newt/TestGearsNEWT.java   |  126 -
 .../gl2/gears/newt/TestGearsNewtAWTWrapper.java    |  114 -
 .../junit/jogl/drawable/TestDrawable01NEWT.java    |  184 --
 .../test/junit/jogl/glsl/TestGLSLSimple01NEWT.java |  143 --
 .../TestTransformFeedbackVaryingsBug407NEWT.java   |  231 --
 ...TestSwingAWTRobotUsageBeforeJOGLInitBug411.java |  333 ---
 .../test/junit/jogl/offscreen/ReadBuffer2File.java |   70 -
 .../junit/jogl/offscreen/ReadBuffer2Screen.java    |  188 --
 .../test/junit/jogl/offscreen/ReadBufferBase.java  |   91 -
 .../test/junit/jogl/offscreen/ReadBufferUtil.java  |  107 -
 .../test/junit/jogl/offscreen/Surface2File.java    |   79 -
 .../junit/jogl/offscreen/TestOffscreen01NEWT.java  |  489 ----
 .../test/junit/jogl/offscreen/WindowUtilNEWT.java  |  110 -
 .../test/junit/jogl/texture/TestTexture01AWT.java  |  146 --
 .../util/texture/gl2/TextureGL2ListenerDraw1.java  |  109 -
 .../jogamp/test/junit/newt/TestCloseNewtAWT.java   |  141 --
 .../junit/newt/TestDisplayLifecycle01NEWT.java     |  264 ---
 .../junit/newt/TestDisplayLifecycle02NEWT.java     |  386 ---
 .../test/junit/newt/TestEventSourceNotAWTBug.java  |  110 -
 .../test/junit/newt/TestFocus01SwingAWTRobot.java  |  201 --
 .../test/junit/newt/TestFocus02SwingAWTRobot.java  |  301 ---
 .../test/junit/newt/TestGLWindows00NEWT.java       |  133 --
 .../test/junit/newt/TestGLWindows01NEWT.java       |  384 ---
 .../junit/newt/TestGLWindows02NEWTAnimated.java    |  303 ---
 .../test/junit/newt/TestListenerCom01AWT.java      |  167 --
 .../test/junit/newt/TestRemoteGLWindows01NEWT.java |  161 --
 .../test/junit/newt/TestRemoteWindow01NEWT.java    |  146 --
 .../test/junit/newt/TestScreenMode00NEWT.java      |  140 --
 .../test/junit/newt/TestScreenMode01NEWT.java      |  284 ---
 .../test/junit/newt/TestScreenMode02NEWT.java      |  187 --
 .../jogamp/test/junit/newt/TestWindows01NEWT.java  |  179 --
 .../jogamp/test/junit/newt/WindowEventCom1.java    |   42 -
 .../jogamp/test/junit/newt/WindowEventCom2.java    |   48 -
 .../jogamp/test/junit/newt/WindowEventCom3.java    |   44 -
 .../test/junit/newt/parenting/GLRunnableDummy.java |   57 -
 .../test/junit/newt/parenting/KeyAction.java       |   45 -
 .../junit/newt/parenting/TestParenting01NEWT.java  |  716 ------
 .../junit/newt/parenting/TestParenting01aAWT.java  |  443 ----
 .../junit/newt/parenting/TestParenting01bAWT.java  |  205 --
 .../junit/newt/parenting/TestParenting01cAWT.java  |  243 --
 .../newt/parenting/TestParenting01cSwingAWT.java   |  365 ---
 .../junit/newt/parenting/TestParenting02AWT.java   |  267 ---
 .../junit/newt/parenting/TestParenting02NEWT.java  |  235 --
 .../junit/newt/parenting/TestParenting03AWT.java   |  203 --
 .../junit/newt/parenting/TestParenting03bAWT.java  |  258 ---
 .../test/junit/newt/parenting/WindowAction.java    |   44 -
 .../jogamp/test/junit/util/AWTFocusAdapter.java    |   73 -
 .../com/jogamp/test/junit/util/AWTKeyAdapter.java  |   54 -
 .../jogamp/test/junit/util/AWTMouseAdapter.java    |   53 -
 .../com/jogamp/test/junit/util/AWTRobotUtil.java   |  338 ---
 .../com/jogamp/test/junit/util/DumpVersion.java    |   52 -
 .../jogamp/test/junit/util/EventCountAdapter.java  |   36 -
 .../test/junit/util/EventCountAdapterUtil.java     |   49 -
 .../jogamp/test/junit/util/GLSLSimpleProgram.java  |  121 -
 .../com/jogamp/test/junit/util/MiscUtils.java      |   63 -
 .../jogamp/test/junit/util/NEWTFocusAdapter.java   |   64 -
 .../com/jogamp/test/junit/util/NEWTKeyAdapter.java |   58 -
 .../jogamp/test/junit/util/NEWTMouseAdapter.java   |   57 -
 .../com/jogamp/test/junit/util/QuitAdapter.java    |   53 -
 .../jogamp/test/junit/util/SingletonInstance.java  |  143 --
 .../com/jogamp/test/junit/util/UITestCase.java     |   72 -
 .../jogamp/nativewindow/NativeWindowVersion.java   |    4 +-
 .../com/jogamp/nativewindow/impl/Debug.java        |  140 --
 .../impl/GraphicsConfigurationFactoryImpl.java     |   43 -
 .../jogamp/nativewindow/impl/NWJNILibLoader.java   |   47 -
 .../nativewindow/impl/NativeWindowFactoryImpl.java |  110 -
 .../jogamp/nativewindow/impl/NullToolkitLock.java  |   55 -
 .../com/jogamp/nativewindow/impl/ProxySurface.java |  156 --
 .../nativewindow/impl/jawt/JAWTJNILibLoader.java   |   78 -
 .../nativewindow/impl/jawt/JAWTToolkitLock.java    |   54 -
 .../jogamp/nativewindow/impl/jawt/JAWTUtil.java    |  195 --
 .../jogamp/nativewindow/impl/jawt/JAWTWindow.java  |  277 ---
 .../nativewindow/impl/jawt/JAWT_PlatformInfo.java  |   47 -
 .../impl/jawt/macosx/MacOSXJAWTWindow.java         |  148 --
 .../impl/jawt/windows/WindowsJAWTWindow.java       |  145 --
 .../impl/jawt/x11/X11JAWTToolkitLock.java          |   60 -
 .../nativewindow/impl/jawt/x11/X11JAWTWindow.java  |  156 --
 .../impl/jawt/x11/X11SunJDKReflection.java         |  132 --
 .../impl/x11/X11GraphicsConfigurationFactory.java  |  104 -
 .../nativewindow/impl/x11/X11ToolkitLock.java      |   55 -
 .../com/jogamp/nativewindow/impl/x11/X11Util.java  |  609 -----
 .../javax/media/nativewindow/Capabilities.java     |   60 +-
 .../media/nativewindow/CapabilitiesChooser.java    |    4 +-
 .../media/nativewindow/CapabilitiesImmutable.java  |    3 +
 .../nativewindow/DefaultCapabilitiesChooser.java   |   34 +-
 .../nativewindow/DefaultGraphicsConfiguration.java |   22 +-
 .../media/nativewindow/DefaultGraphicsDevice.java  |    8 +-
 .../media/nativewindow/DefaultGraphicsScreen.java  |    4 +-
 .../nativewindow/GraphicsConfigurationFactory.java |   26 +-
 .../media/nativewindow/NativeWindowFactory.java    |  163 +-
 .../javax/media/nativewindow/ProxySurface.java     |  150 ++
 .../javax/media/nativewindow/ToolkitLock.java      |    4 +-
 .../media/nativewindow/WindowClosingProtocol.java  |   66 +
 .../nativewindow/awt/AWTGraphicsConfiguration.java |    7 +-
 .../media/nativewindow/awt/AWTGraphicsDevice.java  |    4 +-
 .../nativewindow/awt/AWTWindowClosingProtocol.java |  139 ++
 .../media/nativewindow/egl/EGLGraphicsDevice.java  |   12 +-
 .../classes/javax/media/nativewindow/package.html  |   51 +-
 .../javax/media/nativewindow/util/Dimension.java   |    3 +-
 .../windows/WindowsGraphicsDevice.java             |    6 +-
 .../nativewindow/x11/X11GraphicsConfiguration.java |    7 +-
 .../media/nativewindow/x11/X11GraphicsDevice.java  |   17 +-
 .../media/nativewindow/x11/X11GraphicsScreen.java  |    2 +-
 .../classes/jogamp/nativewindow/Debug.java         |  140 ++
 .../DefaultGraphicsConfigurationFactoryImpl.java   |   43 +
 .../jogamp/nativewindow/NWJNILibLoader.java        |   47 +
 .../nativewindow/NativeWindowFactoryImpl.java      |  107 +
 .../jogamp/nativewindow/NullToolkitLock.java       |   55 +
 .../jogamp/nativewindow/WrappedSurface.java        |   70 +
 .../classes/jogamp/nativewindow/awt/AWTMisc.java   |   96 +
 .../jogamp/nativewindow/jawt/JAWTJNILibLoader.java |   76 +
 .../jogamp/nativewindow/jawt/JAWTToolkitLock.java  |   54 +
 .../classes/jogamp/nativewindow/jawt/JAWTUtil.java |  241 ++
 .../jogamp/nativewindow/jawt/JAWTWindow.java       |  281 +++
 .../nativewindow/jawt/JAWT_PlatformInfo.java       |   45 +
 .../nativewindow/jawt/macosx/MacOSXJAWTWindow.java |  148 ++
 .../jawt/windows/Win32SunJDKReflection.java        |  117 +
 .../jawt/windows/WindowsJAWTWindow.java            |  147 ++
 .../nativewindow/jawt/x11/X11JAWTToolkitLock.java  |   60 +
 .../nativewindow/jawt/x11/X11JAWTWindow.java       |  156 ++
 .../nativewindow/jawt/x11/X11SunJDKReflection.java |  118 +
 .../jogamp/nativewindow/swt/SWTAccessor.java       |  240 ++
 .../jogamp/nativewindow/windows/GDISurface.java    |   87 +
 .../nativewindow/windows/RegisteredClass.java      |   45 +
 .../windows/RegisteredClassFactory.java            |  133 ++
 .../x11/X11GraphicsConfigurationFactory.java       |  104 +
 .../jogamp/nativewindow/x11/X11ToolkitLock.java    |   55 +
 .../classes/jogamp/nativewindow/x11/X11Util.java   |  612 +++++
 src/nativewindow/native/JAWT_DrawingSurfaceInfo.c  |    2 +-
 src/nativewindow/native/NativewindowCommon.c       |   57 +
 src/nativewindow/native/NativewindowCommon.h       |   15 +
 src/nativewindow/native/windows/GDImisc.c          |  212 +-
 src/nativewindow/native/x11/Xmisc.c                |  129 +-
 src/newt/classes/com/jogamp/newt/Display.java      |    4 +-
 src/newt/classes/com/jogamp/newt/NewtFactory.java  |    8 +-
 src/newt/classes/com/jogamp/newt/NewtVersion.java  |    6 +-
 src/newt/classes/com/jogamp/newt/Screen.java       |    2 +-
 src/newt/classes/com/jogamp/newt/Window.java       |    5 +-
 .../classes/com/jogamp/newt/awt/NewtCanvasAWT.java |  108 +-
 .../com/jogamp/newt/awt/NewtFactoryAWT.java        |    4 +-
 .../classes/com/jogamp/newt/event/KeyEvent.java    |    2 +-
 .../com/jogamp/newt/event/TraceWindowAdapter.java  |    4 +
 .../com/jogamp/newt/event/WindowAdapter.java       |    2 +
 .../classes/com/jogamp/newt/event/WindowEvent.java |   12 +-
 .../com/jogamp/newt/event/WindowListener.java      |    3 +
 .../com/jogamp/newt/event/awt/AWTAdapter.java      |    2 +-
 .../jogamp/newt/event/awt/AWTNewtEventFactory.java |    2 +-
 src/newt/classes/com/jogamp/newt/impl/Debug.java   |  140 --
 .../com/jogamp/newt/impl/DefaultEDTUtil.java       |  330 ---
 .../classes/com/jogamp/newt/impl/DisplayImpl.java  |  416 ----
 .../com/jogamp/newt/impl/NEWTJNILibLoader.java     |   62 -
 .../com/jogamp/newt/impl/OffscreenWindow.java      |  128 -
 .../classes/com/jogamp/newt/impl/ScreenImpl.java   |  505 ----
 .../com/jogamp/newt/impl/ScreenModeStatus.java     |  207 --
 .../classes/com/jogamp/newt/impl/WindowImpl.java   | 2205 ------------------
 .../com/jogamp/newt/impl/awt/AWTCanvas.java        |  289 ---
 .../com/jogamp/newt/impl/awt/AWTDisplay.java       |   63 -
 .../com/jogamp/newt/impl/awt/AWTScreen.java        |   65 -
 .../com/jogamp/newt/impl/awt/AWTWindow.java        |  289 ---
 .../com/jogamp/newt/impl/event/NEWTEventTask.java  |   56 -
 .../com/jogamp/newt/impl/intel/gdl/Display.java    |  104 -
 .../com/jogamp/newt/impl/intel/gdl/Screen.java     |   68 -
 .../com/jogamp/newt/impl/intel/gdl/Window.java     |  147 --
 .../com/jogamp/newt/impl/macosx/MacDisplay.java    |  101 -
 .../com/jogamp/newt/impl/macosx/MacScreen.java     |   57 -
 .../com/jogamp/newt/impl/macosx/MacWindow.java     |  434 ----
 .../newt/impl/opengl/broadcom/egl/Display.java     |   81 -
 .../newt/impl/opengl/broadcom/egl/Screen.java      |   62 -
 .../newt/impl/opengl/broadcom/egl/Window.java      |  164 --
 .../com/jogamp/newt/impl/opengl/kd/KDDisplay.java  |   84 -
 .../com/jogamp/newt/impl/opengl/kd/KDScreen.java   |   58 -
 .../com/jogamp/newt/impl/opengl/kd/KDWindow.java   |  147 --
 .../jogamp/newt/impl/windows/WindowsDisplay.java   |  105 -
 .../jogamp/newt/impl/windows/WindowsScreen.java    |  114 -
 .../jogamp/newt/impl/windows/WindowsWindow.java    |  209 --
 .../com/jogamp/newt/impl/x11/X11Display.java       |  115 -
 .../com/jogamp/newt/impl/x11/X11Screen.java        |  270 ---
 .../com/jogamp/newt/impl/x11/X11Window.java        |  150 --
 .../classes/com/jogamp/newt/opengl/GLWindow.java   |  119 +-
 .../classes/com/jogamp/newt/util/MainThread.java   |  125 +-
 src/newt/classes/jogamp/newt/Debug.java            |  140 ++
 src/newt/classes/jogamp/newt/DefaultEDTUtil.java   |  335 +++
 src/newt/classes/jogamp/newt/DisplayImpl.java      |  452 ++++
 src/newt/classes/jogamp/newt/NEWTJNILibLoader.java |   62 +
 src/newt/classes/jogamp/newt/OffscreenWindow.java  |  135 ++
 src/newt/classes/jogamp/newt/ScreenImpl.java       |  524 +++++
 src/newt/classes/jogamp/newt/ScreenModeStatus.java |  207 ++
 src/newt/classes/jogamp/newt/WindowImpl.java       | 2239 ++++++++++++++++++
 src/newt/classes/jogamp/newt/awt/AWTCanvas.java    |  312 +++
 src/newt/classes/jogamp/newt/awt/AWTDisplay.java   |   67 +
 src/newt/classes/jogamp/newt/awt/AWTEDTUtil.java   |  108 +
 src/newt/classes/jogamp/newt/awt/AWTScreen.java    |   65 +
 src/newt/classes/jogamp/newt/awt/AWTWindow.java    |  244 ++
 .../jogamp/newt/awt/opengl/VersionApplet.java      |  174 ++
 .../classes/jogamp/newt/event/NEWTEventTask.java   |   56 +
 .../classes/jogamp/newt/intel/gdl/Display.java     |  104 +
 src/newt/classes/jogamp/newt/intel/gdl/Screen.java |   68 +
 src/newt/classes/jogamp/newt/intel/gdl/Window.java |  148 ++
 .../classes/jogamp/newt/macosx/MacDisplay.java     |  100 +
 src/newt/classes/jogamp/newt/macosx/MacScreen.java |   57 +
 src/newt/classes/jogamp/newt/macosx/MacWindow.java |  439 ++++
 .../jogamp/newt/opengl/broadcom/egl/Display.java   |   81 +
 .../jogamp/newt/opengl/broadcom/egl/Screen.java    |   62 +
 .../jogamp/newt/opengl/broadcom/egl/Window.java    |  165 ++
 .../classes/jogamp/newt/opengl/kd/KDDisplay.java   |   84 +
 .../classes/jogamp/newt/opengl/kd/KDScreen.java    |   58 +
 .../classes/jogamp/newt/opengl/kd/KDWindow.java    |  148 ++
 .../jogamp/newt/windows/WindowsDisplay.java        |   94 +
 .../classes/jogamp/newt/windows/WindowsScreen.java |  114 +
 .../classes/jogamp/newt/windows/WindowsWindow.java |  209 ++
 src/newt/classes/jogamp/newt/x11/X11Display.java   |  114 +
 src/newt/classes/jogamp/newt/x11/X11Screen.java    |  270 +++
 src/newt/classes/jogamp/newt/x11/X11Window.java    |  146 ++
 src/newt/native/BroadcomEGL.c                      |   16 +-
 src/newt/native/IntelGDL.c                         |   24 +-
 src/newt/native/KDWindow.c                         |   25 +-
 src/newt/native/MacWindow.m                        |   62 +-
 src/newt/native/NewtMacWindow.m                    |    5 +-
 src/newt/native/WindowEvent.h                      |   13 +-
 src/newt/native/WindowsWindow.c                    |  188 +-
 src/newt/native/X11Window.c                        |  119 +-
 .../opengl/test/bugs/Bug427GLJPanelTest1.java      |   72 +
 .../com/jogamp/opengl/test/bugs/Issue326Test1.java |   94 +
 .../com/jogamp/opengl/test/bugs/Issue326Test2.java |   73 +
 .../com/jogamp/opengl/test/bugs/Issue344Base.java  |  107 +
 .../com/jogamp/opengl/test/bugs/Issue344Test1.java |   12 +
 .../com/jogamp/opengl/test/bugs/Issue344Test2.java |   12 +
 .../com/jogamp/opengl/test/bugs/Issue344Test3.java |   12 +
 .../com/jogamp/opengl/test/bugs/Issue344Test4.java |   12 +
 .../test/junit/jogl/acore/TestGLProfile01NEWT.java |  166 ++
 .../junit/jogl/acore/TestSharedContextListAWT.java |  158 ++
 .../jogl/acore/TestSharedContextListNEWT.java      |  140 ++
 .../opengl/test/junit/jogl/awt/TestAWT01GLn.java   |  135 ++
 .../junit/jogl/awt/TestAWT02WindowClosing.java     |  111 +
 .../jogl/awt/TestAWT03GLCanvasRecreate01.java      |  183 ++
 .../TestBug461OffscreenSupersamplingSwingAWT.java  |  173 ++
 .../test/junit/jogl/awt/TestSwingAWT01GLn.java     |  147 ++
 .../TestAWTTextRendererUseVertexArrayBug464.java   |  155 ++
 .../awt/text/TextRendererGLEventListener01.java    |  124 +
 .../jogl/awt/text/TextRendererTraceGL2Mock01.java  |  137 ++
 .../test/junit/jogl/caps/MultisampleChooser01.java |   68 +
 .../test/junit/jogl/caps/MultisampleDemo01.java    |  138 ++
 .../test/junit/jogl/caps/TestMultisampleAWT.java   |  121 +
 .../test/junit/jogl/caps/TestMultisampleNEWT.java  |  100 +
 .../test/junit/jogl/demos/es1/RedSquare.java       |  169 ++
 .../test/junit/jogl/demos/es2/RedSquare0.java      |  198 ++
 .../jogl/demos/es2/shader/RedSquareShader.java     |   68 +
 .../test/junit/jogl/demos/gl2/gears/Gears.java     |  371 +++
 .../junit/jogl/demos/gl2/gears/TestGearsAWT.java   |  122 +
 .../jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java |  130 ++
 .../gl2/gears/TestGearsGLJPanelAWTBug450.java      |  163 ++
 .../jogl/demos/gl2/gears/newt/TestGearsNEWT.java   |  130 ++
 .../gl2/gears/newt/TestGearsNewtAWTWrapper.java    |  112 +
 .../junit/jogl/drawable/TestDrawable01NEWT.java    |  184 ++
 .../test/junit/jogl/glsl/TestGLSLSimple01NEWT.java |  143 ++
 .../jogl/glsl/TestShaderCompilationBug459AWT.java  |  162 ++
 .../TestTransformFeedbackVaryingsBug407NEWT.java   |  231 ++
 .../jogl/glu/TestBug463ScaleImageMemoryAWT.java    |  114 +
 .../junit/jogl/glu/TestGluUnprojectDoubleNOUI.java |   57 +
 .../junit/jogl/glu/TestGluUnprojectFloatNOUI.java  |   58 +
 ...TestSwingAWTRobotUsageBeforeJOGLInitBug411.java |  333 +++
 .../test/junit/jogl/offscreen/ReadBuffer2File.java |   70 +
 .../junit/jogl/offscreen/ReadBuffer2Screen.java    |  188 ++
 .../test/junit/jogl/offscreen/ReadBufferBase.java  |   91 +
 .../test/junit/jogl/offscreen/ReadBufferUtil.java  |  107 +
 .../test/junit/jogl/offscreen/Surface2File.java    |   79 +
 .../offscreen/TestOffscreen01GLPBufferNEWT.java    |  327 +++
 .../jogl/offscreen/TestOffscreen02BitmapNEWT.java  |  184 ++
 .../test/junit/jogl/offscreen/WindowUtilNEWT.java  |  110 +
 .../opengl/test/junit/jogl/swt/OneTriangle.java    |   71 +
 .../opengl/test/junit/jogl/swt/TestSWT01GLn.java   |  199 ++
 .../opengl/test/junit/jogl/swt/TestSWT02GLn.java   |  236 ++
 .../test/junit/jogl/swt/TestSWTAWT01GLn.java       |  184 ++
 .../texture/TestGrayTextureFromFileAWTBug417.java  |  143 ++
 .../test/junit/jogl/texture/TestTexture01AWT.java  |  146 ++
 .../test/junit/jogl/texture/grayscale_texture.png  |  Bin 0 -> 4873 bytes
 .../util/texture/gl2/TextureGL2ListenerDraw1.java  |  112 +
 .../opengl/test/junit/newt/TestCloseNewtAWT.java   |  122 +
 .../junit/newt/TestDisplayLifecycle01NEWT.java     |  264 +++
 .../junit/newt/TestDisplayLifecycle02NEWT.java     |  386 +++
 .../test/junit/newt/TestEventSourceNotAWTBug.java  |  110 +
 .../test/junit/newt/TestFocus01SwingAWTRobot.java  |  201 ++
 .../test/junit/newt/TestFocus02SwingAWTRobot.java  |  301 +++
 .../test/junit/newt/TestGLWindows00NEWT.java       |  133 ++
 .../test/junit/newt/TestGLWindows01NEWT.java       |  384 +++
 .../junit/newt/TestGLWindows02NEWTAnimated.java    |  303 +++
 .../test/junit/newt/TestListenerCom01AWT.java      |  167 ++
 .../test/junit/newt/TestRemoteGLWindows01NEWT.java |  171 ++
 .../test/junit/newt/TestRemoteWindow01NEWT.java    |  151 ++
 .../test/junit/newt/TestScreenMode00NEWT.java      |  135 ++
 .../test/junit/newt/TestScreenMode01NEWT.java      |  284 +++
 .../test/junit/newt/TestScreenMode02NEWT.java      |  187 ++
 .../junit/newt/TestWindowClosingProtocol01AWT.java |  160 ++
 .../newt/TestWindowClosingProtocol02NEWT.java      |   96 +
 .../newt/TestWindowClosingProtocol03NewtAWT.java   |  115 +
 .../opengl/test/junit/newt/TestWindows01NEWT.java  |  179 ++
 .../opengl/test/junit/newt/WindowEventCom1.java    |   42 +
 .../opengl/test/junit/newt/WindowEventCom2.java    |   48 +
 .../opengl/test/junit/newt/WindowEventCom3.java    |   44 +
 .../test/junit/newt/parenting/GLRunnableDummy.java |   57 +
 .../test/junit/newt/parenting/KeyAction.java       |   45 +
 .../junit/newt/parenting/TestParenting01NEWT.java  |  716 ++++++
 .../junit/newt/parenting/TestParenting01aAWT.java  |  443 ++++
 .../junit/newt/parenting/TestParenting01bAWT.java  |  205 ++
 .../junit/newt/parenting/TestParenting01cAWT.java  |  243 ++
 .../newt/parenting/TestParenting01cSwingAWT.java   |  365 +++
 .../junit/newt/parenting/TestParenting02AWT.java   |  267 +++
 .../junit/newt/parenting/TestParenting02NEWT.java  |  235 ++
 .../junit/newt/parenting/TestParenting03AWT.java   |  203 ++
 .../junit/newt/parenting/TestParenting03bAWT.java  |  258 +++
 .../test/junit/newt/parenting/WindowAction.java    |   47 +
 .../opengl/test/junit/util/AWTFocusAdapter.java    |   73 +
 .../opengl/test/junit/util/AWTKeyAdapter.java      |   54 +
 .../opengl/test/junit/util/AWTMouseAdapter.java    |   53 +
 .../opengl/test/junit/util/AWTRobotUtil.java       |  497 ++++
 .../jogamp/opengl/test/junit/util/DumpGLInfo.java  |   51 +
 .../opengl/test/junit/util/EventCountAdapter.java  |   36 +
 .../test/junit/util/EventCountAdapterUtil.java     |   49 +
 .../opengl/test/junit/util/GLSLSimpleProgram.java  |  121 +
 .../jogamp/opengl/test/junit/util/MiscUtils.java   |   63 +
 .../opengl/test/junit/util/NEWTFocusAdapter.java   |   64 +
 .../opengl/test/junit/util/NEWTKeyAdapter.java     |   58 +
 .../opengl/test/junit/util/NEWTMouseAdapter.java   |   57 +
 .../jogamp/opengl/test/junit/util/QuitAdapter.java |   52 +
 .../opengl/test/junit/util/SingletonInstance.java  |  143 ++
 .../jogamp/opengl/test/junit/util/UITestCase.java  |   72 +
 src/test/jogamp/newt/WindowImplAccess.java         |   57 +
 {test => src/test}/native/displayMultiple01.c      |    0
 {test => src/test}/native/displayMultiple02.c      |    0
 {test => src/test}/native/glExtensionsListGL2.c    |    0
 {test => src/test}/native/glExtensionsListGL3.c    |    0
 {test => src/test}/native/make.sh                  |    0
 test/Issue326Test1.java                            |   92 -
 test/Issue326Test2.java                            |   71 -
 test/Issue344Base.java                             |  105 -
 test/Issue344Test1.java                            |   10 -
 test/Issue344Test2.java                            |   10 -
 test/Issue344Test3.java                            |   10 -
 test/Issue344Test4.java                            |   10 -
 www/index.html                                     |   10 +-
 953 files changed, 88591 insertions(+), 75979 deletions(-)

diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..a37a338
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="build/nativewindow/classes" path="src/nativewindow/classes">
+		<attributes>
+			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jogl/build/nativewindow/obj"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="build/jogl/classes" path="build/jogl/gensrc/classes">
+		<attributes>
+			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jogl/build/jogl/obj"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="build/nativewindow/classes" path="build/nativewindow/gensrc/classes">
+		<attributes>
+			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jogl/build/nativewindow/obj"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="build/test/build/classes" path="src/test"/>
+	<classpathentry excluding="com/jogamp/audio/windows/waveout/TestSpatialization.java|jogamp/opengl/gl2/fixme/" kind="src" output="build/jogl/classes" path="src/jogl/classes">
+		<attributes>
+			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jogl/build/jogl/obj"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="build/newt/classes" path="src/newt/classes">
+		<attributes>
+			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jogl/build/newt/obj"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/gluegen"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Ant"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/SWT"/>
+	<classpathentry kind="output" path="build/eclipse-classes"/>
+</classpath>
diff --git a/.externalToolBuilders/jogl builder.launch b/.externalToolBuilders/jogl builder.launch
new file mode 100644
index 0000000..eab22e8
--- /dev/null
+++ b/.externalToolBuilders/jogl builder.launch	
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="all.ide,"/>
+<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="all.ide,"/>
+<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_CLEAN_TARGETS" value="clean,"/>
+<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="all.ide,"/>
+<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jogl"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/jogl/make/build.xml}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,clean"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/jogl/make}"/>
+</launchConfiguration>
diff --git a/.externalToolBuilders/org.eclipse.jdt.core.javabuilder.launch b/.externalToolBuilders/org.eclipse.jdt.core.javabuilder.launch
new file mode 100644
index 0000000..7fe64af
--- /dev/null
+++ b/.externalToolBuilders/org.eclipse.jdt.core.javabuilder.launch
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.jdt.core.javabuilder"/>
+<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+</launchConfiguration>
diff --git a/.project b/.project
new file mode 100644
index 0000000..db143f4
--- /dev/null
+++ b/.project
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>jogl</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+			<arguments>
+				<dictionary>
+					<key>LaunchConfigHandle</key>
+					<value><project>/.externalToolBuilders/jogl builder.launch</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+			<triggers>full,incremental,</triggers>
+			<arguments>
+				<dictionary>
+					<key>LaunchConfigHandle</key>
+					<value><project>/.externalToolBuilders/org.eclipse.jdt.core.javabuilder.launch</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/LICENSE.txt b/LICENSE.txt
index 96a014f..9631a94 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -7,6 +7,14 @@ Additional licenses compatible with the BSD 3-clause license are listed below A.
 
 +++
 
+Exception is the content of folder 'make/lib'.
+This folder contains build/test time only Java binaries (JAR) to ease the build setup.
+Each JAR file has it's corresponding LICENSE file containing the 
+source location and license text. None of these binaries are contained in any way 
+by the generated and deployed JOGL binaries.
+
++++
+
 L.1) The JOGL source tree contains code from the JogAmp Community
      which is covered by the Simplified BSD 2-clause license:
 
diff --git a/doc/NEWT.txt b/doc/NEWT.txt
new file mode 100644
index 0000000..c97d90e
--- /dev/null
+++ b/doc/NEWT.txt
@@ -0,0 +1,30 @@
+NEWT / Swing/AWT mixed usage:
+==================================
+
+1) Shut down menus when NEWT window gains focus:
++++
+  glWindow.addWindowListener(new WindowAdapter() {
+          public void windowGainedFocus(WindowEvent arg0) {
+                  MenuSelectionManager.defaultManager().clearSelectedPath();
+          }                       
+  });
++++
+
+2) Mixing hw/lw components
+
+http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6776743
+http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6788954
+http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6797587
+
+Bug 6788954:
+    If an existing application embedds a heavyweight component in a frame, 
+    and at the same time installs a custom glass pane, 
+    the heavyweight component will disappear. 
+    This regression is not very serious since we never supported mixing of hw and lw components 
+    in general. The developer will have two options to resolve the problem:
+    1. By modifying the software to tag the glass pane properly, or
+    2. To suggest users to use the sun.awt.disableMixing system property 
+       to disable the hw/lw mixing code at all.
+
+
+
diff --git a/doc/TODO.txt b/doc/TODO.txt
index 294f16c..4c5f61f 100644
--- a/doc/TODO.txt
+++ b/doc/TODO.txt
@@ -1,17 +1,12 @@
-This list is probably completely out of date...
-anyone the guts to remove it? :)
--mbien
+WIP:
+
+- Protected access for Impl classes
 
 Random, somewhat old to-do list:
 
 - Non-const array types must be properly released with JNI_COMMIT in
   order to see side effects if the array was copied.
 
-- Think about e.g. protected access for Impl classes
-
-- Fix glProgramStringARB and glGetProgramString{NV,ARB} so that they
-  use Strings and/or StringBuffers insteead of GLUbyte* and void*
-
 - figure out how to deal with WGL entry points:
     WINGDIAPI HGLRC WINAPI wglCreateLayerContext(HDC, int);
     WINGDIAPI BOOL  WINAPI wglUseFontBitmapsA(HDC, DWORD, DWORD, DWORD);
@@ -33,9 +28,3 @@ Random, somewhat old to-do list:
 - Throw an exception if native calls to GetPrimitiveArrayCritical
   return null.
 
-- Before emitting functions and constants, sort them first by
-  extension suffix (i.e., ARB, ATI, NV, etc) and then by name. This
-  will organize them in the file more logically. When writing the
-  code, the sort function can check the last substring that's all caps,
-  and treat this as the extension owner. Be careful though, some end
-  in "3D" and that's not an extension.
diff --git a/etc/profile.jogl b/etc/profile.jogl
index c3d7199..dec1296 100755
--- a/etc/profile.jogl
+++ b/etc/profile.jogl
@@ -23,8 +23,12 @@ function concat_jogl_list()
     echo $JOGL_LIST
 }
 
+ARCH=`uname -m`
+KERNEL=`uname -s | awk ' { printf "%s",tolower($0) ; } '`
+
 uname -a | grep -i LINUX && OSS=x11
 uname -a | grep -i Darwin && OSS=osx
+uname -a | grep -i CYGWIN && OSS=win
 
 JOGL_AWT="jogl.awt.jar jogl.util.awt.jar newt.awt.jar nativewindow.awt.jar"
 
@@ -139,6 +143,31 @@ if [ ! -z "$JOGL_PROFILE" ] ; then
     export JOGL_CLASSPATH
 fi
 
+if [ "$KERNEL" = "linux" ] ; then
+    SWT_SUB="gtk"
+elif [ "$KERNEL" = "darwin" ] ; then
+    SWT_SUB="cocoa"
+fi
+if [ -z "$SWT_CLASSPATH" ] ; then
+    SWT_CLASSPATH_0=$JOGL_BUILD_DIR/../make/lib/swt/$SWT_SUB-$KERNEL-$ARCH/swt-debug.jar
+    SWT_CLASSPATH_1=$HOME/.java/swt.jar
+    if [ ! -e "$SWT_CLASSPATH_0" ] ; then 
+        echo Info: NO JOGL SWT $SWT_CLASSPATH_0
+        if [ ! -e "$SWT_CLASSPATH_1" ] ; then 
+            echo Info: NO Users SWT $SWT_CLASSPATH_1
+        else
+            export SWT_CLASSPATH=$SWT_CLASSPATH_1
+            echo Info: Using Users SWT $SWT_CLASSPATH
+        fi
+    else
+        export SWT_CLASSPATH=$SWT_CLASSPATH_0
+        echo Info: Using JOGL SWT $SWT_CLASSPATH
+    fi
+    if [ ! -z "$SWT_CLASSPATH" ] ; then
+        export SWT_CLASSPATH
+    fi
+fi
+
 if [ -z "$JOGL_CLASSPATH" ] ; then
     print_usage
 fi
diff --git a/jnlp-files/applet-version-jnlp.html b/jnlp-files/applet-version-jnlp.html
new file mode 100644
index 0000000..218f21f
--- /dev/null
+++ b/jnlp-files/applet-version-jnlp.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>JOGL JNLP Applet Version (JNLP/Launcher)</title>
+</head>
+<body>
+
+<P>
+The applet below shall show you the version of the Jogl components
+and your platform.
+</P>
+<p>
+JNLP Applet with AppletLauncher fallback version.
+</p>
+
+<P>
+
+<applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
+      width=800
+      height=600
+      archive="JOGL_CODEBASE_TAG/../util/applet-launcher.jar,
+               JOGL_CODEBASE_TAG/newt.all.jar,
+               JOGL_CODEBASE_TAG/jogl.all.jar,
+               JOGL_CODEBASE_TAG/nativewindow.all.jar,
+               JOGL_CODEBASE_TAG/gluegen-rt.jar">
+   <param name="codebase_lookup" value="false">
+   <param name="subapplet.classname" value="jogamp.newt.awt.opengl.VersionApplet">
+   <param name="subapplet.displayname" value="JOGL Applet Version">
+   <!-- param name="noddraw.check" value="true" -->
+   <param name="progressbar" value="true">
+   <param name="jnlpNumExtensions" value="1">
+   <param name="jnlpExtension1" value="JOGL_CODEBASE_TAG/jogl-core.jnlp">
+   <!-- param name="java_arguments" value="-Dsun.java2d.noddraw=true" -->
+   <param name="jnlp_href" value="JOGL_CODEBASE_TAG/applet-version.jnlp">
+</applet>
+
+
+</P>
+
+</body>
+</html>
diff --git a/jnlp-files/applet-version-lancheronly.html b/jnlp-files/applet-version-lancheronly.html
new file mode 100644
index 0000000..718e9eb
--- /dev/null
+++ b/jnlp-files/applet-version-lancheronly.html
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>JOGL JNLP Applet Version (Launcher)</title>
+</head>
+<body>
+
+<P>
+The applet below shall show you the version of the Jogl components
+and your platform.
+</P>
+<p>
+AppletLauncher only version.
+</p>
+
+<P>
+
+<applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
+      width=800
+      height=600
+      archive="JOGL_CODEBASE_TAG/../util/applet-launcher.jar,
+               JOGL_CODEBASE_TAG/newt.all.jar,
+               JOGL_CODEBASE_TAG/jogl.all.jar,
+               JOGL_CODEBASE_TAG/nativewindow.all.jar,
+               JOGL_CODEBASE_TAG/gluegen-rt.jar">
+   <param name="codebase_lookup" value="false">
+   <param name="subapplet.classname" value="jogamp.newt.awt.opengl.VersionApplet">
+   <param name="subapplet.displayname" value="JOGL Applet Version">
+   <!-- param name="noddraw.check" value="true" -->
+   <param name="progressbar" value="true">
+   <param name="jnlpNumExtensions" value="1">
+   <param name="jnlpExtension1" value="JOGL_CODEBASE_TAG/jogl-core.jnlp">
+</applet>
+
+
+</P>
+
+</body>
+</html>
diff --git a/jnlp-files/applet-version.jnlp b/jnlp-files/applet-version.jnlp
new file mode 100644
index 0000000..c621b46
--- /dev/null
+++ b/jnlp-files/applet-version.jnlp
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp codebase="JOGL_CODEBASE_TAG" href="applet-version.jnlp" version="JOGAMP_VERSION">
+  <information>
+    <title>JOGL JNLP Applet Version</title>
+    <vendor>JogAmp Community</vendor>
+    <homepage href="http://jogamp.org/"/>
+    <description>JOGL Version</description>
+    <offline-allowed/>
+  </information>
+  <update check="background" policy="always"/>
+
+    <resources>
+      <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
+      <!-- property name="sun.java2d.noddraw" value="true"/-->
+      <extension name="newt-all-awt" href="JOGL_CODEBASE_TAG/newt-all-awt.jnlp" />
+    </resources>
+
+  <applet-desc 
+      name="Version-Applet"
+      main-class="jogamp.newt.awt.opengl.VersionApplet"
+      width="800" 
+      height="600">
+  </applet-desc>
+</jnlp>
diff --git a/jnlp-files/application-version.jnlp b/jnlp-files/application-version.jnlp
new file mode 100644
index 0000000..3fac56c
--- /dev/null
+++ b/jnlp-files/application-version.jnlp
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp codebase="JOGL_CODEBASE_TAG" href="applet-version.jnlp" version="JOGAMP_VERSION">
+  <information>
+    <title>JOGL JNLP Application Version</title>
+    <vendor>JogAmp Community</vendor>
+    <homepage href="http://jogamp.org/"/>
+    <description>JOGL Version</description>
+    <offline-allowed/>
+  </information>
+  <update check="background" policy="always"/>
+
+    <resources>
+      <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
+      <!-- property name="sun.java2d.noddraw" value="true"/-->
+      <extension name="newt-all-awt" href="JOGL_CODEBASE_TAG/newt-all-awt.jnlp" />
+    </resources>
+
+  <application-desc main-class="jogamp.newt.awt.opengl.VersionApplet"/>
+</jnlp>
diff --git a/jnlp-files/javaws-version.jnlp b/jnlp-files/javaws-version.jnlp
new file mode 100755
index 0000000..fa14f95
--- /dev/null
+++ b/jnlp-files/javaws-version.jnlp
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp codebase="JOGL_CODEBASE_TAG" href="javaws-version.jnlp" version="JOGAMP_VERSION">
+  <information>
+    <title>JOGL JNLP Javaws Version</title>
+    <vendor>JogAmp Community</vendor>
+    <homepage href="http://jogamp.org/"/>
+    <description>JOGL Version</description>
+    <offline-allowed/>
+  </information>
+  <update check="background" policy="always"/>
+
+    <resources>
+      <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
+      <!-- property name="sun.java2d.noddraw" value="true"/-->
+      <extension name="newt-all-awt" href="JOGL_CODEBASE_TAG/newt-all-awt.jnlp" />
+    </resources>
+
+  <application-desc main-class="jogamp.newt.awt.opengl.VersionApplet"/>
+</jnlp>
diff --git a/jnlp-files/jogl-all-awt.jnlp b/jnlp-files/jogl-all-awt.jnlp
index df0c560..822c26a 100644
--- a/jnlp-files/jogl-all-awt.jnlp
+++ b/jnlp-files/jogl-all-awt.jnlp
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="jogl-all-awt.jnlp">
+      href="jogl-all-awt.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>Java(tm) Binding to the OpenGL(r) API (ALL.AWT)</title>
     <vendor>JogAmp Community</vendor>
diff --git a/jnlp-files/jogl-all-noawt.jnlp b/jnlp-files/jogl-all-noawt.jnlp
index 14fb181..55b548f 100644
--- a/jnlp-files/jogl-all-noawt.jnlp
+++ b/jnlp-files/jogl-all-noawt.jnlp
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="jogl-all-noawt.jnlp">
+      href="jogl-all-noawt.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>Java(tm) Binding to the OpenGL(r) API (ALL.NO_AWT)</title>
     <vendor>JogAmp Community</vendor>
diff --git a/jnlp-files/jogl-awt.jnlp b/jnlp-files/jogl-awt.jnlp
index 684c2d5..ffdaee0 100644
--- a/jnlp-files/jogl-awt.jnlp
+++ b/jnlp-files/jogl-awt.jnlp
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="jogl-awt.jnlp">
+      href="jogl-awt.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>Java(tm) Binding to the OpenGL(r) API (AWT)</title>
     <vendor>JogAmp Community</vendor>
diff --git a/jnlp-files/jogl-core.jnlp b/jnlp-files/jogl-core.jnlp
index dca2937..464c65c 100644
--- a/jnlp-files/jogl-core.jnlp
+++ b/jnlp-files/jogl-core.jnlp
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="jogl-core.jnlp">
+      href="jogl-core.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>Java(tm) Binding to the OpenGL(r) API (CORE)</title>
     <vendor>JogAmp Community</vendor>
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="jogl.core.jar" main="true"/>
+      <jar href="jogl.core.jar"/>
       <jar href="jogl.util.jar" download="lazy"/>
 
       <extension name="gluegen-rt"   href="GLUEGEN_CODEBASE_TAG/gluegen-rt.jnlp" />
diff --git a/jnlp-files/jogl-gl2es12.jnlp b/jnlp-files/jogl-gl2es12.jnlp
deleted file mode 100644
index 92fa621..0000000
--- a/jnlp-files/jogl-gl2es12.jnlp
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="jogl-gl2es12.jnlp">
-  <information>
-    <title>Java(tm) Binding to the OpenGL(r) API (GL2ES12)</title>
-    <vendor>JogAmp Community</vendor>
-    <homepage href="http://jogamp.org/"/>
-    <description>Java Binding to the OpenGL API - JSR-231 2.0.0 - GL2ES12</description>
-    <description kind="short">Java programming language binding for the OpenGL 3D graphics API - GL2ES12.</description>
-    <offline-allowed/>
-  </information>
-  <update check="background" policy="always"/>
-  <security>
-      <all-permissions/>
-  </security>
-    <resources>
-      <jar href="jogl.glu.mipmap.jar" download="lazy"/>
-      <jar href="jogl.glu.tess.jar" download="lazy"/>
-
-      <jar href="jogl.util.fixedfuncemu.jar" download="lazy"/>
-
-      <!-- jar href="jogl.sdk.jar" /-->
-
-      <extension name="jogl-core" href="JOGL_CODEBASE_TAG/jogl-core.jnlp" />
-    </resources>
-
-    <resources os="Mobile-Embedded">
-      <jar href="jogl.egl.jar" />
-      <jar href="jogl.gles1.jar" />
-      <jar href="jogl.gles1.dbg.jar" download="lazy"/>
-      <jar href="jogl.gles2.jar" />
-      <jar href="jogl.gles2.dbg.jar" download="lazy"/>
-    </resources>
-    <resources os="Windows">
-      <jar href="jogl.gl2es12.win.jar" />
-      <jar href="jogl.gl2es12.dbg.jar" download="lazy"/>
-    </resources>
-    <resources os="SunOS Linux">
-      <jar href="jogl.gl2es12.x11.jar" />
-      <jar href="jogl.gl2es12.dbg.jar" download="lazy"/>
-    </resources>
-    <resources os="Mac OS X">
-      <jar href="jogl.gl2es12.osx.jar" />
-      <jar href="jogl.gl2es12.dbg.jar" download="lazy"/>
-    </resources>
-
-  <component-desc />
-</jnlp>
diff --git a/jnlp-files/nativewindow-all-awt.jnlp b/jnlp-files/nativewindow-all-awt.jnlp
index 5273c2c..57a1895 100644
--- a/jnlp-files/nativewindow-all-awt.jnlp
+++ b/jnlp-files/nativewindow-all-awt.jnlp
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="nativewindow-all-awt.jnlp">
+      href="nativewindow-all-awt.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>Java(tm) NativeWindow Interface API (ALL.AWT)</title>
     <vendor>JogAmp Community</vendor>
-    <homepage href="http://nativewindow.dev.java.net/"/>
+    <homepage href="http://jogamp.org/"/>
     <description>Java API for a binding to a native windowing system - 2.0 - ALL.AWT</description>
     <description kind="short">Java API for a binding to a native windowing system - 2.0 - ALL.AWT</description>
     <offline-allowed/>
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="nativewindow.all.jar" main="true" />
+      <jar href="nativewindow.all.jar"/>
       <extension name="gluegen-rt"   href="GLUEGEN_CODEBASE_TAG/gluegen-rt.jnlp" />
     </resources>
 
diff --git a/jnlp-files/nativewindow-awt.jnlp b/jnlp-files/nativewindow-awt.jnlp
index b7a5c0f..d37446c 100644
--- a/jnlp-files/nativewindow-awt.jnlp
+++ b/jnlp-files/nativewindow-awt.jnlp
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="nativewindow-awt.jnlp">
+      href="nativewindow-awt.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>Java(tm) NativeWindow Interface API (AWT)</title>
     <vendor>JogAmp Community</vendor>
-    <homepage href="http://nativewindow.dev.java.net/"/>
+    <homepage href="http://jogamp.org/"/>
     <description>Java API for a binding to a native windowing system - 2.0 - AWT</description>
     <description kind="short">Java API for a binding to a native windowing system - 2.0 - AWT</description>
     <offline-allowed/>
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="nativewindow.awt.jar" main="true" />
+      <jar href="nativewindow.awt.jar"/>
       <extension name="nativewindow" href="JOGL_CODEBASE_TAG/nativewindow.jnlp" />
     </resources>
 
diff --git a/jnlp-files/nativewindow.jnlp b/jnlp-files/nativewindow.jnlp
index 8af99a5..a2b0c79 100644
--- a/jnlp-files/nativewindow.jnlp
+++ b/jnlp-files/nativewindow.jnlp
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="nativewindow.jnlp">
+      href="nativewindow.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>Java(tm) NativeWindow Interface API (CORE)</title>
     <vendor>JogAmp Community</vendor>
-    <homepage href="http://nativewindow.dev.java.net/"/>
+    <homepage href="http://jogamp.org/"/>
     <description>Java API for a binding to a native windowing system - 2.0 - CORE</description>
     <description kind="short">Java API for a binding to a native windowing system - 2.0 - CORE</description>
     <offline-allowed/>
@@ -14,56 +14,56 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="nativewindow.core.jar" main="true" />
+      <jar href="nativewindow.core.jar" />
       <extension name="gluegen-rt"   href="GLUEGEN_CODEBASE_TAG/gluegen-rt.jnlp" />
     </resources>
 
     <resources os="Windows" arch="x86">
-      <jar href="nativewindow.os.windows.jar" main="true" />
+      <jar href="nativewindow.os.win.jar" />
       <nativelib href = "nativewindow-natives-windows-i586.jar" />
     </resources>
     <resources os="Windows" arch="amd64">
-      <jar href="nativewindow.os.windows.jar" main="true" />
+      <jar href="nativewindow.os.win.jar" />
       <nativelib href = "nativewindow-natives-windows-amd64.jar" />
     </resources>
     <resources os="Windows" arch="x86_64">
-      <jar href="nativewindow.os.windows.jar" main="true" />
+      <jar href="nativewindow.os.win.jar" />
       <nativelib href = "nativewindow-natives-windows-amd64.jar" />
     </resources>
     <resources os="SunOS" arch="sparc">
-      <jar href="nativewindow.os.x11.jar" main="true" />
+      <jar href="nativewindow.os.x11.jar" />
       <nativelib href = "nativewindow-natives-solaris-sparc.jar" />
     </resources>
     <resources os="SunOS" arch="sparcv9">
-      <jar href="nativewindow.os.x11.jar" main="true" />
+      <jar href="nativewindow.os.x11.jar" />
       <nativelib href = "nativewindow-natives-solaris-sparcv9.jar" />
     </resources>
     <resources os="SunOS" arch="x86">
-      <jar href="nativewindow.os.x11.jar" main="true" />
+      <jar href="nativewindow.os.x11.jar" />
       <nativelib href = "nativewindow-natives-solaris-i586.jar" />
     </resources>
     <resources os="SunOS" arch="amd64">
-      <jar href="nativewindow.os.x11.jar" main="true" />
+      <jar href="nativewindow.os.x11.jar" />
       <nativelib href = "nativewindow-natives-solaris-amd64.jar" />
     </resources>
     <resources os="SunOS" arch="x86_64">
-      <jar href="nativewindow.os.x11.jar" main="true" />
+      <jar href="nativewindow.os.x11.jar" />
       <nativelib href = "nativewindow-natives-solaris-amd64.jar" />
     </resources>
     <resources os="Linux" arch="i386">
-      <jar href="nativewindow.os.x11.jar" main="true" />
+      <jar href="nativewindow.os.x11.jar" />
       <nativelib href = "nativewindow-natives-linux-i586.jar" />
     </resources>
     <resources os="Linux" arch="x86">
-      <jar href="nativewindow.os.x11.jar" main="true" />
+      <jar href="nativewindow.os.x11.jar" />
       <nativelib href = "nativewindow-natives-linux-i586.jar" />
     </resources>
     <resources os="Linux" arch="amd64">
-      <jar href="nativewindow.os.x11.jar" main="true" />
+      <jar href="nativewindow.os.x11.jar" />
       <nativelib href = "nativewindow-natives-linux-amd64.jar" />
     </resources>
     <resources os="Linux" arch="x86_64">
-      <jar href="nativewindow.os.x11.jar" main="true" />
+      <jar href="nativewindow.os.x11.jar" />
       <nativelib href = "nativewindow-natives-linux-amd64.jar" />
     </resources>
     <resources os="Mac OS X" arch="i386">
diff --git a/jnlp-files/newt-all-awt.jnlp b/jnlp-files/newt-all-awt.jnlp
index f063ae1..c4444ff 100644
--- a/jnlp-files/newt-all-awt.jnlp
+++ b/jnlp-files/newt-all-awt.jnlp
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="newt-all-awt.jnlp">
+      href="newt-all-awt.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>NEWT - New Windowing Toolkit (ALL.AWT)</title>
     <vendor>JogAmp Community</vendor>
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="newt.all.jar" main="true"/>
+      <jar href="newt.all.jar" />
       <extension name="jogl-all-awt" href="JOGL_CODEBASE_TAG/jogl-all-awt.jnlp" />
     </resources>
 
diff --git a/jnlp-files/newt-all-noawt.jnlp b/jnlp-files/newt-all-noawt.jnlp
index 63ff48e..c67c7ac 100644
--- a/jnlp-files/newt-all-noawt.jnlp
+++ b/jnlp-files/newt-all-noawt.jnlp
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="newt-all-noawt.jnlp">
+      href="newt-all-noawt.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>NEWT - New Windowing Toolkit (ALL.NO_AWT)</title>
     <vendor>JogAmp Community</vendor>
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="newt.all-noawt.jar" main="true"/>
+      <jar href="newt.all-noawt.jar" />
       <extension name="jogl-all-noawt" href="JOGL_CODEBASE_TAG/jogl-all-noawt.jnlp" />
     </resources>
 
diff --git a/jnlp-files/newt-awt.jnlp b/jnlp-files/newt-awt.jnlp
index 02f2578..fc5b7f1 100644
--- a/jnlp-files/newt-awt.jnlp
+++ b/jnlp-files/newt-awt.jnlp
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="newt-awt.jnlp">
+      href="newt-awt.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>NEWT - New Windowing Toolkit (AWT)</title>
     <vendor>JogAmp Community</vendor>
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="newt.awt.jar" main="true"/>
+      <jar href="newt.awt.jar" />
       <extension name="nativewindow-awt" href="JOGL_CODEBASE_TAG/nativewindow-awt.jnlp" />
       <extension name="newt" href="JOGL_CODEBASE_TAG/newt.jnlp" />
     </resources>
diff --git a/jnlp-files/newt-jogl.jnlp b/jnlp-files/newt-jogl.jnlp
index ee95a1f..cd0f5d6 100644
--- a/jnlp-files/newt-jogl.jnlp
+++ b/jnlp-files/newt-jogl.jnlp
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="newt-jogl.jnlp">
+      href="newt-jogl.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>NEWT - New Windowing Toolkit (JOGL)</title>
     <vendor>JogAmp Community</vendor>
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="newt.ogl.jar" main="true"/>
+      <jar href="newt.ogl.jar" />
       <extension name="newt" href="JOGL_CODEBASE_TAG/newt.jnlp" />
       <extension name="jogl-core" href="JOGL_CODEBASE_TAG/jogl-core.jnlp" />
     </resources>
diff --git a/jnlp-files/newt.jnlp b/jnlp-files/newt.jnlp
index ce4ed6f..9decf24 100644
--- a/jnlp-files/newt.jnlp
+++ b/jnlp-files/newt.jnlp
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <jnlp codebase="JOGL_CODEBASE_TAG/"
-      href="newt.jnlp">
+      href="newt.jnlp" version="JOGAMP_VERSION">
   <information>
     <title>NEWT - New Windowing Toolkit (CORE)</title>
     <vendor>JogAmp Community</vendor>
@@ -14,64 +14,64 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="newt.core.jar" main="true" />
+      <jar href="newt.core.jar" />
       <extension name="nativewindow" href="JOGL_CODEBASE_TAG/nativewindow.jnlp" />
     </resources>
 
     <resources os="Windows" arch="x86">
-      <jar href="newt.win.jar" main="true" />
+      <jar href="newt.os.win.jar" />
       <nativelib href = "newt-natives-windows-i586.jar" />
     </resources>
     <resources os="Windows" arch="amd64">
-      <jar href="newt.win.jar" main="true" />
+      <jar href="newt.os.win.jar" />
       <nativelib href = "newt-natives-windows-amd64.jar" />
     </resources>
     <resources os="Windows" arch="x86_64">
-      <jar href="newt.win.jar" main="true" />
+      <jar href="newt.os.win.jar" />
       <nativelib href = "newt-natives-windows-amd64.jar" />
     </resources>
     <resources os="SunOS" arch="sparc">
-      <jar href="newt.x11.jar" main="true" />
+      <jar href="newt.os.x11.jar" />
       <nativelib href = "newt-natives-solaris-sparc.jar" />
     </resources>
     <resources os="SunOS" arch="sparcv9">
-      <jar href="newt.x11.jar" main="true" />
+      <jar href="newt.os.x11.jar" />
       <nativelib href = "newt-natives-solaris-sparcv9.jar" />
     </resources>
     <resources os="SunOS" arch="x86">
-      <jar href="newt.x11.jar" main="true" />
+      <jar href="newt.os.x11.jar" />
       <nativelib href = "newt-natives-solaris-i586.jar" />
     </resources>
     <resources os="SunOS" arch="amd64">
-      <jar href="newt.x11.jar" main="true" />
+      <jar href="newt.os.x11.jar" />
       <nativelib href = "newt-natives-solaris-amd64.jar" />
     </resources>
     <resources os="SunOS" arch="x86_64">
-      <jar href="newt.x11.jar" main="true" />
+      <jar href="newt.os.x11.jar" />
       <nativelib href = "newt-natives-solaris-amd64.jar" />
     </resources>
     <resources os="Linux" arch="i386">
-      <jar href="newt.x11.jar" main="true" />
+      <jar href="newt.os.x11.jar" />
       <nativelib href = "newt-natives-linux-i586.jar" />
     </resources>
     <resources os="Linux" arch="x86">
-      <jar href="newt.x11.jar" main="true" />
+      <jar href="newt.os.x11.jar" />
       <nativelib href = "newt-natives-linux-i586.jar" />
     </resources>
     <resources os="Linux" arch="amd64">
-      <jar href="newt.x11.jar" main="true" />
+      <jar href="newt.os.x11.jar" />
       <nativelib href = "newt-natives-linux-amd64.jar" />
     </resources>
     <resources os="Linux" arch="x86_64">
-      <jar href="newt.x11.jar" main="true" />
+      <jar href="newt.os.x11.jar" />
       <nativelib href = "newt-natives-linux-amd64.jar" />
     </resources>
     <resources os="Mac OS X" arch="i386">
-      <jar href="newt.osx.jar" main="true" />
+      <jar href="newt.os.osx.jar" />
       <nativelib href = "newt-natives-macosx-universal.jar" />
     </resources>
     <resources os="Mac OS X" arch="x86_64">
-      <jar href="newt.osx.jar" main="true" />
+      <jar href="newt.os.osx.jar" />
       <nativelib href = "newt-natives-macosx-universal.jar" />
     </resources>
 
diff --git a/jogl.iml b/jogl.iml
index 419fbc9..3a65c74 100644
--- a/jogl.iml
+++ b/jogl.iml
@@ -7,7 +7,6 @@
       <sourceFolder url="file://$MODULE_DIR$/src/jogl/junit" isTestSource="true" />
     </content>
     <content url="file://$MODULE_DIR$/build/jogl">
-      <sourceFolder url="file://$MODULE_DIR$/build/jogl/gensrc/classes-cdc" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/build/jogl/gensrc/classes" isTestSource="false" />
     </content>
     <orderEntry type="inheritedJdk" />
diff --git a/make/build-common.xml b/make/build-common.xml
index e6a0661..4d38d74 100644
--- a/make/build-common.xml
+++ b/make/build-common.xml
@@ -15,6 +15,8 @@
     <!-- Pull in GlueGen cpptasks build file -->
     <property name="gluegen.root" value="../../gluegen" />
     <import file="${gluegen.root}/make/gluegen-cpptasks.xml" />
+    <import file="${gluegen.root}/make/jogamp-archivetasks.xml" />
+    <import file="${gluegen.root}/make/jogamp-env.xml" />
 
     <property name="ant-contrib.jar"  value="${gluegen.root}/make/lib/ant-contrib-1.0b3.jar" />
 
@@ -30,7 +32,7 @@
     <!-- 
        - Base initialization of properties and detection of operating system.
       -->
-    <target name="common.init" depends="gluegen.cpptasks.detect.os" unless="common.init.done">
+    <target name="common.init" depends="jogamp.env.init, gluegen.cpptasks.detect.os" unless="common.init.done">
         <property name="common.init.done" value="true" />
 
         <!-- Set the project root directory to be up one directory. -->
@@ -77,7 +79,6 @@
 
         <echo message="setup.nodesktop: ${setup.nodesktop}" />
         <echo message="setup.noAWT: ${setup.noAWT}" />
-        <echo message="setup.noCDC: ${setup.noCDC}" />
 
         <!-- Load the user specified properties file that defines various host
            - specific paths.  The user will be notified if this is does not
@@ -90,9 +91,46 @@
         <echo message="antlr.jar=${antlr.jar}" />
         <echo message="junit.jar=${junit.jar}" />
 
-        <property name="target.sourcelevel" value="1.4" />
+        <!-- Set swt.jar to the correct file for this platform. We point to the debug JARs to allow
+             stepping into SWT calls using the accompanying source code zip archives. -->
+        <condition property="swt.jar" value="${project.root}/make/lib/swt/win32-win32-x86_64/swt-debug.jar">
+          <istrue value="${isWindowsAMD64}" />
+        </condition>
+        <condition property="swt.jar" value="${project.root}/make/lib/swt/win32-win32-x86/swt-debug.jar">
+          <istrue value="${isWindowsX86}" />
+        </condition>
+        <condition property="swt.jar" value="${project.root}/make/lib/swt/gtk-linux-x86_64/swt-debug.jar">
+          <istrue value="${isLinuxAMD64}" />
+        </condition>
+        <condition property="swt.jar" value="${project.root}/make/lib/swt/gtk-linux-x86/swt-debug.jar">
+          <istrue value="${isLinuxX86}" />
+        </condition>
+        <condition property="swt.jar" value="${project.root}/make/lib/swt/cocoa-macosx-x86_64/swt-debug.jar">
+          <and>
+            <istrue value="${isOSX}" />
+            <or>
+              <os arch="AMD64" />
+              <os arch="x86_64" />
+            </or>                
+          </and>
+        </condition>
+        <condition property="swt.jar" value="${project.root}/make/lib/swt/cocoa-macosx/swt-debug.jar">
+          <and>
+            <istrue value="${isOSX}" />
+            <or>
+              <os arch="i386" />
+              <os arch="x86" />
+            </or>
+          </and>
+        </condition>
+        <echo message="swt.jar=${swt.jar}" />
+
+        <property name="target.sourcelevel" value="1.5" />
         <property name="host.sourcelevel"   value="1.5" />
 
+        <!-- property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" /-->
+        <property name="javadoc.link" value="http://download.oracle.com/javase/1.5.0/docs/api/" />
+
         <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally -->
         <property name="javacdebug"       value="true" /> 
         <property name="javacdebuglevel"  value="source,lines" /> 
@@ -106,9 +144,6 @@
              and need exact string matching, which is why they use file.separator
              instead of "/". -->
 
-        <property name="javac.bootclasspath-cdc.jar" value="${gluegen.root}/make/lib/cdc_fp.jar"/>
-        <echo message="javac.bootclasspath-cdc.jar: ${javac.bootclasspath-cdc.jar}" />
-
         <!-- NOTE that these require a checked-out GlueGen, etc workspace as a -->
         <!-- sibling of the JOGL workspace. -->
         <property name="gluegen.make"               value="${gluegen.root}/make" />
@@ -134,17 +169,15 @@
         <property name="build.newt"                 value="${build}/newt" />
         <property name="obj.newt"                   value="${build.newt}/obj"/>
 
-        <property name="junit.make"                 value="." />
-        <property name="junit.build.xml"            value="${junit.make}/build-junit.xml" />
-        <property name="results.junit"              value="${build}/test/results" />
-        <property name="build.junit"                value="${build}/test/build" />
-        <property name="obj.junit"                  value="${build.junit}/obj"/>
+        <property name="results.test"              value="${build}/test/results" />
+        <property name="build.test"                value="${build}/test/build" />
+        <property name="obj.test"                  value="${build.test}/obj"/>
 
         <condition property="obj.custom" value="${custom.libdir}${path.separator}" else="">
           <isset property="custom.libdir"/>
         </condition>
 
-        <property name="obj.all.paths"              value="${obj.custom}${obj.gluegen}${path.separator}${obj.nativewindow}${path.separator}${obj.jogl}${path.separator}${obj.newt}${path.separator}${obj.junit}" />
+        <property name="obj.all.paths"              value="${obj.custom}${obj.gluegen}${path.separator}${obj.nativewindow}${path.separator}${obj.jogl}${path.separator}${obj.newt}${path.separator}${obj.test}" />
 
         <path id="gluegen.classpath">
           <pathelement location="${gluegen.jar}" />
@@ -173,24 +206,40 @@
         <property name="jogl.all-noawt.jar"         value="${build.jogl}/jogl.all-noawt.jar" />
         <property name="newt.all-noawt.jar"         value="${build.newt}/newt.all-noawt.jar" />
 
+        <path id="swt_gluegen.classpath">
+            <pathelement location="${gluegen-rt.jar}" />
+            <pathelement location="${swt.jar}" />
+        </path>
+
         <path id="nativewindow_gluegen.classpath">
             <pathelement location="${gluegen-rt.jar}" />
+            <pathelement location="${swt.jar}" />
             <pathelement location="${nativewindow.all.jar}" />
         </path>
 
         <path id="nativewindow_gluegen_jogl.classpath">
             <pathelement location="${gluegen-rt.jar}" />
+            <pathelement location="${swt.jar}" />
             <pathelement location="${nativewindow.all.jar}" />
             <pathelement location="${jogl.all.jar}" />
         </path>
 
         <path id="jogl_newt_all.classpath">
             <pathelement location="${gluegen-rt.jar}" />
+            <pathelement location="${swt.jar}" />
             <pathelement location="${nativewindow.all.jar}" />
             <pathelement location="${jogl.all.jar}" />
             <pathelement location="${newt.all.jar}" />
         </path>
 
+        <path id="jogl_newt_all-noawt.classpath">
+            <pathelement location="${gluegen-rt.jar}" />
+            <pathelement location="${swt.jar}" />
+            <pathelement location="${nativewindow.all-noawt.jar}" />
+            <pathelement location="${jogl.all-noawt.jar}" />
+            <pathelement location="${newt.all-noawt.jar}" />
+        </path>
+
         <path id="junit_jogl_newt.compile.classpath">
             <pathelement location="${junit.jar}" />
             <pathelement location="${ant.jar}" />
@@ -199,6 +248,7 @@
             <pathelement location="${nativewindow.all.jar}" />
             <pathelement location="${jogl.all.jar}" />
             <pathelement location="${newt.all.jar}" />
+            <pathelement location="${swt.jar}" />
         </path>
 
         <path id="junit_jogl_awt.run.classpath">
@@ -212,6 +262,21 @@
             <pathelement location="${jogl.test.jar}" />
         </path>
 
+        <!-- classpath used when running SWT tests -->
+        <path id="junit_jogl_swt.run.classpath">
+          <pathelement location="${junit.jar}" />
+          <pathelement location="${ant.jar}" />
+          <pathelement location="${ant-junit.jar}" />
+          <pathelement location="${gluegen-rt.jar}" />
+          <pathelement location="${swt.jar}" />
+          <pathelement location="${nativewindow.all.jar}" />
+          <pathelement location="${jogl.all.jar}" />
+          <pathelement location="${newt.event.jar}" />
+          <pathelement location="${jogl.test.jar}" />
+        </path>
+        <property name="junit_jogl_swt.run.jars"
+                  value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${gluegen-rt.jar}${path.separator}${swt.jar}${path.separator}${nativewindow.all.jar}${path.separator}${jogl.all.jar}${path.separator}${newt.all.jar}${path.separator}${jogl.test.jar}"/>
+
         <path id="junit_jogl_newt.run.classpath">
             <pathelement location="${junit.jar}" />
             <pathelement location="${ant.jar}" />
@@ -235,46 +300,16 @@
             <pathelement location="${newt.all.jar}" />
             <pathelement location="${jogl.test.jar}" />
         </path>
+        <property name="junit_jogl_newt_awt.run.jars"
+                  value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${gluegen-rt.jar}${path.separator}${nativewindow.all.jar}${path.separator}${jogl.all.jar}${path.separator}${newt.all.jar}${path.separator}${jogl.test.jar}"/>
 
-        <path id="jogl_newt_all-noawt.classpath">
-            <pathelement location="${gluegen-rt.jar}" />
-            <pathelement location="${nativewindow.all-noawt.jar}" />
-            <pathelement location="${jogl.all-noawt.jar}" />
-            <pathelement location="${newt.all-noawt.jar}" />
-        </path>
-
-        <!-- CDC combinations . NO.AWT -->
-        <property name="gluegen-rt.cdc.jar"         value="${build.gluegen}/gluegen-rt.cdc.jar" />
-        <property name="gluegen-gl.cdc.jar"         value="${build.jogl}/gluegen-gl.cdc.jar" />
-
-        <property name="nativewindow.all.cdc.jar"   value="${build.nativewindow}/nativewindow.all.cdc.jar" />
-        <property name="jogl.all.cdc.jar"           value="${build.jogl}/jogl.all.cdc.jar" />
-        <property name="newt.all.cdc.jar"           value="${build.newt}/newt.all.cdc.jar" />
-
-        <path id="nativewindow_gluegen.classpath-cdc">
-            <pathelement location="${gluegen-rt.cdc.jar}" />
-            <pathelement location="${nativewindow.all.cdc.jar}" />
-        </path>
-
-        <path id="nativewindow_gluegen_jogl.classpath-cdc">
-            <pathelement location="${gluegen-rt.cdc.jar}" />
-            <pathelement location="${nativewindow.all.cdc.jar}" />
-            <pathelement location="${jogl.all.cdc.jar}" />
-        </path>
-
-        <path id="jogl_newt_all.classpath-cdc">
-            <pathelement location="${gluegen-rt.cdc.jar}" />
-            <pathelement location="${nativewindow.all.cdc.jar}" />
-            <pathelement location="${jogl.all.cdc.jar}" />
-            <pathelement location="${newt.all.cdc.jar}" />
-        </path>
 
         <!-- Atomic JavaSE JARS -->
 
         <property name="nativewindow.core.jar"         value="${build.nativewindow}/nativewindow.core.jar" />
         <property name="nativewindow.awt.jar"          value="${build.nativewindow}/nativewindow.awt.jar"  />
         <property name="nativewindow.os.x11.jar"       value="${build.nativewindow}/nativewindow.os.x11.jar"  />
-        <property name="nativewindow.os.windows.jar"   value="${build.nativewindow}/nativewindow.os.windows.jar"  />
+        <property name="nativewindow.os.win.jar"       value="${build.nativewindow}/nativewindow.os.win.jar"  />
         
         <property name="jogl.core.jar"                  value="${build.jogl}/jogl.core.jar" />
         <property name="jogl.cg.jar"                    value="${build.jogl}/jogl.cg.jar" />
@@ -309,35 +344,8 @@
         <property name="newt.os.win.jar"                value="${build.newt}/newt.os.win.jar" />
         <property name="newt.os.osx.jar"                value="${build.newt}/newt.os.osx.jar" />
         <property name="newt.ogl.jar"                   value="${build.newt}/newt.ogl.jar" />
-        <property name="newt.broadcomegl.jar"           value="${build.newt}/newt.broadcomegl.jar" />
-        <property name="newt.intelgdl.jar"              value="${build.newt}/newt.intelgdl.jar" />
-
-        <!-- Atomic CDC JARS -->
-        <property name="nativewindow.core.cdc.jar"       value="${build.nativewindow}/nativewindow.core.cdc.jar" />
-        <property name="nativewindow.os.x11.cdc.jar"     value="${build.nativewindow}/nativewindow.os.x11.cdc.jar"  />
-        <property name="nativewindow.os.windows.cdc.jar" value="${build.nativewindow}/nativewindow.os.windows.cdc.jar"  />
-
-        <property name="jogl.core.cdc.jar"              value="${build.jogl}/jogl.core.cdc.jar" />
-        <property name="jogl.gles1.cdc.jar"             value="${build.jogl}/jogl.gles1.cdc.jar" />
-        <property name="jogl.gles1.dbg.cdc.jar"         value="${build.jogl}/jogl.gles1.dbg.cdc.jar" />
-        <property name="jogl.gles2.cdc.jar"             value="${build.jogl}/jogl.gles2.cdc.jar" />
-        <property name="jogl.gles2.dbg.cdc.jar"         value="${build.jogl}/jogl.gles2.dbg.cdc.jar" />
-        <property name="jogl.egl.cdc.jar"               value="${build.jogl}/jogl.egl.cdc.jar" />
-        <property name="jogl.glutess.cdc.jar"           value="${build.jogl}/jogl.glu.tess.cdc.jar" />
-        <property name="jogl.glumipmap.cdc.jar"         value="${build.jogl}/jogl.glu.mipmap.cdc.jar" />
-        <property name="jogl.os.x11.cdc.jar"            value="${build.jogl}/jogl.os.x11.cdc.jar" />
-        <property name="jogl.os.win.cdc.jar"            value="${build.jogl}/jogl.os.win.cdc.jar" />
-        <property name="jogl.os.osx.cdc.jar"            value="${build.jogl}/jogl.os.osx.cdc.jar" />
-        <property name="jogl.util.cdc.jar"              value="${build.jogl}/jogl.util.cdc.jar" />
-        <property name="jogl.util.fixedfuncemu.cdc.jar" value="${build.jogl}/jogl.util.fixedfuncemu.cdc.jar" />
-
-        <property name="newt.core.cdc.jar"              value="${build.newt}/newt.core.cdc.jar" />
-        <property name="newt.os.x11.cdc.jar"            value="${build.newt}/newt.os.x11.cdc.jar" />
-        <property name="newt.os.win.cdc.jar"            value="${build.newt}/newt.os.win.cdc.jar" />
-        <property name="newt.os.osx.cdc.jar"            value="${build.newt}/newt.os.osx.cdc.jar" />
-        <property name="newt.ogl.cdc.jar"               value="${build.newt}/newt.ogl.cdc.jar" />
-        <property name="newt.broadcomegl.cdc.jar"       value="${build.newt}/newt.broadcomegl.cdc.jar" />
-        <property name="newt.intelgdl.cdc.jar"          value="${build.newt}/newt.intelgdl.cdc.jar" />
+        <property name="newt.hw.broadcomegl.jar"        value="${build.newt}/newt.hw.broadcomegl.jar" />
+        <property name="newt.hw.intelgdl.jar"           value="${build.newt}/newt.hw.intelgdl.jar" />
 
         <!-- The location and name of the configuration ANT file that will 
            - validate to ensure that all user-define variables are set. -->
@@ -354,14 +362,7 @@
 
         <!-- Run the GlueGen build to ensure that the GlueGen ANT task
            - has been built. -->
-        <!-- FIXME: remove passing down of antlr.jar when gluegen.properties is on all
-             nightly build machines -->
-        <ant antfile="${gluegen.build.xml}" dir="${gluegen.make}" target="all" inheritAll="false">
-          <propertyset>
-            <propertyref name="antlr.jar" />
-            <!--propertyref name="gluegen.nsig" /-->
-          </propertyset>
-        </ant>
+        <ant antfile="${gluegen.build.xml}" dir="${gluegen.make}" target="base.compile" inheritAll="false"/>
     </target>
 
 
diff --git a/make/build-jogl.xml b/make/build-jogl.xml
index ddfbc25..c14f667 100644
--- a/make/build-jogl.xml
+++ b/make/build-jogl.xml
@@ -54,7 +54,6 @@
    - Internal settings, may not be necessary to set them manually,
      since all JAR archives are orthogonal.
        setup.noAWT
-       setup.noCDC
 
    - Skip gluegen: java.generate.skip
    -->
@@ -62,6 +61,11 @@
 
     <import file="build-common.xml"/>
 
+    <!-- needed for outofdate task -->
+    <taskdef resource="net/sf/antcontrib/antlib.xml">
+      <classpath> <pathelement location="${ant-contrib.jar}"/> </classpath>
+    </taskdef>
+
     <!-- ================================================================== -->
     <!-- 
        - Base initialization and detection of operating system.
@@ -71,59 +75,59 @@
                   value="com/jogamp/gluegen/opengl/** com/jogamp/gluegen/runtime/opengl/*"/>
 
         <property name="java.part.core" 
-                  value="javax/media/opengl/* javax/media/opengl/fixedfunc/* javax/media/opengl/glu/* javax/media/opengl/glu/gl2es1/* com/jogamp/gluegen/runtime/opengl/* com/jogamp/opengl/* com/jogamp/opengl/impl/* com/jogamp/opengl/impl/glu/* com/jogamp/opengl/impl/glu/error/*"/>
+                  value="javax/media/opengl/* javax/media/opengl/fixedfunc/* javax/media/opengl/glu/* javax/media/opengl/glu/gl2es1/* com/jogamp/gluegen/runtime/opengl/* com/jogamp/opengl/* jogamp/opengl/* jogamp/opengl/glu/* jogamp/opengl/glu/error/*"/>
         <property name="java.part.core.exclude" value="javax/media/opengl/Debug* javax/media/opengl/Trace*"/>
 
         <property name="java.part.nv-cg"
-                  value="com/jogamp/opengl/cg com/jogamp/opengl/cg/*"/>
+                  value="com/jogamp/opengl/cg com/jogamp/opengl/cg/* jogamp/opengl/cg/*"/>
 
         <property name="java.part.egl"
-                  value="com/jogamp/opengl/impl/egl/*"/>
+                  value="jogamp/opengl/egl/*"/>
 
         <property name="java.part.glutess"
-                  value="com/jogamp/opengl/impl/glu/tessellator/**"/>
+                  value="jogamp/opengl/glu/tessellator/**"/>
 
         <property name="java.part.glumipmap"
-                  value="com/jogamp/opengl/impl/glu/mipmap/**"/>
+                  value="jogamp/opengl/glu/mipmap/**"/>
 
         <property name="java.part.glugldesktop"
-                  value="com/jogamp/opengl/impl/glu/gl2/** com/jogamp/opengl/impl/glu/nurbs/** com/jogamp/opengl/impl/glu/registry/** javax/media/opengl/glu/gl2/**"/>
+                  value="jogamp/opengl/glu/gl2/** jogamp/opengl/glu/nurbs/** jogamp/opengl/glu/registry/** javax/media/opengl/glu/gl2/**"/>
 
         <property name="java.part.openmax"
-                  value="com/jogamp/openmax/**"/>
+                  value="com/jogamp/openmax/** jogamp/openmax/**"/>
 
         <property name="java.part.sdk"
                   value="com/jogamp/opengl/util/glsl/sdk/**"/>
 
         <property name="java.part.glx"
-                  value="com/jogamp/opengl/impl/x11/glx/*"/>
+                  value="jogamp/opengl/x11/glx/*"/>
 
         <property name="java.part.wgl"
-                  value="com/jogamp/opengl/impl/windows/wgl/*"/>
+                  value="jogamp/opengl/windows/wgl/*"/>
 
         <property name="java.part.cgl"
-                  value="com/jogamp/opengl/impl/macosx/cgl/*"/>
+                  value="jogamp/opengl/macosx/cgl/*"/>
 
         <property name="java.part.gldesktop"
-                  value="com/jogamp/opengl/impl/**/gl2/** com/jogamp/opengl/impl/**/gl3/** com/jogamp/opengl/impl/**/gl4/**"/>
+                  value="jogamp/opengl/**/gl2/** jogamp/opengl/**/gl3/** jogamp/opengl/**/gl4/**"/>
 
         <property name="java.part.gldesktop.dbg"
                   value="javax/media/opengl/TraceGL2.* javax/media/opengl/DebugGL2.* javax/media/opengl/TraceGL2GL3.* javax/media/opengl/DebugGL2GL3.* javax/media/opengl/TraceGL3.* javax/media/opengl/DebugGL3.* javax/media/opengl/TraceGL3bc.* javax/media/opengl/DebugGL3bc.* javax/media/opengl/TraceGL4.* javax/media/opengl/DebugGL4.* javax/media/opengl/TraceGL4bc.* javax/media/opengl/DebugGL4bc.*"/>
 
         <property name="java.part.es1"
-                  value="javax/media/opengl/**/es1/** com/jogamp/opengl/**/es1/**"/>
+                  value="javax/media/opengl/**/es1/** com/jogamp/opengl/**/es1/** jogamp/opengl/**/es1/**"/>
 
         <property name="java.part.es1.dbg"
                   value="javax/media/opengl/TraceGLES1.* javax/media/opengl/DebugGLES1.* javax/media/opengl/TraceGL2ES1.* javax/media/opengl/DebugGL2ES1.*"/>
 
         <property name="java.part.es2"
-                  value="javax/media/opengl/**/es2/** com/jogamp/opengl/**/es2/**"/>
+                  value="javax/media/opengl/**/es2/** com/jogamp/opengl/**/es2/** jogamp/opengl/**/es2/**"/>
 
         <property name="java.part.es2.dbg"
                   value="javax/media/opengl/TraceGLES2.* javax/media/opengl/DebugGLES2.* javax/media/opengl/TraceGL2ES2.* javax/media/opengl/DebugGL2ES2.*"/>
 
         <property name="java.part.awt"
-                  value="javax/media/opengl/awt/** com/jogamp/opengl/impl/**/awt/**"/>
+                  value="javax/media/opengl/awt/** jogamp/opengl/**/awt/**"/>
 
         <property name="java.part.util"
                   value="com/jogamp/opengl/util/* com/jogamp/opengl/util/texture/** com/jogamp/opengl/util/packrect/**"/>
@@ -138,10 +142,10 @@
                   value="com/jogamp/opengl/util/glsl/* com/jogamp/opengl/util/glsl/fixedfunc/*"/>
 
         <property name="java.part.util.fixedfuncemu"
-                  value="com/jogamp/opengl/util/glsl/fixedfunc/impl/**"/>
+                  value="jogamp/opengl/util/glsl/fixedfunc/**"/>
 
         <property name="java.part.util.fixedfuncemu.shadercode"
-                  value="com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/* com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/**"/>
+                  value="jogamp/opengl/util/glsl/fixedfunc/shaders/* jogamp/opengl/util/glsl/fixedfunc/shaders/bin/**"/>
 
         <!-- condition excludes -->
 
@@ -158,16 +162,16 @@
         </condition>
 
         <property name="java.excludes.javadoc.packagenames"
-                  value="com.jogamp.opengl.impl.gl2.fixme.*,com.jogamp.audio.windows.waveout.TestSpatialization"/>
+                  value="jogamp.opengl.gl2.fixme.*,com.jogamp.audio.windows.waveout.TestSpatialization"/>
 
         <property name="java.excludes.fixme" 
-                  value="com/jogamp/opengl/impl/gl2/fixme/** com/jogamp/audio/windows/waveout/TestSpatialization.java" />
+                  value="jogamp/opengl/gl2/fixme/** com/jogamp/audio/windows/waveout/TestSpatialization.java" />
 
-        <property name="java.excludes.cdcfp"
-                  value="${java.excludes.fixme} ${java.part.nv-cg} ${java.part.gldesktop} ${java.part.gldesktop.dbg} ${java.part.awt} ${java.part.glugldesktop} ${java.part.util.awt} ${java.part.util.gldesktop} com/jogamp/opengl/util/TGAWriter.java"/>
+        <property name="java.part.desktop"
+                   value="${java.part.glx} ${java.part.wgl} ${java.part.cgl} ${java.excludes.fixme} ${java.part.nv-cg} ${java.part.gldesktop} ${java.part.gldesktop.dbg} ${java.part.awt} ${java.part.glugldesktop} ${java.part.util.awt} ${java.part.util.gldesktop} com/jogamp/opengl/util/TGAWriter.java"/>
 
         <condition property="java.excludes.desktop"
-                   value="${java.part.glx} ${java.excludes.cdcfp}">
+                   value="${java.part.desktop}">
            <isset property="setup.nodesktop"/> 
         </condition>
 
@@ -198,7 +202,6 @@
         <!-- The generated source directories. -->
         <property name="src.generated" value="${build.jogl}/gensrc" />
         <property name="src.generated.java" value="${src.generated}/classes" />
-        <property name="src.generated.java-cdc" value="${src.generated}/classes-cdc" />
         <property name="src.generated.java.cg" value="${src.generated.java}/com/jogamp/opengl/cg" />
         <property name="src.generated.c" value="${src.generated}/native/jogl" />
         <property name="src.generated.c.openmax" value="${src.generated}/native/openmax" />
@@ -206,7 +209,6 @@
         
         <!-- The compiler output directories. -->
         <property name="classes"                    value="${build.jogl}/classes" />
-        <property name="classes-cdc"                value="${build.jogl}/classes-cdc" />
         <property name="obj.joglsub"                value="${obj.jogl}/jogl" />
         <property name="obj.cgsub"                  value="${obj.jogl}/cg" />
 
@@ -264,14 +266,13 @@
         <property name="javadoc" value="${project.root}/javadoc_jogl_public" />
         <property name="javadoc.spec" value="${project.root}/javadoc_jogl_spec" />
         <property name="javadoc.dev" value="${project.root}/javadoc_jogl_dev" />
-        <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" />
         <property name="javadoc.windowtitle" value="JOGL API -- JSR-231 ${jogl_base_version} Specification" />
         <property name="javadoc.overview" value="doc/jogl/spec-overview.html" />
         <property name="javadoc.spec.packagenames" value="javax.media.opengl.*" />
 
         <property name="javadoc.packagenames" value="${javadoc.spec.packagenames},com.jogamp.opengl.util.*" />
 
-        <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.jogamp.opengl.impl.*,com.jogamp.gluegen,com.jogamp.gluegen.runtime" />
+        <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},jogamp.opengl.*,com.jogamp.gluegen,com.jogamp.gluegen.runtime" />
     <property name="javadoc.bottom" value="Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="http://jcp.org/en/jsr/detail?id=231">license terms</a>." />
     </target>
     
@@ -294,20 +295,6 @@
         <property name="gl2.headers" value="${stub.includes}/opengl/GL/*.h" /> <!-- NOTE:  this MUST be relative for FileSet --> <!-- CHECK:  this may need to be pruned for each platform -->
     </target>
 
-    <target name="setup.javacdc">
-        <copy file="../src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/jogamp/opengl/impl/SystemUtil.java" />
-        <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/jogamp/opengl/util/texture/TextureIO.java" />
-        <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/jogamp/opengl/util/texture/spi/DDSImage.java" />
-        <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/jogamp/opengl/util/texture/spi/TGAImage.java" />
-    </target>
-
-    <target name="setup.javase">
-        <copy file="../src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javase" tofile="${src.generated.java}/com/jogamp/opengl/impl/SystemUtil.java" />
-        <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javase" tofile="${src.generated.java}/com/jogamp/opengl/util/texture/TextureIO.java" />
-        <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javase" tofile="${src.generated.java}/com/jogamp/opengl/util/texture/spi/DDSImage.java" />
-        <copy file="../src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javase" tofile="${src.generated.java}/com/jogamp/opengl/util/texture/spi/TGAImage.java" />
-    </target>
-
     <!-- ================================================================== -->
     <!-- 
        - Initialize all parameters required for the build and create any
@@ -316,21 +303,15 @@
     <target name="init" depends="declare.common, declare.gl.gles, declare.gl.gl2">
         <!-- Create the required output directories. -->
         <mkdir dir="${src.generated.java}" />
-        <mkdir dir="${src.generated.java-cdc}" />
         <mkdir dir="${src.generated.c}" />
         <mkdir dir="${src.generated.c}/MacOSX" />
         <mkdir dir="${src.generated.c}/Windows" />
         <mkdir dir="${src.generated.c}/X11" />
         <mkdir dir="${src.generated.c.openmax}" />
         <mkdir dir="${classes}" />
-        <mkdir dir="${classes-cdc}" />
         <mkdir dir="${obj.jogl}" />
         <mkdir dir="${obj.joglsub}" />
         <mkdir dir="${obj.cgsub}" />
-
-        <!-- Set up Java SE and Java CDC files -->
-        <antcall target="setup.javase"  inheritRefs="true" />
-        <antcall target="setup.javacdc" inheritRefs="true" />
     </target>
 
     <!--
@@ -676,7 +657,7 @@
                fork="yes"
                memoryMaximumSize="${javac.memorymax}"
                includeAntRuntime="true"
-               source="1.5" debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+               source="${target.sourcelevel}" debug="${javacdebug}" debuglevel="${javacdebuglevel}">
             <classpath refid="gluegen-gl.classpath"/>
             <src path="${src.java}" />
         </javac>
@@ -880,10 +861,6 @@
             <arg value="${src.generated.java}/javax/media/opengl" />
             <classpath refid="pipeline.classpath" />
         </java>
-        <copy todir="${src.generated.java-cdc}">
-            <fileset dir="${src.generated.java}"
-                     includes="javax/media/opengl/DebugGLES1.java javax/media/opengl/TraceGLES1.java javax/media/opengl/DebugGL2ES1.java javax/media/opengl/TraceGL2ES1.java" />
-        </copy>
     </target>          
 
     <target name="java.generate.composable.pipeline.es2" depends="java.generate.composable.pipeline.check.es2" unless="java.generate.composable.pipeline.skip.es2">
@@ -897,10 +874,6 @@
             <arg value="${src.generated.java}/javax/media/opengl" />
             <classpath refid="pipeline.classpath" />
         </java>
-        <copy todir="${src.generated.java-cdc}">
-            <fileset dir="${src.generated.java}"
-                     includes="javax/media/opengl/DebugGLES2.java javax/media/opengl/TraceGLES2.java javax/media/opengl/DebugGL2ES2.java javax/media/opengl/TraceGL2ES2.java" />
-        </copy>
     </target>          
 
     <target name="java.generate.composable.pipeline.gl2" depends="java.generate.composable.pipeline.check.gl2" unless="java.generate.composable.pipeline.skip.gl2">
@@ -914,10 +887,6 @@
             <arg value="${src.generated.java}/javax/media/opengl" />
             <classpath refid="pipeline.classpath" />
         </java>
-        <copy todir="${src.generated.java-cdc}">
-            <fileset dir="${src.generated.java}"
-                     includes="javax/media/opengl/DebugGL2.java javax/media/opengl/TraceGL2.java javax/media/opengl/DebugGL2GL3.java javax/media/opengl/TraceGL2GL3.java" />
-        </copy>
     </target>          
 
     <target name="java.generate.composable.pipeline.gl3" depends="java.generate.composable.pipeline.check.gl3" unless="java.generate.composable.pipeline.skip.gl3">
@@ -926,20 +895,12 @@
             <arg value="${src.generated.java}/javax/media/opengl" />
             <classpath refid="pipeline.classpath" />
         </java>
-        <copy todir="${src.generated.java-cdc}">
-            <fileset dir="${src.generated.java}"
-                     includes="javax/media/opengl/DebugGL3.java javax/media/opengl/TraceGL3.java" />
-        </copy>
 
         <java classname="com.jogamp.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
             <arg value="javax.media.opengl.GL3bc" />
             <arg value="${src.generated.java}/javax/media/opengl" />
             <classpath refid="pipeline.classpath" />
         </java>
-        <copy todir="${src.generated.java-cdc}">
-            <fileset dir="${src.generated.java}"
-                     includes="javax/media/opengl/DebugGL3bc.java javax/media/opengl/TraceGL3bc.java" />
-        </copy>
     </target>          
 
     <target name="java.generate.composable.pipeline.gl4" depends="java.generate.composable.pipeline.check.gl4" unless="java.generate.composable.pipeline.skip.gl4">
@@ -948,20 +909,12 @@
             <arg value="${src.generated.java}/javax/media/opengl" />
             <classpath refid="pipeline.classpath" />
         </java>
-        <copy todir="${src.generated.java-cdc}">
-            <fileset dir="${src.generated.java}"
-                     includes="javax/media/opengl/DebugGL4.java javax/media/opengl/TraceGL4.java" />
-        </copy>
 
         <java classname="com.jogamp.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
             <arg value="javax.media.opengl.GL4bc" />
             <arg value="${src.generated.java}/javax/media/opengl" />
             <classpath refid="pipeline.classpath" />
         </java>
-        <copy todir="${src.generated.java-cdc}">
-            <fileset dir="${src.generated.java}"
-                     includes="javax/media/opengl/DebugGL4bc.java javax/media/opengl/TraceGL4bc.java" />
-        </copy>
     </target>          
 
     <target name="java.generate.composable.pipeline" depends="java.generate.composable.pipeline.es1, java.generate.composable.pipeline.es2, java.generate.composable.pipeline.gl2, java.generate.composable.pipeline.gl3, java.generate.composable.pipeline.gl4">
@@ -971,32 +924,28 @@
         <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
              (the uptodate element doesn't support arbitrary source and destination files) -->
         <dependset>
-            <srcfilelist dir="${classes}/com/jogamp/opengl/util/glsl/fixedfunc" files="FixedFuncHook.class" />
+            <srcfilelist dir="${classes}/jogamp/opengl/util/glsl/fixedfunc" files="FixedFuncHook.class" />
             <srcfilelist dir="${classes}/javax/media/opengl" files="GL2ES1.class" />
             <srcfilelist dir="${classes}/javax/media/opengl" files="GL2ES2.class" />
-            <targetfileset dir="${src.generated.java}/com/jogamp/opengl/util/glsl/fixedfunc/impl"
+            <targetfileset dir="${src.generated.java}/jogamp/opengl/util/glsl/fixedfunc"
                            includes="FixedFuncImpl.java" />
         </dependset>
                            
         <!-- Now choose one of the two to test to see if we have to regenerate -->
         <uptodate property="java.generate.composable.pipeline.custom.skip.glfixfunc"
                   srcfile="${classes}/javax/media/opengl/GL2ES1.class"
-                  targetfile="${src.generated.java}/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncImpl.java" />
+                  targetfile="${src.generated.java}/jogamp/opengl/util/glsl/fixedfunc/FixedFuncImpl.java" />
     </target>        
     <target name="java.generate.composable.pipeline.custom.glfixfunc" depends="java.generate.composable.pipeline.custom.check.glfixfunc" unless="java.generate.composable.pipeline.custom.skip.glfixfunc">
         <java classname="com.jogamp.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
             <arg value="javax.media.opengl.GL2ES1" />
-            <arg value="${src.generated.java}/com/jogamp/opengl/util/glsl/fixedfunc/impl" />
-            <arg value="com.jogamp.opengl.util.glsl.fixedfunc.impl.FixedFuncImpl" />
-            <arg value="com.jogamp.opengl.util.glsl.fixedfunc.impl.FixedFuncHook" />
+            <arg value="${src.generated.java}/jogamp/opengl/util/glsl/fixedfunc" />
+            <arg value="jogamp.opengl.util.glsl.fixedfunc.FixedFuncImpl" />
+            <arg value="jogamp.opengl.util.glsl.fixedfunc.FixedFuncHook" />
             <arg value="javax.media.opengl.GL2ES2" />
             <arg value="prolog_xor_downstream" />
             <classpath refid="pipeline.classpath" />
         </java>
-        <copy todir="${src.generated.java-cdc}">
-            <fileset dir="${src.generated.java}"
-                     includes="com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncImpl.java" />
-        </copy>
     </target>          
     <target name="java.generate.composable.pipeline.custom" depends="init, common.gluegen.build, java.generate.composable.pipeline.custom.glfixfunc">
     </target>
@@ -1015,21 +964,11 @@
                fork="yes"
                memoryMaximumSize="${javac.memorymax}"
                includeAntRuntime="false"
-               source="1.4" debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+               source="${target.sourcelevel}" debug="${javacdebug}" debuglevel="${javacdebuglevel}">
             <classpath refid="nativewindow_gluegen.classpath"/>
             <src path="${src.java}" />
             <src path="${src.generated.java}" />
         </javac>
-
-        <copy todir="${src.generated.java-cdc}">
-            <fileset dir="${src.generated.java}"
-                     includes="**" 
-                     excludes="com/jogamp/opengl/cg/** com/jogamp/opengl/impl/gl2/** com/jogamp/opengl/impl/gl3/** com/jogamp/opengl/impl/gl4/** com/jogamp/opengl/impl/glu/gl2/** javax/media/opengl/glu/gl2/**"/>
-        </copy>
-        <copy todir="${classes-cdc}">
-            <fileset dir="${classes}"
-                     includes="**" />
-        </copy>
     </target>
 
     <target name="java.compile.secondpass.javase">
@@ -1047,23 +986,7 @@
         </javac>
     </target>
 
-           <!--    bootclasspath="${javac.bootclasspath-cdc.jar}" -->
-    <target name="java.compile.secondpass.javacdc" unless="setup.noCDC">
-        <!-- Perform the second pass Java compile; everything except portion of fixed function emulation depending on generated code. -->
-        <javac destdir="${classes-cdc}"
-               excludes="com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java,${java.excludes.all},${java.excludes.cdcfp}"
-               source="${target.sourcelevel}"
-               fork="yes"
-               memoryMaximumSize="${javac.memorymax}"
-               includeAntRuntime="false"
-               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
-            <classpath refid="nativewindow_gluegen.classpath-cdc"/>
-            <src path="${src.java}" />
-            <src path="${src.generated.java-cdc}" />
-        </javac>
-    </target>
-
-    <target name="java.compile.secondpass" depends="java.generate.composable.pipeline, java.compile.secondpass.javase, java.compile.secondpass.javacdc" />
+    <target name="java.compile.secondpass" depends="java.generate.composable.pipeline, java.compile.secondpass.javase" />
 
     <target name="java.compile.thirdpass.javase">
         <!-- Perform the third pass Java compile; everything including fixed function emulation. -->
@@ -1080,23 +1003,7 @@
         </javac>
     </target>
 
-    <target name="java.compile.thirdpass.javacdc" unless="setup.noCDC">
-        <!-- Perform the third pass Java compile; everything including fixed function emulation. -->
-        <javac destdir="${classes-cdc}"
-               excludes="${java.excludes.all},${java.excludes.cdcfp}"
-               source="${target.sourcelevel}"
-               bootclasspath="${javac.bootclasspath-cdc.jar}"
-               fork="yes"
-               memoryMaximumSize="${javac.memorymax}"
-               includeAntRuntime="false"
-               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
-            <classpath refid="nativewindow_gluegen.classpath-cdc"/>
-            <src path="${src.java}" />
-            <src path="${src.generated.java-cdc}" />
-        </javac>
-    </target>
-
-    <target name="java.compile.thirdpass" depends="java.generate.composable.pipeline.custom, java.compile.thirdpass.javase, java.compile.thirdpass.javacdc" />
+    <target name="java.compile.thirdpass" depends="java.generate.composable.pipeline.custom, java.compile.thirdpass.javase" />
 
     <target name="java.compile" depends="java.compile.firstpass,java.compile.secondpass,java.compile.thirdpass" />
 
@@ -1282,7 +1189,6 @@
 
     <target name="rename.dylib" if="isOSX">
         <move file="${src}" tofile="${dest}" />
-        <copy file="${dest}" tofile="${dest-cdc}" />
     </target>
 
     <macrodef name="c.build">
@@ -1348,62 +1254,83 @@
 
         <echo message="Compiling @{output.lib.name}" />
 
-        <cc outtype="shared" 
-            objdir="${obj.joglsub}" 
-            outfile="${obj.jogl}/@{output.lib.name}"
-            optimize="${c.compiler.optimise}" 
-            debug="${c.compiler.debug}"
-            multithreaded="true" 
-            exceptions="false" 
-            rtti="false">   
-  
-          <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
-  
-          <compiler extends="@{compiler.cfg.id}" >
-            <sysincludepath path="${java.includes.dir}"/>
-            <sysincludepath path="${java.includes.dir.platform}"/>
-            <includepath path="stub_includes/khr"/>
-            <includepath path="stub_includes/egl"/>
-            <includepath path="stub_includes/opengl"/>
-            <includepath path="stub_includes/openmax" if="useOpenMAX"/>
-            <includepath path="stub_includes/cg" if="jogl.cg"/>        
-  
-            <!-- This is for the generated headers for handwritten C code -->
-            <includepath path="${src.generated.c}" />
-            <includepath path="${src.generated.c}/X11" if="isX11"/>
-            <includepath path="${src.generated.c}/MacOSX" if="isOSX"/>
-            <includepath path="${src.generated.c}/Windows" if="isWindows"/>
-            <includepath path="${src.generated.c.openmax}" if="useOpenMAX"/>
-  
-            <!-- This must come last to not override real include paths -->
-            <!-- includepath path="stub_includes/macosx" if="isOSX" / -->
-          </compiler>
-
-          <linker extends="@{linker.cfg.id}">
-            <syslibset dir="${java.lib.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
-            <syslibset dir="${java.lib.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/>
-          </linker>
-        </cc>
-
-        <!-- FIXME: this is a hack; the cpptask should have an option to change the
-             suffix or at least understand the override from dylib to jnilib -->
-        <antcall target="rename.dylib" inheritRefs="true">
-            <param name="src"  value="${build.jogl}/obj/lib@{output.lib.name}.dylib" />
-            <param name="dest" value="${build.jogl}/obj/lib@{output.lib.name}.jnilib" />
-            <param name="dest-cdc" value="${build.jogl}/obj/lib@{output.lib.name}.so" />
-        </antcall>
-
-        <!-- FIXME: this is a hack; the cpptask should have an option to change the
-             suffix or at least understand the override from dylib to jnilib -->
-        <antcall target="rename.mingw.dll" inheritRefs="true">
-            <param name="src"  value="${build.jogl}/obj/lib@{output.lib.name}.so" />
-            <param name="dest" value="${build.jogl}/obj/@{output.lib.name}.dll" />
-        </antcall>
+      	<!-- have to wrap cc task with outofdate, because otherwise cc links a new library
+      	     even when no files have been compiled -->
+        <outofdate>
+          <sourcefiles>
+            <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
+          </sourcefiles>
+          <targetfiles>
+            <fileset dir="${obj.jogl}" includes="lib@{output.lib.name}.so"/>
+            <fileset dir="${obj.jogl}" includes="@{output.lib.name}.dll"/>
+            <fileset dir="${obj.jogl}" includes="lib@{output.lib.name}.jnilib"/>
+          </targetfiles>
+          <sequential>
+            <cc outtype="shared" 
+                objdir="${obj.joglsub}" 
+                outfile="${obj.jogl}/@{output.lib.name}"
+                optimize="${c.compiler.optimise}" 
+                debug="${c.compiler.debug}"
+                multithreaded="true" 
+                exceptions="false" 
+                rtti="false">   
+      
+              <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
+      
+              <compiler extends="@{compiler.cfg.id}" >
+                <sysincludepath path="${java.includes.dir}"/>
+                <sysincludepath path="${java.includes.dir.platform}"/>
+                <includepath path="stub_includes/khr"/>
+                <includepath path="stub_includes/egl"/>
+                <includepath path="stub_includes/opengl"/>
+                <includepath path="stub_includes/openmax" if="useOpenMAX"/>
+                <includepath path="stub_includes/cg" if="jogl.cg"/>        
+      
+                <!-- This is for the generated headers for handwritten C code -->
+                <includepath path="${src.generated.c}" />
+                <includepath path="${src.generated.c}/X11" if="isX11"/>
+                <includepath path="${src.generated.c}/MacOSX" if="isOSX"/>
+                <includepath path="${src.generated.c}/Windows" if="isWindows"/>
+                <includepath path="${src.generated.c.openmax}" if="useOpenMAX"/>
+      
+                <!-- This must come last to not override real include paths -->
+                <!-- includepath path="stub_includes/macosx" if="isOSX" / -->
+              </compiler>
+    
+              <linker extends="@{linker.cfg.id}">
+                <syslibset dir="${java.lib.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
+                <syslibset dir="${java.lib.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/>
+              </linker>
+            </cc>
+    
+            <!-- FIXME: this is a hack; the cpptask should have an option to change the
+                 suffix or at least understand the override from dylib to jnilib -->
+            <antcall target="rename.dylib" inheritRefs="true">
+                <param name="src"  value="${obj.jogl}/lib@{output.lib.name}.dylib" />
+                <param name="dest" value="${obj.jogl}/lib@{output.lib.name}.jnilib" />
+            </antcall>
+    
+            <!-- FIXME: this is a hack; the cpptask should have an option to change the
+                 suffix or at least understand the override from dylib to jnilib -->
+            <antcall target="rename.mingw.dll" inheritRefs="true">
+                <param name="src"  value="${obj.jogl}/lib@{output.lib.name}.so" />
+                <param name="dest" value="${obj.jogl}/@{output.lib.name}.dll" />
+            </antcall>
+
+            <!-- this stripping may be called more than once on the same library dir,
+                 but that should cause no harm, and doing it here inside outofdate
+                 prevents the JARs from always being rebuilt even if no source code changes -->
+            <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true">
+                <param name="libdir" value="${obj.jogl}"/>
+            </antcall>
+
+          </sequential>
+        </outofdate>
       </sequential>
     </macrodef>  
 
     <target name="c.build.jogl.prepare.openMAX" if="useOpenMAX">
-      <javah destdir="${src.generated.c.openmax}" classpath="${classes-cdc}" class="com.jogamp.openmax.OMXInstance" />
+      <javah destdir="${src.generated.c.openmax}" classpath="${classes}" class="com.jogamp.openmax.OMXInstance" />
     </target>
 
     <target name="c.build.jogl.prepare" depends="c.build.jogl.prepare.openMAX">
@@ -1453,10 +1380,6 @@
     </target>
 
     <target name="c.build.jogl" depends="c.configure,c.build.jogl.prepare,c.build.jogl.desktop,c.build.jogl.es2,c.build.jogl.es1,c.build.jogl.cg">
-      <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true">
-          <param name="libdir" value="${obj.jogl}"/>
-      </antcall>
-
       <antcall target="c.manifest" inheritRefs="true" />
     </target>
 
@@ -1464,7 +1387,7 @@
     <!--
        - Build the jogl.jar files.
       -->
-    <target name="build-jars" depends="gluegen.cpptasks.detect.os,build-jars-javase,build-jars-cdc" />
+    <target name="build-jars" depends="gluegen.cpptasks.detect.os,build-jars-javase" />
 
     <target name="setup-manifestfile" depends="common.init">
         <property name="manifestfile" value="joglversion"/>
@@ -1480,20 +1403,6 @@
         </copy>
     </target>
 
-    <target name="setup-manifestfile-cdc" unless="setup.noCDC" depends="common.init">
-        <property name="manifestfile" value="joglversion-cdc"/>
-        <copy file="${manifestfile}"
-            tofile="${build.jogl}/tempversion-cdc"
-            overwrite="true">
-            <filterset>
-                <filter token="VERSION" value="${jogl.version}"/>
-                <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
-                <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
-                <filter token="BASEVERSION" value="${jogl_base_version}"/>
-            </filterset>
-        </copy>
-    </target>
-
     <target name="build-cg-jar-javase" depends="setup-manifestfile" if="jogl.cg">
         <jar manifest="${build.jogl}/tempversion" destfile="${jogl.cg.jar}" filesonly="true">
             <fileset dir="${classes}"
@@ -1530,7 +1439,7 @@
         </jar>
         <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gles2.jar}" filesonly="true">
             <fileset dir="${classes}"
-                     includes="${java.part.es2}, ${java.part.openmax}"
+                     includes="${java.part.es2} ${java.part.openmax}"
                      excludes="${java.part.es2.dbg}"/>
         </jar>
         <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gles2.dbg.jar}" filesonly="true">
@@ -1539,44 +1448,6 @@
         </jar>
     </target>
 
-    <target name="build-jars-os-desktop-cdc" depends="setup-manifestfile" unless="setup.nodesktop">
-        <jar manifest="${build.jogl}/tempversion" destfile="${jogl.os.x11.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}" includes="${java.part.glx}"/>
-        </jar>
-        <jar manifest="${build.jogl}/tempversion" destfile="${jogl.os.win.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}" includes="${java.part.wgl}" />
-        </jar>
-        <jar manifest="${build.jogl}/tempversion" destfile="${jogl.os.osx.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}" includes="${java.part.cgl}"/>
-        </jar>
-    </target>
-
-    <target name="build-jars-es-cdc" depends="setup-manifestfile-cdc" unless="setup.noCDC">
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.egl.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.egl}"
-                     excludes="${java.part.awt}"/>
-        </jar>
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.gles1.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.es1}"
-                     excludes="${java.part.es1.dbg}"/>
-        </jar>
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.gles1.dbg.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.es1.dbg}"/>
-        </jar>
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.gles2.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.es2}, ${java.part.openmax}"
-                     excludes="${java.part.es2.dbg}"/>
-        </jar>
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.gles2.dbg.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.es2.dbg}"/>
-        </jar>
-    </target>
-
     <target name="build-jars-awt-javase" depends="setup-manifestfile" unless="setup.noAWT">
         <jar manifest="${build.jogl}/tempversion" destfile="${jogl.awt.jar}" filesonly="true">
             <fileset dir="${classes}"
@@ -1590,13 +1461,12 @@
 
     <target name="build-jars-all-awt-javase" depends="setup-manifestfile" unless="setup.noAWT">
         <jar manifest="${build.jogl}/tempversion" destfile="${jogl.all.jar}" filesonly="true">
-            <fileset dir="${classes}">
+            <fileset dir="${classes}"
+                     includes="${java.part.openmax}">
                 <include name="javax/media/opengl/**" />
                 <include name="com/jogamp/gluegen/runtime/**" />
                 <include name="com/jogamp/opengl/**" />
-                <include name="${java.part.openmax}" />
-                <!-- FIXME: this is temporary until we move these classes to another workspace -->
-                <include name="com/jogamp/**" />
+                <include name="jogamp/opengl/**" />
             </fileset>
             <fileset dir="${src.java}"
                      includes="${java.part.util.fixedfuncemu.shadercode}"/>
@@ -1605,63 +1475,24 @@
     <target name="build-jars-all-noawt-javase" depends="setup-manifestfile">
         <jar manifest="${build.jogl}/tempversion" destfile="${jogl.all-noawt.jar}" filesonly="true">
             <fileset dir="${classes}"
-                includes="javax/media/opengl/** com/jogamp/gluegen/runtime/** com/jogamp/opengl/** ${java.part.openmax} com/jogamp/**"
-                excludes="${java.part.awt} ${java.part.util.awt}">
+                     includes="${java.part.openmax}"
+                     excludes="${java.part.awt} ${java.part.util.awt}">
+                <include name="javax/media/opengl/**" />
+                <include name="com/jogamp/gluegen/runtime/**" />
+                <include name="com/jogamp/opengl/**" />
+                <include name="jogamp/opengl/**" />
             </fileset>
             <fileset dir="${src.java}"
                      includes="${java.part.util.fixedfuncemu.shadercode}"/>
         </jar>
     </target>
-    <target name="build-jars-all-cdc" depends="setup-manifestfile">
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.all.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.core} ${java.part.egl} ${java.part.glutess} ${java.part.glumipmap} ${java.part.openmax} ${java.part.sdk} ${java.part.glx} ${java.part.cgl} ${java.part.wgl} ${java.part.es1} ${java.part.es1.dbg} ${java.part.es2} ${java.part.es2.dbg} ${java.part.util} ${java.part.util.glsl} ${java.part.util.fixedfuncemu}"
-                     excludes="${java.excludes.cdcfp}"/>
-            <fileset dir="${src.java}"
-                     includes="${java.part.util.fixedfuncemu.shadercode}"/>
-        </jar>
-    </target>
-
-
-    <target name="build-jars-cdc" depends="setup-manifestfile-cdc, build-jars-es-cdc, build-jars-all-cdc" unless="setup.noCDC">
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.core.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.core}"
-                     excludes="${java.part.core.exclude}"/>
-        </jar>
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.glutess.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.glutess}"/>
-        </jar>
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.glumipmap.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.glumipmap}"/>
-        </jar>
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.util.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.util} ${java.part.util.glsl}"
-                     excludes="${java.part.util.awt} ${java.part.util.gldesktop} ${java.part.util.fixedfuncemu}"/>
-        </jar>
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.util.fixedfuncemu.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.util.fixedfuncemu}"/>
-            <fileset dir="${src.java}"
-                     includes="${java.part.util.fixedfuncemu.shadercode}"/>
-        </jar>
-        <jar manifest="${build.jogl}/tempversion-cdc" destfile="${build.jogl}/jogl-natives-${os.and.arch}-cdc.jar" filesonly="true">
-            <fileset dir="${obj.jogl}">
-              <include name="*_es1.${native.library.suffix-cdc}" />
-              <include name="*_es2.${native.library.suffix-cdc}" />
-            </fileset>
-        </jar>
-    </target>
 
     <target name="build-jars-desktop-javase" depends="setup-manifestfile,build-jars-os-desktop-javase" unless="setup.nodesktop">
         <!--os specific gldesktop-->
         <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gldesktop.jar}" filesonly="true">
             <fileset dir="${classes}"
-                     includes="${java.part.gldesktop}, ${java.part.openmax}"
-                     excludes="${java.part.gldesktop.dbg}, ${java.part.glugldesktop}"/>
+                     includes="${java.part.gldesktop} ${java.part.openmax}"
+                     excludes="${java.part.gldesktop.dbg} ${java.part.glugldesktop}"/>
         </jar>
 
         <!-- misc -->
@@ -1676,7 +1507,7 @@
         <jar manifest="${build.jogl}/tempversion" destfile="${jogl.util.gldesktop.jar}" filesonly="true">
             <fileset dir="${classes}"
                      includes="${java.part.util.gldesktop}"
-                     excludes="com/jogamp/opengl/**/awt/**"/>
+                     excludes="${java.part.awt} ${java.part.util.awt}"/>
         </jar>
     </target>
 
@@ -1730,7 +1561,7 @@
                  sourcepath="${src.java};${src.generated.java}"        
                  destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}" 
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  maxmemory="512m"
                  linkoffline="${javadoc.link} 142-packages"
          bottom="${javadoc.bottom}" >
@@ -1747,7 +1578,7 @@
                  sourcepath="${src.java};${src.generated.java}"        
                  destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}" 
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  maxmemory="512m"
                  linkoffline="${javadoc.link} 142-packages"
          bottom="${javadoc.bottom}" >
@@ -1765,7 +1596,7 @@
                  sourcepath="${src.java};${src.generated.java}"
                  destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}"
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  maxmemory="512m"
                  linkoffline="${javadoc.link} 142-packages"
                  bottom="${javadoc.bottom}" >
@@ -1782,7 +1613,7 @@
                  sourcepath="${src.java};${src.generated.java}"
                  destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}"
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  maxmemory="512m"
                  linkoffline="${javadoc.link} 142-packages"
                  bottom="${javadoc.bottom}" >
@@ -1800,7 +1631,7 @@
                  sourcepath="${src.java};${src.generated.java}"        
                  destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}" 
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  maxmemory="512m"
                  linkoffline="${javadoc.link} 142-packages"
          bottom="${javadoc.bottom}" >
@@ -1817,7 +1648,7 @@
                  sourcepath="${src.java};${src.generated.java}"        
                  destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}" 
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  maxmemory="512m"
                  linkoffline="${javadoc.link} 142-packages"
          bottom="${javadoc.bottom}" >
diff --git a/make/build-junit.xml b/make/build-junit.xml
deleted file mode 100644
index 2536d56..0000000
--- a/make/build-junit.xml
+++ /dev/null
@@ -1,280 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<project name="JOGLTest" basedir="." default="all">
-
-    <description>JUNIT Tests JOGL</description>
-
-    <import file="build-common.xml"/>
-
-    <taskdef resource="net/sf/antcontrib/antlib.xml">
-      <classpath> <pathelement location="${ant-contrib.jar}"/> </classpath>
-    </taskdef>
-
-    <!-- ================================================================== -->
-    <!-- 
-       - Declare all paths and user defined variables.
-      -->
-    <target name="declare.common" description="Declare properties" depends="common.init">
-        <property name="rootrel.src.junit"    value="src/junit" />
-        <property name="src.junit"            value="${project.root}/${rootrel.src.junit}" />
-
-        <property name="classes"              value="${build.junit}/classes" />
-        <property name="classes.path"         location="${classes}"/> <!-- absolute path -->
-
-        <property name="java.dir.test"        value="com/jogamp/test"/>
-        <property name="java.part.test"       value="${java.dir.test}/**"/>
-
-        <property name="batchtest.timeout"    value="1800000"/> <!-- 30 min -->
-
-    </target>
-    
-    <!-- ================================================================== -->
-    <!-- 
-       - Initialize all parameters required for the build and create any
-       - required directories.
-      -->
-    <target name="init" depends="declare.common">
-        <!-- Create the required output directories. -->
-        <mkdir dir="${obj.junit}" />
-        <mkdir dir="${classes}" />
-    </target>
-
-    <!-- ================================================================== -->
-    <!--
-       - Clean up all that is built.
-      -->
-    <target name="clean" description="Remove all build products" depends="declare.common">
-        <delete includeEmptyDirs="true" quiet="true">
-            <fileset dir="${build.junit}" />
-        </delete>
-    </target>
-
-    <!-- ================================================================== -->
-    <!--
-       - Build/run junit.
-      -->
-    <target name="junit.compile.check" depends="init">
-      <property name="jogl.test.jar.path" location="${jogl.test.jar}"/> <!-- absolute path -->
-      <echo message="jogl.test.jar ${jogl.test.jar.path}"/>
-      <uptodate property="junit.compile.skip">
-        <srcfiles dir= "."                 includes="*.xml"/>
-        <srcfiles dir= "${src.junit}"      includes="**"/>
-        <srcfiles                          file="${nativewindow.all.jar}" />
-        <srcfiles                          file="${jogl.all.jar}" />
-        <srcfiles                          file="${newt.all.jar}" />
-        <srcfiles                          file="${gluegen.jar}" />
-        <mapper type="merge" to="${jogl.test.jar.path}"/>
-      </uptodate>
-    </target>
-
-    <target name="junit.compile" depends="junit.compile.check" unless="junit.compile.skip">
-        <!-- Perform the junit pass Java compile -->
-        <javac destdir="${classes}"
-               source="${host.sourcelevel}"
-               fork="yes"
-               memoryMaximumSize="${javac.memorymax}"
-               includeAntRuntime="false"
-               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
-            <classpath refid="junit_jogl_newt.compile.classpath"/>
-            <src path="${src.junit}" />
-        </javac>
-        <delete includeEmptyDirs="true" quiet="true">
-            <fileset file="${jogl.test.jar}" />
-        </delete>
-        <jar destfile="${jogl.test.jar}" filesonly="true">
-            <fileset dir="${classes}">
-                <include name="${java.part.test}"/>
-            </fileset>
-        </jar>
-    </target>
-
-    <target name="junit.run.setup" depends="junit.compile">
-        <mkdir dir="${results.junit}" />
-        <delete quiet="true">
-            <fileset dir="${results.junit}" includes="**"/>
-        </delete>
-
-        <condition property="jvmarg.newt.headless" value="-XstartOnFirstThread -Djava.awt.headless=true"><isset property="isOSX"/></condition>
-        <condition property="jvmarg.newt.headless" value="-Djava.awt.headless=true"><not><isset property="isOSX"/></not></condition>
-    </target>
-
-    <!-- NEWT is currently not supported on OSX -->
-    <target name="junit.run.newt.headless" depends="junit.run.setup" unless="isOSX">
-        <!-- Test*NEWT* 
-
-             Emulation of junit task,
-             due to the fact that we have to place invoke our MainThread class first (-> MacOSX).
-
-             Utilizing Ant-1.8.0 and ant-contrib-1.0b3 (loops, mutable properties).
-          --> 
-        <for param="test.class.path.m" keepgoing="true">
-            <!-- results in absolute path -->
-            <fileset dir="${classes}">
-                <include name="${java.dir.test}/**/Test*NEWT*"/>
-                <exclude name="**/*$$*"/>
-            </fileset>
-          <sequential>
-            <var name="test.class.path" unset="true"/>
-            <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
-            <var name="test.class.fqn" unset="true"/>
-            <pathconvert property="test.class.fqn">
-              <fileset file="${classes}${file.separator}${test.class.path}"/>
-              <chainedmapper>
-                  <globmapper    from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
-                  <packagemapper from="*.class"           to="*"/> <!-- FQCN -->
-              </chainedmapper>
-            </pathconvert>
-            <var name="test.class.result.file" value="${results.junit}/TEST-${test.class.fqn}.xml"/>
-            <echo message="Testing ${test.class.fqn} -> ${test.class.result.file}"/>
-            <apply dir="." executable="${java.home}/bin/java" 
-                 parallel="false" 
-                 timeout="${batchtest.timeout}"
-                 vmlauncher="false"
-                 relative="true"
-                 failonerror="false">
-                <env key="${system.env.library.path}" path="${obj.all.paths}"/>
-                <env key="CLASSPATH" value="${junit_jogl_newt.run.jars}"/>
-                <arg value="-Djava.library.path=${obj.all.paths}"/>
-                <arg line="${jvmarg.newt.headless}"/>
-                <!--
-                <arg line="-Dnewt.debug.EDT"/>
-                -->
-                <arg line="com.jogamp.newt.util.MainThread"/>
-                <arg line="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner"/>
-                <srcfile/>
-                <arg line="filtertrace=true"/>
-                <arg line="haltOnError=false"/>
-                <arg line="haltOnFailure=false"/>
-                <arg line="showoutput=true"/>
-                <arg line="outputtoformatters=true"/>
-                <arg line="logfailedtests=true"/>
-                <arg line="logtestlistenerevents=true"/>
-                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter"/>
-                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.class.result.file}"/>
-                <mappedresources>
-                    <fileset dir="${classes}" includes="${test.class.path}"/>
-                    <packagemapper from="*.class" to="*"/>
-                </mappedresources>
-            </apply>
-          </sequential>
-        </for>
-    </target>
-
-    <!-- junit.run.newt is covered by junit.run.newt.headless, disable it for now, but may be checked manually.
-         This test target would also overwrite the test result XML files, we would also need a solution here for hudson,
-         if run in parallel.
-         NEWT is currently not supported on OSX 
-      -->
-    <target name="junit.run.newt" depends="junit.run.setup" unless="isOSX">
-        <!-- Test*NEWT* -->
-        <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
-            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
-            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>
-
-            <!--
-            <jvmarg value="-Dnewt.debug.EDT"/>
-            <jvmarg value="-Djogl.debug=all"/>
-            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
-            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
-            <jvmarg value="-Djogl.debug.GLSLState"/>
-            <jvmarg value="-Dnativewindow.debug=all"/>
-            <jvmarg value="-Dnewt.debug=all"/>
-            <jvmarg value="-verbose:jni"/> 
-            <jvmarg value="-client"/>
-            <jvmarg value="-d32"/>
-            -->
-
-            <formatter usefile="false" type="plain"/>
-            <formatter usefile="true" type="xml"/>
-            <classpath refid="junit_jogl_newt.run.classpath"/>
-
-            <batchtest todir="${results.junit}">
-              <fileset dir="${classes}">
-                  <include name="${java.dir.test}/**/Test*NEWT*"/>
-                  <exclude name="**/*$$*"/>
-              </fileset>
-              <formatter usefile="false" type="brief"/>
-              <formatter usefile="true" type="xml"/>
-            </batchtest>
-        </junit>
-    </target>
-
-    <target name="junit.run.awt" depends="junit.run.setup">
-        <!-- Test*AWT* -->
-        <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
-            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
-            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>
-
-            <!--
-            <jvmarg value="-Dnewt.debug.EDT"/>
-            <jvmarg value="-Djogl.debug=all"/>
-            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
-            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
-            <jvmarg value="-Djogl.debug.GLSLState"/>
-            <jvmarg value="-Dnativewindow.debug=all"/>
-            <jvmarg value="-Dnewt.debug=all"/>
-            <jvmarg value="-verbose:jni"/> 
-            <jvmarg value="-client"/>
-            <jvmarg value="-d32"/>
-            -->
-
-            <formatter usefile="false" type="plain"/>
-            <formatter usefile="true" type="xml"/>
-            <classpath refid="junit_jogl_awt.run.classpath"/>
-
-            <batchtest todir="${results.junit}">
-              <fileset dir="${classes}">
-                  <include name="${java.dir.test}/**/Test*AWT*"/>
-                  <exclude name="**/*$$*"/>
-                  <exclude name="**/newt/**"/>
-              </fileset>
-              <formatter usefile="false" type="brief"/>
-              <formatter usefile="true" type="xml"/>
-            </batchtest>
-        </junit>
-    </target>
-
-    <!-- NEWT is currently not supported on OSX -->
-    <target name="junit.run.newt.awt" depends="junit.run.setup" unless="isOSX">
-        <!-- Test*AWT* -->
-        <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
-            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
-            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>
-
-            <!--
-            <jvmarg value="-Dnewt.debug.EDT"/>
-            <jvmarg value="-Djogl.debug=all"/>
-            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
-            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
-            <jvmarg value="-Djogl.debug.GLSLState"/>
-            <jvmarg value="-Dnativewindow.debug=all"/>
-            <jvmarg value="-Dnewt.debug=all"/>
-            <jvmarg value="-verbose:jni"/> 
-            <jvmarg value="-client"/>
-            <jvmarg value="-d32"/>
-            -->
-
-            <formatter usefile="false" type="plain"/>
-            <formatter usefile="true" type="xml"/>
-            <classpath refid="junit_jogl_newt_awt.run.classpath"/>
-
-            <batchtest todir="${results.junit}">
-              <fileset dir="${classes}">
-                  <include name="${java.dir.test}/**/newt/**/Test*AWT*"/>
-                  <exclude name="**/*$$*"/>
-              </fileset>
-              <formatter usefile="false" type="brief"/>
-              <formatter usefile="true" type="xml"/>
-            </batchtest>
-        </junit>
-    </target>
-
-    <target name="junit.run" depends="junit.run.newt.headless,junit.run.awt,junit.run.newt.awt"/>
-
-    <!-- ================================================================== -->
-    <!--
-       - Build everything.
-      -->
-    <target name="all" description="Build JOGL JUNIT tests and run them." depends="junit.compile, junit.run" />
-
-</project>
diff --git a/make/build-nativewindow.xml b/make/build-nativewindow.xml
index 4326468..475904b 100644
--- a/make/build-nativewindow.xml
+++ b/make/build-nativewindow.xml
@@ -53,9 +53,14 @@
    -->
 <project name="NativeWindow" basedir="." default="all">
 
-  <import file="build-common.xml"/>
+    <import file="build-common.xml"/>
 
-    <!-- ================================================================== -->
+	<!-- needed for outofdate task -->
+    <taskdef resource="net/sf/antcontrib/antlib.xml">
+      <classpath> <pathelement location="${ant-contrib.jar}"/> </classpath>
+    </taskdef>
+
+	<!-- ================================================================== -->
     <!-- 
        - Base initialization and detection of operating system.
       -->
@@ -72,17 +77,20 @@
 
         <!-- partitioning -->
 
+        <property name="java.part.swt"
+                  value="jogamp/nativewindow/swt/**"/>
+
         <property name="java.part.core"
-                  value="javax/media/nativewindow/*, javax/media/nativewindow/util/*, javax/media/nativewindow/egl/*, javax/media/nativewindow/macosx/*, javax/media/nativewindow/windows/*, com/jogamp/nativewindow/*, com/jogamp/nativewindow/impl/*, com/jogamp/nativewindow/impl/jvm/*"/>
+                  value="javax/media/nativewindow/* javax/media/nativewindow/util/* javax/media/nativewindow/egl/* javax/media/nativewindow/macosx/* javax/media/nativewindow/windows/* com/jogamp/nativewindow/* jogamp/nativewindow/* jogamp/nativewindow/jvm/* ${java.part.swt}"/>
 
         <property name="java.part.awt"
-                  value="javax/media/nativewindow/awt/*, com/jogamp/nativewindow/impl/jawt/**, com/jogamp/nativewindow/impl/**/awt/**"/>
+                  value="javax/media/nativewindow/awt/* jogamp/nativewindow/jawt/** jogamp/nativewindow/**/awt/**"/>
 
         <property name="java.part.x11"
-                  value="com/jogamp/nativewindow/impl/x11/** javax/media/nativewindow/x11/*" />
+                  value="jogamp/nativewindow/x11/** javax/media/nativewindow/x11/*" />
 
         <property name="java.part.windows"
-                  value="com/jogamp/nativewindow/impl/windows/** javax/media/nativewindow/windows/*" />
+                  value="jogamp/nativewindow/windows/** javax/media/nativewindow/windows/*" />
 
         <!-- condition excludes -->
 
@@ -118,12 +126,10 @@
         <!-- The generated source directories. -->
         <property name="src.generated" value="${build.nativewindow}/gensrc" />
         <property name="src.generated.java" value="${src.generated}/classes" />
-        <property name="src.generated.java-cdc" value="${src.generated}/classes-cdc" />
         <property name="src.generated.c" value="${src.generated}/native" />
         
         <!-- The compiler output directories. -->
         <property name="classes" value="${build.nativewindow}/classes" />
-        <property name="classes-cdc" value="${build.nativewindow}/classes-cdc" />
 
         <!-- The headers from which Java files are generated -->
         <dirset id="stub.includes.fileset.all" dir=".">
@@ -152,14 +158,13 @@
         <property name="javadoc" value="${project.root}/javadoc_nativewindow_public" />
         <property name="javadoc.spec" value="${project.root}/javadoc_nativewindow_spec" />
         <property name="javadoc.dev" value="${project.root}/javadoc_nativewindow_dev" />
-        <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" />
         <property name="javadoc.windowtitle" value="Native Windowing Interface (NativeWindow) API -- ${nativewindow_base_version} Specification" />
         <property name="javadoc.overview" value="../src/nativewindow/classes/javax/media/nativewindow/package.html" />
         <property name="javadoc.spec.packagenames" value="javax.media.nativewindow.*" />
 
         <property name="javadoc.packagenames" value="${javadoc.spec.packagenames}" />
 
-        <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.jogamp.nativewindow.util.*,com.jogamp.nativewindow.impl.*,com.jogamp.gluegen,com.jogamp.gluegen.runtime" />
+        <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.jogamp.nativewindow.util.*,jogamp.nativewindow.*,com.jogamp.gluegen,com.jogamp.gluegen.runtime" />
     <property name="javadoc.bottom" value="Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="http://jcp.org/en/jsr/detail?id=231">license terms</a>." />
     </target>
     
@@ -171,13 +176,11 @@
     <target name="init" depends="declare.common">
         <!-- Create the required output directories. -->
         <mkdir dir="${src.generated.java}" />
-        <mkdir dir="${src.generated.java-cdc}" />
         <mkdir dir="${src.generated.c}" />
         <mkdir dir="${src.generated.c}/MacOSX" />
         <mkdir dir="${src.generated.c}/Windows" />
         <mkdir dir="${src.generated.c}/X11" />
         <mkdir dir="${classes}" />
-        <mkdir dir="${classes-cdc}" />
         <mkdir dir="${obj.nativewindow}" />
     </target>
 
@@ -201,13 +204,13 @@
 
         <!-- Now check for the presence of one well-known file -->
         <uptodate property="java.generate.skip.x11windowlib"
-                  targetfile="${src.generated.java}/com/jogamp/nativewindow/impl/x11/X11Lib.java">
+                  targetfile="${src.generated.java}/jogamp/nativewindow/x11/X11Lib.java">
             <srcfiles refid="stub.includes.dependencies.fileset.1" />
             <srcfiles refid="stub.includes.dependencies.fileset.2" />
             <srcfiles refid="stub.includes.dependencies.fileset.3" />
         </uptodate>
         <uptodate property="java.generate.skip.jawt"
-                  targetfile="${src.generated.java}/com/jogamp/nativewindow/impl/jawt/JAWT.java">
+                  targetfile="${src.generated.java}/jogamp/nativewindow/jawt/JAWT.java">
             <srcfiles refid="stub.includes.dependencies.fileset.1" />
             <srcfiles refid="stub.includes.dependencies.fileset.2" />
             <srcfiles refid="stub.includes.dependencies.fileset.3" />
@@ -232,10 +235,6 @@
                  emitter="com.jogamp.gluegen.JavaEmitter">
             <classpath refid="gluegen.classpath" />
         </gluegen>
-        <copy todir="${src.generated.java-cdc}">
-            <fileset dir="${src.generated.java}"
-                     includes="com/jogamp/nativewindow/impl/x11/** com/jogamp/nativewindow/impl/windows/**" />
-        </copy>
     </target>
 
     <target name="java.generate.jawt" unless="setup.noAWT">
@@ -252,10 +251,6 @@
                  emitter="com.jogamp.gluegen.JavaEmitter">
             <classpath refid="gluegen.classpath" />
         </gluegen>
-        <copy todir="${src.generated.java-cdc}">
-            <fileset dir="${src.generated.java}"
-                     includes="com/jogamp/nativewindow/impl/jawt/**" />
-        </copy>
     </target>
 
     <target name="java.generate.platforms" >
@@ -313,38 +308,22 @@
        - Compile the original and generated source.  The composable pipelines
        - will be generated.
       -->
-    <target name="java.compile.javacdc" depends="java.generate" unless="setup.noCDC">
-        <!-- Perform the first pass Java compile; everything -->
-        <javac destdir="${classes-cdc}"
-               excludes="${java.part.awt} ${java.excludes.all}"
-               source="${target.sourcelevel}"
-               classpath="${gluegen-rt.cdc.jar}"
-               bootclasspath="${javac.bootclasspath-cdc.jar}"
-               fork="yes"
-               includeAntRuntime="false"
-               memoryMaximumSize="${javac.memorymax}"
-               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
-            <src path="${src.java}" />
-            <src path="${src.generated.java-cdc}" />
-        </javac>
-    </target>
-
     <target name="java.compile.javase" depends="java.generate">
         <!-- Perform the second pass Java compile; everything. -->
         <javac destdir="${classes}"
                excludes="${java.excludes.all}"
                source="${target.sourcelevel}"
-               classpath="${gluegen-rt.jar}"
                fork="yes"
                includeAntRuntime="false"
                memoryMaximumSize="${javac.memorymax}"
                debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+            <classpath refid="swt_gluegen.classpath"/>
             <src path="${src.java}" />
             <src path="${src.generated.java}" />
         </javac>
     </target>
 
-    <target name="java.compile" depends="java.compile.javase,java.compile.javacdc" />
+    <target name="java.compile" depends="java.compile.javase" />
 
     <!-- ================================================================== -->
     <!-- 
@@ -519,7 +498,6 @@
 
     <target name="rename.dylib" if="isOSX">
         <move file="${src}" tofile="${dest}" />
-        <copy file="${dest}" tofile="${dest-cdc}" />
     </target>
 
     <macrodef name="c.build">
@@ -560,62 +538,86 @@
         </patternset>
 
         <patternset id="c.src.files.x11">
-          <include name="${rootrel.generated.c}/X11/X11*.c" if="isX11"/>
-          <include name="${rootrel.src.c}/x11/Xmisc.c" if="isX11"/>
-          <include name="${rootrel.src.c}/x11/XineramaHelper.c" if="isX11"/>
+          <include name="${rootrel.generated.c}/X11/X11*.c"/>
+          <include name="${rootrel.src.c}/x11/Xmisc.c"/>
+          <include name="${rootrel.src.c}/x11/XineramaHelper.c"/>
+          <include name="${rootrel.src.c}/NativewindowCommon.c"/>
         </patternset>
 
         <patternset id="c.src.files.windows">
-          <include name="${rootrel.generated.c}/Windows/GDI*.c" if="isWindows"/>
-          <include name="${rootrel.src.c}/windows/GDImisc.c"    if="isWindows"/>
+          <include name="${rootrel.generated.c}/Windows/GDI*.c"/>
+          <include name="${rootrel.src.c}/windows/GDImisc.c"/>
+          <include name="${rootrel.src.c}/NativewindowCommon.c"/>
         </patternset>
 
         <echo message="Compiling @{output.lib.name}" />
 
-        <cc outtype="shared" 
-            objdir="${obj.nativewindow}" 
-            outfile="${obj.nativewindow}/@{output.lib.name}"
-            optimize="${c.compiler.optimise}" 
-            debug="${c.compiler.debug}"
-            multithreaded="true" 
-            exceptions="false" 
-            rtti="false">   
-  
-          <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
-  
-          <compiler extends="@{compiler.cfg.id}" >
-            <sysincludepath path="${java.includes.dir}"/>
-            <sysincludepath path="${java.includes.dir.platform}"/>
-            <!-- This is for the generated headers for handwritten C code -->
-            <includepath path="${src.generated.c}" />
-            <includepath path="${src.generated.c}/X11" if="isX11"/>
-            <includepath path="${src.generated.c}/MacOSX" if="isOSX"/>
-            <includepath path="${src.generated.c}/Windows" if="isWindows"/>
-  
-            <!-- This must come last to not override real include paths -->
-            <!-- includepath path="stub_includes/macosx" if="isOSX" / -->
-          </compiler>
-  
-          <linker extends="@{linker.cfg.id}">
-            <syslibset dir="${java.lib.dir.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
-            <syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/>
-          </linker>
-        </cc>
-
-        <!-- FIXME: this is a hack; the cpptask should have an option to change the
-             suffix or at least understand the override from dylib to jnilib -->
-        <antcall target="rename.dylib" inheritRefs="true">
-            <param name="src"  value="${build.nativewindow}/obj/lib@{output.lib.name}.dylib" />
-            <param name="dest" value="${build.nativewindow}/obj/lib@{output.lib.name}.jnilib" />
-            <param name="dest-cdc" value="${build.nativewindow}/obj/lib@{output.lib.name}.so" />
-        </antcall>
-
-        <!-- FIXME: this is a hack; the cpptask should have an option to change the
-             suffix or at least understand the override from dylib to jnilib -->
-        <antcall target="rename.mingw.dll" inheritRefs="true">
-            <param name="src"  value="${build.nativewindow}/obj/lib@{output.lib.name}.so" />
-            <param name="dest" value="${build.nativewindow}/obj/@{output.lib.name}.dll" />
-        </antcall>
+        <!-- have to wrap cc task with outofdate, because otherwise cc links a new library
+             even when no files have been compiled -->
+      	<outofdate>
+          <sourcefiles>
+            <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
+          </sourcefiles>
+          <targetfiles>
+            <fileset dir="${obj.nativewindow}" includes="lib@{output.lib.name}.so"/>
+            <fileset dir="${obj.nativewindow}" includes="@{output.lib.name}.dll"/>
+            <fileset dir="${obj.nativewindow}" includes="lib@{output.lib.name}.jnilib"/>
+          </targetfiles>
+          <sequential>
+            <cc outtype="shared" 
+                objdir="${obj.nativewindow}" 
+                outfile="${obj.nativewindow}/@{output.lib.name}"
+                optimize="${c.compiler.optimise}" 
+                debug="${c.compiler.debug}"
+                multithreaded="true" 
+                exceptions="false" 
+                rtti="false">   
+      
+              <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
+      
+              <compiler extends="@{compiler.cfg.id}" >
+                <sysincludepath path="${java.includes.dir}"/>
+                <sysincludepath path="${java.includes.dir.platform}"/>
+                <!-- This is for the generated headers for handwritten C code -->
+                <includepath path="${src.generated.c}" />
+                <includepath path="${src.generated.c}/X11" if="isX11"/>
+                <includepath path="${src.generated.c}/MacOSX" if="isOSX"/>
+                <includepath path="${src.generated.c}/Windows" if="isWindows"/>
+                <includepath path="${src.c}"/>
+      
+                <!-- This must come last to not override real include paths -->
+                <!-- includepath path="stub_includes/macosx" if="isOSX" / -->
+              </compiler>
+      
+              <linker extends="@{linker.cfg.id}">
+                <syslibset dir="${java.lib.dir.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
+                <syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/>
+              </linker>
+            </cc>
+
+            <!-- FIXME: this is a hack; the cpptask should have an option to change the
+                 suffix or at least understand the override from dylib to jnilib -->
+            <antcall target="rename.dylib" inheritRefs="true">
+                <param name="src"  value="${obj.nativewindow}/lib@{output.lib.name}.dylib" />
+                <param name="dest" value="${obj.nativewindow}/lib@{output.lib.name}.jnilib" />
+            </antcall>
+
+            <!-- FIXME: this is a hack; the cpptask should have an option to change the
+                 suffix or at least understand the override from dylib to jnilib -->
+            <antcall target="rename.mingw.dll" inheritRefs="true">
+                <param name="src"  value="${obj.nativewindow}/lib@{output.lib.name}.so" />
+                <param name="dest" value="${obj.nativewindow}/@{output.lib.name}.dll" />
+            </antcall>
+
+            <!-- this stripping may be called more than once on the same library dir,
+                 but that should cause no harm, and doing it here inside outofdate
+                 prevents the JARs from always being rebuilt even if no source code changes -->
+            <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true">
+                <param name="libdir" value="${obj.nativewindow}"/>
+            </antcall>
+
+          </sequential>
+      	</outofdate>
       </sequential>
     </macrodef>  
 
@@ -642,7 +644,7 @@
     </target>
 
     <target name="c.build.nativewindow.windowlib.x11" if="isX11">
-      <javah destdir="${src.generated.c}/X11" classpath="${classes}" class="com.jogamp.nativewindow.impl.x11.X11Lib" />
+      <javah destdir="${src.generated.c}/X11" classpath="${classes}" class="jogamp.nativewindow.x11.X11Lib" />
 
       <c.build c.compiler.src.files="c.src.files.x11"
                output.lib.name="nativewindow_x11"
@@ -651,7 +653,7 @@
     </target>
 
     <target name="c.build.nativewindow.windowlib.windows" if="isWindows">
-      <javah destdir="${src.generated.c}/Windows" classpath="${classes}" class="com.jogamp.nativewindow.impl.windows.GDI" />
+      <javah destdir="${src.generated.c}/Windows" classpath="${classes}" class="jogamp.nativewindow.windows.GDI" />
 
       <c.build c.compiler.src.files="c.src.files.windows"
                output.lib.name="nativewindow_win32"
@@ -667,10 +669,6 @@
     </target>
 
     <target name="c.build.nativewindow" depends="c.configure,c.build.nativewindow.windowlib,c.build.nativewindow.awt">
-      <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true">
-          <param name="libdir" value="${obj.nativewindow}"/>
-      </antcall>
-
       <antcall target="c.fixup.jawt.version.macosx" inheritrefs="true" />
       <antcall target="c.manifest" inheritRefs="true" />
     </target>
@@ -679,7 +677,7 @@
     <!--
        - Build the nativewindow.jar files.
       -->
-    <target name="build-jars" depends="gluegen.cpptasks.detect.os,build-jars-javase,build-jars-cdc" />
+    <target name="build-jars" depends="gluegen.cpptasks.detect.os,build-jars-javase" />
 
     <target name="setup-manifestfile">
         <property name="manifestfile" value="nativewindowversion"/>
@@ -695,20 +693,6 @@
         </copy>
     </target>
 
-    <target name="setup-manifestfile-cdc">
-        <property name="manifestfile" value="nativewindowversion-cdc"/>
-        <copy file="${manifestfile}"
-          tofile="tempversion-cdc"
-          overwrite="true">
-          <filterset>
-              <filter token="VERSION" value="${nativewindow.version}"/>
-              <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
-              <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
-              <filter token="BASEVERSION" value="${nativewindow_base_version}"/>
-          </filterset>
-        </copy>
-    </target>
-
     <target name="build-jars-awt" depends="setup-manifestfile" unless="setup.noAWT">
         <jar manifest="tempversion" destfile="${nativewindow.awt.jar}" filesonly="true">
             <fileset dir="${classes}"
@@ -723,45 +707,27 @@
                      includes="${java.part.x11}" />
         </jar>
     </target>
-    <target name="build-jars-x11-cdc" depends="setup-manifestfile-cdc">
-        <jar manifest="tempversion-cdc" destfile="${nativewindow.os.x11.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.x11}" />
-        </jar>
-    </target>
 
     <target name="build-jars-windows" depends="setup-manifestfile">
-        <jar manifest="tempversion" destfile="${nativewindow.os.windows.jar}" filesonly="true">
+        <jar manifest="tempversion" destfile="${nativewindow.os.win.jar}" filesonly="true">
             <fileset dir="${classes}"
                      includes="${java.part.windows}" />
         </jar>
     </target>
-    <target name="build-jars-windows-cdc" depends="setup-manifestfile-cdc">
-        <jar manifest="tempversion-cdc" destfile="${nativewindow.os.windows.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.windows}" />
-        </jar>
-    </target>
 
     <target name="build-jars-all" depends="setup-manifestfile" unless="setup.noAWT">
         <jar manifest="tempversion" destfile="${nativewindow.all.jar}" filesonly="true">
             <fileset dir="${classes}"
-                     includes="javax/media/nativewindow/** com/jogamp/nativewindow/**" />
+                     includes="javax/media/nativewindow/** com/jogamp/nativewindow/** jogamp/nativewindow/**" />
         </jar>
     </target>
     <target name="build-jars-all-noawt" depends="setup-manifestfile">
         <jar manifest="tempversion" destfile="${nativewindow.all-noawt.jar}" filesonly="true">
             <fileset dir="${classes}"
-                     includes="javax/media/nativewindow/**, com/jogamp/nativewindow/**" 
+                     includes="javax/media/nativewindow/** com/jogamp/nativewindow/** jogamp/nativewindow/**" 
                      excludes="${java.part.awt}"/>
         </jar>
     </target>
-    <target name="build-jars-all-cdc" depends="setup-manifestfile-cdc">
-        <jar manifest="tempversion-cdc" destfile="${nativewindow.all.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="javax/media/nativewindow/** com/jogamp/nativewindow/**" />
-        </jar>
-    </target>
 
     <target name="build-jars-javase" depends="setup-manifestfile,build-jars-awt,build-jars-x11,build-jars-windows,build-jars-all,build-jars-all-noawt">
         <jar manifest="tempversion" destfile="${nativewindow.core.jar}" filesonly="true">
@@ -777,22 +743,6 @@
         <delete file="tempversion"/>
     </target>
 
-    <target name="build-jars-cdc" depends="setup-manifestfile-cdc,build-jars-x11-cdc,build-jars-windows-cdc,build-jars-all-cdc">
-        <jar manifest="tempversion-cdc" destfile="${nativewindow.core.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.core}"
-                     excludes="${java.part.awt} ${java.part.x11} ${java.part.windows}"/>
-        </jar>
-        <jar manifest="tempversion-cdc" destfile="${build.nativewindow}/nativewindow-natives-${os.and.arch}-cdc.jar" filesonly="true">
-            <fileset dir="${obj.nativewindow}">
-              <include name="*_jvm.${native.library.suffix-cdc}" />
-              <include name="*_x11.${native.library.suffix-cdc}" />
-            </fileset>
-        </jar>
-
-        <delete file="tempversion-cdc"/>
-    </target>
-
     <!-- ================================================================== -->
     <!--
        - Build the Javadocs for the sources.
@@ -805,10 +755,10 @@
         <javadoc packagenames="${javadoc.packagenames}"
                  excludepackagenames="${java.excludes.javadoc.packagenames}"
                  sourcepath="${src.java};${src.generated.java}"        
-                 classpath="${gluegen-rt.cdc.jar}"
+                 classpath="${gluegen-rt.jar}"
                  destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}" 
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  linkoffline="${javadoc.link} 142-packages"
          bottom="${javadoc.bottom}" >
         </javadoc>
@@ -819,10 +769,10 @@
         <javadoc packagenames="${javadoc.spec.packagenames}"
                  excludepackagenames="${java.excludes.javadoc.packagenames}"
                  sourcepath="${src.java};${src.generated.java}"
-                 classpath="${gluegen-rt.cdc.jar}"
+                 classpath="${gluegen-rt.jar}"
                  destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}"
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  linkoffline="${javadoc.link} 142-packages"
                  bottom="${javadoc.bottom}" >
         </javadoc>
@@ -833,10 +783,10 @@
         <javadoc packagenames="${javadoc.dev.packagenames}"
                  excludepackagenames="${java.excludes.javadoc.packagenames}"
                  sourcepath="${src.java};${src.generated.java}"        
-                 classpath="${gluegen-rt.cdc.jar}"
+                 classpath="${gluegen-rt.jar}"
                  destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}" 
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  linkoffline="${javadoc.link} 142-packages"
          bottom="${javadoc.bottom}" >
         </javadoc>
diff --git a/make/build-newt.xml b/make/build-newt.xml
index 7f33f9c..d062f92 100644
--- a/make/build-newt.xml
+++ b/make/build-newt.xml
@@ -46,7 +46,6 @@
 
    - Internal settings, may not be necessary to set them manually,
      since all JAR archives are orthogonal.
-       setup.noCDC
        setup.noAWT
        setup.noOpenGL
 
@@ -58,6 +57,11 @@
 
     <import file="build-common.xml"/>
 
+    <!-- needed for outofdate task -->
+    <taskdef resource="net/sf/antcontrib/antlib.xml">
+      <classpath> <pathelement location="${ant-contrib.jar}"/> </classpath>
+    </taskdef>
+
     <!-- ================================================================== -->
     <!--
        - Base initialization and detection of operating system.
@@ -87,28 +91,28 @@
         <!-- partitioning -->
 
         <property name="java.part.core"
-                  value="com/jogamp/newt/*, com/jogamp/newt/event/*, com/jogamp/newt/util/*, com/jogamp/newt/impl/*, com/jogamp/newt/impl/event/*"/>
+                  value="com/jogamp/newt/* com/jogamp/newt/event/* com/jogamp/newt/util/* jogamp/newt/* jogamp/newt/event/*"/>
 
         <property name="java.part.awt"
-                  value="com/jogamp/newt/impl/awt/*, com/jogamp/newt/awt/*, com/jogamp/newt/event/awt/*"/>
+                  value="com/jogamp/newt/awt/* com/jogamp/newt/event/awt/* jogamp/newt/awt/**"/>
 
         <property name="java.part.x11"
-                  value="com/jogamp/newt/impl/x11/*"/>
+                  value="jogamp/newt/x11/*"/>
 
         <property name="java.part.windows"
-                  value="com/jogamp/newt/impl/windows/*"/>
+                  value="jogamp/newt/windows/*"/>
 
         <property name="java.part.macosx"
-                  value="com/jogamp/newt/impl/macosx/*"/>
+                  value="jogamp/newt/macosx/*"/>
 
         <property name="java.part.opengl"
-                  value="com/jogamp/newt/opengl/*, com/jogamp/newt/impl/opengl/kd/*"/>
+                  value="com/jogamp/newt/opengl/* jogamp/newt/opengl/kd/*"/>
 
         <property name="java.part.broadcomegl"
-                  value="com/jogamp/newt/impl/opengl/broadcom/egl/*"/>
+                  value="jogamp/newt/opengl/broadcom/egl/*"/>
 
         <property name="java.part.intelgdl"
-                  value="com/jogamp/newt/impl/intel/gdl/*"/>
+                  value="jogamp/newt/intel/gdl/*"/>
 
         <!-- condition excludes -->
 
@@ -122,8 +126,6 @@
            <isset property="setup.noOpenGL"/>
         </condition>
 
-        <property name="java.excludes.cdcfp" value="${java.part.awt}"/>
-
         <condition property="java.excludes.desktop"
                    value="${java.part.x11} ${java.part.windows}, ${java.part.macosx}, ${java.part.awt}">
            <isset property="setup.nodesktop"/>
@@ -153,13 +155,11 @@
 
         <!-- The compiler output directories. -->
         <property name="classes" value="${build.newt}/classes" />
-        <property name="classes-cdc" value="${build.newt}/classes-cdc" />
 
         <!-- The javadoc dirs. -->
         <property name="javadoc" value="${project.root}/javadoc_newt_public" />
         <property name="javadoc.spec" value="${project.root}/javadoc_newt_spec" />
         <property name="javadoc.dev" value="${project.root}/javadoc_newt_dev" />
-        <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" />
         <property name="javadoc.windowtitle" value="NEWT API -- ${newt_base_version} Specification" />
         <property name="javadoc.overview" value="spec-overview.html" />
         <property name="javadoc.spec.packagenames" value="com.jogamp.newt, com.jogamp.newt.event.*, com.jogamp.newt.opengl" />
@@ -184,7 +184,6 @@
         <mkdir dir="${src.generated.c}/IntelGDL" />
         <mkdir dir="${src.generated.c}/BroadcomEGL" />
         <mkdir dir="${classes}" />
-        <mkdir dir="${classes-cdc}" />
         <mkdir dir="${obj.newt}" />
     </target>
 
@@ -206,22 +205,7 @@
         </javac>
     </target>
 
-    <target name="java.compile.javacdc" unless="setup.noCDC">
-        <!-- Perform the first pass Java compile; everything -->
-        <javac destdir="${classes-cdc}"
-               excludes="${java.excludes.all} ${java.excludes.cdcfp}"
-               source="${target.sourcelevel}"
-               bootclasspath="${javac.bootclasspath-cdc.jar}"
-               fork="yes"
-               includeAntRuntime="false"
-               memoryMaximumSize="${javac.memorymax}"
-               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
-            <classpath refid="nativewindow_gluegen_jogl.classpath-cdc"/>
-            <src path="${src.java}" />
-        </javac>
-    </target>
-
-    <target name="java.compile" depends="java.compile.javase,java.compile.javacdc" />
+    <target name="java.compile" depends="java.compile.javase" />
 
     <!-- ================================================================== -->
     <!--
@@ -428,7 +412,6 @@
 
     <target name="rename.dylib" if="isOSX">
         <move file="${src}" tofile="${dest}" />
-        <copy file="${dest}" tofile="${dest-cdc}" />
     </target>
 
     <macrodef name="c.build">
@@ -459,83 +442,106 @@
 
         <echo message="Compiling @{output.lib.name}" />
 
-        <cc outtype="shared"
-            objdir="${obj.newt}"
-            outfile="${obj.newt}/@{output.lib.name}"
-            optimize="${c.compiler.optimise}"
-            debug="${c.compiler.debug}"
-            multithreaded="true"
-            exceptions="false"
-            rtti="false">
-
-          <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
-
-          <compiler extends="@{compiler.cfg.id}" >
-            <sysincludepath path="${java.includes.dir}"/>
-            <sysincludepath path="${java.includes.dir.platform}"/>
-            <includepath path="stub_includes/khr"/>
-            <includepath path="stub_includes/egl"/>
-            <!-- This is for the generated headers for handwritten C code -->
-            <includepath path="${src.generated.c}" />
-            <includepath path="${src.generated.c}/X11" if="isX11"/>
-            <includepath path="${src.generated.c}/MacOSX" if="isOSX"/>
-            <includepath path="${src.generated.c}/Windows" if="isWindows"/>
-            <includepath path="${src.generated.c}/KD" if="useKD" />
-            <includepath path="${src.generated.c}/IntelGDL" if="useIntelGDL" />
-            <includepath path="stub_includes/embedded/IntelGDL" if="useIntelGDL" />
-            <includepath path="${src.generated.c}/BroadcomEGL" if="useBroadcomEGL" />
-
-            <!-- This must come last to not override real include paths -->
-            <!-- includepath path="stub_includes/macosx" if="isOSX" / -->
-          </compiler>
-
-          <linker extends="@{linker.cfg.id}">
-            <syslibset dir="${java.lib.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
-            <syslibset dir="${java.lib.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/>
-          </linker>
-        </cc>
-
-        <!-- FIXME: this is a hack; the cpptask should have an option to change the
-             suffix or at least understand the override from dylib to jnilib -->
-        <antcall target="rename.dylib" inheritRefs="true">
-            <param name="src"  value="${obj.newt}/lib@{output.lib.name}.dylib" />
-            <param name="dest" value="${obj.newt}/lib@{output.lib.name}.jnilib" />
-            <param name="dest-cdc" value="${obj.newt}/lib@{output.lib.name}.so" />
-        </antcall>
-
-        <!-- FIXME: this is a hack; the cpptask should have an option to change the
-             suffix or at least understand the override from dylib to jnilib -->
-        <antcall target="rename.mingw.dll" inheritRefs="true">
-            <param name="src"  value="${obj.newt}/lib@{output.lib.name}.so" />
-            <param name="dest" value="${obj.newt}/@{output.lib.name}.dll" />
-        </antcall>
+        <!-- have to wrap cc task with outofdate, because otherwise cc links a new library
+             even when no files have been compiled -->
+        <outofdate>
+          <sourcefiles>
+            <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
+          </sourcefiles>
+          <targetfiles>
+            <fileset dir="${obj.newt}" includes="lib@{output.lib.name}.so"/>
+            <fileset dir="${obj.newt}" includes="@{output.lib.name}.dll"/>
+            <fileset dir="${obj.newt}" includes="lib@{output.lib.name}.jnilib"/>
+          </targetfiles>
+          <sequential>
+            <cc outtype="shared"
+                objdir="${obj.newt}"
+                outfile="${obj.newt}/@{output.lib.name}"
+                optimize="${c.compiler.optimise}"
+                debug="${c.compiler.debug}"
+                multithreaded="true"
+                exceptions="false"
+                rtti="false">
+    
+              <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
+    
+              <compiler extends="@{compiler.cfg.id}" >
+                <sysincludepath path="${java.includes.dir}"/>
+                <sysincludepath path="${java.includes.dir.platform}"/>
+                <includepath path="stub_includes/khr"/>
+                <includepath path="stub_includes/egl"/>
+                <!-- This is for finding Xrandr.h on Solaris. -->
+                <includepath path="/usr/X11/include" />
+                <!-- This is for the generated headers for handwritten C code -->
+                <includepath path="${src.generated.c}" />
+                <includepath path="${src.generated.c}/X11" if="isX11"/>
+                <includepath path="${src.generated.c}/MacOSX" if="isOSX"/>
+                <includepath path="${src.generated.c}/Windows" if="isWindows"/>
+                <includepath path="${src.generated.c}/KD" if="useKD" />
+                <includepath path="${src.generated.c}/IntelGDL" if="useIntelGDL" />
+                <includepath path="stub_includes/embedded/IntelGDL" if="useIntelGDL" />
+                <includepath path="${src.generated.c}/BroadcomEGL" if="useBroadcomEGL" />
+    
+                <!-- This must come last to not override real include paths -->
+                <!-- includepath path="stub_includes/macosx" if="isOSX" / -->
+              </compiler>
+    
+              <linker extends="@{linker.cfg.id}">
+                <syslibset dir="${java.lib.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
+                <syslibset dir="${java.lib.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/>
+              </linker>
+            </cc>
+    
+            <!-- FIXME: this is a hack; the cpptask should have an option to change the
+                 suffix or at least understand the override from dylib to jnilib -->
+            <antcall target="rename.dylib" inheritRefs="true">
+                <param name="src"  value="${obj.newt}/lib@{output.lib.name}.dylib" />
+                <param name="dest" value="${obj.newt}/lib@{output.lib.name}.jnilib" />
+            </antcall>
+    
+            <!-- FIXME: this is a hack; the cpptask should have an option to change the
+                 suffix or at least understand the override from dylib to jnilib -->
+            <antcall target="rename.mingw.dll" inheritRefs="true">
+                <param name="src"  value="${obj.newt}/lib@{output.lib.name}.so" />
+                <param name="dest" value="${obj.newt}/@{output.lib.name}.dll" />
+            </antcall>
+
+          	<!-- this stripping may be called more than once on the same library dir,
+          	     but that should cause no harm, and doing it here inside outofdate
+          	     prevents the JARs from always being rebuilt even if no source code changes -->
+          	<antcall target="gluegen.cpptasks.striplibs" inheritRefs="true">
+                <param name="libdir" value="${obj.newt}"/>
+            </antcall>
+
+          </sequential>
+        </outofdate>
       </sequential>
     </macrodef>
 
     <target name="c.build.newt.prepare.KD" if="useKD">
-      <javah destdir="${src.generated.c}/KD" classpath="${classes}" class="com.jogamp.newt.impl.opengl.kd.KDWindow" />
+      <javah destdir="${src.generated.c}/KD" classpath="${classes}" class="jogamp.newt.opengl.kd.KDWindow" />
     </target>
 
     <target name="c.build.newt.prepare.IntelGDL" if="useIntelGDL">
-      <javah destdir="${src.generated.c}/IntelGDL" classpath="${classes}" class="com.jogamp.newt.impl.intel.gdl.Display" />
-      <javah destdir="${src.generated.c}/IntelGDL" classpath="${classes}" class="com.jogamp.newt.impl.intel.gdl.Screen" />
-      <javah destdir="${src.generated.c}/IntelGDL" classpath="${classes}" class="com.jogamp.newt.impl.intel.gdl.Window" />
+      <javah destdir="${src.generated.c}/IntelGDL" classpath="${classes}" class="jogamp.newt.intel.gdl.Display" />
+      <javah destdir="${src.generated.c}/IntelGDL" classpath="${classes}" class="jogamp.newt.intel.gdl.Screen" />
+      <javah destdir="${src.generated.c}/IntelGDL" classpath="${classes}" class="jogamp.newt.intel.gdl.Window" />
     </target>
 
     <target name="c.build.newt.prepare.BroadcomEGL" if="useBroadcomEGL">
-      <javah destdir="${src.generated.c}/BroadcomEGL" classpath="${classes}" class="com.jogamp.newt.impl.opengl.broadcom.egl.Window" />
+      <javah destdir="${src.generated.c}/BroadcomEGL" classpath="${classes}" class="jogamp.newt.opengl.broadcom.egl.Window" />
     </target>
 
     <target name="c.build.newt.prepare.desktop" unless="setup.nodesktop">
-      <javah destdir="${src.generated.c}/Windows" classpath="${classes}" class="com.jogamp.newt.impl.windows.WindowsWindow" />
-      <javah destdir="${src.generated.c}/Windows" classpath="${classes}" class="com.jogamp.newt.impl.windows.WindowsScreen" />
-      <javah destdir="${src.generated.c}/Windows" classpath="${classes}" class="com.jogamp.newt.impl.windows.WindowsDisplay" />
-      <javah destdir="${src.generated.c}/MacOSX" classpath="${classes}" class="com.jogamp.newt.impl.macosx.MacWindow" />
-      <javah destdir="${src.generated.c}/MacOSX" classpath="${classes}" class="com.jogamp.newt.impl.macosx.MacScreen" />
-      <javah destdir="${src.generated.c}/MacOSX" classpath="${classes}" class="com.jogamp.newt.impl.macosx.MacDisplay" />
-      <javah destdir="${src.generated.c}/X11" classpath="${classes}" class="com.jogamp.newt.impl.x11.X11Window" />
-      <javah destdir="${src.generated.c}/X11" classpath="${classes}" class="com.jogamp.newt.impl.x11.X11Screen" />
-      <javah destdir="${src.generated.c}/X11" classpath="${classes}" class="com.jogamp.newt.impl.x11.X11Display" />
+      <javah destdir="${src.generated.c}/Windows" classpath="${classes}" class="jogamp.newt.windows.WindowsWindow" />
+      <javah destdir="${src.generated.c}/Windows" classpath="${classes}" class="jogamp.newt.windows.WindowsScreen" />
+      <javah destdir="${src.generated.c}/Windows" classpath="${classes}" class="jogamp.newt.windows.WindowsDisplay" />
+      <javah destdir="${src.generated.c}/MacOSX" classpath="${classes}" class="jogamp.newt.macosx.MacWindow" />
+      <javah destdir="${src.generated.c}/MacOSX" classpath="${classes}" class="jogamp.newt.macosx.MacScreen" />
+      <javah destdir="${src.generated.c}/MacOSX" classpath="${classes}" class="jogamp.newt.macosx.MacDisplay" />
+      <javah destdir="${src.generated.c}/X11" classpath="${classes}" class="jogamp.newt.x11.X11Window" />
+      <javah destdir="${src.generated.c}/X11" classpath="${classes}" class="jogamp.newt.x11.X11Screen" />
+      <javah destdir="${src.generated.c}/X11" classpath="${classes}" class="jogamp.newt.x11.X11Display" />
     </target>
 
     <target name="c.build.newt.prepare" depends="c.build.newt.prepare.KD,c.build.newt.prepare.IntelGDL,c.build.newt.prepare.BroadcomEGL,c.build.newt.prepare.desktop" />
@@ -556,10 +562,6 @@
     </target>
 
     <target name="c.build.newt" depends="c.configure,c.build.newt.prepare,c.build.newt.natives">
-      <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true">
-          <param name="libdir" value="${obj.newt}"/>
-      </antcall>
-
       <antcall target="c.manifest" inheritRefs="true" />
     </target>
 
@@ -567,7 +569,7 @@
     <!--
        - Build the newt.jar files.
       -->
-    <target name="build-jars" depends="gluegen.cpptasks.detect.os,build-jars-javase,build-jars-cdc" />
+    <target name="build-jars" depends="gluegen.cpptasks.detect.os,build-jars-javase" />
 
     <target name="setup-manifestfile">
         <property name="manifestfile" value="newtversion"/>
@@ -583,20 +585,6 @@
         </copy>
     </target>
 
-    <target name="setup-manifestfile-cdc">
-        <property name="manifestfile" value="newtversion-cdc"/>
-        <copy file="${manifestfile}"
-          tofile="tempversion-cdc"
-          overwrite="true">
-          <filterset>
-              <filter token="VERSION" value="${newt.version}"/>
-              <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
-              <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
-              <filter token="BASEVERSION" value="${newt_base_version}"/>
-          </filterset>
-        </copy>
-    </target>
-
     <target name="build-jars-awt" depends="setup-manifestfile" unless="setup.noAWT">
         <jar manifest="tempversion" destfile="${newt.awt.jar}" filesonly="true">
             <fileset dir="${classes}"
@@ -609,32 +597,14 @@
             <fileset dir="${classes}"
                      includes="${java.part.opengl}"/>
         </jar>
-        <jar manifest="tempversion" destfile="${newt.broadcomegl.jar}" filesonly="true">
+        <jar manifest="tempversion" destfile="${newt.hw.broadcomegl.jar}" filesonly="true">
             <fileset dir="${classes}"
                      includes="${java.part.broadcomegl}"/>
         </jar>
     </target>
 
     <target name="build-jars-driver" depends="setup-manifestfile">
-        <jar manifest="tempversion" destfile="${newt.intelgdl.jar}" filesonly="true">
-            <fileset dir="${classes}"
-                     includes="${java.part.intelgdl}"/>
-        </jar>
-    </target>
-
-    <target name="build-jars-opengl-cdc" depends="setup-manifestfile-cdc" unless="setup.noOpenGL">
-        <jar manifest="tempversion-cdc" destfile="${newt.ogl.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.opengl}"/>
-        </jar>
-        <jar manifest="tempversion-cdc" destfile="${newt.broadcomegl.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.broadcomegl}"/>
-        </jar>
-    </target>
-
-    <target name="build-jars-driver-cdc" depends="setup-manifestfile-cdc">
-        <jar manifest="tempversion-cdc" destfile="${newt.intelgdl.cdc.jar}" filesonly="true">
+        <jar manifest="tempversion" destfile="${newt.hw.intelgdl.jar}" filesonly="true">
             <fileset dir="${classes}"
                      includes="${java.part.intelgdl}"/>
         </jar>
@@ -655,45 +625,32 @@
         </jar>
     </target>
 
-    <target name="build-jars-desktop-cdc" depends="setup-manifestfile-cdc" unless="setup.nodesktop">
-        <jar manifest="tempversion-cdc" destfile="${newt.os.x11.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.x11}"/>
-        </jar>
-        <jar manifest="tempversion-cdc" destfile="${newt.os.win.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.windows}"/>
-        </jar>
-        <jar manifest="tempversion-cdc" destfile="${newt.os.osx.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.macosx}"/>
-        </jar>
-    </target>
-
     <target name="build-jars-all-awt" depends="setup-manifestfile" unless="setup.noAWT">
         <jar manifest="tempversion" destfile="${newt.all.jar}" filesonly="true">
-            <fileset dir="${classes}"
-                     includes="com/jogamp/newt/**" />
+            <fileset dir="${classes}">
+                <include name="com/jogamp/newt/**" />
+                <include name="jogamp/newt/**" />
+            </fileset>
         </jar>
         <jar manifest="tempversion" destfile="${newt.event.jar}" filesonly="true">
-            <fileset dir="${classes}"
-                     includes="com/jogamp/newt/Display* com/jogamp/newt/Screen* com/jogamp/newt/Window* com/jogamp/newt/ScreenMode* com/jogamp/newt/event/** com/jogamp/newt/impl/Debug*" />
+            <fileset dir="${classes}">
+                <include name="com/jogamp/newt/Display*" />
+                <include name="com/jogamp/newt/Screen*" />
+                <include name="com/jogamp/newt/Window*" />
+                <include name="com/jogamp/newt/ScreenMode*" />
+                <include name="com/jogamp/newt/event/**" />
+                <include name="jogamp/newt/Debug*" />
+            </fileset>
         </jar>
     </target>
 
     <target name="build-jars-all-noawt" depends="setup-manifestfile">
         <jar manifest="tempversion" destfile="${newt.all-noawt.jar}" filesonly="true">
             <fileset dir="${classes}"
-                     includes="com/jogamp/newt/**"
-                     excludes="${java.part.awt}" />
-        </jar>
-    </target>
-
-    <target name="build-jars-all-cdc" depends="setup-manifestfile-cdc">
-        <jar manifest="tempversion-cdc" destfile="${newt.all.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="com/jogamp/newt/**"
-                     excludes="${java.excludes.cdcfp}" />
+                     excludes="${java.part.awt}">
+                <include name="com/jogamp/newt/**" />
+                <include name="jogamp/newt/**" />
+            </fileset>
         </jar>
     </target>
 
@@ -710,19 +667,6 @@
         <delete file="tempversion"/>
     </target>
 
-    <target name="build-jars-cdc" depends="setup-manifestfile-cdc,build-jars-opengl-cdc,build-jars-all-cdc,build-jars-desktop-cdc,build-jars-driver-cdc" unless="setup.noCDC">
-        <jar manifest="tempversion-cdc" destfile="${newt.core.cdc.jar}" filesonly="true">
-            <fileset dir="${classes-cdc}"
-                     includes="${java.part.core}"/>
-        </jar>
-        <jar manifest="tempversion-cdc" destfile="${build.newt}/newt-natives-${os.and.arch}-cdc.jar" filesonly="true">
-            <fileset dir="${obj.newt}">
-              <include name="*.${native.library.suffix-cdc}" />
-            </fileset>
-        </jar>
-        <delete file="tempversion-cdc"/>
-    </target>
-
     <!-- ================================================================== -->
     <!--
        - Build the Javadocs for the sources.
@@ -737,7 +681,7 @@
                  sourcepath="${src.java};${src.generated.java}"
                  destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}"
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  linkoffline="${javadoc.link} 142-packages"
          bottom="${javadoc.bottom}" >
          <classpath refid="nativewindow_gluegen_jogl.classpath"/>
@@ -751,7 +695,7 @@
                  sourcepath="${src.java};${src.generated.java}"
                  destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}"
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  linkoffline="${javadoc.link} 142-packages"
                  bottom="${javadoc.bottom}" >
          <classpath refid="nativewindow_gluegen_jogl.classpath"/>
@@ -765,7 +709,7 @@
                  sourcepath="${src.java};${src.generated.java}"
                  destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}"
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  linkoffline="${javadoc.link} 142-packages"
          bottom="${javadoc.bottom}" >
          <classpath refid="nativewindow_gluegen_jogl.classpath"/>
diff --git a/make/build-staticglgen.xml b/make/build-staticglgen.xml
index 968e350..325b737 100644
--- a/make/build-staticglgen.xml
+++ b/make/build-staticglgen.xml
@@ -29,7 +29,7 @@
         <mkdir dir="${classes}" />
 
         <!-- Compile BuildStaticGLInfo -->
-        <javac srcdir="${src.java}" destdir="${classes}" includes="**/BuildStaticGLInfo.java" source="1.4" debug="true" debuglevel="${javacdebuglevel}"
+        <javac srcdir="${src.java}" destdir="${classes}" includes="**/BuildStaticGLInfo.java" source="${target.sourcelevel}" debug="true" debuglevel="${javacdebuglevel}"
                includeAntRuntime="false">
             <classpath refid="antlr.classpath" />
         </javac>
@@ -50,9 +50,9 @@
         <!-- Build the BuildStaticGLInfo ANT task.
            - NOTE:  ONLY the StaticGLGen is built at this time.  BuildStaticGLInfo 
            -        itself is built in a separate task.  -->
-        <javac destdir="${classes}" includes="**/StaticGLGenTask.java" source="1.4" debug="true" debuglevel="${javacdebuglevel}"
+        <javac destdir="${classes}" includes="**/StaticGLGenTask.java" source="${target.sourcelevel}" debug="true" debuglevel="${javacdebuglevel}"
                includeAntRuntime="false">
-	        <src path="${src.java}" />
+            <src path="${src.java}" />
             <classpath refid="classpath" />
         </javac>
         
diff --git a/make/build-test.xml b/make/build-test.xml
new file mode 100644
index 0000000..f996ba2
--- /dev/null
+++ b/make/build-test.xml
@@ -0,0 +1,487 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="JOGLTest" basedir="." default="all">
+
+    <description>JUNIT Tests JOGL</description>
+
+    <import file="build-common.xml"/>
+
+    <taskdef resource="net/sf/antcontrib/antlib.xml">
+      <classpath> <pathelement location="${ant-contrib.jar}"/> </classpath>
+    </taskdef>
+
+    <!-- ================================================================== -->
+    <!-- 
+       - Declare all paths and user defined variables.
+      -->
+    <target name="declare.common" description="Declare properties" depends="common.init">
+        <property name="rootrel.src.test"     value="src/test" />
+        <property name="src.test"             value="${project.root}/${rootrel.src.test}" />
+
+        <property name="classes"              value="${build.test}/classes" />
+        <property name="classes.path"         location="${classes}"/> <!-- absolute path -->
+
+        <property name="java.part.test"       value="com/jogamp/** jogamp/**"/>
+        <property name="java.dir.test"        value="com/jogamp/opengl/test"/>
+        <property name="java.dir.junit"       value="${java.dir.test}/junit"/>
+        <property name="java.dir.bugs"        value="${java.dir.test}/bugs"/>
+
+        <property name="test.archive.name"    value="${archive.name}-test-results-${build.node.name}"/>
+        <condition property="jvmarg.mainthrd" value="-XstartOnFirstThread"><isset property="isOSX"/></condition>
+        <condition property="jvmarg.mainthrd" value="-Ddummy"><not><isset property="isOSX"/></not></condition>
+        <condition property="jvmarg.headless" value="-XstartOnFirstThread -Djava.awt.headless=true"><isset property="isOSX"/></condition>
+        <condition property="jvmarg.headless" value="-Djava.awt.headless=true"><not><isset property="isOSX"/></not></condition>
+
+        <property name="batchtest.timeout"    value="1800000"/> <!-- 30 min -->
+    </target>
+    
+    <!-- ================================================================== -->
+    <!--
+       - Clean up all that is built.
+      -->
+    <target name="clean" description="Remove all build products" depends="declare.common">
+        <delete includeEmptyDirs="true" quiet="true">
+            <fileset dir="${build.test}" />
+        </delete>
+    </target>
+
+    <!-- ================================================================== -->
+    <!--
+       - Build/run tests/junit.
+      -->
+    <target name="test.compile.check" depends="declare.common">
+      <!-- Create the required output directories. -->
+      <mkdir dir="${obj.test}" />
+      <mkdir dir="${classes}" />
+
+      <!-- Clean the results -->
+      <delete quiet="true">
+        <fileset dir="${results.test}" includes="**"/>
+        <fileset file="${build}/${test.archive.name}.7z"/>
+      </delete>
+      <mkdir dir="${results.test}" />
+
+      <property name="jogl.test.jar.path" location="${jogl.test.jar}"/> <!-- absolute path -->
+      <echo message="jogl.test.jar ${jogl.test.jar.path}"/>
+      <uptodate property="test.compile.skip">
+        <srcfiles dir= "."                 includes="*.xml"/>
+        <srcfiles dir= "${src.test}"       includes="**"/>
+        <srcfiles                          file="${nativewindow.all.jar}" />
+        <srcfiles                          file="${jogl.all.jar}" />
+        <srcfiles                          file="${newt.all.jar}" />
+        <srcfiles                          file="${gluegen.jar}" />
+        <mapper type="merge" to="${jogl.test.jar.path}"/>
+      </uptodate>
+    </target>
+
+    <target name="test.compile" depends="test.compile.check" unless="test.compile.skip">
+        <!-- Perform the junit pass Java compile -->
+        <javac destdir="${classes}"
+               source="${host.sourcelevel}"
+               fork="yes"
+               memoryMaximumSize="${javac.memorymax}"
+               includeAntRuntime="false"
+               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+            <classpath refid="junit_jogl_newt.compile.classpath"/>
+            <src path="${src.test}" />
+        </javac>
+        <jar destfile="${jogl.test.jar}" filesonly="true">
+            <!-- get all class files, but skip any resource files that external tools
+                 might have copied into the class directory (otherwise, it's possible
+                 to get the same resource file twice in the jar) -->
+            <fileset dir="${classes}"
+                includes="${java.part.test}"/>
+            <!-- include any resource files that tests may requre -->
+            <fileset dir="${src.test}">
+                <exclude name="**/*.java"/>
+            </fileset>
+        </jar>
+    </target>
+
+    <target name="test.manual.run" depends="test.compile">
+        <for param="test.class.path.m" keepgoing="true">
+            <!-- results in absolute path -->
+            <fileset dir="${classes}">
+                <include name="${java.dir.bugs}/**/*Test*"/>
+                <exclude name="**/*$$*"/>
+            </fileset>
+          <sequential>
+            <var name="test.class.path" unset="true"/>
+            <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
+            <var name="test.class.fqn" unset="true"/>
+            <pathconvert property="test.class.fqn">
+              <fileset file="${classes}${file.separator}${test.class.path}"/>
+              <chainedmapper>
+                  <globmapper    from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
+                  <packagemapper from="*.class"           to="*"/> <!-- FQCN -->
+              </chainedmapper>
+            </pathconvert>
+            <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.log"/>
+            <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
+            <apply dir="." executable="${java.home}/bin/java" 
+                 parallel="false" 
+                 timeout="${batchtest.timeout}"
+                 vmlauncher="false"
+                 relative="true"
+                 failonerror="false"
+                 output="${test.class.result.file}">
+                <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+                <env key="CLASSPATH" value="${junit_jogl_newt_awt.run.jars}"/>
+                <arg value="-Djava.library.path=${obj.all.paths}"/>
+                <!--
+                <arg line="-Dnewt.debug.EDT"/>
+                -->
+                <srcfile/>
+                <mappedresources>
+                    <fileset dir="${classes}" includes="${test.class.path}"/>
+                    <packagemapper from="*.class" to="*"/>
+                </mappedresources>
+            </apply>
+          </sequential>
+        </for>
+        <antcall target="test-zip-archive" inheritRefs="true" inheritAll="true"/>
+    </target>
+
+    <target name="junit.run.noui" depends="test.compile">
+        <!-- Test*NOUI* -->
+        <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
+            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>
+
+            <!--
+            <jvmarg value="-Djogl.debug=all"/>
+            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
+            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
+            <jvmarg value="-Djogl.debug.GLSLState"/>
+            <jvmarg value="-Dnativewindow.debug=all"/>
+            <jvmarg value="-verbose:jni"/> 
+            <jvmarg value="-client"/>
+            <jvmarg value="-d32"/>
+            -->
+
+            <formatter usefile="false" type="plain"/>
+            <formatter usefile="true" type="xml"/>
+            <classpath refid="junit_jogl_awt.run.classpath"/>
+
+            <batchtest todir="${results.test}">
+              <fileset dir="${classes}">
+                  <include name="${java.dir.junit}/**/Test*NOUI*"/>
+                  <exclude name="**/*$$*"/>
+              </fileset>
+              <formatter usefile="false" type="brief"/>
+              <formatter usefile="true" type="xml"/>
+            </batchtest>
+        </junit>
+    </target>
+
+    <!-- NEWT is currently not supported on OSX -->
+    <target name="junit.run.newt.headless" depends="test.compile" unless="isOSX">
+        <!-- Test*NEWT* 
+
+             Emulation of junit task,
+             due to the fact that we have to place invoke our MainThread class first (-> MacOSX).
+
+             Utilizing Ant-1.8.0 and ant-contrib-1.0b3 (loops, mutable properties).
+          --> 
+        <for param="test.class.path.m" keepgoing="true">
+            <!-- results in absolute path -->
+            <fileset dir="${classes}">
+                <include name="${java.dir.junit}/**/Test*NEWT*"/>
+                <exclude name="**/*$$*"/>
+            </fileset>
+          <sequential>
+            <var name="test.class.path" unset="true"/>
+            <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
+            <var name="test.class.fqn" unset="true"/>
+            <pathconvert property="test.class.fqn">
+              <fileset file="${classes}${file.separator}${test.class.path}"/>
+              <chainedmapper>
+                  <globmapper    from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
+                  <packagemapper from="*.class"           to="*"/> <!-- FQCN -->
+              </chainedmapper>
+            </pathconvert>
+            <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.xml"/>
+            <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
+            <apply dir="." executable="${java.home}/bin/java" 
+                 parallel="false" 
+                 timeout="${batchtest.timeout}"
+                 vmlauncher="false"
+                 relative="true"
+                 failonerror="false">
+                <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+                <env key="CLASSPATH" value="${junit_jogl_newt.run.jars}"/>
+                <arg value="-Djava.library.path=${obj.all.paths}"/>
+                <arg line="${jvmarg.headless}"/>
+                <!--
+                <arg line="-Dnewt.debug.EDT"/>
+                -->
+                <arg line="com.jogamp.newt.util.MainThread"/>
+                <arg line="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner"/>
+                <srcfile/>
+                <arg line="filtertrace=true"/>
+                <arg line="haltOnError=false"/>
+                <arg line="haltOnFailure=false"/>
+                <arg line="showoutput=true"/>
+                <arg line="outputtoformatters=true"/>
+                <arg line="logfailedtests=true"/>
+                <arg line="logtestlistenerevents=true"/>
+                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter"/>
+                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.class.result.file}"/>
+                <mappedresources>
+                    <fileset dir="${classes}" includes="${test.class.path}"/>
+                    <packagemapper from="*.class" to="*"/>
+                </mappedresources>
+            </apply>
+          </sequential>
+        </for>
+    </target>
+
+    <!-- junit.run.newt is covered by junit.run.newt.headless, disable it for now, but may be checked manually.
+         This test target would also overwrite the test result XML files, we would also need a solution here for hudson,
+         if run in parallel.
+         NEWT is currently not supported on OSX 
+      -->
+    <target name="junit.run.newt" depends="test.compile" unless="isOSX">
+        <!-- Test*NEWT* -->
+        <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
+            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>
+
+            <!--
+            <jvmarg value="-Dnewt.debug.EDT"/>
+            <jvmarg value="-Djogl.debug=all"/>
+            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
+            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
+            <jvmarg value="-Djogl.debug.GLSLState"/>
+            <jvmarg value="-Dnativewindow.debug=all"/>
+            <jvmarg value="-Dnewt.debug=all"/>
+            <jvmarg value="-verbose:jni"/> 
+            <jvmarg value="-client"/>
+            <jvmarg value="-d32"/>
+            -->
+
+            <formatter usefile="false" type="plain"/>
+            <formatter usefile="true" type="xml"/>
+            <classpath refid="junit_jogl_newt.run.classpath"/>
+
+            <batchtest todir="${results.test}">
+              <fileset dir="${classes}">
+                  <include name="${java.dir.junit}/**/Test*NEWT*"/>
+                  <exclude name="**/*$$*"/>
+              </fileset>
+              <formatter usefile="false" type="brief"/>
+              <formatter usefile="true" type="xml"/>
+            </batchtest>
+        </junit>
+    </target>
+
+    <target name="junit.run.awt" depends="test.compile">
+        <!-- Test*AWT* -->
+        <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
+            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>
+
+            <!--
+            <jvmarg value="-Djogl.debug=all"/>
+            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
+            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
+            <jvmarg value="-Djogl.debug.GLSLState"/>
+            <jvmarg value="-Dnativewindow.debug=all"/>
+            <jvmarg value="-verbose:jni"/> 
+            <jvmarg value="-client"/>
+            <jvmarg value="-d32"/>
+            -->
+
+            <formatter usefile="false" type="plain"/>
+            <formatter usefile="true" type="xml"/>
+            <classpath refid="junit_jogl_awt.run.classpath"/>
+
+            <batchtest todir="${results.test}">
+              <fileset dir="${classes}">
+                  <include name="${java.dir.junit}/**/Test*AWT*"/>
+                  <exclude name="**/*$$*"/>
+                  <exclude name="**/*SWT*"/>
+                  <exclude name="**/newt/**"/>
+              </fileset>
+              <formatter usefile="false" type="brief"/>
+              <formatter usefile="true" type="xml"/>
+            </batchtest>
+        </junit>
+    </target>
+
+    <target name="junit.run.awt.singletest" depends="test.compile">
+        <!-- Test*AWT* -->
+        <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
+            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>
+
+            <!--
+            <jvmarg value="-Djogl.debug=all"/>
+            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
+            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
+            <jvmarg value="-Djogl.debug.GLSLState"/>
+            <jvmarg value="-Dnativewindow.debug=all"/>
+            <jvmarg value="-verbose:jni"/> 
+            <jvmarg value="-client"/>
+            <jvmarg value="-d32"/>
+            -->
+
+            <formatter usefile="false" type="plain"/>
+            <formatter usefile="true" type="xml"/>
+            <classpath refid="junit_jogl_newt_awt.run.classpath"/>
+
+            <test name="${testclass}"/>
+        </junit>
+    </target>
+
+    <target name="junit.run.swt.headless" depends="test.compile" description="Runs all pure SWT tests.">
+        <!-- Test*SWT* 
+
+             Emulation of junit task,
+             due to the fact that we have to place invoke our MainThread class first (-> MacOSX).
+
+             Utilizing Ant-1.8.0 and ant-contrib-1.0b3 (loops, mutable properties).
+          --> 
+        <for param="test.class.path.m" keepgoing="true">
+            <!-- results in absolute path -->
+            <fileset dir="${classes}">
+                <include name="${java.dir.junit}/**/Test*SWT*"/>
+                <exclude name="**/*$$*"/>
+                <exclude name="**/*AWT*"/>
+                <exclude name="**/newt/**"/>
+            </fileset>
+          <sequential>
+            <var name="test.class.path" unset="true"/>
+            <property name="test.class.path" basedir="${classes}" relative="true" location="@{test.class.path.m}"/>
+            <var name="test.class.fqn" unset="true"/>
+            <pathconvert property="test.class.fqn">
+              <fileset file="${classes}${file.separator}${test.class.path}"/>
+              <chainedmapper>
+                  <globmapper    from="${classes.path}${file.separator}*" to="*"/> <!-- rel. -->
+                  <packagemapper from="*.class"           to="*"/> <!-- FQCN -->
+              </chainedmapper>
+            </pathconvert>
+            <var name="test.class.result.file" value="${results.test}/TEST-${test.class.fqn}.xml"/>
+            <echo message="Testing ${test.class.fqn} -- ${test.class.result.file}"/>
+            <apply dir="." executable="${java.home}/bin/java" 
+                 parallel="false" 
+                 timeout="${batchtest.timeout}"
+                 vmlauncher="false"
+                 relative="true"
+                 failonerror="false">
+                <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+                <env key="CLASSPATH" value="${junit_jogl_swt.run.jars}"/>
+                <arg value="-Djava.library.path=${obj.all.paths}"/>
+                <arg line="${jvmarg.headless}"/>
+                <!--
+                <arg line="-Dnewt.debug.EDT"/>
+                -->
+                <arg line="com.jogamp.newt.util.MainThread"/>
+                <arg line="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner"/>
+                <srcfile/>
+                <arg line="filtertrace=true"/>
+                <arg line="haltOnError=false"/>
+                <arg line="haltOnFailure=false"/>
+                <arg line="showoutput=true"/>
+                <arg line="outputtoformatters=true"/>
+                <arg line="logfailedtests=true"/>
+                <arg line="logtestlistenerevents=true"/>
+                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter"/>
+                <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.class.result.file}"/>
+                <mappedresources>
+                    <fileset dir="${classes}" includes="${test.class.path}"/>
+                    <packagemapper from="*.class" to="*"/>
+                </mappedresources>
+            </apply>
+          </sequential>
+        </for>
+    </target>
+
+    <target name="junit.run.swt.awt" depends="test.compile" description="Runs all SWT_AWT tests.">
+      <!-- Test*SWT* -->
+      <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
+          <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+          <jvmarg value="-Djava.library.path=${obj.all.paths}"/>
+          <jvmarg value="${jvmarg.mainthrd}"/>
+
+          <!--
+          <jvmarg value="-Djogl.debug=all"/>
+          <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
+          <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
+          <jvmarg value="-Djogl.debug.GLSLState"/>
+          <jvmarg value="-Dnativewindow.debug=all"/>
+          <jvmarg value="-verbose:jni"/> 
+          <jvmarg value="-client"/>
+          <jvmarg value="-d32"/>
+          -->
+
+          <formatter usefile="false" type="plain"/>
+          <formatter usefile="true" type="xml"/>
+          <classpath refid="junit_jogl_swt.run.classpath"/>
+
+          <batchtest todir="${results.test}">
+            <fileset dir="${classes}">
+                <include name="${java.dir.junit}/**/Test*SWT*AWT*"/>
+                <exclude name="**/*$$*"/>
+                <exclude name="**/newt/**"/>
+            </fileset>
+            <formatter usefile="false" type="brief"/>
+            <formatter usefile="true" type="xml"/>
+          </batchtest>
+      </junit>
+    </target>
+
+    <!-- NEWT is currently not supported on OSX -->
+    <target name="junit.run.newt.awt" depends="test.compile" unless="isOSX">
+        <!-- Test*AWT* -->
+        <junit forkmode="perTest" showoutput="true" fork="true" haltonerror="off" timeout="${batchtest.timeout}">
+            <env key="${system.env.library.path}" path="${obj.all.paths}"/>
+            <jvmarg value="-Djava.library.path=${obj.all.paths}"/>
+
+            <!--
+            <jvmarg value="-Dnewt.debug.EDT"/>
+            <jvmarg value="-Djogl.debug=all"/>
+            <jvmarg value="-Dgluegen.debug.NativeLibrary=true"/>
+            <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/>
+            <jvmarg value="-Djogl.debug.GLSLState"/>
+            <jvmarg value="-Dnativewindow.debug=all"/>
+            <jvmarg value="-Dnewt.debug=all"/>
+            <jvmarg value="-verbose:jni"/> 
+            <jvmarg value="-client"/>
+            <jvmarg value="-d32"/>
+            -->
+
+            <formatter usefile="false" type="plain"/>
+            <formatter usefile="true" type="xml"/>
+            <classpath refid="junit_jogl_newt_awt.run.classpath"/>
+
+            <batchtest todir="${results.test}">
+              <fileset dir="${classes}">
+                  <include name="${java.dir.junit}/**/newt/**/Test*AWT*"/>
+                  <exclude name="**/*$$*"/>
+              </fileset>
+              <formatter usefile="false" type="brief"/>
+              <formatter usefile="true" type="xml"/>
+            </batchtest>
+        </junit>
+    </target>
+
+    <target name="test.auto.run" depends="junit.run"/>
+    <target name="junit.run" depends="junit.run.noui,junit.run.newt.headless,junit.run.awt,junit.run.newt.awt,junit.run.swt.headless,junit.run.swt.awt">
+        <antcall target="test-zip-archive" inheritRefs="true" inheritAll="true"/>
+    </target>
+
+    <!-- updates / create the test results zip file -->
+    <target name="test-zip-archive" depends="declare.common">
+        <archive.7z destfile="${build}/${test.archive.name}.7z"
+                    basedir="${results.test}" 
+                    includes="**" />
+    </target>
+
+    <!-- ================================================================== -->
+    <!--
+       - Build everything.
+      -->
+    <target name="all" description="Build JOGL JUNIT tests" depends="test.compile" />
+
+</project>
diff --git a/make/build.xml b/make/build.xml
index c5bfcdd..d9fdf1e 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -8,16 +8,26 @@
        - Main build target.
       -->
 
-    <target name="all" description="Build nativewindow, jogl and newt projects, incl. all junit tests " depends="init,build.nativewindow,build.jogl,build.newt,junit.compile,one.dir,tag.build,developer-zip-archive" />
+    <target name="all" description="Build nativewindow, jogl and newt projects, incl. all junit tests " depends="init,build.nativewindow,build.jogl,build.newt,test.compile,one.dir,tag.build,developer-zip-archive" />
 
-    <target name="all.but-archives" description="Build nativewindow, jogl and newt projects, incl. all junit tests " depends="init,build.nativewindow,build.jogl,build.newt,junit.compile,one.dir,tag.build" />
+    <target name="all.but-archives" description="Build nativewindow, jogl and newt projects, incl. all junit tests " depends="init,build.nativewindow,build.jogl,build.newt,test.compile,one.dir,tag.build" />
 
-    <target name="junit.compile">
-      <ant antfile="build-junit.xml" target="junit.compile" inheritRefs="true" inheritAll="true"/>
+    <target name="all.ide" description="Build nativewindow, jogl and newt projects, including all junit tests, but don't copy libs or JARs or tag the build" depends="init,build.nativewindow,build.jogl,build.newt,test.compile" />
+
+    <target name="test.compile">
+      <ant antfile="build-test.xml" target="test.compile" inheritRefs="true" inheritAll="true"/>
+    </target>
+
+    <target name="test.auto.run" description="Run automated tests (junit and others) in nativewindow, jogl and newt projects">
+      <ant antfile="build-test.xml" target="test.auto.run" inheritRefs="true" inheritAll="true"/>
     </target>
 
-    <target name="junit.run" description="Run JUNIT tests in nativewindow, jogl and newt projects">
-      <ant antfile="build-junit.xml" target="junit.run" inheritRefs="true" inheritAll="true"/>
+    <target name="junit.run" description="Run automated junit tests in nativewindow, jogl and newt projects">
+      <ant antfile="build-test.xml" target="junit.run" inheritRefs="true" inheritAll="true"/>
+    </target>
+
+    <target name="test.manual.run" description="Run manual operated tests in nativewindow, jogl and newt projects">
+      <ant antfile="build-test.xml" target="test.manual.run" inheritRefs="true" inheritAll="true"/>
     </target>
 
     <target name="javadoc.all.zip" depends="javadoc.init, javadoc.all, javadoc.zip"/>
@@ -29,8 +39,9 @@
     <target name="javadoc.spec" description="Build Specifications JOGL and Nativewindow" 
                                 depends="javadoc.init, javadoc.nw.spec, javadoc.jogl.spec" />
 
+    <!-- excluded javadoc.dev due to time consumption -->
     <target name="javadoc.all" description="Build all NativeWindow, JOGL and NEWT docs" 
-                               depends="javadoc.init, javadoc.nw.spec, javadoc.jogl.spec, javadoc.public, javadoc.dev"/>
+                               depends="javadoc.init, javadoc.nw.spec, javadoc.jogl.spec, javadoc.public"/>
 
     <target name="clean" depends="init">
         <ant antfile="${nativewindow.build.xml}" dir="${nativewindow.make}" target="clean" inheritRefs="true" inheritAll="true"/>
@@ -64,10 +75,10 @@
         <delete includeEmptyDirs="true" quiet="true" dir="${lib}" failonerror="false" />
         <mkdir dir="${lib}" />
         <copy todir="${lib}">
-            <fileset dir="${gluegen.root}/${rootrel.build}/obj" includes="*.${native.library.suffix} *.${native.library.suffix-cdc}" />
-            <fileset dir="${build}/jogl/obj" includes="*.${native.library.suffix} *.${native.library.suffix-cdc}" />
-            <fileset dir="${build}/nativewindow/obj" includes="*.${native.library.suffix} *.${native.library.suffix-cdc}" />
-            <fileset dir="${build}/newt/obj" includes="*.${native.library.suffix} *.${native.library.suffix-cdc}" />
+            <fileset dir="${gluegen.root}/${rootrel.build}/obj" includes="*.${native.library.suffix}" />
+            <fileset dir="${build}/jogl/obj" includes="*.${native.library.suffix}" />
+            <fileset dir="${build}/nativewindow/obj" includes="*.${native.library.suffix}" />
+            <fileset dir="${build}/newt/obj" includes="*.${native.library.suffix}" />
         </copy>
     </target>
 
@@ -107,7 +118,7 @@
        - This must be called after all of the build targets complete.
       -->
 
-    <target name="developer-zip-archive" depends="init" unless="build.noarchives">
+    <target name="developer-zip-archive" depends="init" if="build.archiveon">
         <delete includeEmptyDirs="true" quiet="true" dir="${archive}" failonerror="false" />
         <mkdir dir="${archive}" />
         <copy file="${build}/artifact.properties" todir="${archive}" />
@@ -140,8 +151,7 @@
         <copy todir="${archive}/etc">
             <fileset dir="${project.root}/etc" includes="*" />
         </copy>
-        <delete quiet="true" file="${build}/${archive.name}.zip"/>
-        <zip destfile="${build}/${archive.name}.zip"
+        <archive.7z destfile="${build}/${archive.name}.7z"
              basedir="${build}"
              includes="${archive.name}/**" />
         <!-- Clean up after ourselves -->
@@ -177,9 +187,6 @@
     </target>
 
     <target name="javadoc.init" depends="init">
-        <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" />
-        <!--property name="javadoc.link" value="http://download.oracle.com/javase/1.4.2/docs/api/"/-->
-
         <!-- Link offline with relative URLs does not work.
              Link online with relative URLs works, 
              so we have to assume the same relative online folder structure:
@@ -226,11 +233,11 @@
         <property name="javadoc.spec.packagenames" value="javax.media.opengl.*" />
 
         <property name="javadoc.windowtitle" value="JOGL, NativeWindow and NEWT APIs" />
-        <property name="javadoc.packagenames" value="${javadoc.nw.spec.packagenames}, ${javadoc.spec.packagenames}, com.jogamp.opengl, com.jogamp.opengl.util.*, com.jogamp.nativewindow, com.jogamp.newt, com.jogamp.newt.event.*, com.jogamp.newt.opengl" />
+        <property name="javadoc.packagenames" value="${javadoc.nw.spec.packagenames}, ${javadoc.spec.packagenames}, com.jogamp.opengl.*, com.jogamp.nativewindow.*, com.jogamp.newt.*" />
 
-        <property name="javadoc.dev.packagenames" value="${javadoc.packagenames}, com.jogamp.opengl.*, com.jogamp.nativewindow.*, com.jogamp.newt.*, com.jogamp.gluegen.opengl.*, com.jogamp.gluegen.runtime.opengl.*" />
+        <property name="javadoc.dev.packagenames" value="${javadoc.packagenames}, com.jogamp.opengl.*, com.jogamp.nativewindow.*, com.jogamp.newt.*, com.jogamp.gluegen.opengl.*, com.jogamp.gluegen.runtime.opengl.*, jogamp.nativewindow.*, jogamp.opengl.*, jogamp.newt.*" />
 
-        <property name="java.excludes.javadoc.packagenames" value="com.jogamp.opengl.impl.gl2.fixme.*,com.jogamp.audio.windows.waveout.TestSpatialization"/>
+        <property name="java.excludes.javadoc.packagenames" value="jogamp.opengl.gl2.fixme.*,com.jogamp.audio.windows.waveout.TestSpatialization"/>
         <property name="javadoc.bottom" value="Copyright 2010 JogAmp Community." />
     </target>
 
@@ -244,7 +251,7 @@
                  windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}" 
                  access="public"
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  maxmemory="1024m"
                  bottom="${javadoc.bottom}" >
             <classpath refid="jogl_newt_all.classpath"/>
@@ -265,7 +272,7 @@
                  windowtitle="${javadoc.spec.windowtitle}"
                  overview="${javadoc.overview}"
                  access="public"
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  maxmemory="1024m"
                  bottom="${javadoc.bottom}" >
             <classpath refid="jogl_newt_all.classpath"/>
@@ -287,7 +294,7 @@
                  windowtitle="${javadoc.windowtitle}"
                  overview="${javadoc.overview}" 
                  access="protected"
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  maxmemory="1024m"
                  bottom="${javadoc.bottom}" >
             <classpath refid="jogl_newt_all.classpath"/>
@@ -308,7 +315,7 @@
                  windowtitle="${javadoc.nw.spec.windowtitle}"
                  overview="${javadoc.nw.overview}"
                  access="public"
-                 source="1.4"
+                 source="${target.sourcelevel}"
                  maxmemory="1024m"
                  bottom="${javadoc.bottom}" >
             <classpath refid="jogl_newt_all.classpath"/>
@@ -320,7 +327,7 @@
     </target>
                                                                                                                                    
     <target name="javadoc.zip" depends="javadoc.init">
-        <zip destfile="${build}/javadoc.zip"
+        <archive.7z destfile="${build}/javadoc.7z"
              basedir="${javadoc.root.path}"
              includes="jogl/**" />
     </target>
diff --git a/make/config/jogl/cg-common-CustomJavaCode.java b/make/config/jogl/cg-common-CustomJavaCode.java
index cdaa6f2..31d1961 100644
--- a/make/config/jogl/cg-common-CustomJavaCode.java
+++ b/make/config/jogl/cg-common-CustomJavaCode.java
@@ -1,12 +1,12 @@
-private static DynamicLookupHelper cgDynamicLookupHelper;
-private static CgProcAddressTable cgProcAddressTable;
+private static final DynamicLibraryBundle cgDynamicLookupHelper;
+private static final CgProcAddressTable cgProcAddressTable;
 
 static {
     cgProcAddressTable = new CgProcAddressTable();
     if(null==cgProcAddressTable) {
       throw new RuntimeException("Couldn't instantiate CgProcAddressTable");
     }
-    DynamicLibraryBundle cgDynamicLookupHelper = new DynamicLibraryBundle(new CgDynamicLibraryBundleInfo());
+    cgDynamicLookupHelper = new DynamicLibraryBundle(new CgDynamicLibraryBundleInfo());
     if(null==cgDynamicLookupHelper) {
       throw new RuntimeException("Null CgDynamicLookupHelper");
     }
diff --git a/make/config/jogl/cg-common.cfg b/make/config/jogl/cg-common.cfg
index 45bba95..7ec4739 100644
--- a/make/config/jogl/cg-common.cfg
+++ b/make/config/jogl/cg-common.cfg
@@ -101,7 +101,7 @@ Ignore cgGetParameterValues
 Ignore cgGetProgramOptions
 
 # And NativeLibLoader for help loading the native libraries
-Import com.jogamp.opengl.impl.*
+Import jogamp.opengl.*
 Import com.jogamp.common.os.DynamicLookupHelper
 Import com.jogamp.common.os.DynamicLibraryBundle
 Import com.jogamp.opengl.cg.CgDynamicLibraryBundleInfo
diff --git a/make/config/jogl/cgl-macosx.cfg b/make/config/jogl/cgl-macosx.cfg
index 2b28d3c..38034a7 100644
--- a/make/config/jogl/cgl-macosx.cfg
+++ b/make/config/jogl/cgl-macosx.cfg
@@ -3,7 +3,7 @@
 JavaOutputDir gensrc/classes
 NativeOutputDir gensrc/native/jogl/MacOSX
 
-Package com.jogamp.opengl.impl.macosx.cgl
+Package jogamp.opengl.macosx.cgl
 JavaClass CGL
 Style AllStatic
 Include gl-common.cfg
diff --git a/make/config/jogl/cglext.cfg b/make/config/jogl/cglext.cfg
index 404a852..721fe91 100644
--- a/make/config/jogl/cglext.cfg
+++ b/make/config/jogl/cglext.cfg
@@ -6,10 +6,10 @@
 JavaOutputDir gensrc/classes
 NativeOutputDir gensrc/native/jogl/MacOSX
 
-Package com.jogamp.opengl.impl.macosx.cgl
+Package jogamp.opengl.macosx.cgl
 Style InterfaceAndImpl
 JavaClass CGLExt
-ImplPackage com.jogamp.opengl.impl.macosx.cgl
+ImplPackage jogamp.opengl.macosx.cgl
 ImplJavaClass CGLExtImpl
 Include gl-common.cfg
 Include gl-desktop.cfg
diff --git a/make/config/jogl/egl-common.cfg b/make/config/jogl/egl-common.cfg
index fd65d5c..da0e332 100644
--- a/make/config/jogl/egl-common.cfg
+++ b/make/config/jogl/egl-common.cfg
@@ -7,7 +7,7 @@ GLHeader EGL/eglext.h
 Import java.util.*
 Import javax.media.opengl.*
 Import javax.media.opengl.fixedfunc.*
-Import com.jogamp.opengl.impl.*
+Import jogamp.opengl.*
 
 # Treat all of the EGL types as opaque longs
 # Opaque long EGLConfig
diff --git a/make/config/jogl/egl.cfg b/make/config/jogl/egl.cfg
index c194de2..ea299bf 100644
--- a/make/config/jogl/egl.cfg
+++ b/make/config/jogl/egl.cfg
@@ -3,7 +3,7 @@
 JavaOutputDir gensrc/classes
 NativeOutputDir gensrc/native/jogl/egl
 
-Package com.jogamp.opengl.impl.egl
+Package jogamp.opengl.egl
 JavaClass EGL
 Style AllStatic
 # Shouldn't matter which one of these we pick up
diff --git a/make/config/jogl/eglext.cfg b/make/config/jogl/eglext.cfg
index 3b46aca..3af90d3 100644
--- a/make/config/jogl/eglext.cfg
+++ b/make/config/jogl/eglext.cfg
@@ -3,15 +3,15 @@
 JavaOutputDir gensrc/classes
 NativeOutputDir gensrc/native/jogl/egl
 
-Package com.jogamp.opengl.impl.egl
+Package jogamp.opengl.egl
 Style InterfaceAndImpl
 JavaClass EGLExt
-ImplPackage com.jogamp.opengl.impl.egl
+ImplPackage jogamp.opengl.egl
 ImplJavaClass EGLExtImpl
 # Shouldn't matter which one of these we pick up
 Include egl-common.cfg
 
-ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/jogamp/opengl/impl/egl/EGL.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/jogamp/opengl/egl/EGL.java
 
 HierarchicalNativeOutput false
 
diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg
index 4e72daa..2c59a74 100644
--- a/make/config/jogl/gl-common.cfg
+++ b/make/config/jogl/gl-common.cfg
@@ -11,7 +11,7 @@ UnsupportedExceptionType GLException
 Import java.util.*
 Import javax.media.opengl.*
 Import javax.media.opengl.fixedfunc.*
-Import com.jogamp.opengl.impl.*
+Import jogamp.opengl.*
 
 #####################################################################
 # Mostly desktop OpenGL stuff below
@@ -450,7 +450,7 @@ ArgumentIsString glTransformFeedbackVaryings 2
 #
 JavaPrologue glGetString  if(_context.isExtensionCacheInitialized()) {
 JavaPrologue glGetString    if(GL.GL_EXTENSIONS==name) {
-JavaPrologue glGetString        return _context.getGLExtensions();
+JavaPrologue glGetString        return _context.getGLExtensionsString();
 JavaPrologue glGetString    } /* else if(GL.GL_VERSION==name) {
 JavaPrologue glGetString        return _context.getGLVersion();
 JavaPrologue glGetString    } */
diff --git a/make/config/jogl/gl-es1.cfg b/make/config/jogl/gl-es1.cfg
index 4543b7f..5c69be9 100644
--- a/make/config/jogl/gl-es1.cfg
+++ b/make/config/jogl/gl-es1.cfg
@@ -17,7 +17,7 @@ JavaClass GLES1
 Extends GLES1 GLBase
 Extends GLES1 GL
 Extends GLES1 GL2ES1
-ImplPackage com.jogamp.opengl.impl.es1
+ImplPackage jogamp.opengl.es1
 ImplJavaClass GLES1Impl
 Implements GLES1Impl GLBase
 Implements GLES1Impl GL
diff --git a/make/config/jogl/gl-es2.cfg b/make/config/jogl/gl-es2.cfg
index 9caa3b7..dcdc39b 100644
--- a/make/config/jogl/gl-es2.cfg
+++ b/make/config/jogl/gl-es2.cfg
@@ -12,7 +12,7 @@ JavaClass GLES2
 Extends GLES2 GLBase
 Extends GLES2 GL
 Extends GLES2 GL2ES2
-ImplPackage com.jogamp.opengl.impl.es2
+ImplPackage jogamp.opengl.es2
 ImplJavaClass GLES2Impl
 Implements GLES2Impl GLBase
 Implements GLES2Impl GL
diff --git a/make/config/jogl/gl-gl4bc.cfg b/make/config/jogl/gl-gl4bc.cfg
index 33105d5..06a9c76 100644
--- a/make/config/jogl/gl-gl4bc.cfg
+++ b/make/config/jogl/gl-gl4bc.cfg
@@ -27,7 +27,7 @@ Extends GL4bc GL2
 Extends GL4bc GL3
 Extends GL4bc GL3bc
 Extends GL4bc GL4
-ImplPackage com.jogamp.opengl.impl.gl4
+ImplPackage jogamp.opengl.gl4
 ImplJavaClass GL4bcImpl
 Implements GL4bcImpl GLBase
 Implements GL4bcImpl GL
diff --git a/make/config/jogl/gl-if-gl3.cfg b/make/config/jogl/gl-if-gl3.cfg
index 6682e41..3ccc2c5 100644
--- a/make/config/jogl/gl-if-gl3.cfg
+++ b/make/config/jogl/gl-if-gl3.cfg
@@ -14,7 +14,7 @@ Extends GL3 GLBase
 Extends GL3 GL
 Extends GL3 GL2ES2
 Extends GL3 GL2GL3
-ImplPackage com.jogamp.opengl.impl.gl3
+ImplPackage jogamp.opengl.gl3
 ImplJavaClass GL3Impl
 Implements GL3Impl GLBase
 Implements GL3Impl GL
diff --git a/make/config/jogl/gl-impl-CustomCCode-gl4bc.c b/make/config/jogl/gl-impl-CustomCCode-gl4bc.c
index 778559e..d389db2 100644
--- a/make/config/jogl/gl-impl-CustomCCode-gl4bc.c
+++ b/make/config/jogl/gl-impl-CustomCCode-gl4bc.c
@@ -1,10 +1,10 @@
 /*   Java->C glue code:
- *   Java package: com.jogamp.opengl.impl.gl4.GL4bcImpl
+ *   Java package: jogamp.opengl.gl4.GL4bcImpl
  *    Java method: long dispatch_glMapBuffer(int target, int access)
  *     C function: void * glMapBuffer(GLenum target, GLenum access);
  */
 JNIEXPORT jlong JNICALL 
-Java_com_jogamp_opengl_impl_gl4_GL4bcImpl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+Java_jogamp_opengl_gl4_GL4bcImpl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
   PFNGLMAPBUFFERPROC ptr_glMapBuffer;
   void * _res;
   ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
@@ -14,12 +14,12 @@ Java_com_jogamp_opengl_impl_gl4_GL4bcImpl_dispatch_1glMapBuffer(JNIEnv *env, job
 }
 
 /*   Java->C glue code:
- *   Java package: com.jogamp.opengl.impl.gl4.GL4bcImpl
+ *   Java package: jogamp.opengl.gl4.GL4bcImpl
  *    Java method: long dispatch_glMapNamedBufferEXT(int target, int access)
  *     C function: void * glMapNamedBufferEXT(GLenum target, GLenum access);
  */
 JNIEXPORT jlong JNICALL 
-Java_com_jogamp_opengl_impl_gl4_GL4bcImpl_dispatch_1glMapNamedBufferEXT(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+Java_jogamp_opengl_gl4_GL4bcImpl_dispatch_1glMapNamedBufferEXT(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
   PFNGLMAPNAMEDBUFFEREXTPROC ptr_glMapNamedBufferEXT;
   void * _res;
   ptr_glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC) (intptr_t) glProcAddress;
@@ -29,11 +29,11 @@ Java_com_jogamp_opengl_impl_gl4_GL4bcImpl_dispatch_1glMapNamedBufferEXT(JNIEnv *
 }
 
 /*   Java->C glue code:
- *   Java package: com.jogamp.opengl.impl.gl4.GL4bcImpl
+ *   Java package: jogamp.opengl.gl4.GL4bcImpl
  *    Java method: ByteBuffer newDirectByteBuffer(long addr, long capacity);
  *     C function: jobject newDirectByteBuffer(jlong addr, jlong capacity);
  */
 JNIEXPORT jobject JNICALL
-Java_com_jogamp_opengl_impl_gl4_GL4bcImpl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jlong capacity) {
+Java_jogamp_opengl_gl4_GL4bcImpl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jlong capacity) {
   return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
 }
diff --git a/make/config/jogl/gl-impl-CustomCCode-gles1.c b/make/config/jogl/gl-impl-CustomCCode-gles1.c
index 422935b..0155c13 100644
--- a/make/config/jogl/gl-impl-CustomCCode-gles1.c
+++ b/make/config/jogl/gl-impl-CustomCCode-gles1.c
@@ -1,11 +1,11 @@
 typedef GLvoid* (GL_APIENTRY* PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
 /*   Java->C glue code:
- *   Java package: com.jogamp.opengl.impl.es1.GLES1Impl
+ *   Java package: jogamp.opengl.es1.GLES1Impl
  *    Java method: long dispatch_glMapBuffer(int target, int access)
  *     C function: void * glMapBuffer(GLenum target, GLenum access);
  */
 JNIEXPORT jlong JNICALL 
-Java_com_jogamp_opengl_impl_es1_GLES1Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+Java_jogamp_opengl_es1_GLES1Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
   PFNGLMAPBUFFERPROC ptr_glMapBuffer;
   void * _res;
   ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
@@ -15,11 +15,11 @@ Java_com_jogamp_opengl_impl_es1_GLES1Impl_dispatch_1glMapBuffer(JNIEnv *env, job
 }
 
 /*   Java->C glue code:
- *   Java package: com.jogamp.opengl.impl.es1.GLES1Impl
+ *   Java package: jogamp.opengl.es1.GLES1Impl
  *    Java method: ByteBuffer newDirectByteBuffer(long addr, long capacity);
  *     C function: jobject newDirectByteBuffer(jlong addr, jlong capacity);
  */
 JNIEXPORT jobject JNICALL
-Java_com_jogamp_opengl_impl_es1_GLES1Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jlong capacity) {
+Java_jogamp_opengl_es1_GLES1Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jlong capacity) {
   return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
 }
diff --git a/make/config/jogl/gl-impl-CustomCCode-gles2.c b/make/config/jogl/gl-impl-CustomCCode-gles2.c
index 86fc47b..e140df7 100644
--- a/make/config/jogl/gl-impl-CustomCCode-gles2.c
+++ b/make/config/jogl/gl-impl-CustomCCode-gles2.c
@@ -1,11 +1,11 @@
 typedef GLvoid* (GL_APIENTRY* PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
 /*   Java->C glue code:
- *   Java package: com.jogamp.opengl.impl.es2.GLES2Impl
+ *   Java package: jogamp.opengl.es2.GLES2Impl
  *    Java method: long dispatch_glMapBuffer(int target, int access)
  *     C function: void * glMapBuffer(GLenum target, GLenum access);
  */
 JNIEXPORT jlong JNICALL 
-Java_com_jogamp_opengl_impl_es2_GLES2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+Java_jogamp_opengl_es2_GLES2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
   PFNGLMAPBUFFERPROC ptr_glMapBuffer;
   void * _res;
   ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
@@ -15,11 +15,11 @@ Java_com_jogamp_opengl_impl_es2_GLES2Impl_dispatch_1glMapBuffer(JNIEnv *env, job
 }
 
 /*   Java->C glue code:
- *   Java package: com.jogamp.opengl.impl.es2.GLES2Impl
+ *   Java package: jogamp.opengl.es2.GLES2Impl
  *    Java method: ByteBuffer newDirectByteBuffer(long addr, long capacity);
  *     C function: jobject newDirectByteBuffer(jlong addr, jlong capacity);
  */
 JNIEXPORT jobject JNICALL
-Java_com_jogamp_opengl_impl_es2_GLES2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jlong capacity) {
+Java_jogamp_opengl_es2_GLES2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jlong capacity) {
   return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
 }
diff --git a/make/config/jogl/glu-CustomJavaCode-base.java b/make/config/jogl/glu-CustomJavaCode-base.java
index fcbcaca..49722b4 100644
--- a/make/config/jogl/glu-CustomJavaCode-base.java
+++ b/make/config/jogl/glu-CustomJavaCode-base.java
@@ -169,7 +169,7 @@ protected static boolean checkedGLUtessellatorImpl = false;
 
 protected static final void validateGLUtessellatorImpl() {
     if(!checkedGLUtessellatorImpl) {
-        availableGLUtessellatorImpl = ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.glu.tessellator.GLUtessellatorImpl", GLU.class.getClassLoader());
+        availableGLUtessellatorImpl = ReflectionUtil.isClassAvailable("jogamp.opengl.glu.tessellator.GLUtessellatorImpl", GLU.class.getClassLoader());
         checkedGLUtessellatorImpl = true;
     }
     if(!availableGLUtessellatorImpl) {
@@ -1220,7 +1220,7 @@ protected static final void validateGLUquadricImpl() {
     if(!checkedGLUquadricImpl) {
         synchronized (syncObject) {
             if(!checkedGLUquadricImpl) {
-                availableGLUquadricImpl = ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.glu.GLUquadricImpl", GLU.class.getClassLoader());
+                availableGLUquadricImpl = ReflectionUtil.isClassAvailable("jogamp.opengl.glu.GLUquadricImpl", GLU.class.getClassLoader());
                 checkedGLUquadricImpl = true;
             }
         }
diff --git a/make/config/jogl/glu-CustomJavaCode-gl2es1.java b/make/config/jogl/glu-CustomJavaCode-gl2es1.java
index 3f52049..203d1ee 100644
--- a/make/config/jogl/glu-CustomJavaCode-gl2es1.java
+++ b/make/config/jogl/glu-CustomJavaCode-gl2es1.java
@@ -86,7 +86,7 @@ protected static boolean checkedMipmap = false;
 
 protected static final void validateMipmap() {
     if(!checkedMipmap) {
-        availableMipmap = ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.glu.mipmap.Mipmap", GLU.class.getClassLoader());
+        availableMipmap = ReflectionUtil.isClassAvailable("jogamp.opengl.glu.mipmap.Mipmap", GLU.class.getClassLoader());
         checkedMipmap = true;
     }
     if(!availableMipmap) {
diff --git a/make/config/jogl/glu-base.cfg b/make/config/jogl/glu-base.cfg
index d859225..f4021d6 100644
--- a/make/config/jogl/glu-base.cfg
+++ b/make/config/jogl/glu-base.cfg
@@ -20,8 +20,8 @@ Ignore gluScaleImage
 IncludeAs CustomJavaCode GLU glu-CustomJavaCode-base.java
 
 # Imports for the Error and Registry classes
-Import com.jogamp.opengl.impl.glu.error.Error
-Import com.jogamp.opengl.impl.glu.registry.Registry
+Import jogamp.opengl.glu.error.Error
+Import jogamp.opengl.glu.registry.Registry
 
 Include glu-common.cfg
 
diff --git a/make/config/jogl/glu-common.cfg b/make/config/jogl/glu-common.cfg
index f5fc7c1..d2a4802 100644
--- a/make/config/jogl/glu-common.cfg
+++ b/make/config/jogl/glu-common.cfg
@@ -11,9 +11,9 @@ TagNativeBinding true
 #
 Import javax.media.opengl.*
 Import javax.media.opengl.glu.*
-Import com.jogamp.opengl.impl.*
-Import com.jogamp.opengl.impl.glu.*
-Import com.jogamp.opengl.impl.glu.tessellator.GLUtessellatorImpl
+Import jogamp.opengl.*
+Import jogamp.opengl.glu.*
+Import jogamp.opengl.glu.tessellator.GLUtessellatorImpl
 Import com.jogamp.common.util.ReflectionUtil
 
 # Raise GLException instead of RuntimeException in glue code
diff --git a/make/config/jogl/glu-gl2.cfg b/make/config/jogl/glu-gl2.cfg
index aec0c44..11eeb7c 100644
--- a/make/config/jogl/glu-gl2.cfg
+++ b/make/config/jogl/glu-gl2.cfg
@@ -25,7 +25,7 @@ CustomCCode #endif
 Include ../intptr.cfg
 
 EmitProcAddressTable true
-ProcAddressTablePackage   com.jogamp.opengl.impl.glu.gl2
+ProcAddressTablePackage   jogamp.opengl.glu.gl2
 ProcAddressTableClassName GLUgl2ProcAddressTable
 GetProcAddressTableExpr   getGLUProcAddressTable()
 
@@ -38,14 +38,14 @@ IncludeAs CustomJavaCode GLUgl2 glu-CustomJavaCode-gl2.java
 # GLU needs access to the GLUtesselatorImpl class for GLUtesselator,
 # to the Mipmap class for scaling and mipmap generation,
 # and to the nurbs.* package for the NURBS functionality
-Import com.jogamp.opengl.impl.glu.nurbs.*
+Import jogamp.opengl.glu.nurbs.*
 Import java.security.*
 Import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver
-Import com.jogamp.opengl.impl.glu.gl2.nurbs.*
-Import com.jogamp.opengl.impl.glu.mipmap.Mipmap
-Import com.jogamp.opengl.impl.glu.gl2.*
+Import jogamp.opengl.glu.gl2.nurbs.*
+Import jogamp.opengl.glu.mipmap.Mipmap
+Import jogamp.opengl.glu.gl2.*
 Import javax.media.opengl.GL2
-Import com.jogamp.opengl.impl.gl2.ProjectDouble
+Import jogamp.opengl.gl2.ProjectDouble
 
 #
 # ------------------------
diff --git a/make/config/jogl/glu-gl2es1.cfg b/make/config/jogl/glu-gl2es1.cfg
index af89014..fa70113 100644
--- a/make/config/jogl/glu-gl2es1.cfg
+++ b/make/config/jogl/glu-gl2es1.cfg
@@ -20,7 +20,7 @@ Ignore gluScaleImage
 IncludeAs CustomJavaCode GLUgl2es1 glu-CustomJavaCode-gl2es1.java
 
 Import javax.media.opengl.GLES1
-Import com.jogamp.opengl.impl.glu.mipmap.Mipmap
+Import jogamp.opengl.glu.mipmap.Mipmap
 
 
 Include glu-common.cfg
diff --git a/make/config/jogl/glx-CustomCCode.c b/make/config/jogl/glx-CustomCCode.c
index dec3f45..e372e51 100644
--- a/make/config/jogl/glx-CustomCCode.c
+++ b/make/config/jogl/glx-CustomCCode.c
@@ -30,29 +30,29 @@ static void _initClazzAccess(JNIEnv *env) {
 
     c = (*env)->FindClass(env, clazzNameBuffers);
     if(NULL==c) {
-        fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX: can't find %s\n", clazzNameBuffers);
+        fprintf(stderr, "FatalError: Java_jogamp_opengl_x11_glx_GLX: can't find %s\n", clazzNameBuffers);
         (*env)->FatalError(env, clazzNameBuffers);
     }
     clazzBuffers = (jclass)(*env)->NewGlobalRef(env, c);
     if(NULL==clazzBuffers) {
-        fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameBuffers);
+        fprintf(stderr, "FatalError: Java_jogamp_opengl_x11_glx_GLX: can't use %s\n", clazzNameBuffers);
         (*env)->FatalError(env, clazzNameBuffers);
     }
     c = (*env)->FindClass(env, clazzNameByteBuffer);
     if(NULL==c) {
-        fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX: can't find %s\n", clazzNameByteBuffer);
+        fprintf(stderr, "FatalError: Java_jogamp_opengl_x11_glx_GLX: can't find %s\n", clazzNameByteBuffer);
         (*env)->FatalError(env, clazzNameByteBuffer);
     }
     clazzByteBuffer = (jclass)(*env)->NewGlobalRef(env, c);
     if(NULL==c) {
-        fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameByteBuffer);
+        fprintf(stderr, "FatalError: Java_jogamp_opengl_x11_glx_GLX: can't use %s\n", clazzNameByteBuffer);
         (*env)->FatalError(env, clazzNameByteBuffer);
     }
 
     cstrBuffers = (*env)->GetStaticMethodID(env, clazzBuffers, 
                             clazzNameBuffersStaticCstrName, clazzNameBuffersStaticCstrSignature);
     if(NULL==cstrBuffers) {
-        fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX:: can't create %s.%s %s\n",
+        fprintf(stderr, "FatalError: Java_jogamp_opengl_x11_glx_GLX:: can't create %s.%s %s\n",
             clazzNameBuffers,
             clazzNameBuffersStaticCstrName, clazzNameBuffersStaticCstrSignature);
         (*env)->FatalError(env, clazzNameBuffersStaticCstrName);
@@ -60,12 +60,12 @@ static void _initClazzAccess(JNIEnv *env) {
 }
 
 /*   Java->C glue code:
- *   Java package: com.jogamp.opengl.impl.x11.glx.GLX
+ *   Java package: jogamp.opengl.x11.glx.GLX
  *    Java method: XVisualInfo glXGetVisualFromFBConfig(long dpy, long config)
  *     C function: XVisualInfo *  glXGetVisualFromFBConfig(Display *  dpy, GLXFBConfig config);
  */
 JNIEXPORT jobject JNICALL 
-Java_com_jogamp_opengl_impl_x11_glx_GLX_dispatch_1glXGetVisualFromFBConfig(JNIEnv *env, jclass _unused, jlong dpy, jlong config, jlong procAddress) {
+Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXGetVisualFromFBConfig(JNIEnv *env, jclass _unused, jlong dpy, jlong config, jlong procAddress) {
   typedef XVisualInfo* (APIENTRY*_local_PFNGLXGETVISUALFROMFBCONFIG)(Display *  dpy, GLXFBConfig config);
   _local_PFNGLXGETVISUALFROMFBCONFIG ptr_glXGetVisualFromFBConfig;
   XVisualInfo *  _res;
@@ -88,12 +88,12 @@ Java_com_jogamp_opengl_impl_x11_glx_GLX_dispatch_1glXGetVisualFromFBConfig(JNIEn
 }
 
 /*   Java->C glue code:
- *   Java package: com.jogamp.opengl.impl.x11.glx.GLX
+ *   Java package: jogamp.opengl.x11.glx.GLX
  *    Java method: java.nio.LongBuffer glXChooseFBConfig(long dpy, int screen, java.nio.IntBuffer attribList, java.nio.IntBuffer nitems)
  *     C function: GLXFBConfig *  glXChooseFBConfig(Display *  dpy, int screen, const int *  attribList, int *  nitems);
  */
 JNIEXPORT jobject JNICALL 
-Java_com_jogamp_opengl_impl_x11_glx_GLX_dispatch_1glXChooseFBConfig(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset, jobject nitems, jint nitems_byte_offset, jlong procAddress) {
+Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXChooseFBConfig(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset, jobject nitems, jint nitems_byte_offset, jlong procAddress) {
   typedef GLXFBConfig* (APIENTRY*_local_PFNGLXCHOOSEFBCONFIG)(Display *  dpy, int screen, const int *  attribList, int *  nitems);
   _local_PFNGLXCHOOSEFBCONFIG ptr_glXChooseFBConfig;
   int * _ptr2 = NULL;
@@ -131,12 +131,12 @@ Java_com_jogamp_opengl_impl_x11_glx_GLX_dispatch_1glXChooseFBConfig(JNIEnv *env,
 }
 
 /*   Java->C glue code:
- *   Java package: com.jogamp.opengl.impl.x11.glx.GLX
+ *   Java package: jogamp.opengl.x11.glx.GLX
  *    Java method: XVisualInfo glXChooseVisual(long dpy, int screen, java.nio.IntBuffer attribList)
  *     C function: XVisualInfo *  glXChooseVisual(Display *  dpy, int screen, int *  attribList);
  */
 JNIEXPORT jobject JNICALL 
-Java_com_jogamp_opengl_impl_x11_glx_GLX_dispatch_1glXChooseVisual(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset, jlong procAddress) {
+Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXChooseVisual(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset, jlong procAddress) {
   typedef XVisualInfo* (APIENTRY*_local_PFNGLXCHOOSEVISUAL)(Display *  dpy, int screen, int *  attribList);
   _local_PFNGLXCHOOSEVISUAL ptr_glXChooseVisual;
   int * _ptr2 = NULL;
diff --git a/make/config/jogl/glx-CustomJavaCode.java b/make/config/jogl/glx-CustomJavaCode.java
index 0c3693b..36ad100 100644
--- a/make/config/jogl/glx-CustomJavaCode.java
+++ b/make/config/jogl/glx-CustomJavaCode.java
@@ -21,7 +21,7 @@
   {
     final long __addr_ = glxProcAddressTable._addressof_glXChooseFBConfig;
     if (__addr_ == 0) {
-        throw new GLException("Method \"glXGetVisualFromFBConfig\" not available");
+        throw new GLException("Method \"glXChooseFBConfig\" not available");
     }
     if(attribList != null && attribList.length <= attribList_offset)
       throw new GLException("array offset argument \"attribList_offset\" (" + attribList_offset + ") equals or exceeds array length (" + attribList.length + ")");
diff --git a/make/config/jogl/glx-x11.cfg b/make/config/jogl/glx-x11.cfg
index dee1d01..4daa78b 100644
--- a/make/config/jogl/glx-x11.cfg
+++ b/make/config/jogl/glx-x11.cfg
@@ -3,7 +3,7 @@
 JavaOutputDir gensrc/classes
 NativeOutputDir gensrc/native/jogl/X11
 
-Package com.jogamp.opengl.impl.x11.glx
+Package jogamp.opengl.x11.glx
 JavaClass GLX
 Style AllStatic
 Include gl-common.cfg
@@ -21,7 +21,7 @@ EmitProcAddressTable true
 ProcAddressTableClassName GLXProcAddressTable
 GetProcAddressTableExpr glxProcAddressTable
 
-Import com.jogamp.nativewindow.impl.x11.*
+Import jogamp.nativewindow.x11.*
 Import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver
 
 CustomJavaCode GLX private static GLXProcAddressTable glxProcAddressTable = new GLXProcAddressTable(new GLProcAddressResolver());
diff --git a/make/config/jogl/glxext.cfg b/make/config/jogl/glxext.cfg
index aeed3af..82490a2 100644
--- a/make/config/jogl/glxext.cfg
+++ b/make/config/jogl/glxext.cfg
@@ -3,13 +3,13 @@
 JavaOutputDir gensrc/classes
 NativeOutputDir gensrc/native/jogl/X11
 
-Package com.jogamp.opengl.impl.x11.glx
+Package jogamp.opengl.x11.glx
 Style InterfaceAndImpl
 JavaClass GLXExt
-ImplPackage com.jogamp.opengl.impl.x11.glx
+ImplPackage jogamp.opengl.x11.glx
 ImplJavaClass GLXExtImpl
 
-ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/jogamp/opengl/impl/x11/glx/GLX.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/jogamp/opengl/x11/glx/GLX.java
 Include gl-common.cfg
 Include gl-desktop.cfg
 
@@ -20,7 +20,7 @@ EmitProcAddressTable true
 ProcAddressTableClassName GLXExtProcAddressTable
 GetProcAddressTableExpr _context.getGLXExtProcAddressTable()
 
-Import com.jogamp.nativewindow.impl.x11.*
+Import jogamp.nativewindow.x11.*
 
 # Ignore everything that doesn't start with glX or GLX
 IgnoreNot ^(glX|GLX).+
diff --git a/make/config/jogl/wgl-win32.cfg b/make/config/jogl/wgl-win32.cfg
index 97938a8..a868345 100644
--- a/make/config/jogl/wgl-win32.cfg
+++ b/make/config/jogl/wgl-win32.cfg
@@ -3,7 +3,7 @@
 JavaOutputDir gensrc/classes
 NativeOutputDir gensrc/native/jogl/Windows
 
-Package com.jogamp.opengl.impl.windows.wgl
+Package jogamp.opengl.windows.wgl
 JavaClass WGL
 Style AllStatic
 Include gl-common.cfg
diff --git a/make/config/jogl/wglext.cfg b/make/config/jogl/wglext.cfg
index aca757b..d37a861 100644
--- a/make/config/jogl/wglext.cfg
+++ b/make/config/jogl/wglext.cfg
@@ -3,10 +3,10 @@
 JavaOutputDir gensrc/classes
 NativeOutputDir gensrc/native/jogl/Windows
 
-Package com.jogamp.opengl.impl.windows.wgl
+Package jogamp.opengl.windows.wgl
 Style InterfaceAndImpl
 JavaClass WGLExt
-ImplPackage com.jogamp.opengl.impl.windows.wgl
+ImplPackage jogamp.opengl.windows.wgl
 ImplJavaClass WGLExtImpl
 Include gl-common.cfg
 Include gl-desktop.cfg
diff --git a/make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java b/make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java
index aad0ab2..598ced3 100644
--- a/make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java
+++ b/make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java
@@ -16,12 +16,12 @@ private static JAWT_PlatformInfo newPlatformInfo(ByteBuffer buf) {
     try {
       Class factoryClass;
       if (osName.startsWith("wind")) {
-        factoryClass = Class.forName("com.jogamp.nativewindow.impl.jawt.windows.JAWT_Win32DrawingSurfaceInfo");
+        factoryClass = Class.forName("jogamp.nativewindow.jawt.windows.JAWT_Win32DrawingSurfaceInfo");
       } else if (osName.startsWith("mac os x")) {
-        factoryClass = Class.forName("com.jogamp.nativewindow.impl.jawt.macosx.JAWT_MacOSXDrawingSurfaceInfo");
+        factoryClass = Class.forName("jogamp.nativewindow.jawt.macosx.JAWT_MacOSXDrawingSurfaceInfo");
       } else {
         // Assume Linux, Solaris, etc. Should probably test for these explicitly.
-        factoryClass = Class.forName("com.jogamp.nativewindow.impl.jawt.x11.JAWT_X11DrawingSurfaceInfo");
+        factoryClass = Class.forName("jogamp.nativewindow.jawt.x11.JAWT_X11DrawingSurfaceInfo");
       }
       platformInfoFactoryMethod = factoryClass.getMethod("create",
                                                          new Class[] { ByteBuffer.class });
diff --git a/make/config/nativewindow/jawt-common.cfg b/make/config/nativewindow/jawt-common.cfg
index 4ed0a88..d633c47 100644
--- a/make/config/nativewindow/jawt-common.cfg
+++ b/make/config/nativewindow/jawt-common.cfg
@@ -1,6 +1,6 @@
 # Common JAWT config file
 Style AllStatic
-Package com.jogamp.nativewindow.impl.jawt
+Package jogamp.nativewindow.jawt
 JavaClass JAWTFactory
 JavaOutputDir gensrc/classes
 #NativeOutputDir gensrc/native/<PLATFORM>
@@ -21,6 +21,6 @@ IncludeAs CustomJavaCode JAWT jawt-CustomJavaCode.java
 CustomCCode #include <jawt.h>
 
 import java.security.*
-import com.jogamp.nativewindow.impl.jawt.*
+import jogamp.nativewindow.jawt.*
 
 IncludeAs CustomJavaCode JAWT_DrawingSurfaceInfo jawt-DrawingSurfaceInfo-CustomJavaCode.java
diff --git a/make/config/nativewindow/jawt-macosx.cfg b/make/config/nativewindow/jawt-macosx.cfg
index e018af0..c41367f 100644
--- a/make/config/nativewindow/jawt-macosx.cfg
+++ b/make/config/nativewindow/jawt-macosx.cfg
@@ -9,6 +9,6 @@ Opaque long NSView *
 CustomCCode #include <inttypes.h>
 CustomCCode #include </usr/include/machine/types.h>
 
-StructPackage JAWT_MacOSXDrawingSurfaceInfo com.jogamp.nativewindow.impl.jawt.macosx
+StructPackage JAWT_MacOSXDrawingSurfaceInfo jogamp.nativewindow.jawt.macosx
 EmitStruct JAWT_MacOSXDrawingSurfaceInfo
 Implements JAWT_MacOSXDrawingSurfaceInfo JAWT_PlatformInfo
diff --git a/make/config/nativewindow/jawt-win32.cfg b/make/config/nativewindow/jawt-win32.cfg
index 00b3a33..d1fa702 100644
--- a/make/config/nativewindow/jawt-win32.cfg
+++ b/make/config/nativewindow/jawt-win32.cfg
@@ -10,6 +10,6 @@ IgnoreField JAWT_Win32DrawingSurfaceInfo hpalette
 
 Include ../intptr.cfg
 
-StructPackage JAWT_Win32DrawingSurfaceInfo com.jogamp.nativewindow.impl.jawt.windows
+StructPackage JAWT_Win32DrawingSurfaceInfo jogamp.nativewindow.jawt.windows
 EmitStruct JAWT_Win32DrawingSurfaceInfo
 Implements JAWT_Win32DrawingSurfaceInfo JAWT_PlatformInfo
diff --git a/make/config/nativewindow/jawt-x11.cfg b/make/config/nativewindow/jawt-x11.cfg
index 4e7ed26..ac9d1aa 100644
--- a/make/config/nativewindow/jawt-x11.cfg
+++ b/make/config/nativewindow/jawt-x11.cfg
@@ -10,6 +10,6 @@ IgnoreField JAWT_X11DrawingSurfaceInfo GetAWTColor
 
 CustomCCode #include <inttypes.h>
 
-StructPackage JAWT_X11DrawingSurfaceInfo com.jogamp.nativewindow.impl.jawt.x11
+StructPackage JAWT_X11DrawingSurfaceInfo jogamp.nativewindow.jawt.x11
 EmitStruct JAWT_X11DrawingSurfaceInfo
 Implements JAWT_X11DrawingSurfaceInfo JAWT_PlatformInfo
diff --git a/make/config/nativewindow/win32-CustomJavaCode.java b/make/config/nativewindow/win32-CustomJavaCode.java
index 54a7fa5..5d0c829 100644
--- a/make/config/nativewindow/win32-CustomJavaCode.java
+++ b/make/config/nativewindow/win32-CustomJavaCode.java
@@ -1,28 +1,58 @@
   
-  private static final long hInstance;
+  private static final boolean DEBUG = Debug.debug("GDI");
 
-  static {
-    NWJNILibLoader.loadNativeWindow("win32");
-    hInstance = initIDs0();
-    if( 0 == hInstance ) {
-        throw new NativeWindowException("GDI: Could not initialized native stub");
+  private static final String dummyWindowClassNameBase = "_dummyWindow_clazz" ;
+  private static RegisteredClassFactory dummyWindowClassFactory;
+  private static boolean isInit = false;
+
+  private static native boolean initIDs0();
+  private static native long getDummyWndProc0();
+
+  public static synchronized void initSingleton(boolean firstX11ActionOnProcess) {
+    if(!isInit) {
+        NWJNILibLoader.loadNativeWindow("win32");
+        
+        if( !initIDs0() ) {
+            throw new NativeWindowException("GDI: Could not initialized native stub");
+        }
+
+        if(DEBUG) {
+            System.out.println("GDI.isFirstX11ActionOnProcess: "+firstX11ActionOnProcess);
+        }
+
+        dummyWindowClassFactory = new RegisteredClassFactory(dummyWindowClassNameBase, getDummyWndProc0());
+        isInit = true;
     }
   }
 
-  public static synchronized void initSingleton() {
-  }
-  private static native long initIDs0();
+  private static RegisteredClass dummyWindowClass = null;
+  private static Object dummyWindowSync = new Object();
 
-  public static long getModuleHandle() {
-    return hInstance;
+  public static long CreateDummyWindow(int x, int y, int width, int height) {
+      synchronized(dummyWindowSync) {
+          dummyWindowClass = dummyWindowClassFactory.getSharedClass();
+          return CreateDummyWindow0(dummyWindowClass.getHandle(), dummyWindowClass.getName(), dummyWindowClass.getName(), x, y, width, height);
+      }
   }
 
-  public static long CreateDummyWindow(int x, int y, int width, int height) {
-      return CreateDummyWindow0(getModuleHandle(), x, y, width, height);
+  public static boolean DestroyDummyWindow(long hwnd) {
+      boolean res;
+      synchronized(dummyWindowSync) {
+          if( null == dummyWindowClass ) {
+              throw new InternalError("GDI Error ("+dummyWindowClassFactory.getSharedRefCount()+"): SharedClass is null");
+          }
+          res = DestroyWindow(hwnd);
+          dummyWindowClassFactory.releaseSharedClass();
+      }
+      return res;
   }
 
   public static Point GetRelativeLocation(long src_win, long dest_win, int src_x, int src_y) {
-    return (Point) GetRelativeLocation0(src_win, dest_win, src_x, src_y);
+      return (Point) GetRelativeLocation0(src_win, dest_win, src_x, src_y);
   }
   private static native Object GetRelativeLocation0(long src_win, long dest_win, int src_x, int src_y);
 
+  public static native boolean CreateWindowClass(long hInstance, String clazzName, long wndProc);
+  public static native boolean DestroyWindowClass(long hInstance, String className);
+  static native long CreateDummyWindow0(long hInstance, String className, String windowName, int x, int y, int width, int height);
+
diff --git a/make/config/nativewindow/win32-lib.cfg b/make/config/nativewindow/win32-lib.cfg
index 46c4f2f..8942111 100644
--- a/make/config/nativewindow/win32-lib.cfg
+++ b/make/config/nativewindow/win32-lib.cfg
@@ -3,7 +3,7 @@
 JavaOutputDir gensrc/classes
 NativeOutputDir gensrc/native/Windows
 
-Package com.jogamp.nativewindow.impl.windows
+Package jogamp.nativewindow.windows
 JavaClass GDI
 Style AllStatic
 
@@ -22,7 +22,8 @@ Opaque long void **
 
 Import javax.media.nativewindow.util.Point
 Import javax.media.nativewindow.NativeWindowException
-Import com.jogamp.nativewindow.impl.NWJNILibLoader
+Import jogamp.nativewindow.NWJNILibLoader
+import jogamp.nativewindow.Debug
 
 CustomCCode #define WIN32_LEAN_AND_MEAN
 CustomCCode #include <windows.h>
@@ -33,7 +34,7 @@ CustomCCode #include <stddef.h>
 
 Include ../intptr.cfg
 
-CustomCCode extern HWND CreateDummyWindow0( HINSTANCE hInstance, int x, int y, int width, int height ) ;
+CustomCCode extern HINSTANCE   GetApplicationHandle();
 
 IncludeAs CustomJavaCode GDI win32-CustomJavaCode.java
 
diff --git a/make/config/nativewindow/x11-CustomJavaCode.java b/make/config/nativewindow/x11-CustomJavaCode.java
index 0570901..8ac5575 100644
--- a/make/config/nativewindow/x11-CustomJavaCode.java
+++ b/make/config/nativewindow/x11-CustomJavaCode.java
@@ -26,7 +26,7 @@
 
   public static native long DefaultVisualID(long display, int screen);
 
-  public static native long CreateDummyWindow(long display, int screen_index, long visualID);
+  public static native long CreateDummyWindow(long display, int screen_index, long visualID, int width, int height);
   public static native void DestroyDummyWindow(long display, long window);
 
   public static Point GetRelativeLocation(long display, int screen_index, long src_win, long dest_win, int src_x, int src_y) {
diff --git a/make/config/nativewindow/x11-lib.cfg b/make/config/nativewindow/x11-lib.cfg
index fb481ac..8848980 100644
--- a/make/config/nativewindow/x11-lib.cfg
+++ b/make/config/nativewindow/x11-lib.cfg
@@ -1,6 +1,6 @@
 # This .cfg file is used to generate the interface to the GLX routines
 # used internally by the X11GLContext implementation.
-Package com.jogamp.nativewindow.impl.x11
+Package jogamp.nativewindow.x11
 JavaClass X11Lib
 Style AllStatic
 
diff --git a/make/createTagletProps.sh b/make/createTagletProps.sh
new file mode 100644
index 0000000..acd762b
--- /dev/null
+++ b/make/createTagletProps.sh
@@ -0,0 +1,34 @@
+root=http://www.opengl.org/sdk/docs/
+
+createProperties() {
+
+    toc=index.html
+    doc=${1}
+
+    #download index
+    wget ${root}/${doc}/xhtml/${toc};
+
+    #find lines with links to gl* function doc
+    grep -E .+\<a\ target=\"pagedisp\"\ href=\"gl[A-Z][^\"]+\"\>gl[A-Z][a-Z0-9]+\</a\>.+ ./${toc} > links;
+
+    #add all links as properties to file and cleanup
+    sed -r "s/.+<td><a target=\"pagedisp\" href=\"([a-Z0-9.]+)\">([a-Z0-9]+)<\/a><\/td>.*/\2 = ${doc}\/xhtml\/\1/" links | sort -u;
+
+    rm ./${toc} ./links
+
+}
+
+>tmp
+
+createProperties man | sed -e "s/man\//man2\//ig" >> tmp
+createProperties man3 >> tmp
+createProperties man4 >> tmp
+
+#add doc root to properties file
+echo "#Generated, do not edit, edit createTagletProps.sh instead.
+#This file is used in NativeTaglet and maps the generated method names
+#to the function specific OpenGL documentation man pages.
+nativetaglet.baseUrl=${root}" > native-taglet.properties;
+
+cat tmp | sort -k1,2 -r | awk '!x[$1]++' | tr -d [:blank:] | sort | sed -e "s/man2\//man\//ig" >> native-taglet.properties;
+rm tmp
diff --git a/make/doc/jogl/spec-overview.html b/make/doc/jogl/spec-overview.html
index 251fcf9..8c9f45f 100644
--- a/make/doc/jogl/spec-overview.html
+++ b/make/doc/jogl/spec-overview.html
@@ -18,35 +18,43 @@ bindings to the native OpenGL(R) 3D graphics library profiles:
 </ul><br>
   See <a href="#GLAPIInclusionCriteria">Inclusion Criteria</a> explaining the OpenGL profile seperation.<br>
   See <a href="#GLRuntimeVersion">OpenGL Runtime Requirements</a>.<br>
-  <br>
-  A binding to the native OpenCL(R) library is not yet specified, but intended to be
-  included in a <a href="#maintenanceupdates">maintenance update</a>.
-  <br>
+  <p>
+  A sample implementation is available as
+  <a href="http://jogl.jogamp.org">JOGL, a JogAmp module</a>.</p>
+ 
+  Other API bindings are available as JogAmp modules:
+  <ul>
+    <li>OpenCL(R) <a href="http://jocl.jogamp.org">as JOCL</a></li>
+    <li>OpenAL(R) <a href="http://joal.jogamp.org">as JOAL</a></li>
+  </ul>
    
 <h3>Dependencies</h3>
   This binding has dependencies to the following:<br><br>
   <ul>
-    <li> Either of the following Java implementations:<br>
+    <li> Either of the following Java implementations:<br/>
     <ul>
-        <li> <a href="http://java.sun.com/j2se/1.4.2/docs/api/">Java SE 1.4 or later</a> </li><br>
-        <li> <a href="http://java.sun.com/javame/technology/cdc/">Java ME CDC 1.1.2 (JSR 218)</a> and 
-             <a href="http://java.sun.com/products/foundation/">Foundation Profile 1.1.2 (JSR 219)</a><br>
-             and either of the following <i>java.nio</i> implementations:<br>
-             <ul>
-                <li> <a href="http://java.sun.com/javame/reference/apis/jsr239/java/nio/package-summary.html"> JSR239 <i>java.nio</i> subset</a> </li>
+        <li> <a href="http://java.sun.com/j2se/1.5.0/docs/api/">Java SE 1.5 or later</a> </li>
+        <li> A mobile JavaVM with language 1.5 support, ie:
+            <ul>
+                <li> <a href="http://developer.android.com/reference/packages.html">Dalvik API Level 7</a> </li>
+                <li> <a href="http://jamvm.sourceforge.net/">JamVM</a> </li>
+            </ul>
+            with
+            <ul>
+                <li> <a href="http://java.sun.com/products/foundation/">Foundation Profile 1.1.2 (JSR 219)</a> </li>
                 <li> <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/package-summary.html"> Java 1.4 <i>java.nio</i> implementation</a> </li>
-             </ul><br>
-    </ul>    
+            </ul></li>
+    </ul></li>
     <li> {@linkplain javax.media.nativewindow NativeWindow Protocol} <br>
     <br>
-    The <i>NativeWindow Protocol</i> is included in Sun's sample implementation </li><br>
+    The <i>NativeWindow Protocol</i> is included in JogAmp's sample implementation </li>
   </ul>
   <br>
 
 <h3>OpenGL Profile Model</h3>
   OpenGL today is not just a single set of functionality, it offers many profiles for different
   purposes, e.g. ES1 and ES2 for mobile, etc.<br>
-  JOGL reflects these profiles <a href="../doc/bouml/html/">with an OO abstraction model</a>,
+  JOGL reflects these profiles <a href="http://jogamp.org/jogl/doc/bouml/html/">with an OO abstraction model</a>,
   specifying interfaces encapsulating common subsets.<br> 
    
 <h3>Package Structure</h3>
@@ -71,7 +79,7 @@ was incorporated into core OpenGL until version 3.1, inclusive, are subsumed int
         Note: Intersecting OpenGL 3.1 subsumed extensions are subsumed in GL2 as well, to offer the best common GL2GL3 intersection.<br>
         See <a href="#GL2InclusionCriteria">GL2 Inclusion Criteria</a>.<br>
         See <a href="#GL2RuntimeVersion">GL2 Runtime Requirements</a>.<br>
-        Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li><br>
+        Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li>
 
         <li> {@link javax.media.opengl.GL3 javax.media.opengl.GL3} interface<br>
         <br>
@@ -82,27 +90,27 @@ inclusive, as well as most of it's extensions defined at the time of this specif
         Note: OpenGL 3.1 forward compatible no more includes fixed point functionality.<br>
         See <a href="#GL3InclusionCriteria">GL3 Inclusion Criteria</a>.<br>
         See <a href="#GL3RuntimeVersion">GL3 Runtime Requirements</a>.<br>
-        Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li><br>
+        Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li>
 
         <li> {@link javax.media.opengl.GL3bc javax.media.opengl.GL3bc} interface<br>
         <br>
         This interface contains the OpenGL 3.x compatibility profile,<br>
         ie includes all methods as defined in {@link javax.media.opengl.GL2} and {@link javax.media.opengl.GL3}.<br>
-        Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li><br>
+        Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li>
 
         <li> {@link javax.media.opengl.GLES1 javax.media.opengl.GLES1} interface<br>
         <br>
         This interface contains all core embedded OpenGL methods of ES 1.x, with x >= 0,
 inclusive, as well as most of it's extensions defined at the
 time of this specification. <br>
-        Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li><br>
+        Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li>
 
         <li> {@link javax.media.opengl.GLES2 javax.media.opengl.GLES2} interface<br>
         <br>
         This interface contains all core embedded OpenGL methods of ES 2.x, with x >= 0,
 inclusive, as well as most of it's extensions defined at the
 time of this specification. <br>
-        Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li><br>
+        Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li>
     </ul>
     Additionally the packages contains interfaces where the main profiles intersect each other.
     These interfaces purposes is to provide common subsets of profiles to be used
@@ -112,36 +120,36 @@ time of this specification. <br>
         <br>
         Common interface containing the profile type identification and conversion methods.<br>
         Used to query which specialized profile class an instance of this object actually is and 
-        offering a protocol to convert it to these types.</li><br>
+        offering a protocol to convert it to these types.</li>
 
         <li> {@link javax.media.opengl.GL javax.media.opengl.GL} interface<br>
         <br>
         Common interface containing the subset of all profiles, GL3bc, GL3, GL2, GLES1 and GLES2.<br>
-        This interface reflects common data types, texture and framebuffer functionality.</li><br>
+        This interface reflects common data types, texture and framebuffer functionality.</li>
 
         <li> {@link javax.media.opengl.GL2ES1 javax.media.opengl.GL2ES1} interface<br>
         <br>
         Interface containing the common subset of GL2 and GLES1.<br>
-        This interface reflects only the fixed functionality of OpenGL</li><br>
+        This interface reflects only the fixed functionality of OpenGL</li>
 
         <li> {@link javax.media.opengl.GL2ES2 javax.media.opengl.GL2ES2} interface<br>
         <br>
         Interface containing the common subset of GL3, GL2 and GLES2.<br>
-        This interface reflects only the programmable shader functionality of desktop and embedded OpenGL</li><br>
+        This interface reflects only the programmable shader functionality of desktop and embedded OpenGL</li>
 
         <li> {@link javax.media.opengl.GL2GL3 javax.media.opengl.GL2GL3} interface<br>
         <br>
         Interface containing the common subset of core GL3 (OpenGL 3.1+) and GL2 (OpenGL 3.0),
         also known as the OpenGL 3.0 forward compatible, non deprecated subset.<br>
-        This interface reflects only the programmable shader functionality of desktop OpenGL</li><br>
+        This interface reflects only the programmable shader functionality of desktop OpenGL</li>
     </ul>
-  </li><br>
+  </li>
 
   <li>The <b>javax.media.opengl.glu</b> package<br>
     <br>
     This package contains bindings for the OpenGL Graphics System Utility (GLU) 
 Library version 1.3, inclusive, with the exception of the GLU NURBS routines 
-which are not exposed.</li><br>
+which are not exposed.</li>
 </ul>
 <br>
    
@@ -185,8 +193,7 @@ boolean.<br>
     <li>Functions that take an untyped pointer argument for immediate use</li>
     <li>Functions that take a typed pointer argument for immediate use</li>
     <li>Functions that take an untyped pointer argument for deferred use</li>
-    <li>Functions that take a typed pointer argument for deferred use</li>
-    <br>
+    <li>Functions that take a typed pointer argument for deferred use</li>    
 </ul>
   Functions that take an untyped (void*) pointer argument for immediate use 
 are given a single binding that takes a New I/O (NIO) Buffer object. The Buffer
@@ -330,9 +337,8 @@ between two GLContexts associated with the same GLDrawable.
   OpenGL functions and OpenGL extensions have been included in the Java bindings 
 according the following rules: <br>
  
-<ul>
-  <a name="GL3InclusionCriteria"/>
-  <li> {@link javax.media.opengl.GL3 javax.media.opengl.GL3} interface
+<ul>  
+  <li> <a name="GL3InclusionCriteria"/> {@link javax.media.opengl.GL3 javax.media.opengl.GL3} interface
    <ul>
        <li>All functions in core, forward compatible, OpenGL 3.1 - 3.2, inclusive, have been included,
            as described in the header files <code>GL3/gl3.h</code>.</li>
@@ -349,9 +355,8 @@ according the following rules: <br>
             <li> OpenGL 3.2 core profile is compatible with OpenGL 3.1 forward compatible spec.</li>
             <li> OpenGL 3.2 Spec Appendix E.1: It is not possible to implement both core and compatibility profiles in a single GL context, ..</li>
            </ul></li>
-   </ul></li>
-  <a name="GL2InclusionCriteria"/>
-  <li> {@link javax.media.opengl.GL2 javax.media.opengl.GL2} interface
+   </ul></li>  
+  <li> <a name="GL2InclusionCriteria"/> {@link javax.media.opengl.GL2 javax.media.opengl.GL2} interface
    <ul>
        <li>All functions in core OpenGL 3.0, inclusive, have been included.</li>
        <li>Reason for making the <em>cut</em> at OpenGL 3.0 are:
@@ -474,124 +479,84 @@ javax.media.opengl namespace via future maintenance updates to the API.<br>
 <blockquote><a href="http://www.jcp.org/en/jsr/detail?id=231"> http://www.jcp.org/en/jsr/detail?id=231</a></blockquote>
    
 <ul>
-    <li>OpenCL Specification</li>
-   
-</ul>
-    
-<blockquote><a
- href="http://www.khronos.org/registry/cl/"> 
-http://www.khronos.org/registry/cl/</a></blockquote>
-    
-<ul>
-    <li>OpenGL 3.2 Core Specification</li>
-   
+    <li>OpenGL 4.1 Core Specification</li>
 </ul>
-    
 <blockquote><a
- href="http://www.opengl.org/registry/doc/glspec32.core.20090803.pdf"> 
-http://www.opengl.org/registry/doc/glspec32.core.20090803.pdf</a></blockquote>
-    
+ href="http://www.opengl.org/registry/doc/glspec41.core.20100725.withchanges.pdf">
+http://www.opengl.org/registry/doc/glspec41.core.20100725.withchanges.pdf</a></blockquote>
+
 <ul>
-    <li>OpenGL 3.1 Specification</li>
-   
+    <li>OpenGL 4.1 Compatibility Specification</li>
 </ul>
-    
 <blockquote><a
- href="http://www.opengl.org/registry/doc/glspec31.20090324.pdf"> 
-http://www.opengl.org/registry/doc/glspec31.20090324.pdf</a></blockquote>
-    
+ href="http://www.opengl.org/registry/doc/glspec41.compatibility.20100725.withchanges.pdf">
+http://www.opengl.org/registry/doc/glspec41.compatibility.20100725.withchanges.pdf</a></blockquote>
+
 <ul>
-    <li>OpenGL 3.0 Specification</li>
-   
-</ul>
-    
+    <li>OpenGL 3.0 Specification</li>   
+</ul>    
 <blockquote><a
  href="http://www.opengl.org/registry/doc/glspec30.20080923.pdf"> 
 http://www.opengl.org/registry/doc/glspec30.20080923.pdf</a></blockquote>
     
 <ul>
-    <li>OpenGL 2.1 Specification</li>
-   
-</ul>
-    
+    <li>OpenGL 2.1 Specification</li>   
+</ul>    
 <blockquote><a
  href="http://www.opengl.org/registry/doc/glspec21.20061201.pdf"> 
 http://www.opengl.org/registry/doc/glspec21.20061201.pdf</a></blockquote>
     
 <ul>
-    <li>OpenGL 2.0 Specification</li>
-   
-</ul>
-    
-<blockquote><a
- href="http://www.opengl.org/documentation/specs/version2.0/glspec20.pdf"> 
-http://www.opengl.org/documentation/specs/version2.0/glspec20.pdf</a></blockquote>
-    
-<ul>
-    <li> OpenGL Extension Registry</li>
-   
-</ul>
-   
+    <li> OpenGL Extension Registry</li>   
+</ul>   
 <blockquote><a
  href="http://www.opengl.org/registry/"> http://www.opengl.org/registry/</a></blockquote>
     
 <pre></pre>
    
 <ul>
-    <li>OpenGL ES 2.x Specification </li>
-   
-</ul>
-    
+    <li>OpenGL ES 2.x Specification </li>   
+</ul>    
 <blockquote><a
  href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.24.pdf">
 http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.24.pdf</a></blockquote>
     
 <ul>
-    <li>OpenGL ES 1.x Specification </li>
-   
-</ul>
-    
+    <li>OpenGL ES 1.x Specification </li>   
+</ul>    
 <blockquote><a
  href="http://www.khronos.org/registry/gles/specs/1.1/es_full_spec_1.1.12.pdf">
 http://www.khronos.org/registry/gles/specs/1.1/es_full_spec_1.1.12.pdf</a></blockquote>
     
 <ul>
-    <li>OpenGL ES Registry</li>
-   
-</ul>
-    
+    <li>OpenGL ES Registry</li>   
+</ul>    
 <blockquote><a
  href="http://www.khronos.org/registry/gles/">
 http://www.khronos.org/registry/gles/</a></blockquote>
     
 <ul>
-    <li>OpenGL Utility Library: GLU 1.3 Specificiation</li>
-   
-</ul>
-   
+    <li>OpenGL Utility Library: GLU 1.3 Specificiation</li>   
+</ul>   
 <blockquote><a
  href="http://www.opengl.org/documentation/specs/glu/glu1_3.pdf"> http://www.opengl.org/documentation/specs/glu/glu1_3.pdf</a></blockquote>
    
 <ul>
-    <li>OpenGL ARB Web site</li>
-   
-</ul>
-   
+    <li>OpenGL ARB Web site</li>   
+</ul>   
 <blockquote><a href="http://www.opengl.org/about/arb/index.html"> http://www.opengl.org/about/arb/index.html</a></blockquote>
    
-<h3><br>
-  </h3>
-   
 <h3>Revision History<br>
   </h3>
    
 <ul>
-<li> Early Draft Review, October/November 2005
-<li> Public Review, December/January 2005
-<li> Proposed Final Draft Review, February/March 2006
-<li> 1.0.0 Final Release, September 2006
-<li> 1.1.0 Maintenance Release, April 2007
-<li> 2.0.0 Maintenance Release, July 2009
+<li> Early Draft Review, October/November 2005</li>
+<li> Public Review, December/January 2005</li>
+<li> Proposed Final Draft Review, February/March 2006</li>
+<li> 1.0.0 Final Release, September 2006</li>
+<li> 1.1.0 Maintenance Release, April 2007</li>
+<li> 2.0.0 Maintenance Release, July 2009</li>
+<li> 2.0.1 Java Dependency Update to 1.5, February 2011</li>
 </ul>
   <br>
   <br>
diff --git a/make/jogl_wince6_vs9/gluegen-rt/gluegen-rt.vcproj b/make/jogl_wince6_vs9/gluegen-rt/gluegen-rt.vcproj
index 4f459fe..ab787ef 100644
--- a/make/jogl_wince6_vs9/gluegen-rt/gluegen-rt.vcproj
+++ b/make/jogl_wince6_vs9/gluegen-rt/gluegen-rt.vcproj
@@ -60,7 +60,7 @@
 				Name="VCCLCompilerTool"
 				ExecutionBucket="7"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm"
+                AdditionalIncludeDirectories="..\..\..\make\stub_includes\egl,..\..\..\make\stub_includes\opengl,..\..\..\build\gensrc\native\newt\Windows"
 				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
 				MinimalRebuild="true"
 				RuntimeLibrary="2"
diff --git a/make/jogl_wince6_vs9/jogl_es1/jogl_es1.vcproj b/make/jogl_wince6_vs9/jogl_es1/jogl_es1.vcproj
index a4477d0..7612421 100644
--- a/make/jogl_wince6_vs9/jogl_es1/jogl_es1.vcproj
+++ b/make/jogl_wince6_vs9/jogl_es1/jogl_es1.vcproj
@@ -59,7 +59,7 @@
 				Name="VCCLCompilerTool"
 				ExecutionBucket="7"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm,,..\..\..\make\stub_includes\egl,..\..\..\make\stub_includes\opengl,..\..\..\build\gensrc\native\newt\Windows"
+                AdditionalIncludeDirectories="..\..\..\make\stub_includes\egl,..\..\..\make\stub_includes\opengl,..\..\..\build\gensrc\native\newt\Windows"
 				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
 				MinimalRebuild="true"
 				RuntimeLibrary="2"
diff --git a/make/jogl_wince6_vs9/jogl_es2/jogl_es2.vcproj b/make/jogl_wince6_vs9/jogl_es2/jogl_es2.vcproj
index 1a9ad99..12f29cd 100644
--- a/make/jogl_wince6_vs9/jogl_es2/jogl_es2.vcproj
+++ b/make/jogl_wince6_vs9/jogl_es2/jogl_es2.vcproj
@@ -59,7 +59,7 @@
 				Name="VCCLCompilerTool"
 				ExecutionBucket="7"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm,,..\..\..\make\stub_includes\egl,..\..\..\make\stub_includes\opengl,..\..\..\build\gensrc\native\newt\Windows"
+                AdditionalIncludeDirectories="..\..\..\make\stub_includes\egl,..\..\..\make\stub_includes\opengl,..\..\..\build\gensrc\native\newt\Windows"
 				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
 				MinimalRebuild="true"
 				RuntimeLibrary="2"
diff --git a/make/jogl_wince6_vs9/newt/newt.vcproj b/make/jogl_wince6_vs9/newt/newt.vcproj
index dc3c635..17f1ca7 100644
--- a/make/jogl_wince6_vs9/newt/newt.vcproj
+++ b/make/jogl_wince6_vs9/newt/newt.vcproj
@@ -60,7 +60,7 @@
 				Name="VCCLCompilerTool"
 				ExecutionBucket="7"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm,..\..\..\build\gensrc\native\newt\Windows,..\..\..\build\gensrc\native\newt\KD,..\..\..\make\stub_includes\egl"
+                AdditionalIncludeDirectories="..\..\..\build\gensrc\native\newt\Windows,..\..\..\build\gensrc\native\newt\KD,..\..\..\make\stub_includes\egl"
 				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
 				MinimalRebuild="true"
 				RuntimeLibrary="2"
diff --git a/make/joglversion-cdc b/make/joglversion-cdc
deleted file mode 100644
index 4b17456..0000000
--- a/make/joglversion-cdc
+++ /dev/null
@@ -1,12 +0,0 @@
-Specification-Title: Java Bindings for OpenGL API Specification CDC
-Specification-Version: @BASEVERSION@
-Specification-Vendor: JogAmp Community
-Implementation-Title: Java Bindings for OpenGL Runtime Environment CDC
-Implementation-Version: @VERSION@
-Implementation-Branch: @SCM_BRANCH@
-Implementation-Commit: @SCM_COMMIT@
-Implementation-Vendor: JogAmp Community
-Implementation-URL: http://jogamp.org/
-Extension-Name: javax.media.opengl
-Implementation-Vendor-Id: com.jogamp
-Trusted-Library: true
diff --git a/make/lib/swt/LICENSE.txt b/make/lib/swt/LICENSE.txt
new file mode 100644
index 0000000..671ea7c
--- /dev/null
+++ b/make/lib/swt/LICENSE.txt
@@ -0,0 +1,16 @@
+Project Website incl source code: http://wiki.eclipse.org/SWT
+
+License
+
+The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.
+
+http://www.eclipse.org/legal/epl/notice.html (local copy: ./notice.html)
+http://www.eclipse.org/legal/epl-v10.html    (local copy: ./epl-v10.html)
+
+Each subdirectory contains the proper license documents:
+    cocoa-macosx/about.html
+    cocoa-macosx-x86_64/about.html
+    gtk-linux-x86/about.html
+    gtk-linux-x86_64/about.html
+    win32-win32-x86/about.html
+    win32-win32-x86_64/about.html
diff --git a/make/lib/swt/README.txt b/make/lib/swt/README.txt
new file mode 100644
index 0000000..214cec5
--- /dev/null
+++ b/make/lib/swt/README.txt
@@ -0,0 +1 @@
+version 3.6.1
diff --git a/make/lib/swt/cocoa-macosx-x86_64/about.html b/make/lib/swt/cocoa-macosx-x86_64/about.html
new file mode 100644
index 0000000..e8d3f42
--- /dev/null
+++ b/make/lib/swt/cocoa-macosx-x86_64/about.html
@@ -0,0 +1,205 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>August 17, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content").  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL").  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+<h3>Third Party Content</h3>
+
+<p>The Content includes items that have been sourced from third parties as set out below. If you 
+did not receive this Content directly from the Eclipse Foundation, the following is provided 
+for informational purposes only, and you should look to the Redistributor’s license for 
+terms and conditions of use.</p>
+
+<h4>Carbon Binding</h4>
+
+<p>The "Carbon Binding" is a binding to the Carbon API.  The Content may include any or all of three portions of the Carbon Binding:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Carbon Binding:</p>
+<ul>
+	<li>libswt-pi-carbon-xxxx.jnilib (where "xxxx" is the version number)</li>	
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Carbon Binding:</p>
+
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/carbon (but not including any sub-directories)</li>
+</ul>
+
+<p>The Carbon Binding contains portions of Apple Computer's Carbon API header files which are:</p>
+
+<blockquote>Copyright © 1983-2002 Apple Computer, Inc.</blockquote>
+
+<p>In addition to the terms and conditions of the EPL, the following notice applies to your use of the Carbon Binding and must be retained and reproduced in its entirety with all redistributions of the
+Carbon Binding:</p>
+
+<blockquote>
+Copyright © 2004 Apple Computer, Inc.<br>
+This text and the following notice must be retained and reproduced in their entirety with all redistributions of this project:<br><br>
+<strong>IMPORTANT NOTICE</strong>: This project, which consists of certain Java bindings, includes or otherwise makes references to application programming interfaces
+(APIs) that are owned by Apple Computer, Inc., including but not limited to certain Apple Carbon APIs. While you may use, copy, modify and redistribute
+this Java bindings project in accordance with the terms of the Eclipse Public License (EPL) version 1.0, you are not granted any rights under any Apple or
+third party intellectual property rights (including without limitation, patent, copyright, trademark and trade secret rights) to Apple's Carbon API header files
+themselves, nor to any underlying implementations of any Apple Carbon APIs or to any functionality that is invoked by calling any of those APIs. Without
+limiting the generality of the foregoing, you understand that it is not Apple's intention by way of this project to authorize the reverse engineering of the Java
+bindings into Apple's original Carbon.h header files.
+</blockquote>
+
+<h4>Mozilla Binding</h4>
+
+<p>The "Mozilla Binding" is a binding to the Mozilla API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Mozilla Binding:</p>
+<ul>
+	<li>libswt-xulrunner-carbon-xxxx.so (where "xxxx" is the version number)</li>
+	<li>libswt-xpcominit-carbon-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Mozilla Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/mozilla (but not including any sub-directories)</li>
+</ul>
+
+<p>The Mozilla Binding contains portions of Mozilla ("Mozilla").  Mozilla is made available by Mozilla.org.  Use of Mozilla is governed by the terms and
+conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided with the Content (<a href="about_files/mpl-v11.txt" target="_blank">mpl-v11.txt</a>) and is also available at
+<a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html</a>.</p>
+
+<h4>Independent JPEG Group's JPEG software release 6b</h4>
+
+<p>This software is based in part on the work of the Independent JPEG Group's JPEG software release 6b ("LIBJPEG").
+LIBJPEG was used to implement the decoding of JPEG format files in Java (TM).  The Content does NOT include any portion of the LIBJPEG file ansi2knr.c.</p>
+
+<p>Your use of LIBJPEG is subject to the terms and conditions located in the <a href="about_files/IJG_README">about_files/IJG_README</a> file which is included
+with the Content.</p>
+
+<p>The IJG's website is located at <a href="http://ijg.org/" target="_blank">http://ijg.org</a>.</p>
+
+<p>The class org.eclipse.swt.internal.image.JPEGFileFormat is based on following files from LIBJPEG:</p>
+
+<ul>
+    <li>cderror.h</li>
+    <li>cdjpeg.h</li>
+    <li>jchuff.h</li>
+    <li>jdcolor.c</li>
+    <li>jdct.h</li>
+    <li>jdhuff.h</li>
+    <li>jerror.h</li>
+    <li>jidctint.c</li>
+    <li>jinclude.h</li>
+    <li>jmemsys.h</li>
+    <li>jmorecfg.h</li>
+    <li>jpegint.h</li>
+    <li>jpeglib.h</li>
+    <li>jversion.h</li>
+    <li>transupp.h</li>
+</ul>
+
+<p>The class org.eclipse.swt.internal.image.JPEGDecoder is based on the following files from LIBJPEG:</p>
+
+<ul>
+	<li>jcapimin.c</li>
+	<li>jcapistd.c</li>
+	<li>jccoefct.c</li>
+	<li>jccolor.c</li>
+	<li>jcdctmgr.c</li>
+	<li>jchuff.c</li>
+	<li>jcinit.c</li>
+	<li>jcmainct.c</li>
+	<li>jcmarker.c</li>
+	<li>jcmaster.c</li>
+	<li>jcomapi.c</li>
+	<li>jcparam.c</li>
+	<li>jcphuff.c</li>
+	<li>jcprepct.c</li>
+	<li>jcsample.c</li>
+	<li>jctrans.c</li>
+	<li>jdapimin.c</li>
+	<li>jdapistd.c</li>
+	<li>jdatadst.c</li>
+	<li>jdatasrc.c</li>
+	<li>jdcoefct.c</li>
+	<li>jdcolor.c</li>
+	<li>jddctmgr.c</li>
+	<li>jdhuff.c</li>
+	<li>jdinput.c</li>
+	<li>jdmainct.c</li>
+	<li>jdmarker.c</li>
+	<li>jdmaster.c</li>
+	<li>jdmerge.c</li>
+	<li>jdphuff.c</li>
+	<li>jdpostct.c</li>
+	<li>jdsample.c</li>
+	<li>jdtrans.c</li>
+	<li>jerror.c</li>
+	<li>jfdctflt.c</li>
+	<li>jfdctfst.c</li>
+	<li>jfdctint.c</li>
+	<li>jidctflt.c</li>
+	<li>jidctfst.c</li>
+	<li>jidctint.c</li>
+	<li>jidctred.c</li>
+	<li>jpegtran.c</li>
+	<li>jquant1.c</li>
+	<li>jquant2.c</li>
+	<li>jutils.c</li>
+	<li>cderror.h</li>
+	<li>cdjpeg.h</li>
+	<li>jchuff.h</li>
+	<li>jconfig.h</li>
+	<li>jdct.h</li>
+	<li>jdhuff.h</li>
+	<li>jerror.h</li>
+	<li>jinclude.h</li>
+	<li>jmorecfg.h</li>
+	<li>jpegint.h</li>
+	<li>jpeglib.h</li>
+	<li>jversion.h</li>
+	<li>transupp.h</li>
+</ul>
+	
+<p>The following changes were made to the LIBJPEG code in the Content:</p>
+
+<ol>
+	<li>In Java, pointer math is not allowed so indexing was used instead.</li>
+	<li>Function pointers were replaced with switch statements.</li>
+	<li>The virtual memory, tracing and progress monitoring were removed.</li>
+	<li>The error handling was simplified and now uses Java exceptions.</li>
+</ol>
+
+<h4>PuTTY 0.58 (derivative work)</h4>
+
+<p>Portions of the SWT class org/eclipse/swt/internal/image/PngDeflater are based on PuTTY's sshzlib.c. PuTTY is made available by Mozilla.org.  Use of PuTTY is governed by the terms and
+conditions of the the following MIT-style license:  </p>
+<blockquote>
+  <p><em>PuTTY is copyright 1997-2007 Simon Tatham.</em> </p>
+  <p><em>Portions copyright Robert de Bath, Joris van Rantwijk, Delian  Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,  Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn,  and CORE SDI S.A.</em> </p>
+  <p><em>Permission is hereby granted, free of charge, to any person  obtaining a copy of this software and associated documentation files  (the "Software"), to deal in the Software without restriction,  including without limitation the rights to use, copy, modify, merge,  publish, distribute, sublicense, and/or sell copies of the Software,  and to permit persons to whom the Software is furnished to do so,  subject to the following conditions:</em> </p>
+  <p><em>The above copyright notice and this permission notice shall be  included in all copies or substantial portions of the Software.</em> </p>
+  <p><em>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND  NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR ANY  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</em> </p>
+</blockquote>
+<p>A copy of the license is also available at <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html" target="_blank">http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html</a>.</p>
+
+<p><small>Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.</small></p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/make/lib/swt/cocoa-macosx-x86_64/about_files/IJG_README b/make/lib/swt/cocoa-macosx-x86_64/about_files/IJG_README
new file mode 100644
index 0000000..86cc206
--- /dev/null
+++ b/make/lib/swt/cocoa-macosx-x86_64/about_files/IJG_README
@@ -0,0 +1,385 @@
+The Independent JPEG Group's JPEG software
+==========================================
+
+README for release 6b of 27-Mar-1998
+====================================
+
+This distribution contains the sixth public release of the Independent JPEG
+Group's free JPEG software.  You are welcome to redistribute this software and
+to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
+
+Serious users of this software (particularly those incorporating it into
+larger programs) should contact IJG at jpeg-info at uunet.uu.net to be added to
+our electronic mailing list.  Mailing list members are notified of updates
+and have a chance to participate in technical discussions, etc.
+
+This software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
+Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
+Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
+Group.
+
+IJG is not affiliated with the official ISO JPEG standards committee.
+
+
+DOCUMENTATION ROADMAP
+=====================
+
+This file contains the following sections:
+
+OVERVIEW            General description of JPEG and the IJG software.
+LEGAL ISSUES        Copyright, lack of warranty, terms of distribution.
+REFERENCES          Where to learn more about JPEG.
+ARCHIVE LOCATIONS   Where to find newer versions of this software.
+RELATED SOFTWARE    Other stuff you should get.
+FILE FORMAT WARS    Software *not* to get.
+TO DO               Plans for future IJG releases.
+
+Other documentation files in the distribution are:
+
+User documentation:
+  install.doc       How to configure and install the IJG software.
+  usage.doc         Usage instructions for cjpeg, djpeg, jpegtran,
+                    rdjpgcom, and wrjpgcom.
+  *.1               Unix-style man pages for programs (same info as usage.doc).
+  wizard.doc        Advanced usage instructions for JPEG wizards only.
+  change.log        Version-to-version change highlights.
+Programmer and internal documentation:
+  libjpeg.doc       How to use the JPEG library in your own programs.
+  example.c         Sample code for calling the JPEG library.
+  structure.doc     Overview of the JPEG library's internal structure.
+  filelist.doc      Road map of IJG files.
+  coderules.doc     Coding style rules --- please read if you contribute code.
+
+Please read at least the files install.doc and usage.doc.  Useful information
+can also be found in the JPEG FAQ (Frequently Asked Questions) article.  See
+ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
+
+If you want to understand how the JPEG code works, we suggest reading one or
+more of the REFERENCES, then looking at the documentation files (in roughly
+the order listed) before diving into the code.
+
+
+OVERVIEW
+========
+
+This package contains C software to implement JPEG image compression and
+decompression.  JPEG (pronounced "jay-peg") is a standardized compression
+method for full-color and gray-scale images.  JPEG is intended for compressing
+"real-world" scenes; line drawings, cartoons and other non-realistic images
+are not its strong suit.  JPEG is lossy, meaning that the output image is not
+exactly identical to the input image.  Hence you must not use JPEG if you
+have to have identical output bits.  However, on typical photographic images,
+very good compression levels can be obtained with no visible change, and
+remarkably high compression levels are possible if you can tolerate a
+low-quality image.  For more details, see the references, or just experiment
+with various compression settings.
+
+This software implements JPEG baseline, extended-sequential, and progressive
+compression processes.  Provision is made for supporting all variants of these
+processes, although some uncommon parameter settings aren't implemented yet.
+For legal reasons, we are not distributing code for the arithmetic-coding
+variants of JPEG; see LEGAL ISSUES.  We have made no provision for supporting
+the hierarchical or lossless processes defined in the standard.
+
+We provide a set of library routines for reading and writing JPEG image files,
+plus two sample applications "cjpeg" and "djpeg", which use the library to
+perform conversion between JPEG and some other popular image file formats.
+The library is intended to be reused in other applications.
+
+In order to support file conversion and viewing software, we have included
+considerable functionality beyond the bare JPEG coding/decoding capability;
+for example, the color quantization modules are not strictly part of JPEG
+decoding, but they are essential for output to colormapped file formats or
+colormapped displays.  These extra functions can be compiled out of the
+library if not required for a particular application.  We have also included
+"jpegtran", a utility for lossless transcoding between different JPEG
+processes, and "rdjpgcom" and "wrjpgcom", two simple applications for
+inserting and extracting textual comments in JFIF files.
+
+The emphasis in designing this software has been on achieving portability and
+flexibility, while also making it fast enough to be useful.  In particular,
+the software is not intended to be read as a tutorial on JPEG.  (See the
+REFERENCES section for introductory material.)  Rather, it is intended to
+be reliable, portable, industrial-strength code.  We do not claim to have
+achieved that goal in every aspect of the software, but we strive for it.
+
+We welcome the use of this software as a component of commercial products.
+No royalty is required, but we do ask for an acknowledgement in product
+documentation, as described under LEGAL ISSUES.
+
+
+LEGAL ISSUES
+============
+
+In plain English:
+
+1. We don't promise that this software works.  (But if you find any bugs,
+   please let us know!)
+2. You can use this software for whatever you want.  You don't have to pay us.
+3. You may not pretend that you wrote this software.  If you use it in a
+   program, you must acknowledge somewhere in your documentation that
+   you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose.  This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library.  If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it.  This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+
+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
+by the usual distribution terms of the Free Software Foundation; principally,
+that you must include source code if you redistribute it.  (See the file
+ansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
+of any program generated from the IJG code, this does not limit you more than
+the foregoing paragraphs do.
+
+The Unix configuration script "configure" was produced with GNU Autoconf.
+It is copyright by the Free Software Foundation but is freely distributable.
+The same holds for its supporting scripts (config.guess, config.sub,
+ltconfig, ltmain.sh).  Another support script, install-sh, is copyright
+by M.I.T. but is also freely distributable.
+
+It appears that the arithmetic coding option of the JPEG spec is covered by
+patents owned by IBM, AT&T, and Mitsubishi.  Hence arithmetic coding cannot
+legally be used without obtaining one or more licenses.  For this reason,
+support for arithmetic coding has been removed from the free JPEG software.
+(Since arithmetic coding provides only a marginal gain over the unpatented
+Huffman mode, it is unlikely that very many implementations will support it.)
+So far as we are aware, there are no patent restrictions on the remaining
+code.
+
+The IJG distribution formerly included code to read and write GIF files.
+To avoid entanglement with the Unisys LZW patent, GIF reading support has
+been removed altogether, and the GIF writer has been simplified to produce
+"uncompressed GIFs".  This technique does not use the LZW algorithm; the
+resulting GIF files are larger than usual, but are readable by all standard
+GIF decoders.
+
+We are required to state that
+    "The Graphics Interchange Format(c) is the Copyright property of
+    CompuServe Incorporated.  GIF(sm) is a Service Mark property of
+    CompuServe Incorporated."
+
+
+REFERENCES
+==========
+
+We highly recommend reading one or more of these references before trying to
+understand the innards of the JPEG software.
+
+The best short technical introduction to the JPEG compression algorithm is
+	Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+	Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
+(Adjacent articles in that issue discuss MPEG motion picture compression,
+applications of JPEG, and related topics.)  If you don't have the CACM issue
+handy, a PostScript file containing a revised version of Wallace's article is
+available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz.  The file (actually
+a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
+omits the sample images that appeared in CACM, but it includes corrections
+and some added material.  Note: the Wallace article is copyright ACM and IEEE,
+and it may not be used for commercial purposes.
+
+A somewhat less technical, more leisurely introduction to JPEG can be found in
+"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
+M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides
+good explanations and example C code for a multitude of compression methods
+including JPEG.  It is an excellent source if you are comfortable reading C
+code but don't know much about data compression in general.  The book's JPEG
+sample code is far from industrial-strength, but when you are ready to look
+at a full implementation, you've got one here...
+
+The best full description of JPEG is the textbook "JPEG Still Image Data
+Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
+by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.  Price US$59.95, 638 pp.
+The book includes the complete text of the ISO JPEG standards (DIS 10918-1
+and draft DIS 10918-2).  This is by far the most complete exposition of JPEG
+in existence, and we highly recommend it.
+
+The JPEG standard itself is not available electronically; you must order a
+paper copy through ISO or ITU.  (Unless you feel a need to own a certified
+official copy, we recommend buying the Pennebaker and Mitchell book instead;
+it's much cheaper and includes a great deal of useful explanatory material.)
+In the USA, copies of the standard may be ordered from ANSI Sales at (212)
+642-4900, or from Global Engineering Documents at (800) 854-7179.  (ANSI
+doesn't take credit card orders, but Global does.)  It's not cheap: as of
+1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
+shipping/handling.  The standard is divided into two parts, Part 1 being the
+actual specification, while Part 2 covers compliance testing methods.  Part 1
+is titled "Digital Compression and Coding of Continuous-tone Still Images,
+Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
+10918-1, ITU-T T.81.  Part 2 is titled "Digital Compression and Coding of
+Continuous-tone Still Images, Part 2: Compliance testing" and has document
+numbers ISO/IEC IS 10918-2, ITU-T T.83.
+
+Some extensions to the original JPEG standard are defined in JPEG Part 3,
+a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84.  IJG
+currently does not support any Part 3 extensions.
+
+The JPEG standard does not specify all details of an interchangeable file
+format.  For the omitted details we follow the "JFIF" conventions, revision
+1.02.  A copy of the JFIF spec is available from:
+	Literature Department
+	C-Cube Microsystems, Inc.
+	1778 McCarthy Blvd.
+	Milpitas, CA 95035
+	phone (408) 944-6300,  fax (408) 944-6314
+A PostScript version of this document is available by FTP at
+ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz.  There is also a plain text
+version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
+the figures.
+
+The TIFF 6.0 file format specification can be obtained by FTP from
+ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme
+found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
+IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
+Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
+(Compression tag 7).  Copies of this Note can be obtained from ftp.sgi.com or
+from ftp://ftp.uu.net/graphics/jpeg/.  It is expected that the next revision
+of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
+Although IJG's own code does not support TIFF/JPEG, the free libtiff library
+uses our library to implement TIFF/JPEG per the Note.  libtiff is available
+from ftp://ftp.sgi.com/graphics/tiff/.
+
+
+ARCHIVE LOCATIONS
+=================
+
+The "official" archive site for this software is ftp.uu.net (Internet
+address 192.48.96.9).  The most recent released version can always be found
+there in directory graphics/jpeg.  This particular version will be archived
+as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz.  If you don't have
+direct Internet access, UUNET's archives are also available via UUCP; contact
+help at uunet.uu.net for information on retrieving files that way.
+
+Numerous Internet sites maintain copies of the UUNET files.  However, only
+ftp.uu.net is guaranteed to have the latest official version.
+
+You can also obtain this software in DOS-compatible "zip" archive format from
+the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or
+on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12
+"JPEG Tools".  Again, these versions may sometimes lag behind the ftp.uu.net
+release.
+
+The JPEG FAQ (Frequently Asked Questions) article is a useful source of
+general information about JPEG.  It is updated constantly and therefore is
+not included in this distribution.  The FAQ is posted every two weeks to
+Usenet newsgroups comp.graphics.misc, news.answers, and other groups.
+It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
+and other news.answers archive sites, including the official news.answers
+archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
+If you don't have Web or FTP access, send e-mail to mail-server at rtfm.mit.edu
+with body
+	send usenet/news.answers/jpeg-faq/part1
+	send usenet/news.answers/jpeg-faq/part2
+
+
+RELATED SOFTWARE
+================
+
+Numerous viewing and image manipulation programs now support JPEG.  (Quite a
+few of them use this library to do so.)  The JPEG FAQ described above lists
+some of the more popular free and shareware viewers, and tells where to
+obtain them on Internet.
+
+If you are on a Unix machine, we highly recommend Jef Poskanzer's free
+PBMPLUS software, which provides many useful operations on PPM-format image
+files.  In particular, it can convert PPM images to and from a wide range of
+other formats, thus making cjpeg/djpeg considerably more useful.  The latest
+version is distributed by the NetPBM group, and is available from numerous
+sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
+Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
+you are likely to have difficulty making it work on any non-Unix machine.
+
+A different free JPEG implementation, written by the PVRG group at Stanford,
+is available from ftp://havefun.stanford.edu/pub/jpeg/.  This program
+is designed for research and experimentation rather than production use;
+it is slower, harder to use, and less portable than the IJG code, but it
+is easier to read and modify.  Also, the PVRG code supports lossless JPEG,
+which we do not.  (On the other hand, it doesn't do progressive JPEG.)
+
+
+FILE FORMAT WARS
+================
+
+Some JPEG programs produce files that are not compatible with our library.
+The root of the problem is that the ISO JPEG committee failed to specify a
+concrete file format.  Some vendors "filled in the blanks" on their own,
+creating proprietary formats that no one else could read.  (For example, none
+of the early commercial JPEG implementations for the Macintosh were able to
+exchange compressed files.)
+
+The file format we have adopted is called JFIF (see REFERENCES).  This format
+has been agreed to by a number of major commercial JPEG vendors, and it has
+become the de facto standard.  JFIF is a minimal or "low end" representation.
+We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
+Technical Note #2) for "high end" applications that need to record a lot of
+additional data about an image.  TIFF/JPEG is fairly new and not yet widely
+supported, unfortunately.
+
+The upcoming JPEG Part 3 standard defines a file format called SPIFF.
+SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
+be able to read the most common variant of SPIFF.  SPIFF has some technical
+advantages over JFIF, but its major claim to fame is simply that it is an
+official standard rather than an informal one.  At this point it is unclear
+whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
+standard.  IJG intends to support SPIFF once the standard is frozen, but we
+have not decided whether it should become our default output format or not.
+(In any case, our decoder will remain capable of reading JFIF indefinitely.)
+
+Various proprietary file formats incorporating JPEG compression also exist.
+We have little or no sympathy for the existence of these formats.  Indeed,
+one of the original reasons for developing this free software was to help
+force convergence on common, open format standards for JPEG files.  Don't
+use a proprietary file format!
+
+
+TO DO
+=====
+
+The major thrust for v7 will probably be improvement of visual quality.
+The current method for scaling the quantization tables is known not to be
+very good at low Q values.  We also intend to investigate block boundary
+smoothing, "poor man's variable quantization", and other means of improving
+quality-vs-file-size performance without sacrificing compatibility.
+
+In future versions, we are considering supporting some of the upcoming JPEG
+Part 3 extensions --- principally, variable quantization and the SPIFF file
+format.
+
+As always, speeding things up is of great interest.
+
+Please send bug reports, offers of help, etc. to jpeg-info at uunet.uu.net.
diff --git a/make/lib/swt/cocoa-macosx-x86_64/about_files/mpl-v11.txt b/make/lib/swt/cocoa-macosx-x86_64/about_files/mpl-v11.txt
new file mode 100644
index 0000000..7714141
--- /dev/null
+++ b/make/lib/swt/cocoa-macosx-x86_64/about_files/mpl-v11.txt
@@ -0,0 +1,470 @@
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the "License"); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
diff --git a/make/lib/swt/cocoa-macosx-x86_64/swt-debug.jar b/make/lib/swt/cocoa-macosx-x86_64/swt-debug.jar
new file mode 100644
index 0000000..a369b68
Binary files /dev/null and b/make/lib/swt/cocoa-macosx-x86_64/swt-debug.jar differ
diff --git a/make/lib/swt/cocoa-macosx/about.html b/make/lib/swt/cocoa-macosx/about.html
new file mode 100644
index 0000000..d4f53de
--- /dev/null
+++ b/make/lib/swt/cocoa-macosx/about.html
@@ -0,0 +1,218 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>August 17, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content").  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL").  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+<h3>Third Party Content</h3>
+
+<p>The Content includes items that have been sourced from third parties as set out below. If you 
+did not receive this Content directly from the Eclipse Foundation, the following is provided 
+for informational purposes only, and you should look to the Redistributor’s license for 
+terms and conditions of use.</p>
+
+<h4>Carbon Binding</h4>
+
+<p>The "Carbon Binding" is a binding to the Carbon API.  The Content may include any or all of three portions of the Carbon Binding:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Carbon Binding:</p>
+<ul>
+	<li>libswt-pi-carbon-xxxx.jnilib (where "xxxx" is the version number)</li>	
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Carbon Binding:</p>
+
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/carbon (but not including any sub-directories)</li>
+</ul>
+
+<p>The Carbon Binding contains portions of Apple Computer's Carbon API header files which are:</p>
+
+<blockquote>Copyright © 1983-2002 Apple Computer, Inc.</blockquote>
+
+<p>In addition to the terms and conditions of the EPL, the following notice applies to your use of the Carbon Binding and must be retained and reproduced in its entirety with all redistributions of the
+Carbon Binding:</p>
+
+<blockquote>
+Copyright © 2004 Apple Computer, Inc.<br>
+This text and the following notice must be retained and reproduced in their entirety with all redistributions of this project:<br><br>
+<strong>IMPORTANT NOTICE</strong>: This project, which consists of certain Java bindings, includes or otherwise makes references to application programming interfaces
+(APIs) that are owned by Apple Computer, Inc., including but not limited to certain Apple Carbon APIs. While you may use, copy, modify and redistribute
+this Java bindings project in accordance with the terms of the Eclipse Public License (EPL) version 1.0, you are not granted any rights under any Apple or
+third party intellectual property rights (including without limitation, patent, copyright, trademark and trade secret rights) to Apple's Carbon API header files
+themselves, nor to any underlying implementations of any Apple Carbon APIs or to any functionality that is invoked by calling any of those APIs. Without
+limiting the generality of the foregoing, you understand that it is not Apple's intention by way of this project to authorize the reverse engineering of the Java
+bindings into Apple's original Carbon.h header files.
+</blockquote>
+
+<h4>Mozilla Binding</h4>
+
+<p>The "Mozilla Binding" is a binding to the Mozilla API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Mozilla Binding:</p>
+<ul>
+	<li>libswt-xulrunner-cocoa-xxxx.so (where "xxxx" is the version number)</li>
+	<li>libswt-xpcominit-cocoa-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Mozilla Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/mozilla (but not including any sub-directories)</li>
+</ul>
+
+<p>The Mozilla Binding contains portions of Mozilla ("Mozilla").  Mozilla is made available by Mozilla.org.  Use of Mozilla is governed by the terms and
+conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided with the Content (<a href="about_files/mpl-v11.txt" target="_blank">mpl-v11.txt</a>) and is also available at
+<a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html</a>.</p>
+
+<h4>XULRunner 1.9 (subset, derivative work)</h4>
+
+The library libswt-xulrunner-cocoa-xxxx.jnilib (where "xxxx" is the version number) contains a small portion of XULRunner 1.9 content (header files) that have
+been modified from the Original Code provided by mozilla.org, and whose Initial Developer is Netscape Communications Corporation. Use of this code is governed by
+the terms and conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided with the Content (<a href="./about_files/mpl-v11.txt">mpl-v11.txt</a>)
+and is also available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>.
+<p>The changed files are:
+<ul>
+  <li>org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext.h</code>
+  <li>org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h</code>
+</ul>
+Changes to the original files were made by SWT on April 7, 2009 and are marked with trailing comment <em>"//SWT-20090407"</em>.
+
+<h4>Independent JPEG Group's JPEG software release 6b</h4>
+
+<p>This software is based in part on the work of the Independent JPEG Group's JPEG software release 6b ("LIBJPEG").
+LIBJPEG was used to implement the decoding of JPEG format files in Java (TM).  The Content does NOT include any portion of the LIBJPEG file ansi2knr.c.</p>
+
+<p>Your use of LIBJPEG is subject to the terms and conditions located in the <a href="about_files/IJG_README">about_files/IJG_README</a> file which is included
+with the Content.</p>
+
+<p>The IJG's website is located at <a href="http://ijg.org/" target="_blank">http://ijg.org</a>.</p>
+
+<p>The class org.eclipse.swt.internal.image.JPEGFileFormat is based on following files from LIBJPEG:</p>
+
+<ul>
+    <li>cderror.h</li>
+    <li>cdjpeg.h</li>
+    <li>jchuff.h</li>
+    <li>jdcolor.c</li>
+    <li>jdct.h</li>
+    <li>jdhuff.h</li>
+    <li>jerror.h</li>
+    <li>jidctint.c</li>
+    <li>jinclude.h</li>
+    <li>jmemsys.h</li>
+    <li>jmorecfg.h</li>
+    <li>jpegint.h</li>
+    <li>jpeglib.h</li>
+    <li>jversion.h</li>
+    <li>transupp.h</li>
+</ul>
+
+<p>The class org.eclipse.swt.internal.image.JPEGDecoder is based on the following files from LIBJPEG:</p>
+
+<ul>
+	<li>jcapimin.c</li>
+	<li>jcapistd.c</li>
+	<li>jccoefct.c</li>
+	<li>jccolor.c</li>
+	<li>jcdctmgr.c</li>
+	<li>jchuff.c</li>
+	<li>jcinit.c</li>
+	<li>jcmainct.c</li>
+	<li>jcmarker.c</li>
+	<li>jcmaster.c</li>
+	<li>jcomapi.c</li>
+	<li>jcparam.c</li>
+	<li>jcphuff.c</li>
+	<li>jcprepct.c</li>
+	<li>jcsample.c</li>
+	<li>jctrans.c</li>
+	<li>jdapimin.c</li>
+	<li>jdapistd.c</li>
+	<li>jdatadst.c</li>
+	<li>jdatasrc.c</li>
+	<li>jdcoefct.c</li>
+	<li>jdcolor.c</li>
+	<li>jddctmgr.c</li>
+	<li>jdhuff.c</li>
+	<li>jdinput.c</li>
+	<li>jdmainct.c</li>
+	<li>jdmarker.c</li>
+	<li>jdmaster.c</li>
+	<li>jdmerge.c</li>
+	<li>jdphuff.c</li>
+	<li>jdpostct.c</li>
+	<li>jdsample.c</li>
+	<li>jdtrans.c</li>
+	<li>jerror.c</li>
+	<li>jfdctflt.c</li>
+	<li>jfdctfst.c</li>
+	<li>jfdctint.c</li>
+	<li>jidctflt.c</li>
+	<li>jidctfst.c</li>
+	<li>jidctint.c</li>
+	<li>jidctred.c</li>
+	<li>jpegtran.c</li>
+	<li>jquant1.c</li>
+	<li>jquant2.c</li>
+	<li>jutils.c</li>
+	<li>cderror.h</li>
+	<li>cdjpeg.h</li>
+	<li>jchuff.h</li>
+	<li>jconfig.h</li>
+	<li>jdct.h</li>
+	<li>jdhuff.h</li>
+	<li>jerror.h</li>
+	<li>jinclude.h</li>
+	<li>jmorecfg.h</li>
+	<li>jpegint.h</li>
+	<li>jpeglib.h</li>
+	<li>jversion.h</li>
+	<li>transupp.h</li>
+</ul>
+	
+<p>The following changes were made to the LIBJPEG code in the Content:</p>
+
+<ol>
+	<li>In Java, pointer math is not allowed so indexing was used instead.</li>
+	<li>Function pointers were replaced with switch statements.</li>
+	<li>The virtual memory, tracing and progress monitoring were removed.</li>
+	<li>The error handling was simplified and now uses Java exceptions.</li>
+</ol>
+
+<h4>PuTTY 0.58 (derivative work)</h4>
+
+<p>Portions of the SWT class org/eclipse/swt/internal/image/PngDeflater are based on PuTTY's sshzlib.c. PuTTY is made available by Mozilla.org.  Use of PuTTY is governed by the terms and
+conditions of the the following MIT-style license:  </p>
+<blockquote>
+  <p><em>PuTTY is copyright 1997-2007 Simon Tatham.</em> </p>
+  <p><em>Portions copyright Robert de Bath, Joris van Rantwijk, Delian  Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,  Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn,  and CORE SDI S.A.</em> </p>
+  <p><em>Permission is hereby granted, free of charge, to any person  obtaining a copy of this software and associated documentation files  (the "Software"), to deal in the Software without restriction,  including without limitation the rights to use, copy, modify, merge,  publish, distribute, sublicense, and/or sell copies of the Software,  and to permit persons to whom the Software is furnished to do so,  subject to the following conditions:</em> </p>
+  <p><em>The above copyright notice and this permission notice shall be  included in all copies or substantial portions of the Software.</em> </p>
+  <p><em>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND  NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR ANY  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</em> </p>
+</blockquote>
+<p>A copy of the license is also available at <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html" target="_blank">http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html</a>.</p>
+
+<p><small>Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.</small></p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/make/lib/swt/cocoa-macosx/about_files/IJG_README b/make/lib/swt/cocoa-macosx/about_files/IJG_README
new file mode 100644
index 0000000..86cc206
--- /dev/null
+++ b/make/lib/swt/cocoa-macosx/about_files/IJG_README
@@ -0,0 +1,385 @@
+The Independent JPEG Group's JPEG software
+==========================================
+
+README for release 6b of 27-Mar-1998
+====================================
+
+This distribution contains the sixth public release of the Independent JPEG
+Group's free JPEG software.  You are welcome to redistribute this software and
+to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
+
+Serious users of this software (particularly those incorporating it into
+larger programs) should contact IJG at jpeg-info at uunet.uu.net to be added to
+our electronic mailing list.  Mailing list members are notified of updates
+and have a chance to participate in technical discussions, etc.
+
+This software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
+Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
+Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
+Group.
+
+IJG is not affiliated with the official ISO JPEG standards committee.
+
+
+DOCUMENTATION ROADMAP
+=====================
+
+This file contains the following sections:
+
+OVERVIEW            General description of JPEG and the IJG software.
+LEGAL ISSUES        Copyright, lack of warranty, terms of distribution.
+REFERENCES          Where to learn more about JPEG.
+ARCHIVE LOCATIONS   Where to find newer versions of this software.
+RELATED SOFTWARE    Other stuff you should get.
+FILE FORMAT WARS    Software *not* to get.
+TO DO               Plans for future IJG releases.
+
+Other documentation files in the distribution are:
+
+User documentation:
+  install.doc       How to configure and install the IJG software.
+  usage.doc         Usage instructions for cjpeg, djpeg, jpegtran,
+                    rdjpgcom, and wrjpgcom.
+  *.1               Unix-style man pages for programs (same info as usage.doc).
+  wizard.doc        Advanced usage instructions for JPEG wizards only.
+  change.log        Version-to-version change highlights.
+Programmer and internal documentation:
+  libjpeg.doc       How to use the JPEG library in your own programs.
+  example.c         Sample code for calling the JPEG library.
+  structure.doc     Overview of the JPEG library's internal structure.
+  filelist.doc      Road map of IJG files.
+  coderules.doc     Coding style rules --- please read if you contribute code.
+
+Please read at least the files install.doc and usage.doc.  Useful information
+can also be found in the JPEG FAQ (Frequently Asked Questions) article.  See
+ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
+
+If you want to understand how the JPEG code works, we suggest reading one or
+more of the REFERENCES, then looking at the documentation files (in roughly
+the order listed) before diving into the code.
+
+
+OVERVIEW
+========
+
+This package contains C software to implement JPEG image compression and
+decompression.  JPEG (pronounced "jay-peg") is a standardized compression
+method for full-color and gray-scale images.  JPEG is intended for compressing
+"real-world" scenes; line drawings, cartoons and other non-realistic images
+are not its strong suit.  JPEG is lossy, meaning that the output image is not
+exactly identical to the input image.  Hence you must not use JPEG if you
+have to have identical output bits.  However, on typical photographic images,
+very good compression levels can be obtained with no visible change, and
+remarkably high compression levels are possible if you can tolerate a
+low-quality image.  For more details, see the references, or just experiment
+with various compression settings.
+
+This software implements JPEG baseline, extended-sequential, and progressive
+compression processes.  Provision is made for supporting all variants of these
+processes, although some uncommon parameter settings aren't implemented yet.
+For legal reasons, we are not distributing code for the arithmetic-coding
+variants of JPEG; see LEGAL ISSUES.  We have made no provision for supporting
+the hierarchical or lossless processes defined in the standard.
+
+We provide a set of library routines for reading and writing JPEG image files,
+plus two sample applications "cjpeg" and "djpeg", which use the library to
+perform conversion between JPEG and some other popular image file formats.
+The library is intended to be reused in other applications.
+
+In order to support file conversion and viewing software, we have included
+considerable functionality beyond the bare JPEG coding/decoding capability;
+for example, the color quantization modules are not strictly part of JPEG
+decoding, but they are essential for output to colormapped file formats or
+colormapped displays.  These extra functions can be compiled out of the
+library if not required for a particular application.  We have also included
+"jpegtran", a utility for lossless transcoding between different JPEG
+processes, and "rdjpgcom" and "wrjpgcom", two simple applications for
+inserting and extracting textual comments in JFIF files.
+
+The emphasis in designing this software has been on achieving portability and
+flexibility, while also making it fast enough to be useful.  In particular,
+the software is not intended to be read as a tutorial on JPEG.  (See the
+REFERENCES section for introductory material.)  Rather, it is intended to
+be reliable, portable, industrial-strength code.  We do not claim to have
+achieved that goal in every aspect of the software, but we strive for it.
+
+We welcome the use of this software as a component of commercial products.
+No royalty is required, but we do ask for an acknowledgement in product
+documentation, as described under LEGAL ISSUES.
+
+
+LEGAL ISSUES
+============
+
+In plain English:
+
+1. We don't promise that this software works.  (But if you find any bugs,
+   please let us know!)
+2. You can use this software for whatever you want.  You don't have to pay us.
+3. You may not pretend that you wrote this software.  If you use it in a
+   program, you must acknowledge somewhere in your documentation that
+   you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose.  This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library.  If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it.  This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+
+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
+by the usual distribution terms of the Free Software Foundation; principally,
+that you must include source code if you redistribute it.  (See the file
+ansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
+of any program generated from the IJG code, this does not limit you more than
+the foregoing paragraphs do.
+
+The Unix configuration script "configure" was produced with GNU Autoconf.
+It is copyright by the Free Software Foundation but is freely distributable.
+The same holds for its supporting scripts (config.guess, config.sub,
+ltconfig, ltmain.sh).  Another support script, install-sh, is copyright
+by M.I.T. but is also freely distributable.
+
+It appears that the arithmetic coding option of the JPEG spec is covered by
+patents owned by IBM, AT&T, and Mitsubishi.  Hence arithmetic coding cannot
+legally be used without obtaining one or more licenses.  For this reason,
+support for arithmetic coding has been removed from the free JPEG software.
+(Since arithmetic coding provides only a marginal gain over the unpatented
+Huffman mode, it is unlikely that very many implementations will support it.)
+So far as we are aware, there are no patent restrictions on the remaining
+code.
+
+The IJG distribution formerly included code to read and write GIF files.
+To avoid entanglement with the Unisys LZW patent, GIF reading support has
+been removed altogether, and the GIF writer has been simplified to produce
+"uncompressed GIFs".  This technique does not use the LZW algorithm; the
+resulting GIF files are larger than usual, but are readable by all standard
+GIF decoders.
+
+We are required to state that
+    "The Graphics Interchange Format(c) is the Copyright property of
+    CompuServe Incorporated.  GIF(sm) is a Service Mark property of
+    CompuServe Incorporated."
+
+
+REFERENCES
+==========
+
+We highly recommend reading one or more of these references before trying to
+understand the innards of the JPEG software.
+
+The best short technical introduction to the JPEG compression algorithm is
+	Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+	Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
+(Adjacent articles in that issue discuss MPEG motion picture compression,
+applications of JPEG, and related topics.)  If you don't have the CACM issue
+handy, a PostScript file containing a revised version of Wallace's article is
+available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz.  The file (actually
+a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
+omits the sample images that appeared in CACM, but it includes corrections
+and some added material.  Note: the Wallace article is copyright ACM and IEEE,
+and it may not be used for commercial purposes.
+
+A somewhat less technical, more leisurely introduction to JPEG can be found in
+"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
+M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides
+good explanations and example C code for a multitude of compression methods
+including JPEG.  It is an excellent source if you are comfortable reading C
+code but don't know much about data compression in general.  The book's JPEG
+sample code is far from industrial-strength, but when you are ready to look
+at a full implementation, you've got one here...
+
+The best full description of JPEG is the textbook "JPEG Still Image Data
+Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
+by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.  Price US$59.95, 638 pp.
+The book includes the complete text of the ISO JPEG standards (DIS 10918-1
+and draft DIS 10918-2).  This is by far the most complete exposition of JPEG
+in existence, and we highly recommend it.
+
+The JPEG standard itself is not available electronically; you must order a
+paper copy through ISO or ITU.  (Unless you feel a need to own a certified
+official copy, we recommend buying the Pennebaker and Mitchell book instead;
+it's much cheaper and includes a great deal of useful explanatory material.)
+In the USA, copies of the standard may be ordered from ANSI Sales at (212)
+642-4900, or from Global Engineering Documents at (800) 854-7179.  (ANSI
+doesn't take credit card orders, but Global does.)  It's not cheap: as of
+1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
+shipping/handling.  The standard is divided into two parts, Part 1 being the
+actual specification, while Part 2 covers compliance testing methods.  Part 1
+is titled "Digital Compression and Coding of Continuous-tone Still Images,
+Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
+10918-1, ITU-T T.81.  Part 2 is titled "Digital Compression and Coding of
+Continuous-tone Still Images, Part 2: Compliance testing" and has document
+numbers ISO/IEC IS 10918-2, ITU-T T.83.
+
+Some extensions to the original JPEG standard are defined in JPEG Part 3,
+a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84.  IJG
+currently does not support any Part 3 extensions.
+
+The JPEG standard does not specify all details of an interchangeable file
+format.  For the omitted details we follow the "JFIF" conventions, revision
+1.02.  A copy of the JFIF spec is available from:
+	Literature Department
+	C-Cube Microsystems, Inc.
+	1778 McCarthy Blvd.
+	Milpitas, CA 95035
+	phone (408) 944-6300,  fax (408) 944-6314
+A PostScript version of this document is available by FTP at
+ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz.  There is also a plain text
+version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
+the figures.
+
+The TIFF 6.0 file format specification can be obtained by FTP from
+ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme
+found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
+IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
+Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
+(Compression tag 7).  Copies of this Note can be obtained from ftp.sgi.com or
+from ftp://ftp.uu.net/graphics/jpeg/.  It is expected that the next revision
+of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
+Although IJG's own code does not support TIFF/JPEG, the free libtiff library
+uses our library to implement TIFF/JPEG per the Note.  libtiff is available
+from ftp://ftp.sgi.com/graphics/tiff/.
+
+
+ARCHIVE LOCATIONS
+=================
+
+The "official" archive site for this software is ftp.uu.net (Internet
+address 192.48.96.9).  The most recent released version can always be found
+there in directory graphics/jpeg.  This particular version will be archived
+as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz.  If you don't have
+direct Internet access, UUNET's archives are also available via UUCP; contact
+help at uunet.uu.net for information on retrieving files that way.
+
+Numerous Internet sites maintain copies of the UUNET files.  However, only
+ftp.uu.net is guaranteed to have the latest official version.
+
+You can also obtain this software in DOS-compatible "zip" archive format from
+the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or
+on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12
+"JPEG Tools".  Again, these versions may sometimes lag behind the ftp.uu.net
+release.
+
+The JPEG FAQ (Frequently Asked Questions) article is a useful source of
+general information about JPEG.  It is updated constantly and therefore is
+not included in this distribution.  The FAQ is posted every two weeks to
+Usenet newsgroups comp.graphics.misc, news.answers, and other groups.
+It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
+and other news.answers archive sites, including the official news.answers
+archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
+If you don't have Web or FTP access, send e-mail to mail-server at rtfm.mit.edu
+with body
+	send usenet/news.answers/jpeg-faq/part1
+	send usenet/news.answers/jpeg-faq/part2
+
+
+RELATED SOFTWARE
+================
+
+Numerous viewing and image manipulation programs now support JPEG.  (Quite a
+few of them use this library to do so.)  The JPEG FAQ described above lists
+some of the more popular free and shareware viewers, and tells where to
+obtain them on Internet.
+
+If you are on a Unix machine, we highly recommend Jef Poskanzer's free
+PBMPLUS software, which provides many useful operations on PPM-format image
+files.  In particular, it can convert PPM images to and from a wide range of
+other formats, thus making cjpeg/djpeg considerably more useful.  The latest
+version is distributed by the NetPBM group, and is available from numerous
+sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
+Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
+you are likely to have difficulty making it work on any non-Unix machine.
+
+A different free JPEG implementation, written by the PVRG group at Stanford,
+is available from ftp://havefun.stanford.edu/pub/jpeg/.  This program
+is designed for research and experimentation rather than production use;
+it is slower, harder to use, and less portable than the IJG code, but it
+is easier to read and modify.  Also, the PVRG code supports lossless JPEG,
+which we do not.  (On the other hand, it doesn't do progressive JPEG.)
+
+
+FILE FORMAT WARS
+================
+
+Some JPEG programs produce files that are not compatible with our library.
+The root of the problem is that the ISO JPEG committee failed to specify a
+concrete file format.  Some vendors "filled in the blanks" on their own,
+creating proprietary formats that no one else could read.  (For example, none
+of the early commercial JPEG implementations for the Macintosh were able to
+exchange compressed files.)
+
+The file format we have adopted is called JFIF (see REFERENCES).  This format
+has been agreed to by a number of major commercial JPEG vendors, and it has
+become the de facto standard.  JFIF is a minimal or "low end" representation.
+We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
+Technical Note #2) for "high end" applications that need to record a lot of
+additional data about an image.  TIFF/JPEG is fairly new and not yet widely
+supported, unfortunately.
+
+The upcoming JPEG Part 3 standard defines a file format called SPIFF.
+SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
+be able to read the most common variant of SPIFF.  SPIFF has some technical
+advantages over JFIF, but its major claim to fame is simply that it is an
+official standard rather than an informal one.  At this point it is unclear
+whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
+standard.  IJG intends to support SPIFF once the standard is frozen, but we
+have not decided whether it should become our default output format or not.
+(In any case, our decoder will remain capable of reading JFIF indefinitely.)
+
+Various proprietary file formats incorporating JPEG compression also exist.
+We have little or no sympathy for the existence of these formats.  Indeed,
+one of the original reasons for developing this free software was to help
+force convergence on common, open format standards for JPEG files.  Don't
+use a proprietary file format!
+
+
+TO DO
+=====
+
+The major thrust for v7 will probably be improvement of visual quality.
+The current method for scaling the quantization tables is known not to be
+very good at low Q values.  We also intend to investigate block boundary
+smoothing, "poor man's variable quantization", and other means of improving
+quality-vs-file-size performance without sacrificing compatibility.
+
+In future versions, we are considering supporting some of the upcoming JPEG
+Part 3 extensions --- principally, variable quantization and the SPIFF file
+format.
+
+As always, speeding things up is of great interest.
+
+Please send bug reports, offers of help, etc. to jpeg-info at uunet.uu.net.
diff --git a/make/lib/swt/cocoa-macosx/about_files/mpl-v11.txt b/make/lib/swt/cocoa-macosx/about_files/mpl-v11.txt
new file mode 100644
index 0000000..7714141
--- /dev/null
+++ b/make/lib/swt/cocoa-macosx/about_files/mpl-v11.txt
@@ -0,0 +1,470 @@
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the "License"); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
diff --git a/make/lib/swt/cocoa-macosx/swt-debug.jar b/make/lib/swt/cocoa-macosx/swt-debug.jar
new file mode 100644
index 0000000..6e1a2a5
Binary files /dev/null and b/make/lib/swt/cocoa-macosx/swt-debug.jar differ
diff --git a/make/lib/swt/epl-v10.html b/make/lib/swt/epl-v10.html
new file mode 100644
index 0000000..fd39122
--- /dev/null
+++ b/make/lib/swt/epl-v10.html
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Public License - Version 1.0</title>
+<style type="text/css">
+  body {
+    size: 8.5in 11.0in;
+    margin: 0.25in 0.5in 0.25in 0.5in;
+    tab-interval: 0.5in;
+    }
+  p {  	
+    margin-left: auto;
+    margin-top:  0.5em;
+    margin-bottom: 0.5em;
+    }
+  p.list {
+  	margin-left: 0.5in;
+    margin-top:  0.05em;
+    margin-bottom: 0.05em;
+    }
+  </style>
+
+</head>
+
+<body lang="EN-US">
+
+<h2>Eclipse Public License - v 1.0</h2>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+</body>
+
+</html>
diff --git a/make/lib/swt/gtk-linux-x86/about.html b/make/lib/swt/gtk-linux-x86/about.html
new file mode 100644
index 0000000..6c5fbd8
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86/about.html
@@ -0,0 +1,301 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>August 17, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content").  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL").  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+<h3>Third Party Content</h3>
+
+<p>The Content includes items that have been sourced from third parties as set out below. If you 
+did not receive this Content directly from the Eclipse Foundation, the following is provided 
+for informational purposes only, and you should look to the Redistributor’s license for 
+terms and conditions of use.</p>
+
+<h4>Gnome Binding</h4>
+
+<p>The "Gnome Binding" is a binding to the Gnome API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Gnome Binding:</p>
+<ul>
+	<li>libswt-gnome-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Gnome Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/gnome (but not including any sub-directories)</li>
+</ul>
+
+<p>The Gnome Binding contains portions of Gnome ("Library").  Gnome is made available by The Free Software Foundation.  Use of the Library is governed by the terms and
+conditions of the GNU Lesser General Public License Version 2.1 ("LGPL").  Use of the Gnome Binding on a standalone
+basis, is also governed by the terms and conditions of the LGPL.  A copy of the LGPL is provided with the Content (<a href="about_files/lgpl-v21.txt" target="_blank">lgpl-v21.txt</a>) and is also available at
+<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">http://www.gnu.org/licenses/lgpl.html</a>.</p>
+
+<p>In accordance with Section 6 of the LGPL, you may combine or link a "work that uses the Library" (e.g. the SWT) with the Library to produce a work
+containing portions of the Library (e.g. the Gnome Binding) and distribute that work under the terms of your choice (e.g. the EPL) provided you comply with all
+other terms and conditions of Section 6 as well as other Sections of the LGPL.  Please note, if you modify the Gnome Binding such modifications shall be
+governed by the terms and conditions of the LGPL.  Also note, the terms of the EPL permit you to modify the combined work and the source code of the combined
+work is provided for debugging purposes so there is no need to reverse engineer the combined work.</p>
+
+<h4>GTK+ Binding</h4>
+
+<p>The "GTK+ Binding" is a binding to the GTK+ API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the GTK+ Binding:</p>
+<ul>
+	<li>libswt-atk-gtk-xxxx.so (where "xxxx" is the version number)</li>
+	<li>libswt-pi-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the GTK+ Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/accessibility/gtk (but not including any sub-directories)</li>
+	<li>The contents of the directory org/eclipse/swt/internal/cde (but not including any sub-directories)</li>
+	<li>The contents of the directory org/eclipse/swt/internal/gtk (but not including any sub-directories)</li>				
+</ul>
+
+<p>The GTK+ Binding contains portions of GTK+ ("Library").  GTK+ is made available by The Free Software Foundation.  Use of the Library is governed by the terms and
+conditions of the GNU Lesser General Public License Version 2.1 ("LGPL").  Use of the GTK+ Binding on a standalone
+basis, is also governed by the terms and conditions of the LGPL.  A copy of the LGPL is provided with the Content (<a href="about_files/lgpl-v21.txt" target="_blank">lgpl-v21.txt</a>) and is also available at
+<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">http://www.gnu.org/licenses/lgpl.html</a>.</p>
+
+<p>In accordance with Section 6 of the LGPL, you may combine or link a "work that uses the Library" (e.g. the SWT) with the Library to produce a work
+containing portions of the Library (e.g. the GTK+ Binding) and distribute that work under the terms of your choice (e.g. the EPL) provided you comply with all
+other terms and conditions of Section 6 as well as other Sections of the LGPL.  Please note, if you modify the GTK+ Binding such modifications shall be
+governed by the terms and conditions of the LGPL.  Also note, the terms of the EPL permit you to modify the combined work and the source code of the combined
+work is provided for debugging purposes so there is no need to reverse engineer the combined work.</p>
+
+<h4>WebKitGTK+ Binding</h4>
+
+<p>The "WebKitGTK+ Binding" is a binding to the WebKitGTK+ API. The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the WebKitGTK+ Binding:</p>
+
+<ul>
+    <li>libswt-webkit-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the WebKitGTK+ Binding:</p>
+<ul>
+    <li>The contents of the directory org/eclipse/swt/internal/webkit (but not including any sub-directories)</li>
+</ul>
+
+<p>
+The WebKitGTK+ Binding contains portions of WebKitGTK+ ("Library"). WebKitGTK+ is made available by the WebKitGTK+ open source project (<a href="http://webkitgtk.org/" target="_blank">http://webkit.org/</a>). Use of the Library is governed by the terms and conditions of the GNU Lesser General Public License Version 2.1 ("LGPL"). Use of the WebKitGTK+ Binding on a standalone basis, is also governed by the terms and conditions of the LGPL. A copy of the LGPL is provided [...]
+
+<p>
+In accordance with Section 6 of the LGPL, you may combine or link a "work that uses the Library" (e.g. the SWT) with the Library to produce a work containing portions of the Library (e.g. the WebKitGTK+ Binding) and distribute that work under the terms of your choice (e.g. the EPL) provided you comply with all other terms and conditions of Section 6 as well as other Sections of the LGPL. Please note, if you modify the WebKitGTK+ Binding such modifications shall be governed by t [...]
+
+<p>The WebKitGTK+ Binding also contains portions of the WebKit JavaScriptCore code which is made available by the WebKit open source project (<a href="http://webkit.org/" target="_blank">http://webkit.org/</a>).  The WebKit JavaScriptCore code was obtained under the terms of the BSD license.  A copy of the BSD license is provided (<a href="about_files/webkit-bsd.txt"target="_blank">webkit-bsd.txt</a>) and is also available at <a href="http://webkit.org/coding/bsd-license.html" target="_b [...]
+
+<h4>libsoup</h4>
+
+<p>The "WebKitGTK+ Binding" also includes a binding to the libsoup API. The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the WebKitGTK+ Binding:</p>
+<ul>
+    <li>libswt-webkit-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the WebKitGTK+ Binding:</p>
+<ul>
+    <li>The contents of the directory org/eclipse/swt/internal/webkit (but not including any sub-directories)</li>
+</ul>
+
+<p>The WebKitGTK+ Binding contains portions of libsoup ("Library"). libsoup is made available by The GNOME Project (<a href="http://live.gnome.org/LibSoup" target="_blank">http://live.gnome.org/LibSoup/</a>). Use of the Library is governed by the terms and conditions of the GNU Lesser General Public License Version 2.1 ("LGPL"). Use of the WebKitGTK+ Binding on a standalone basis, is also governed by the terms and conditions of the LGPL. A copy of the LGPL is provided [...]
+
+<h4>Mozilla Binding</h4>
+
+<p>The "Mozilla Binding" is a binding to the Mozilla API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Mozilla Binding:</p>
+<ul>
+	<li>libswt-mozilla-gtk-xxxx.so (where "xxxx" is the version number)</li>
+	<li>libswt-mozilla-gcc3-gtk-xxxx.so (where "xxxx" is the version number)</li>
+	<li>libswt-xulrunner-gtk-xxxx.so (where "xxxx" is the version number)</li>
+	<li>libswt-xpcominit-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Mozilla Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/mozilla (but not including any sub-directories)</li>
+</ul>
+
+<p>The Mozilla Binding contains portions of Mozilla ("Mozilla").  Mozilla is made available by Mozilla.org.  Use of Mozilla is governed by the terms and
+conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided with the Content (<a href="about_files/mpl-v11.txt" target="_blank">mpl-v11.txt</a>) and is also available at
+<a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html</a>.</p>
+
+<h4>XULRunner 1.9 (subset, derivative work)</h4>
+
+The libraries libswt-xulrunner-gtk-xxxx.so, libswt-mozilla-gtk-xxxx.so, and libswt-mozilla-gcc3-gtk-xxxx.so (where "xxxx" is the version number) contain a small portion of XULRunner 1.9 content (header files)
+that have been modified from the Original Code provided by mozilla.org, and whose Initial Developer is Netscape Communications Corporation. Use of this code is governed by
+the terms and conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided with the Content (<a href="./about_files/mpl-v11.txt">mpl-v11.txt</a>)
+and is also available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>.
+<p>The changed files are:
+<ul>
+  <li>org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext.h</code>
+  <li>org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h</code>
+</ul>
+Changes to the original files were made by SWT on April 7, 2009 and are marked with trailing comment <em>"//SWT-20090407"</em>.
+
+<h4>Cairo Binding</h4>
+
+<p>The "Cairo Binding" is a binding to the Cairo API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Cairo Binding:</p>
+<ul>
+	<li>libswt-cairo-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Cairo Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/cairo (but not including any sub-directories)</li>
+</ul>
+
+<p>The Cairo Binding contains portions of Cairo ("Cairo").  Cairo is made available by the Cairo project at
+<a href="http://www.cairographics.org" target="_blank">http://www.cairographics.org</a>.  Use of Cairo by the Cairo Binding is governed by the terms and
+conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is
+provided with the Content (<a href="about_files/mpl-v11.txt" target="_blank">mpl-v11.txt</a>) and is also available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>.</p>
+
+<h4>Cairo for Linux</h4>
+
+<p>Refer to the file <a href="about_files/about_cairo.html">about_files/about_cairo.html</a> for licensing details about "Cairo for Linux."
+
+<h4>Independent JPEG Group's JPEG software release 6b</h4>
+
+<p>This software is based in part on the work of the Independent JPEG Group's JPEG software release 6b ("LIBJPEG").
+LIBJPEG was used to implement the decoding of JPEG format files in Java (TM).  The Content does NOT include any portion of the LIBJPEG file ansi2knr.c.</p>
+
+<p>Your use of LIBJPEG is subject to the terms and conditions located in the <a href="about_files/IJG_README">about_files/IJG_README</a> file which is included
+with the Content.</p>
+
+<p>The IJG's website is located at <a href="http://ijg.org/" target="_blank">http://ijg.org</a>.</p>
+
+<p>The class org.eclipse.swt.internal.image.JPEGFileFormat is based on following files from LIBJPEG:</p>
+
+<ul>
+    <li>cderror.h</li>
+    <li>cdjpeg.h</li>
+    <li>jchuff.h</li>
+    <li>jdcolor.c</li>
+    <li>jdct.h</li>
+    <li>jdhuff.h</li>
+    <li>jerror.h</li>
+    <li>jidctint.c</li>
+    <li>jinclude.h</li>
+    <li>jmemsys.h</li>
+    <li>jmorecfg.h</li>
+    <li>jpegint.h</li>
+    <li>jpeglib.h</li>
+    <li>jversion.h</li>
+    <li>transupp.h</li>
+</ul>
+
+<p>The class org.eclipse.swt.internal.image.JPEGDecoder is based on the following files from LIBJPEG:</p>
+
+<ul>
+	<li>jcapimin.c</li>
+	<li>jcapistd.c</li>
+	<li>jccoefct.c</li>
+	<li>jccolor.c</li>
+	<li>jcdctmgr.c</li>
+	<li>jchuff.c</li>
+	<li>jcinit.c</li>
+	<li>jcmainct.c</li>
+	<li>jcmarker.c</li>
+	<li>jcmaster.c</li>
+	<li>jcomapi.c</li>
+	<li>jcparam.c</li>
+	<li>jcphuff.c</li>
+	<li>jcprepct.c</li>
+	<li>jcsample.c</li>
+	<li>jctrans.c</li>
+	<li>jdapimin.c</li>
+	<li>jdapistd.c</li>
+	<li>jdatadst.c</li>
+	<li>jdatasrc.c</li>
+	<li>jdcoefct.c</li>
+	<li>jdcolor.c</li>
+	<li>jddctmgr.c</li>
+	<li>jdhuff.c</li>
+	<li>jdinput.c</li>
+	<li>jdmainct.c</li>
+	<li>jdmarker.c</li>
+	<li>jdmaster.c</li>
+	<li>jdmerge.c</li>
+	<li>jdphuff.c</li>
+	<li>jdpostct.c</li>
+	<li>jdsample.c</li>
+	<li>jdtrans.c</li>
+	<li>jerror.c</li>
+	<li>jfdctflt.c</li>
+	<li>jfdctfst.c</li>
+	<li>jfdctint.c</li>
+	<li>jidctflt.c</li>
+	<li>jidctfst.c</li>
+	<li>jidctint.c</li>
+	<li>jidctred.c</li>
+	<li>jpegtran.c</li>
+	<li>jquant1.c</li>
+	<li>jquant2.c</li>
+	<li>jutils.c</li>
+	<li>cderror.h</li>
+	<li>cdjpeg.h</li>
+	<li>jchuff.h</li>
+	<li>jconfig.h</li>
+	<li>jdct.h</li>
+	<li>jdhuff.h</li>
+	<li>jerror.h</li>
+	<li>jinclude.h</li>
+	<li>jmorecfg.h</li>
+	<li>jpegint.h</li>
+	<li>jpeglib.h</li>
+	<li>jversion.h</li>
+	<li>transupp.h</li>
+</ul>
+	
+<p>The following changes were made to the LIBJPEG code in the Content:</p>
+
+<ol>
+	<li>In Java, pointer math is not allowed so indexing was used instead.</li>
+	<li>Function pointers were replaced with switch statements.</li>
+	<li>The virtual memory, tracing and progress monitoring were removed.</li>
+	<li>The error handling was simplified and now uses Java exceptions.</li>
+</ol>
+
+<h4>PuTTY 0.58 (derivative work)</h4>
+
+<p>Portions of the SWT class org/eclipse/swt/internal/image/PngDeflater are based on PuTTY's sshzlib.c. PuTTY is made available by Mozilla.org.  Use of PuTTY is governed by the terms and
+conditions of the the following MIT-style license:  </p>
+<blockquote>
+  <p><em>PuTTY is copyright 1997-2007 Simon Tatham.</em> </p>
+  <p><em>Portions copyright Robert de Bath, Joris van Rantwijk, Delian  Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,  Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn,  and CORE SDI S.A.</em> </p>
+  <p><em>Permission is hereby granted, free of charge, to any person  obtaining a copy of this software and associated documentation files  (the "Software"), to deal in the Software without restriction,  including without limitation the rights to use, copy, modify, merge,  publish, distribute, sublicense, and/or sell copies of the Software,  and to permit persons to whom the Software is furnished to do so,  subject to the following conditions:</em> </p>
+  <p><em>The above copyright notice and this permission notice shall be  included in all copies or substantial portions of the Software.</em> </p>
+  <p><em>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND  NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR ANY  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</em> </p>
+</blockquote>
+<p>A copy of the license is also available at <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html" target="_blank">http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html</a>.</p>
+
+<p><small>Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.</small></p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/make/lib/swt/gtk-linux-x86/about_files/IJG_README b/make/lib/swt/gtk-linux-x86/about_files/IJG_README
new file mode 100644
index 0000000..86cc206
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86/about_files/IJG_README
@@ -0,0 +1,385 @@
+The Independent JPEG Group's JPEG software
+==========================================
+
+README for release 6b of 27-Mar-1998
+====================================
+
+This distribution contains the sixth public release of the Independent JPEG
+Group's free JPEG software.  You are welcome to redistribute this software and
+to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
+
+Serious users of this software (particularly those incorporating it into
+larger programs) should contact IJG at jpeg-info at uunet.uu.net to be added to
+our electronic mailing list.  Mailing list members are notified of updates
+and have a chance to participate in technical discussions, etc.
+
+This software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
+Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
+Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
+Group.
+
+IJG is not affiliated with the official ISO JPEG standards committee.
+
+
+DOCUMENTATION ROADMAP
+=====================
+
+This file contains the following sections:
+
+OVERVIEW            General description of JPEG and the IJG software.
+LEGAL ISSUES        Copyright, lack of warranty, terms of distribution.
+REFERENCES          Where to learn more about JPEG.
+ARCHIVE LOCATIONS   Where to find newer versions of this software.
+RELATED SOFTWARE    Other stuff you should get.
+FILE FORMAT WARS    Software *not* to get.
+TO DO               Plans for future IJG releases.
+
+Other documentation files in the distribution are:
+
+User documentation:
+  install.doc       How to configure and install the IJG software.
+  usage.doc         Usage instructions for cjpeg, djpeg, jpegtran,
+                    rdjpgcom, and wrjpgcom.
+  *.1               Unix-style man pages for programs (same info as usage.doc).
+  wizard.doc        Advanced usage instructions for JPEG wizards only.
+  change.log        Version-to-version change highlights.
+Programmer and internal documentation:
+  libjpeg.doc       How to use the JPEG library in your own programs.
+  example.c         Sample code for calling the JPEG library.
+  structure.doc     Overview of the JPEG library's internal structure.
+  filelist.doc      Road map of IJG files.
+  coderules.doc     Coding style rules --- please read if you contribute code.
+
+Please read at least the files install.doc and usage.doc.  Useful information
+can also be found in the JPEG FAQ (Frequently Asked Questions) article.  See
+ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
+
+If you want to understand how the JPEG code works, we suggest reading one or
+more of the REFERENCES, then looking at the documentation files (in roughly
+the order listed) before diving into the code.
+
+
+OVERVIEW
+========
+
+This package contains C software to implement JPEG image compression and
+decompression.  JPEG (pronounced "jay-peg") is a standardized compression
+method for full-color and gray-scale images.  JPEG is intended for compressing
+"real-world" scenes; line drawings, cartoons and other non-realistic images
+are not its strong suit.  JPEG is lossy, meaning that the output image is not
+exactly identical to the input image.  Hence you must not use JPEG if you
+have to have identical output bits.  However, on typical photographic images,
+very good compression levels can be obtained with no visible change, and
+remarkably high compression levels are possible if you can tolerate a
+low-quality image.  For more details, see the references, or just experiment
+with various compression settings.
+
+This software implements JPEG baseline, extended-sequential, and progressive
+compression processes.  Provision is made for supporting all variants of these
+processes, although some uncommon parameter settings aren't implemented yet.
+For legal reasons, we are not distributing code for the arithmetic-coding
+variants of JPEG; see LEGAL ISSUES.  We have made no provision for supporting
+the hierarchical or lossless processes defined in the standard.
+
+We provide a set of library routines for reading and writing JPEG image files,
+plus two sample applications "cjpeg" and "djpeg", which use the library to
+perform conversion between JPEG and some other popular image file formats.
+The library is intended to be reused in other applications.
+
+In order to support file conversion and viewing software, we have included
+considerable functionality beyond the bare JPEG coding/decoding capability;
+for example, the color quantization modules are not strictly part of JPEG
+decoding, but they are essential for output to colormapped file formats or
+colormapped displays.  These extra functions can be compiled out of the
+library if not required for a particular application.  We have also included
+"jpegtran", a utility for lossless transcoding between different JPEG
+processes, and "rdjpgcom" and "wrjpgcom", two simple applications for
+inserting and extracting textual comments in JFIF files.
+
+The emphasis in designing this software has been on achieving portability and
+flexibility, while also making it fast enough to be useful.  In particular,
+the software is not intended to be read as a tutorial on JPEG.  (See the
+REFERENCES section for introductory material.)  Rather, it is intended to
+be reliable, portable, industrial-strength code.  We do not claim to have
+achieved that goal in every aspect of the software, but we strive for it.
+
+We welcome the use of this software as a component of commercial products.
+No royalty is required, but we do ask for an acknowledgement in product
+documentation, as described under LEGAL ISSUES.
+
+
+LEGAL ISSUES
+============
+
+In plain English:
+
+1. We don't promise that this software works.  (But if you find any bugs,
+   please let us know!)
+2. You can use this software for whatever you want.  You don't have to pay us.
+3. You may not pretend that you wrote this software.  If you use it in a
+   program, you must acknowledge somewhere in your documentation that
+   you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose.  This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library.  If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it.  This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+
+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
+by the usual distribution terms of the Free Software Foundation; principally,
+that you must include source code if you redistribute it.  (See the file
+ansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
+of any program generated from the IJG code, this does not limit you more than
+the foregoing paragraphs do.
+
+The Unix configuration script "configure" was produced with GNU Autoconf.
+It is copyright by the Free Software Foundation but is freely distributable.
+The same holds for its supporting scripts (config.guess, config.sub,
+ltconfig, ltmain.sh).  Another support script, install-sh, is copyright
+by M.I.T. but is also freely distributable.
+
+It appears that the arithmetic coding option of the JPEG spec is covered by
+patents owned by IBM, AT&T, and Mitsubishi.  Hence arithmetic coding cannot
+legally be used without obtaining one or more licenses.  For this reason,
+support for arithmetic coding has been removed from the free JPEG software.
+(Since arithmetic coding provides only a marginal gain over the unpatented
+Huffman mode, it is unlikely that very many implementations will support it.)
+So far as we are aware, there are no patent restrictions on the remaining
+code.
+
+The IJG distribution formerly included code to read and write GIF files.
+To avoid entanglement with the Unisys LZW patent, GIF reading support has
+been removed altogether, and the GIF writer has been simplified to produce
+"uncompressed GIFs".  This technique does not use the LZW algorithm; the
+resulting GIF files are larger than usual, but are readable by all standard
+GIF decoders.
+
+We are required to state that
+    "The Graphics Interchange Format(c) is the Copyright property of
+    CompuServe Incorporated.  GIF(sm) is a Service Mark property of
+    CompuServe Incorporated."
+
+
+REFERENCES
+==========
+
+We highly recommend reading one or more of these references before trying to
+understand the innards of the JPEG software.
+
+The best short technical introduction to the JPEG compression algorithm is
+	Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+	Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
+(Adjacent articles in that issue discuss MPEG motion picture compression,
+applications of JPEG, and related topics.)  If you don't have the CACM issue
+handy, a PostScript file containing a revised version of Wallace's article is
+available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz.  The file (actually
+a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
+omits the sample images that appeared in CACM, but it includes corrections
+and some added material.  Note: the Wallace article is copyright ACM and IEEE,
+and it may not be used for commercial purposes.
+
+A somewhat less technical, more leisurely introduction to JPEG can be found in
+"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
+M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides
+good explanations and example C code for a multitude of compression methods
+including JPEG.  It is an excellent source if you are comfortable reading C
+code but don't know much about data compression in general.  The book's JPEG
+sample code is far from industrial-strength, but when you are ready to look
+at a full implementation, you've got one here...
+
+The best full description of JPEG is the textbook "JPEG Still Image Data
+Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
+by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.  Price US$59.95, 638 pp.
+The book includes the complete text of the ISO JPEG standards (DIS 10918-1
+and draft DIS 10918-2).  This is by far the most complete exposition of JPEG
+in existence, and we highly recommend it.
+
+The JPEG standard itself is not available electronically; you must order a
+paper copy through ISO or ITU.  (Unless you feel a need to own a certified
+official copy, we recommend buying the Pennebaker and Mitchell book instead;
+it's much cheaper and includes a great deal of useful explanatory material.)
+In the USA, copies of the standard may be ordered from ANSI Sales at (212)
+642-4900, or from Global Engineering Documents at (800) 854-7179.  (ANSI
+doesn't take credit card orders, but Global does.)  It's not cheap: as of
+1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
+shipping/handling.  The standard is divided into two parts, Part 1 being the
+actual specification, while Part 2 covers compliance testing methods.  Part 1
+is titled "Digital Compression and Coding of Continuous-tone Still Images,
+Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
+10918-1, ITU-T T.81.  Part 2 is titled "Digital Compression and Coding of
+Continuous-tone Still Images, Part 2: Compliance testing" and has document
+numbers ISO/IEC IS 10918-2, ITU-T T.83.
+
+Some extensions to the original JPEG standard are defined in JPEG Part 3,
+a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84.  IJG
+currently does not support any Part 3 extensions.
+
+The JPEG standard does not specify all details of an interchangeable file
+format.  For the omitted details we follow the "JFIF" conventions, revision
+1.02.  A copy of the JFIF spec is available from:
+	Literature Department
+	C-Cube Microsystems, Inc.
+	1778 McCarthy Blvd.
+	Milpitas, CA 95035
+	phone (408) 944-6300,  fax (408) 944-6314
+A PostScript version of this document is available by FTP at
+ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz.  There is also a plain text
+version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
+the figures.
+
+The TIFF 6.0 file format specification can be obtained by FTP from
+ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme
+found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
+IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
+Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
+(Compression tag 7).  Copies of this Note can be obtained from ftp.sgi.com or
+from ftp://ftp.uu.net/graphics/jpeg/.  It is expected that the next revision
+of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
+Although IJG's own code does not support TIFF/JPEG, the free libtiff library
+uses our library to implement TIFF/JPEG per the Note.  libtiff is available
+from ftp://ftp.sgi.com/graphics/tiff/.
+
+
+ARCHIVE LOCATIONS
+=================
+
+The "official" archive site for this software is ftp.uu.net (Internet
+address 192.48.96.9).  The most recent released version can always be found
+there in directory graphics/jpeg.  This particular version will be archived
+as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz.  If you don't have
+direct Internet access, UUNET's archives are also available via UUCP; contact
+help at uunet.uu.net for information on retrieving files that way.
+
+Numerous Internet sites maintain copies of the UUNET files.  However, only
+ftp.uu.net is guaranteed to have the latest official version.
+
+You can also obtain this software in DOS-compatible "zip" archive format from
+the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or
+on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12
+"JPEG Tools".  Again, these versions may sometimes lag behind the ftp.uu.net
+release.
+
+The JPEG FAQ (Frequently Asked Questions) article is a useful source of
+general information about JPEG.  It is updated constantly and therefore is
+not included in this distribution.  The FAQ is posted every two weeks to
+Usenet newsgroups comp.graphics.misc, news.answers, and other groups.
+It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
+and other news.answers archive sites, including the official news.answers
+archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
+If you don't have Web or FTP access, send e-mail to mail-server at rtfm.mit.edu
+with body
+	send usenet/news.answers/jpeg-faq/part1
+	send usenet/news.answers/jpeg-faq/part2
+
+
+RELATED SOFTWARE
+================
+
+Numerous viewing and image manipulation programs now support JPEG.  (Quite a
+few of them use this library to do so.)  The JPEG FAQ described above lists
+some of the more popular free and shareware viewers, and tells where to
+obtain them on Internet.
+
+If you are on a Unix machine, we highly recommend Jef Poskanzer's free
+PBMPLUS software, which provides many useful operations on PPM-format image
+files.  In particular, it can convert PPM images to and from a wide range of
+other formats, thus making cjpeg/djpeg considerably more useful.  The latest
+version is distributed by the NetPBM group, and is available from numerous
+sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
+Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
+you are likely to have difficulty making it work on any non-Unix machine.
+
+A different free JPEG implementation, written by the PVRG group at Stanford,
+is available from ftp://havefun.stanford.edu/pub/jpeg/.  This program
+is designed for research and experimentation rather than production use;
+it is slower, harder to use, and less portable than the IJG code, but it
+is easier to read and modify.  Also, the PVRG code supports lossless JPEG,
+which we do not.  (On the other hand, it doesn't do progressive JPEG.)
+
+
+FILE FORMAT WARS
+================
+
+Some JPEG programs produce files that are not compatible with our library.
+The root of the problem is that the ISO JPEG committee failed to specify a
+concrete file format.  Some vendors "filled in the blanks" on their own,
+creating proprietary formats that no one else could read.  (For example, none
+of the early commercial JPEG implementations for the Macintosh were able to
+exchange compressed files.)
+
+The file format we have adopted is called JFIF (see REFERENCES).  This format
+has been agreed to by a number of major commercial JPEG vendors, and it has
+become the de facto standard.  JFIF is a minimal or "low end" representation.
+We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
+Technical Note #2) for "high end" applications that need to record a lot of
+additional data about an image.  TIFF/JPEG is fairly new and not yet widely
+supported, unfortunately.
+
+The upcoming JPEG Part 3 standard defines a file format called SPIFF.
+SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
+be able to read the most common variant of SPIFF.  SPIFF has some technical
+advantages over JFIF, but its major claim to fame is simply that it is an
+official standard rather than an informal one.  At this point it is unclear
+whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
+standard.  IJG intends to support SPIFF once the standard is frozen, but we
+have not decided whether it should become our default output format or not.
+(In any case, our decoder will remain capable of reading JFIF indefinitely.)
+
+Various proprietary file formats incorporating JPEG compression also exist.
+We have little or no sympathy for the existence of these formats.  Indeed,
+one of the original reasons for developing this free software was to help
+force convergence on common, open format standards for JPEG files.  Don't
+use a proprietary file format!
+
+
+TO DO
+=====
+
+The major thrust for v7 will probably be improvement of visual quality.
+The current method for scaling the quantization tables is known not to be
+very good at low Q values.  We also intend to investigate block boundary
+smoothing, "poor man's variable quantization", and other means of improving
+quality-vs-file-size performance without sacrificing compatibility.
+
+In future versions, we are considering supporting some of the upcoming JPEG
+Part 3 extensions --- principally, variable quantization and the SPIFF file
+format.
+
+As always, speeding things up is of great interest.
+
+Please send bug reports, offers of help, etc. to jpeg-info at uunet.uu.net.
diff --git a/make/lib/swt/gtk-linux-x86/about_files/about_cairo.html b/make/lib/swt/gtk-linux-x86/about_files/about_cairo.html
new file mode 100644
index 0000000..0132307
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86/about_files/about_cairo.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>March 27, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation has included the following package for your convenience:</p> 
+
+<h4>Cairo 1.0.2 for Linux</h4>
+
+<p>Cairo for Linux ("Cairo") is developed by The Cairo Project (<a href="http://www.cairographics.org" target="_blank">http://www.cairographics.org</a>):</p>
+
+<p>Cairo is delivered in the following file ("Cairo Library"):</p>
+<ul>
+    <li>libcairo-swt.so</li>
+</ul>
+
+<p>which was compiled from Cairo source code available at <a href="http://www.cairographics.org/snapshots" target="_blank">http://www.cairographics.org/snapshots</a>.</p>
+
+<p>Your use of the Cairo code in binary form is subject to
+the terms and conditions of Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided (<a href="mpl-v11.txt" target="blank">mpl-v11.txt</a>)
+and is also available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html.</a>
+
+<h4>pixman 0.1.6</h4>
+
+<p>pixman ("pixman") is packaged within the Cairo Library and was compiled from source code available at
+<a href="http://www.cairographics.org/snapshots" target="_blank">http://www.cairographics.org/snapshots</a>.
+pixman includes the following packages:</p>
+
+<ul>
+	<li>libpixregion</li>
+	<li>libic</li>
+	<li>slim</li>
+</ul>
+
+Your use of pixman is subject to the terms and conditions of the licenses in <a href="pixman-licenses.txt" target="blank">pixman-licenses.txt</a>.</p>
+
+<p>If you did not receive the Cairo Library directly from the Eclipse Foundation, the package is being redistributed by another party ("Redistributor") and different terms and conditions may
+apply its use.  Check the Redistributor's license that was provided with the content.  If no such license exists, contact the Redistributor.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/make/lib/swt/gtk-linux-x86/about_files/lgpl-v21.txt b/make/lib/swt/gtk-linux-x86/about_files/lgpl-v21.txt
new file mode 100644
index 0000000..807db79
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86/about_files/lgpl-v21.txt
@@ -0,0 +1,506 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+

+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+

+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+

+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+

+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+

+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+

+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+

+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+

+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+

+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
diff --git a/make/lib/swt/gtk-linux-x86/about_files/mpl-v11.txt b/make/lib/swt/gtk-linux-x86/about_files/mpl-v11.txt
new file mode 100644
index 0000000..7714141
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86/about_files/mpl-v11.txt
@@ -0,0 +1,470 @@
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the "License"); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
diff --git a/make/lib/swt/gtk-linux-x86/about_files/pixman-licenses.txt b/make/lib/swt/gtk-linux-x86/about_files/pixman-licenses.txt
new file mode 100644
index 0000000..5d8dca6
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86/about_files/pixman-licenses.txt
@@ -0,0 +1,92 @@
+libpixregion
+
+Copyright 1987, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its 
+documentation for any purpose and without fee is hereby granted, 
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in 
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.  
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+----------------------------------------------------------------------
+libic
+
+Copyright � 2001 Keith Packard
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation, and that the name of Keith Packard not be used in
+advertising or publicity pertaining to distribution of the software without
+specific, written prior permission.  Keith Packard makes no
+representations about the suitability of this software for any purpose.  It
+is provided "as is" without express or implied warranty.
+
+KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+----------------------------------------------------------------------
+slim
+
+slim is Copyright � 2003 Richard Henderson
+
+Permission to use, copy, modify, distribute, and sell this software
+and its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Richard Henderson not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.  Richard Henderson
+makes no representations about the suitability of this software for
+any purpose.  It is provided "as is" without express or implied
+warranty.
+
+RICHARD HENDERSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL RICHARD HENDERSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/make/lib/swt/gtk-linux-x86/about_files/webkit-bsd.txt b/make/lib/swt/gtk-linux-x86/about_files/webkit-bsd.txt
new file mode 100644
index 0000000..b3b07c6
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86/about_files/webkit-bsd.txt
@@ -0,0 +1,20 @@
+BSD License
+
+Copyright (C) 2009 Apple Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided
+that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and
+the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS �AS IS� AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/make/lib/swt/gtk-linux-x86/swt-debug.jar b/make/lib/swt/gtk-linux-x86/swt-debug.jar
new file mode 100644
index 0000000..2dc8966
Binary files /dev/null and b/make/lib/swt/gtk-linux-x86/swt-debug.jar differ
diff --git a/make/lib/swt/gtk-linux-x86_64/about.html b/make/lib/swt/gtk-linux-x86_64/about.html
new file mode 100644
index 0000000..6c5fbd8
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86_64/about.html
@@ -0,0 +1,301 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>August 17, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content").  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL").  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+<h3>Third Party Content</h3>
+
+<p>The Content includes items that have been sourced from third parties as set out below. If you 
+did not receive this Content directly from the Eclipse Foundation, the following is provided 
+for informational purposes only, and you should look to the Redistributor’s license for 
+terms and conditions of use.</p>
+
+<h4>Gnome Binding</h4>
+
+<p>The "Gnome Binding" is a binding to the Gnome API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Gnome Binding:</p>
+<ul>
+	<li>libswt-gnome-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Gnome Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/gnome (but not including any sub-directories)</li>
+</ul>
+
+<p>The Gnome Binding contains portions of Gnome ("Library").  Gnome is made available by The Free Software Foundation.  Use of the Library is governed by the terms and
+conditions of the GNU Lesser General Public License Version 2.1 ("LGPL").  Use of the Gnome Binding on a standalone
+basis, is also governed by the terms and conditions of the LGPL.  A copy of the LGPL is provided with the Content (<a href="about_files/lgpl-v21.txt" target="_blank">lgpl-v21.txt</a>) and is also available at
+<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">http://www.gnu.org/licenses/lgpl.html</a>.</p>
+
+<p>In accordance with Section 6 of the LGPL, you may combine or link a "work that uses the Library" (e.g. the SWT) with the Library to produce a work
+containing portions of the Library (e.g. the Gnome Binding) and distribute that work under the terms of your choice (e.g. the EPL) provided you comply with all
+other terms and conditions of Section 6 as well as other Sections of the LGPL.  Please note, if you modify the Gnome Binding such modifications shall be
+governed by the terms and conditions of the LGPL.  Also note, the terms of the EPL permit you to modify the combined work and the source code of the combined
+work is provided for debugging purposes so there is no need to reverse engineer the combined work.</p>
+
+<h4>GTK+ Binding</h4>
+
+<p>The "GTK+ Binding" is a binding to the GTK+ API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the GTK+ Binding:</p>
+<ul>
+	<li>libswt-atk-gtk-xxxx.so (where "xxxx" is the version number)</li>
+	<li>libswt-pi-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the GTK+ Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/accessibility/gtk (but not including any sub-directories)</li>
+	<li>The contents of the directory org/eclipse/swt/internal/cde (but not including any sub-directories)</li>
+	<li>The contents of the directory org/eclipse/swt/internal/gtk (but not including any sub-directories)</li>				
+</ul>
+
+<p>The GTK+ Binding contains portions of GTK+ ("Library").  GTK+ is made available by The Free Software Foundation.  Use of the Library is governed by the terms and
+conditions of the GNU Lesser General Public License Version 2.1 ("LGPL").  Use of the GTK+ Binding on a standalone
+basis, is also governed by the terms and conditions of the LGPL.  A copy of the LGPL is provided with the Content (<a href="about_files/lgpl-v21.txt" target="_blank">lgpl-v21.txt</a>) and is also available at
+<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">http://www.gnu.org/licenses/lgpl.html</a>.</p>
+
+<p>In accordance with Section 6 of the LGPL, you may combine or link a "work that uses the Library" (e.g. the SWT) with the Library to produce a work
+containing portions of the Library (e.g. the GTK+ Binding) and distribute that work under the terms of your choice (e.g. the EPL) provided you comply with all
+other terms and conditions of Section 6 as well as other Sections of the LGPL.  Please note, if you modify the GTK+ Binding such modifications shall be
+governed by the terms and conditions of the LGPL.  Also note, the terms of the EPL permit you to modify the combined work and the source code of the combined
+work is provided for debugging purposes so there is no need to reverse engineer the combined work.</p>
+
+<h4>WebKitGTK+ Binding</h4>
+
+<p>The "WebKitGTK+ Binding" is a binding to the WebKitGTK+ API. The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the WebKitGTK+ Binding:</p>
+
+<ul>
+    <li>libswt-webkit-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the WebKitGTK+ Binding:</p>
+<ul>
+    <li>The contents of the directory org/eclipse/swt/internal/webkit (but not including any sub-directories)</li>
+</ul>
+
+<p>
+The WebKitGTK+ Binding contains portions of WebKitGTK+ ("Library"). WebKitGTK+ is made available by the WebKitGTK+ open source project (<a href="http://webkitgtk.org/" target="_blank">http://webkit.org/</a>). Use of the Library is governed by the terms and conditions of the GNU Lesser General Public License Version 2.1 ("LGPL"). Use of the WebKitGTK+ Binding on a standalone basis, is also governed by the terms and conditions of the LGPL. A copy of the LGPL is provided [...]
+
+<p>
+In accordance with Section 6 of the LGPL, you may combine or link a "work that uses the Library" (e.g. the SWT) with the Library to produce a work containing portions of the Library (e.g. the WebKitGTK+ Binding) and distribute that work under the terms of your choice (e.g. the EPL) provided you comply with all other terms and conditions of Section 6 as well as other Sections of the LGPL. Please note, if you modify the WebKitGTK+ Binding such modifications shall be governed by t [...]
+
+<p>The WebKitGTK+ Binding also contains portions of the WebKit JavaScriptCore code which is made available by the WebKit open source project (<a href="http://webkit.org/" target="_blank">http://webkit.org/</a>).  The WebKit JavaScriptCore code was obtained under the terms of the BSD license.  A copy of the BSD license is provided (<a href="about_files/webkit-bsd.txt"target="_blank">webkit-bsd.txt</a>) and is also available at <a href="http://webkit.org/coding/bsd-license.html" target="_b [...]
+
+<h4>libsoup</h4>
+
+<p>The "WebKitGTK+ Binding" also includes a binding to the libsoup API. The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the WebKitGTK+ Binding:</p>
+<ul>
+    <li>libswt-webkit-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the WebKitGTK+ Binding:</p>
+<ul>
+    <li>The contents of the directory org/eclipse/swt/internal/webkit (but not including any sub-directories)</li>
+</ul>
+
+<p>The WebKitGTK+ Binding contains portions of libsoup ("Library"). libsoup is made available by The GNOME Project (<a href="http://live.gnome.org/LibSoup" target="_blank">http://live.gnome.org/LibSoup/</a>). Use of the Library is governed by the terms and conditions of the GNU Lesser General Public License Version 2.1 ("LGPL"). Use of the WebKitGTK+ Binding on a standalone basis, is also governed by the terms and conditions of the LGPL. A copy of the LGPL is provided [...]
+
+<h4>Mozilla Binding</h4>
+
+<p>The "Mozilla Binding" is a binding to the Mozilla API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Mozilla Binding:</p>
+<ul>
+	<li>libswt-mozilla-gtk-xxxx.so (where "xxxx" is the version number)</li>
+	<li>libswt-mozilla-gcc3-gtk-xxxx.so (where "xxxx" is the version number)</li>
+	<li>libswt-xulrunner-gtk-xxxx.so (where "xxxx" is the version number)</li>
+	<li>libswt-xpcominit-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Mozilla Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/mozilla (but not including any sub-directories)</li>
+</ul>
+
+<p>The Mozilla Binding contains portions of Mozilla ("Mozilla").  Mozilla is made available by Mozilla.org.  Use of Mozilla is governed by the terms and
+conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided with the Content (<a href="about_files/mpl-v11.txt" target="_blank">mpl-v11.txt</a>) and is also available at
+<a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html</a>.</p>
+
+<h4>XULRunner 1.9 (subset, derivative work)</h4>
+
+The libraries libswt-xulrunner-gtk-xxxx.so, libswt-mozilla-gtk-xxxx.so, and libswt-mozilla-gcc3-gtk-xxxx.so (where "xxxx" is the version number) contain a small portion of XULRunner 1.9 content (header files)
+that have been modified from the Original Code provided by mozilla.org, and whose Initial Developer is Netscape Communications Corporation. Use of this code is governed by
+the terms and conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided with the Content (<a href="./about_files/mpl-v11.txt">mpl-v11.txt</a>)
+and is also available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>.
+<p>The changed files are:
+<ul>
+  <li>org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext.h</code>
+  <li>org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h</code>
+</ul>
+Changes to the original files were made by SWT on April 7, 2009 and are marked with trailing comment <em>"//SWT-20090407"</em>.
+
+<h4>Cairo Binding</h4>
+
+<p>The "Cairo Binding" is a binding to the Cairo API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Cairo Binding:</p>
+<ul>
+	<li>libswt-cairo-gtk-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Cairo Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/cairo (but not including any sub-directories)</li>
+</ul>
+
+<p>The Cairo Binding contains portions of Cairo ("Cairo").  Cairo is made available by the Cairo project at
+<a href="http://www.cairographics.org" target="_blank">http://www.cairographics.org</a>.  Use of Cairo by the Cairo Binding is governed by the terms and
+conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is
+provided with the Content (<a href="about_files/mpl-v11.txt" target="_blank">mpl-v11.txt</a>) and is also available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>.</p>
+
+<h4>Cairo for Linux</h4>
+
+<p>Refer to the file <a href="about_files/about_cairo.html">about_files/about_cairo.html</a> for licensing details about "Cairo for Linux."
+
+<h4>Independent JPEG Group's JPEG software release 6b</h4>
+
+<p>This software is based in part on the work of the Independent JPEG Group's JPEG software release 6b ("LIBJPEG").
+LIBJPEG was used to implement the decoding of JPEG format files in Java (TM).  The Content does NOT include any portion of the LIBJPEG file ansi2knr.c.</p>
+
+<p>Your use of LIBJPEG is subject to the terms and conditions located in the <a href="about_files/IJG_README">about_files/IJG_README</a> file which is included
+with the Content.</p>
+
+<p>The IJG's website is located at <a href="http://ijg.org/" target="_blank">http://ijg.org</a>.</p>
+
+<p>The class org.eclipse.swt.internal.image.JPEGFileFormat is based on following files from LIBJPEG:</p>
+
+<ul>
+    <li>cderror.h</li>
+    <li>cdjpeg.h</li>
+    <li>jchuff.h</li>
+    <li>jdcolor.c</li>
+    <li>jdct.h</li>
+    <li>jdhuff.h</li>
+    <li>jerror.h</li>
+    <li>jidctint.c</li>
+    <li>jinclude.h</li>
+    <li>jmemsys.h</li>
+    <li>jmorecfg.h</li>
+    <li>jpegint.h</li>
+    <li>jpeglib.h</li>
+    <li>jversion.h</li>
+    <li>transupp.h</li>
+</ul>
+
+<p>The class org.eclipse.swt.internal.image.JPEGDecoder is based on the following files from LIBJPEG:</p>
+
+<ul>
+	<li>jcapimin.c</li>
+	<li>jcapistd.c</li>
+	<li>jccoefct.c</li>
+	<li>jccolor.c</li>
+	<li>jcdctmgr.c</li>
+	<li>jchuff.c</li>
+	<li>jcinit.c</li>
+	<li>jcmainct.c</li>
+	<li>jcmarker.c</li>
+	<li>jcmaster.c</li>
+	<li>jcomapi.c</li>
+	<li>jcparam.c</li>
+	<li>jcphuff.c</li>
+	<li>jcprepct.c</li>
+	<li>jcsample.c</li>
+	<li>jctrans.c</li>
+	<li>jdapimin.c</li>
+	<li>jdapistd.c</li>
+	<li>jdatadst.c</li>
+	<li>jdatasrc.c</li>
+	<li>jdcoefct.c</li>
+	<li>jdcolor.c</li>
+	<li>jddctmgr.c</li>
+	<li>jdhuff.c</li>
+	<li>jdinput.c</li>
+	<li>jdmainct.c</li>
+	<li>jdmarker.c</li>
+	<li>jdmaster.c</li>
+	<li>jdmerge.c</li>
+	<li>jdphuff.c</li>
+	<li>jdpostct.c</li>
+	<li>jdsample.c</li>
+	<li>jdtrans.c</li>
+	<li>jerror.c</li>
+	<li>jfdctflt.c</li>
+	<li>jfdctfst.c</li>
+	<li>jfdctint.c</li>
+	<li>jidctflt.c</li>
+	<li>jidctfst.c</li>
+	<li>jidctint.c</li>
+	<li>jidctred.c</li>
+	<li>jpegtran.c</li>
+	<li>jquant1.c</li>
+	<li>jquant2.c</li>
+	<li>jutils.c</li>
+	<li>cderror.h</li>
+	<li>cdjpeg.h</li>
+	<li>jchuff.h</li>
+	<li>jconfig.h</li>
+	<li>jdct.h</li>
+	<li>jdhuff.h</li>
+	<li>jerror.h</li>
+	<li>jinclude.h</li>
+	<li>jmorecfg.h</li>
+	<li>jpegint.h</li>
+	<li>jpeglib.h</li>
+	<li>jversion.h</li>
+	<li>transupp.h</li>
+</ul>
+	
+<p>The following changes were made to the LIBJPEG code in the Content:</p>
+
+<ol>
+	<li>In Java, pointer math is not allowed so indexing was used instead.</li>
+	<li>Function pointers were replaced with switch statements.</li>
+	<li>The virtual memory, tracing and progress monitoring were removed.</li>
+	<li>The error handling was simplified and now uses Java exceptions.</li>
+</ol>
+
+<h4>PuTTY 0.58 (derivative work)</h4>
+
+<p>Portions of the SWT class org/eclipse/swt/internal/image/PngDeflater are based on PuTTY's sshzlib.c. PuTTY is made available by Mozilla.org.  Use of PuTTY is governed by the terms and
+conditions of the the following MIT-style license:  </p>
+<blockquote>
+  <p><em>PuTTY is copyright 1997-2007 Simon Tatham.</em> </p>
+  <p><em>Portions copyright Robert de Bath, Joris van Rantwijk, Delian  Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,  Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn,  and CORE SDI S.A.</em> </p>
+  <p><em>Permission is hereby granted, free of charge, to any person  obtaining a copy of this software and associated documentation files  (the "Software"), to deal in the Software without restriction,  including without limitation the rights to use, copy, modify, merge,  publish, distribute, sublicense, and/or sell copies of the Software,  and to permit persons to whom the Software is furnished to do so,  subject to the following conditions:</em> </p>
+  <p><em>The above copyright notice and this permission notice shall be  included in all copies or substantial portions of the Software.</em> </p>
+  <p><em>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND  NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR ANY  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</em> </p>
+</blockquote>
+<p>A copy of the license is also available at <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html" target="_blank">http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html</a>.</p>
+
+<p><small>Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.</small></p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/make/lib/swt/gtk-linux-x86_64/about_files/IJG_README b/make/lib/swt/gtk-linux-x86_64/about_files/IJG_README
new file mode 100644
index 0000000..86cc206
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86_64/about_files/IJG_README
@@ -0,0 +1,385 @@
+The Independent JPEG Group's JPEG software
+==========================================
+
+README for release 6b of 27-Mar-1998
+====================================
+
+This distribution contains the sixth public release of the Independent JPEG
+Group's free JPEG software.  You are welcome to redistribute this software and
+to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
+
+Serious users of this software (particularly those incorporating it into
+larger programs) should contact IJG at jpeg-info at uunet.uu.net to be added to
+our electronic mailing list.  Mailing list members are notified of updates
+and have a chance to participate in technical discussions, etc.
+
+This software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
+Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
+Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
+Group.
+
+IJG is not affiliated with the official ISO JPEG standards committee.
+
+
+DOCUMENTATION ROADMAP
+=====================
+
+This file contains the following sections:
+
+OVERVIEW            General description of JPEG and the IJG software.
+LEGAL ISSUES        Copyright, lack of warranty, terms of distribution.
+REFERENCES          Where to learn more about JPEG.
+ARCHIVE LOCATIONS   Where to find newer versions of this software.
+RELATED SOFTWARE    Other stuff you should get.
+FILE FORMAT WARS    Software *not* to get.
+TO DO               Plans for future IJG releases.
+
+Other documentation files in the distribution are:
+
+User documentation:
+  install.doc       How to configure and install the IJG software.
+  usage.doc         Usage instructions for cjpeg, djpeg, jpegtran,
+                    rdjpgcom, and wrjpgcom.
+  *.1               Unix-style man pages for programs (same info as usage.doc).
+  wizard.doc        Advanced usage instructions for JPEG wizards only.
+  change.log        Version-to-version change highlights.
+Programmer and internal documentation:
+  libjpeg.doc       How to use the JPEG library in your own programs.
+  example.c         Sample code for calling the JPEG library.
+  structure.doc     Overview of the JPEG library's internal structure.
+  filelist.doc      Road map of IJG files.
+  coderules.doc     Coding style rules --- please read if you contribute code.
+
+Please read at least the files install.doc and usage.doc.  Useful information
+can also be found in the JPEG FAQ (Frequently Asked Questions) article.  See
+ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
+
+If you want to understand how the JPEG code works, we suggest reading one or
+more of the REFERENCES, then looking at the documentation files (in roughly
+the order listed) before diving into the code.
+
+
+OVERVIEW
+========
+
+This package contains C software to implement JPEG image compression and
+decompression.  JPEG (pronounced "jay-peg") is a standardized compression
+method for full-color and gray-scale images.  JPEG is intended for compressing
+"real-world" scenes; line drawings, cartoons and other non-realistic images
+are not its strong suit.  JPEG is lossy, meaning that the output image is not
+exactly identical to the input image.  Hence you must not use JPEG if you
+have to have identical output bits.  However, on typical photographic images,
+very good compression levels can be obtained with no visible change, and
+remarkably high compression levels are possible if you can tolerate a
+low-quality image.  For more details, see the references, or just experiment
+with various compression settings.
+
+This software implements JPEG baseline, extended-sequential, and progressive
+compression processes.  Provision is made for supporting all variants of these
+processes, although some uncommon parameter settings aren't implemented yet.
+For legal reasons, we are not distributing code for the arithmetic-coding
+variants of JPEG; see LEGAL ISSUES.  We have made no provision for supporting
+the hierarchical or lossless processes defined in the standard.
+
+We provide a set of library routines for reading and writing JPEG image files,
+plus two sample applications "cjpeg" and "djpeg", which use the library to
+perform conversion between JPEG and some other popular image file formats.
+The library is intended to be reused in other applications.
+
+In order to support file conversion and viewing software, we have included
+considerable functionality beyond the bare JPEG coding/decoding capability;
+for example, the color quantization modules are not strictly part of JPEG
+decoding, but they are essential for output to colormapped file formats or
+colormapped displays.  These extra functions can be compiled out of the
+library if not required for a particular application.  We have also included
+"jpegtran", a utility for lossless transcoding between different JPEG
+processes, and "rdjpgcom" and "wrjpgcom", two simple applications for
+inserting and extracting textual comments in JFIF files.
+
+The emphasis in designing this software has been on achieving portability and
+flexibility, while also making it fast enough to be useful.  In particular,
+the software is not intended to be read as a tutorial on JPEG.  (See the
+REFERENCES section for introductory material.)  Rather, it is intended to
+be reliable, portable, industrial-strength code.  We do not claim to have
+achieved that goal in every aspect of the software, but we strive for it.
+
+We welcome the use of this software as a component of commercial products.
+No royalty is required, but we do ask for an acknowledgement in product
+documentation, as described under LEGAL ISSUES.
+
+
+LEGAL ISSUES
+============
+
+In plain English:
+
+1. We don't promise that this software works.  (But if you find any bugs,
+   please let us know!)
+2. You can use this software for whatever you want.  You don't have to pay us.
+3. You may not pretend that you wrote this software.  If you use it in a
+   program, you must acknowledge somewhere in your documentation that
+   you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose.  This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library.  If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it.  This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+
+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
+by the usual distribution terms of the Free Software Foundation; principally,
+that you must include source code if you redistribute it.  (See the file
+ansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
+of any program generated from the IJG code, this does not limit you more than
+the foregoing paragraphs do.
+
+The Unix configuration script "configure" was produced with GNU Autoconf.
+It is copyright by the Free Software Foundation but is freely distributable.
+The same holds for its supporting scripts (config.guess, config.sub,
+ltconfig, ltmain.sh).  Another support script, install-sh, is copyright
+by M.I.T. but is also freely distributable.
+
+It appears that the arithmetic coding option of the JPEG spec is covered by
+patents owned by IBM, AT&T, and Mitsubishi.  Hence arithmetic coding cannot
+legally be used without obtaining one or more licenses.  For this reason,
+support for arithmetic coding has been removed from the free JPEG software.
+(Since arithmetic coding provides only a marginal gain over the unpatented
+Huffman mode, it is unlikely that very many implementations will support it.)
+So far as we are aware, there are no patent restrictions on the remaining
+code.
+
+The IJG distribution formerly included code to read and write GIF files.
+To avoid entanglement with the Unisys LZW patent, GIF reading support has
+been removed altogether, and the GIF writer has been simplified to produce
+"uncompressed GIFs".  This technique does not use the LZW algorithm; the
+resulting GIF files are larger than usual, but are readable by all standard
+GIF decoders.
+
+We are required to state that
+    "The Graphics Interchange Format(c) is the Copyright property of
+    CompuServe Incorporated.  GIF(sm) is a Service Mark property of
+    CompuServe Incorporated."
+
+
+REFERENCES
+==========
+
+We highly recommend reading one or more of these references before trying to
+understand the innards of the JPEG software.
+
+The best short technical introduction to the JPEG compression algorithm is
+	Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+	Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
+(Adjacent articles in that issue discuss MPEG motion picture compression,
+applications of JPEG, and related topics.)  If you don't have the CACM issue
+handy, a PostScript file containing a revised version of Wallace's article is
+available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz.  The file (actually
+a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
+omits the sample images that appeared in CACM, but it includes corrections
+and some added material.  Note: the Wallace article is copyright ACM and IEEE,
+and it may not be used for commercial purposes.
+
+A somewhat less technical, more leisurely introduction to JPEG can be found in
+"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
+M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides
+good explanations and example C code for a multitude of compression methods
+including JPEG.  It is an excellent source if you are comfortable reading C
+code but don't know much about data compression in general.  The book's JPEG
+sample code is far from industrial-strength, but when you are ready to look
+at a full implementation, you've got one here...
+
+The best full description of JPEG is the textbook "JPEG Still Image Data
+Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
+by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.  Price US$59.95, 638 pp.
+The book includes the complete text of the ISO JPEG standards (DIS 10918-1
+and draft DIS 10918-2).  This is by far the most complete exposition of JPEG
+in existence, and we highly recommend it.
+
+The JPEG standard itself is not available electronically; you must order a
+paper copy through ISO or ITU.  (Unless you feel a need to own a certified
+official copy, we recommend buying the Pennebaker and Mitchell book instead;
+it's much cheaper and includes a great deal of useful explanatory material.)
+In the USA, copies of the standard may be ordered from ANSI Sales at (212)
+642-4900, or from Global Engineering Documents at (800) 854-7179.  (ANSI
+doesn't take credit card orders, but Global does.)  It's not cheap: as of
+1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
+shipping/handling.  The standard is divided into two parts, Part 1 being the
+actual specification, while Part 2 covers compliance testing methods.  Part 1
+is titled "Digital Compression and Coding of Continuous-tone Still Images,
+Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
+10918-1, ITU-T T.81.  Part 2 is titled "Digital Compression and Coding of
+Continuous-tone Still Images, Part 2: Compliance testing" and has document
+numbers ISO/IEC IS 10918-2, ITU-T T.83.
+
+Some extensions to the original JPEG standard are defined in JPEG Part 3,
+a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84.  IJG
+currently does not support any Part 3 extensions.
+
+The JPEG standard does not specify all details of an interchangeable file
+format.  For the omitted details we follow the "JFIF" conventions, revision
+1.02.  A copy of the JFIF spec is available from:
+	Literature Department
+	C-Cube Microsystems, Inc.
+	1778 McCarthy Blvd.
+	Milpitas, CA 95035
+	phone (408) 944-6300,  fax (408) 944-6314
+A PostScript version of this document is available by FTP at
+ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz.  There is also a plain text
+version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
+the figures.
+
+The TIFF 6.0 file format specification can be obtained by FTP from
+ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme
+found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
+IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
+Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
+(Compression tag 7).  Copies of this Note can be obtained from ftp.sgi.com or
+from ftp://ftp.uu.net/graphics/jpeg/.  It is expected that the next revision
+of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
+Although IJG's own code does not support TIFF/JPEG, the free libtiff library
+uses our library to implement TIFF/JPEG per the Note.  libtiff is available
+from ftp://ftp.sgi.com/graphics/tiff/.
+
+
+ARCHIVE LOCATIONS
+=================
+
+The "official" archive site for this software is ftp.uu.net (Internet
+address 192.48.96.9).  The most recent released version can always be found
+there in directory graphics/jpeg.  This particular version will be archived
+as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz.  If you don't have
+direct Internet access, UUNET's archives are also available via UUCP; contact
+help at uunet.uu.net for information on retrieving files that way.
+
+Numerous Internet sites maintain copies of the UUNET files.  However, only
+ftp.uu.net is guaranteed to have the latest official version.
+
+You can also obtain this software in DOS-compatible "zip" archive format from
+the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or
+on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12
+"JPEG Tools".  Again, these versions may sometimes lag behind the ftp.uu.net
+release.
+
+The JPEG FAQ (Frequently Asked Questions) article is a useful source of
+general information about JPEG.  It is updated constantly and therefore is
+not included in this distribution.  The FAQ is posted every two weeks to
+Usenet newsgroups comp.graphics.misc, news.answers, and other groups.
+It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
+and other news.answers archive sites, including the official news.answers
+archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
+If you don't have Web or FTP access, send e-mail to mail-server at rtfm.mit.edu
+with body
+	send usenet/news.answers/jpeg-faq/part1
+	send usenet/news.answers/jpeg-faq/part2
+
+
+RELATED SOFTWARE
+================
+
+Numerous viewing and image manipulation programs now support JPEG.  (Quite a
+few of them use this library to do so.)  The JPEG FAQ described above lists
+some of the more popular free and shareware viewers, and tells where to
+obtain them on Internet.
+
+If you are on a Unix machine, we highly recommend Jef Poskanzer's free
+PBMPLUS software, which provides many useful operations on PPM-format image
+files.  In particular, it can convert PPM images to and from a wide range of
+other formats, thus making cjpeg/djpeg considerably more useful.  The latest
+version is distributed by the NetPBM group, and is available from numerous
+sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
+Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
+you are likely to have difficulty making it work on any non-Unix machine.
+
+A different free JPEG implementation, written by the PVRG group at Stanford,
+is available from ftp://havefun.stanford.edu/pub/jpeg/.  This program
+is designed for research and experimentation rather than production use;
+it is slower, harder to use, and less portable than the IJG code, but it
+is easier to read and modify.  Also, the PVRG code supports lossless JPEG,
+which we do not.  (On the other hand, it doesn't do progressive JPEG.)
+
+
+FILE FORMAT WARS
+================
+
+Some JPEG programs produce files that are not compatible with our library.
+The root of the problem is that the ISO JPEG committee failed to specify a
+concrete file format.  Some vendors "filled in the blanks" on their own,
+creating proprietary formats that no one else could read.  (For example, none
+of the early commercial JPEG implementations for the Macintosh were able to
+exchange compressed files.)
+
+The file format we have adopted is called JFIF (see REFERENCES).  This format
+has been agreed to by a number of major commercial JPEG vendors, and it has
+become the de facto standard.  JFIF is a minimal or "low end" representation.
+We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
+Technical Note #2) for "high end" applications that need to record a lot of
+additional data about an image.  TIFF/JPEG is fairly new and not yet widely
+supported, unfortunately.
+
+The upcoming JPEG Part 3 standard defines a file format called SPIFF.
+SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
+be able to read the most common variant of SPIFF.  SPIFF has some technical
+advantages over JFIF, but its major claim to fame is simply that it is an
+official standard rather than an informal one.  At this point it is unclear
+whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
+standard.  IJG intends to support SPIFF once the standard is frozen, but we
+have not decided whether it should become our default output format or not.
+(In any case, our decoder will remain capable of reading JFIF indefinitely.)
+
+Various proprietary file formats incorporating JPEG compression also exist.
+We have little or no sympathy for the existence of these formats.  Indeed,
+one of the original reasons for developing this free software was to help
+force convergence on common, open format standards for JPEG files.  Don't
+use a proprietary file format!
+
+
+TO DO
+=====
+
+The major thrust for v7 will probably be improvement of visual quality.
+The current method for scaling the quantization tables is known not to be
+very good at low Q values.  We also intend to investigate block boundary
+smoothing, "poor man's variable quantization", and other means of improving
+quality-vs-file-size performance without sacrificing compatibility.
+
+In future versions, we are considering supporting some of the upcoming JPEG
+Part 3 extensions --- principally, variable quantization and the SPIFF file
+format.
+
+As always, speeding things up is of great interest.
+
+Please send bug reports, offers of help, etc. to jpeg-info at uunet.uu.net.
diff --git a/make/lib/swt/gtk-linux-x86_64/about_files/about_cairo.html b/make/lib/swt/gtk-linux-x86_64/about_files/about_cairo.html
new file mode 100644
index 0000000..0132307
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86_64/about_files/about_cairo.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>March 27, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation has included the following package for your convenience:</p> 
+
+<h4>Cairo 1.0.2 for Linux</h4>
+
+<p>Cairo for Linux ("Cairo") is developed by The Cairo Project (<a href="http://www.cairographics.org" target="_blank">http://www.cairographics.org</a>):</p>
+
+<p>Cairo is delivered in the following file ("Cairo Library"):</p>
+<ul>
+    <li>libcairo-swt.so</li>
+</ul>
+
+<p>which was compiled from Cairo source code available at <a href="http://www.cairographics.org/snapshots" target="_blank">http://www.cairographics.org/snapshots</a>.</p>
+
+<p>Your use of the Cairo code in binary form is subject to
+the terms and conditions of Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided (<a href="mpl-v11.txt" target="blank">mpl-v11.txt</a>)
+and is also available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html.</a>
+
+<h4>pixman 0.1.6</h4>
+
+<p>pixman ("pixman") is packaged within the Cairo Library and was compiled from source code available at
+<a href="http://www.cairographics.org/snapshots" target="_blank">http://www.cairographics.org/snapshots</a>.
+pixman includes the following packages:</p>
+
+<ul>
+	<li>libpixregion</li>
+	<li>libic</li>
+	<li>slim</li>
+</ul>
+
+Your use of pixman is subject to the terms and conditions of the licenses in <a href="pixman-licenses.txt" target="blank">pixman-licenses.txt</a>.</p>
+
+<p>If you did not receive the Cairo Library directly from the Eclipse Foundation, the package is being redistributed by another party ("Redistributor") and different terms and conditions may
+apply its use.  Check the Redistributor's license that was provided with the content.  If no such license exists, contact the Redistributor.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/make/lib/swt/gtk-linux-x86_64/about_files/lgpl-v21.txt b/make/lib/swt/gtk-linux-x86_64/about_files/lgpl-v21.txt
new file mode 100644
index 0000000..807db79
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86_64/about_files/lgpl-v21.txt
@@ -0,0 +1,506 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+

+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+

+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+

+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+

+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+

+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+

+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+

+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+

+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+

+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
diff --git a/make/lib/swt/gtk-linux-x86_64/about_files/mpl-v11.txt b/make/lib/swt/gtk-linux-x86_64/about_files/mpl-v11.txt
new file mode 100644
index 0000000..7714141
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86_64/about_files/mpl-v11.txt
@@ -0,0 +1,470 @@
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the "License"); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
diff --git a/make/lib/swt/gtk-linux-x86_64/about_files/pixman-licenses.txt b/make/lib/swt/gtk-linux-x86_64/about_files/pixman-licenses.txt
new file mode 100644
index 0000000..5d8dca6
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86_64/about_files/pixman-licenses.txt
@@ -0,0 +1,92 @@
+libpixregion
+
+Copyright 1987, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its 
+documentation for any purpose and without fee is hereby granted, 
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in 
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.  
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+----------------------------------------------------------------------
+libic
+
+Copyright � 2001 Keith Packard
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation, and that the name of Keith Packard not be used in
+advertising or publicity pertaining to distribution of the software without
+specific, written prior permission.  Keith Packard makes no
+representations about the suitability of this software for any purpose.  It
+is provided "as is" without express or implied warranty.
+
+KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+----------------------------------------------------------------------
+slim
+
+slim is Copyright � 2003 Richard Henderson
+
+Permission to use, copy, modify, distribute, and sell this software
+and its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Richard Henderson not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.  Richard Henderson
+makes no representations about the suitability of this software for
+any purpose.  It is provided "as is" without express or implied
+warranty.
+
+RICHARD HENDERSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL RICHARD HENDERSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/make/lib/swt/gtk-linux-x86_64/about_files/webkit-bsd.txt b/make/lib/swt/gtk-linux-x86_64/about_files/webkit-bsd.txt
new file mode 100644
index 0000000..b3b07c6
--- /dev/null
+++ b/make/lib/swt/gtk-linux-x86_64/about_files/webkit-bsd.txt
@@ -0,0 +1,20 @@
+BSD License
+
+Copyright (C) 2009 Apple Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided
+that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and
+the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
+the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS �AS IS� AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/make/lib/swt/gtk-linux-x86_64/swt-debug.jar b/make/lib/swt/gtk-linux-x86_64/swt-debug.jar
new file mode 100644
index 0000000..682b2b0
Binary files /dev/null and b/make/lib/swt/gtk-linux-x86_64/swt-debug.jar differ
diff --git a/make/lib/swt/notice.html b/make/lib/swt/notice.html
new file mode 100644
index 0000000..c184ca3
--- /dev/null
+++ b/make/lib/swt/notice.html
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+   (COLLECTIVELY "CONTENT").  USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+   CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+   OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+   NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+   CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+   ("EPL").  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+   For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+   repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</p>
+
+<ul>
+       <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
+       <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+       <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named "features".  Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
+      and/or Fragments associated with that Feature.</li>
+       <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
+Included Features should be contained in files named "license.html" ("Feature Licenses").  Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+       <li>The top-level (root) directory</li>
+       <li>Plug-in and Fragment directories</li>
+       <li>Inside Plug-ins and Fragments packaged as JARs</li>
+       <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+       <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the
+installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them.  Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.  SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+       <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+       <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+       <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+       <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+       <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+   Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or
+   other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to
+   install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+       href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+   ("Specification").</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+   applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+   in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+   Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+       <li>A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology
+       on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based
+       product.</li>
+       <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+       accessed and copied to the Target Machine.</li>
+       <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+       Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target
+       Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+       the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+       indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+   another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+   possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/make/lib/swt/win32-win32-x86/about.html b/make/lib/swt/win32-win32-x86/about.html
new file mode 100644
index 0000000..c787c6b
--- /dev/null
+++ b/make/lib/swt/win32-win32-x86/about.html
@@ -0,0 +1,184 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>August 17, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content").  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL").  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+<h3>Third Party Content</h3>
+
+<p>The Content includes items that have been sourced from third parties as set out below. If you 
+did not receive this Content directly from the Eclipse Foundation, the following is provided 
+for informational purposes only, and you should look to the Redistributor’s license for 
+terms and conditions of use.</p>
+
+<h4>Mozilla Binding</h4>
+
+<p>The "Mozilla Binding" is a binding to the Mozilla API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Mozilla Binding:</p>
+<ul>
+	<li>swt-xulrunner-win32-xxxx.dll (where "xxxx" is the version number)</li>
+	<li>swt-xpcominit-win32-xxxx.dll (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Mozilla Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/mozilla (but not including any sub-directories)</li>
+</ul>
+
+<p>The Mozilla Binding contains portions of Mozilla ("Mozilla").  Mozilla is made available by Mozilla.org.  Use of Mozilla is governed by the terms and
+conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided with the Content (<a href="about_files/mpl-v11.txt" target="_blank">mpl-v11.txt</a>) and is also available at
+<a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html</a>.</p>
+
+<h4>XULRunner 1.9 (subset, derivative work)</h4>
+
+The library swt-xulrunner-win32-xxxx.dll (where "xxxx" is the version number) contains a small portion of XULRunner 1.9 content (header files) that have
+been modified from the Original Code provided by mozilla.org, and whose Initial Developer is Netscape Communications Corporation. Use of this code is governed by
+the terms and conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided with the Content (<a href="./about_files/mpl-v11.txt">mpl-v11.txt</a>)
+and is also available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>.
+<p>The changed files are:
+<ul>
+  <li>org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext.h</code>
+  <li>org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h</code>
+</ul>
+Changes to the original files were made by SWT on April 7, 2009 and are marked with trailing comment <em>"//SWT-20090407"</em>.
+
+<h4>Independent JPEG Group's JPEG software release 6b</h4>
+
+<p>This software is based in part on the work of the Independent JPEG Group's JPEG software release 6b ("LIBJPEG").
+LIBJPEG was used to implement the decoding of JPEG format files in Java (TM).  The Content does NOT include any portion of the LIBJPEG file ansi2knr.c.</p>
+
+<p>Your use of LIBJPEG is subject to the terms and conditions located in the <a href="about_files/IJG_README">about_files/IJG_README</a> file which is included
+with the Content.</p>
+
+<p>The IJG's website is located at <a href="http://ijg.org/" target="_blank">http://ijg.org</a>.</p>
+
+<p>The class org.eclipse.swt.internal.image.JPEGFileFormat is based on following files from LIBJPEG:</p>
+
+<ul>
+    <li>cderror.h</li>
+    <li>cdjpeg.h</li>
+    <li>jchuff.h</li>
+    <li>jdcolor.c</li>
+    <li>jdct.h</li>
+    <li>jdhuff.h</li>
+    <li>jerror.h</li>
+    <li>jidctint.c</li>
+    <li>jinclude.h</li>
+    <li>jmemsys.h</li>
+    <li>jmorecfg.h</li>
+    <li>jpegint.h</li>
+    <li>jpeglib.h</li>
+    <li>jversion.h</li>
+    <li>transupp.h</li>
+</ul>
+
+<p>The class org.eclipse.swt.internal.image.JPEGDecoder is based on the following files from LIBJPEG:</p>
+
+<ul>
+	<li>jcapimin.c</li>
+	<li>jcapistd.c</li>
+	<li>jccoefct.c</li>
+	<li>jccolor.c</li>
+	<li>jcdctmgr.c</li>
+	<li>jchuff.c</li>
+	<li>jcinit.c</li>
+	<li>jcmainct.c</li>
+	<li>jcmarker.c</li>
+	<li>jcmaster.c</li>
+	<li>jcomapi.c</li>
+	<li>jcparam.c</li>
+	<li>jcphuff.c</li>
+	<li>jcprepct.c</li>
+	<li>jcsample.c</li>
+	<li>jctrans.c</li>
+	<li>jdapimin.c</li>
+	<li>jdapistd.c</li>
+	<li>jdatadst.c</li>
+	<li>jdatasrc.c</li>
+	<li>jdcoefct.c</li>
+	<li>jdcolor.c</li>
+	<li>jddctmgr.c</li>
+	<li>jdhuff.c</li>
+	<li>jdinput.c</li>
+	<li>jdmainct.c</li>
+	<li>jdmarker.c</li>
+	<li>jdmaster.c</li>
+	<li>jdmerge.c</li>
+	<li>jdphuff.c</li>
+	<li>jdpostct.c</li>
+	<li>jdsample.c</li>
+	<li>jdtrans.c</li>
+	<li>jerror.c</li>
+	<li>jfdctflt.c</li>
+	<li>jfdctfst.c</li>
+	<li>jfdctint.c</li>
+	<li>jidctflt.c</li>
+	<li>jidctfst.c</li>
+	<li>jidctint.c</li>
+	<li>jidctred.c</li>
+	<li>jpegtran.c</li>
+	<li>jquant1.c</li>
+	<li>jquant2.c</li>
+	<li>jutils.c</li>
+	<li>cderror.h</li>
+	<li>cdjpeg.h</li>
+	<li>jchuff.h</li>
+	<li>jconfig.h</li>
+	<li>jdct.h</li>
+	<li>jdhuff.h</li>
+	<li>jerror.h</li>
+	<li>jinclude.h</li>
+	<li>jmorecfg.h</li>
+	<li>jpegint.h</li>
+	<li>jpeglib.h</li>
+	<li>jversion.h</li>
+	<li>transupp.h</li>
+</ul>
+	
+<p>The following changes were made to the LIBJPEG code in the Content:</p>
+
+<ol>
+	<li>In Java, pointer math is not allowed so indexing was used instead.</li>
+	<li>Function pointers were replaced with switch statements.</li>
+	<li>The virtual memory, tracing and progress monitoring were removed.</li>
+	<li>The error handling was simplified and now uses Java exceptions.</li>
+</ol>
+
+<h4>PuTTY 0.58 (derivative work)</h4>
+
+<p>Portions of the SWT class org/eclipse/swt/internal/image/PngDeflater are based on PuTTY's sshzlib.c. PuTTY is made available by Mozilla.org.  Use of PuTTY is governed by the terms and
+conditions of the the following MIT-style license:  </p>
+<blockquote>
+  <p><em>PuTTY is copyright 1997-2007 Simon Tatham.</em> </p>
+  <p><em>Portions copyright Robert de Bath, Joris van Rantwijk, Delian  Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,  Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn,  and CORE SDI S.A.</em> </p>
+  <p><em>Permission is hereby granted, free of charge, to any person  obtaining a copy of this software and associated documentation files  (the "Software"), to deal in the Software without restriction,  including without limitation the rights to use, copy, modify, merge,  publish, distribute, sublicense, and/or sell copies of the Software,  and to permit persons to whom the Software is furnished to do so,  subject to the following conditions:</em> </p>
+  <p><em>The above copyright notice and this permission notice shall be  included in all copies or substantial portions of the Software.</em> </p>
+  <p><em>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND  NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR ANY  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</em> </p>
+</blockquote>
+<p>A copy of the license is also available at <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html" target="_blank">http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html</a>.</p>
+
+<p><small>Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.</small></p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/make/lib/swt/win32-win32-x86/about_files/IJG_README b/make/lib/swt/win32-win32-x86/about_files/IJG_README
new file mode 100644
index 0000000..86cc206
--- /dev/null
+++ b/make/lib/swt/win32-win32-x86/about_files/IJG_README
@@ -0,0 +1,385 @@
+The Independent JPEG Group's JPEG software
+==========================================
+
+README for release 6b of 27-Mar-1998
+====================================
+
+This distribution contains the sixth public release of the Independent JPEG
+Group's free JPEG software.  You are welcome to redistribute this software and
+to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
+
+Serious users of this software (particularly those incorporating it into
+larger programs) should contact IJG at jpeg-info at uunet.uu.net to be added to
+our electronic mailing list.  Mailing list members are notified of updates
+and have a chance to participate in technical discussions, etc.
+
+This software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
+Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
+Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
+Group.
+
+IJG is not affiliated with the official ISO JPEG standards committee.
+
+
+DOCUMENTATION ROADMAP
+=====================
+
+This file contains the following sections:
+
+OVERVIEW            General description of JPEG and the IJG software.
+LEGAL ISSUES        Copyright, lack of warranty, terms of distribution.
+REFERENCES          Where to learn more about JPEG.
+ARCHIVE LOCATIONS   Where to find newer versions of this software.
+RELATED SOFTWARE    Other stuff you should get.
+FILE FORMAT WARS    Software *not* to get.
+TO DO               Plans for future IJG releases.
+
+Other documentation files in the distribution are:
+
+User documentation:
+  install.doc       How to configure and install the IJG software.
+  usage.doc         Usage instructions for cjpeg, djpeg, jpegtran,
+                    rdjpgcom, and wrjpgcom.
+  *.1               Unix-style man pages for programs (same info as usage.doc).
+  wizard.doc        Advanced usage instructions for JPEG wizards only.
+  change.log        Version-to-version change highlights.
+Programmer and internal documentation:
+  libjpeg.doc       How to use the JPEG library in your own programs.
+  example.c         Sample code for calling the JPEG library.
+  structure.doc     Overview of the JPEG library's internal structure.
+  filelist.doc      Road map of IJG files.
+  coderules.doc     Coding style rules --- please read if you contribute code.
+
+Please read at least the files install.doc and usage.doc.  Useful information
+can also be found in the JPEG FAQ (Frequently Asked Questions) article.  See
+ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
+
+If you want to understand how the JPEG code works, we suggest reading one or
+more of the REFERENCES, then looking at the documentation files (in roughly
+the order listed) before diving into the code.
+
+
+OVERVIEW
+========
+
+This package contains C software to implement JPEG image compression and
+decompression.  JPEG (pronounced "jay-peg") is a standardized compression
+method for full-color and gray-scale images.  JPEG is intended for compressing
+"real-world" scenes; line drawings, cartoons and other non-realistic images
+are not its strong suit.  JPEG is lossy, meaning that the output image is not
+exactly identical to the input image.  Hence you must not use JPEG if you
+have to have identical output bits.  However, on typical photographic images,
+very good compression levels can be obtained with no visible change, and
+remarkably high compression levels are possible if you can tolerate a
+low-quality image.  For more details, see the references, or just experiment
+with various compression settings.
+
+This software implements JPEG baseline, extended-sequential, and progressive
+compression processes.  Provision is made for supporting all variants of these
+processes, although some uncommon parameter settings aren't implemented yet.
+For legal reasons, we are not distributing code for the arithmetic-coding
+variants of JPEG; see LEGAL ISSUES.  We have made no provision for supporting
+the hierarchical or lossless processes defined in the standard.
+
+We provide a set of library routines for reading and writing JPEG image files,
+plus two sample applications "cjpeg" and "djpeg", which use the library to
+perform conversion between JPEG and some other popular image file formats.
+The library is intended to be reused in other applications.
+
+In order to support file conversion and viewing software, we have included
+considerable functionality beyond the bare JPEG coding/decoding capability;
+for example, the color quantization modules are not strictly part of JPEG
+decoding, but they are essential for output to colormapped file formats or
+colormapped displays.  These extra functions can be compiled out of the
+library if not required for a particular application.  We have also included
+"jpegtran", a utility for lossless transcoding between different JPEG
+processes, and "rdjpgcom" and "wrjpgcom", two simple applications for
+inserting and extracting textual comments in JFIF files.
+
+The emphasis in designing this software has been on achieving portability and
+flexibility, while also making it fast enough to be useful.  In particular,
+the software is not intended to be read as a tutorial on JPEG.  (See the
+REFERENCES section for introductory material.)  Rather, it is intended to
+be reliable, portable, industrial-strength code.  We do not claim to have
+achieved that goal in every aspect of the software, but we strive for it.
+
+We welcome the use of this software as a component of commercial products.
+No royalty is required, but we do ask for an acknowledgement in product
+documentation, as described under LEGAL ISSUES.
+
+
+LEGAL ISSUES
+============
+
+In plain English:
+
+1. We don't promise that this software works.  (But if you find any bugs,
+   please let us know!)
+2. You can use this software for whatever you want.  You don't have to pay us.
+3. You may not pretend that you wrote this software.  If you use it in a
+   program, you must acknowledge somewhere in your documentation that
+   you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose.  This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library.  If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it.  This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+
+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
+by the usual distribution terms of the Free Software Foundation; principally,
+that you must include source code if you redistribute it.  (See the file
+ansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
+of any program generated from the IJG code, this does not limit you more than
+the foregoing paragraphs do.
+
+The Unix configuration script "configure" was produced with GNU Autoconf.
+It is copyright by the Free Software Foundation but is freely distributable.
+The same holds for its supporting scripts (config.guess, config.sub,
+ltconfig, ltmain.sh).  Another support script, install-sh, is copyright
+by M.I.T. but is also freely distributable.
+
+It appears that the arithmetic coding option of the JPEG spec is covered by
+patents owned by IBM, AT&T, and Mitsubishi.  Hence arithmetic coding cannot
+legally be used without obtaining one or more licenses.  For this reason,
+support for arithmetic coding has been removed from the free JPEG software.
+(Since arithmetic coding provides only a marginal gain over the unpatented
+Huffman mode, it is unlikely that very many implementations will support it.)
+So far as we are aware, there are no patent restrictions on the remaining
+code.
+
+The IJG distribution formerly included code to read and write GIF files.
+To avoid entanglement with the Unisys LZW patent, GIF reading support has
+been removed altogether, and the GIF writer has been simplified to produce
+"uncompressed GIFs".  This technique does not use the LZW algorithm; the
+resulting GIF files are larger than usual, but are readable by all standard
+GIF decoders.
+
+We are required to state that
+    "The Graphics Interchange Format(c) is the Copyright property of
+    CompuServe Incorporated.  GIF(sm) is a Service Mark property of
+    CompuServe Incorporated."
+
+
+REFERENCES
+==========
+
+We highly recommend reading one or more of these references before trying to
+understand the innards of the JPEG software.
+
+The best short technical introduction to the JPEG compression algorithm is
+	Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+	Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
+(Adjacent articles in that issue discuss MPEG motion picture compression,
+applications of JPEG, and related topics.)  If you don't have the CACM issue
+handy, a PostScript file containing a revised version of Wallace's article is
+available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz.  The file (actually
+a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
+omits the sample images that appeared in CACM, but it includes corrections
+and some added material.  Note: the Wallace article is copyright ACM and IEEE,
+and it may not be used for commercial purposes.
+
+A somewhat less technical, more leisurely introduction to JPEG can be found in
+"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
+M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides
+good explanations and example C code for a multitude of compression methods
+including JPEG.  It is an excellent source if you are comfortable reading C
+code but don't know much about data compression in general.  The book's JPEG
+sample code is far from industrial-strength, but when you are ready to look
+at a full implementation, you've got one here...
+
+The best full description of JPEG is the textbook "JPEG Still Image Data
+Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
+by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.  Price US$59.95, 638 pp.
+The book includes the complete text of the ISO JPEG standards (DIS 10918-1
+and draft DIS 10918-2).  This is by far the most complete exposition of JPEG
+in existence, and we highly recommend it.
+
+The JPEG standard itself is not available electronically; you must order a
+paper copy through ISO or ITU.  (Unless you feel a need to own a certified
+official copy, we recommend buying the Pennebaker and Mitchell book instead;
+it's much cheaper and includes a great deal of useful explanatory material.)
+In the USA, copies of the standard may be ordered from ANSI Sales at (212)
+642-4900, or from Global Engineering Documents at (800) 854-7179.  (ANSI
+doesn't take credit card orders, but Global does.)  It's not cheap: as of
+1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
+shipping/handling.  The standard is divided into two parts, Part 1 being the
+actual specification, while Part 2 covers compliance testing methods.  Part 1
+is titled "Digital Compression and Coding of Continuous-tone Still Images,
+Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
+10918-1, ITU-T T.81.  Part 2 is titled "Digital Compression and Coding of
+Continuous-tone Still Images, Part 2: Compliance testing" and has document
+numbers ISO/IEC IS 10918-2, ITU-T T.83.
+
+Some extensions to the original JPEG standard are defined in JPEG Part 3,
+a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84.  IJG
+currently does not support any Part 3 extensions.
+
+The JPEG standard does not specify all details of an interchangeable file
+format.  For the omitted details we follow the "JFIF" conventions, revision
+1.02.  A copy of the JFIF spec is available from:
+	Literature Department
+	C-Cube Microsystems, Inc.
+	1778 McCarthy Blvd.
+	Milpitas, CA 95035
+	phone (408) 944-6300,  fax (408) 944-6314
+A PostScript version of this document is available by FTP at
+ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz.  There is also a plain text
+version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
+the figures.
+
+The TIFF 6.0 file format specification can be obtained by FTP from
+ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme
+found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
+IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
+Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
+(Compression tag 7).  Copies of this Note can be obtained from ftp.sgi.com or
+from ftp://ftp.uu.net/graphics/jpeg/.  It is expected that the next revision
+of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
+Although IJG's own code does not support TIFF/JPEG, the free libtiff library
+uses our library to implement TIFF/JPEG per the Note.  libtiff is available
+from ftp://ftp.sgi.com/graphics/tiff/.
+
+
+ARCHIVE LOCATIONS
+=================
+
+The "official" archive site for this software is ftp.uu.net (Internet
+address 192.48.96.9).  The most recent released version can always be found
+there in directory graphics/jpeg.  This particular version will be archived
+as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz.  If you don't have
+direct Internet access, UUNET's archives are also available via UUCP; contact
+help at uunet.uu.net for information on retrieving files that way.
+
+Numerous Internet sites maintain copies of the UUNET files.  However, only
+ftp.uu.net is guaranteed to have the latest official version.
+
+You can also obtain this software in DOS-compatible "zip" archive format from
+the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or
+on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12
+"JPEG Tools".  Again, these versions may sometimes lag behind the ftp.uu.net
+release.
+
+The JPEG FAQ (Frequently Asked Questions) article is a useful source of
+general information about JPEG.  It is updated constantly and therefore is
+not included in this distribution.  The FAQ is posted every two weeks to
+Usenet newsgroups comp.graphics.misc, news.answers, and other groups.
+It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
+and other news.answers archive sites, including the official news.answers
+archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
+If you don't have Web or FTP access, send e-mail to mail-server at rtfm.mit.edu
+with body
+	send usenet/news.answers/jpeg-faq/part1
+	send usenet/news.answers/jpeg-faq/part2
+
+
+RELATED SOFTWARE
+================
+
+Numerous viewing and image manipulation programs now support JPEG.  (Quite a
+few of them use this library to do so.)  The JPEG FAQ described above lists
+some of the more popular free and shareware viewers, and tells where to
+obtain them on Internet.
+
+If you are on a Unix machine, we highly recommend Jef Poskanzer's free
+PBMPLUS software, which provides many useful operations on PPM-format image
+files.  In particular, it can convert PPM images to and from a wide range of
+other formats, thus making cjpeg/djpeg considerably more useful.  The latest
+version is distributed by the NetPBM group, and is available from numerous
+sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
+Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
+you are likely to have difficulty making it work on any non-Unix machine.
+
+A different free JPEG implementation, written by the PVRG group at Stanford,
+is available from ftp://havefun.stanford.edu/pub/jpeg/.  This program
+is designed for research and experimentation rather than production use;
+it is slower, harder to use, and less portable than the IJG code, but it
+is easier to read and modify.  Also, the PVRG code supports lossless JPEG,
+which we do not.  (On the other hand, it doesn't do progressive JPEG.)
+
+
+FILE FORMAT WARS
+================
+
+Some JPEG programs produce files that are not compatible with our library.
+The root of the problem is that the ISO JPEG committee failed to specify a
+concrete file format.  Some vendors "filled in the blanks" on their own,
+creating proprietary formats that no one else could read.  (For example, none
+of the early commercial JPEG implementations for the Macintosh were able to
+exchange compressed files.)
+
+The file format we have adopted is called JFIF (see REFERENCES).  This format
+has been agreed to by a number of major commercial JPEG vendors, and it has
+become the de facto standard.  JFIF is a minimal or "low end" representation.
+We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
+Technical Note #2) for "high end" applications that need to record a lot of
+additional data about an image.  TIFF/JPEG is fairly new and not yet widely
+supported, unfortunately.
+
+The upcoming JPEG Part 3 standard defines a file format called SPIFF.
+SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
+be able to read the most common variant of SPIFF.  SPIFF has some technical
+advantages over JFIF, but its major claim to fame is simply that it is an
+official standard rather than an informal one.  At this point it is unclear
+whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
+standard.  IJG intends to support SPIFF once the standard is frozen, but we
+have not decided whether it should become our default output format or not.
+(In any case, our decoder will remain capable of reading JFIF indefinitely.)
+
+Various proprietary file formats incorporating JPEG compression also exist.
+We have little or no sympathy for the existence of these formats.  Indeed,
+one of the original reasons for developing this free software was to help
+force convergence on common, open format standards for JPEG files.  Don't
+use a proprietary file format!
+
+
+TO DO
+=====
+
+The major thrust for v7 will probably be improvement of visual quality.
+The current method for scaling the quantization tables is known not to be
+very good at low Q values.  We also intend to investigate block boundary
+smoothing, "poor man's variable quantization", and other means of improving
+quality-vs-file-size performance without sacrificing compatibility.
+
+In future versions, we are considering supporting some of the upcoming JPEG
+Part 3 extensions --- principally, variable quantization and the SPIFF file
+format.
+
+As always, speeding things up is of great interest.
+
+Please send bug reports, offers of help, etc. to jpeg-info at uunet.uu.net.
diff --git a/make/lib/swt/win32-win32-x86/about_files/mpl-v11.txt b/make/lib/swt/win32-win32-x86/about_files/mpl-v11.txt
new file mode 100644
index 0000000..7714141
--- /dev/null
+++ b/make/lib/swt/win32-win32-x86/about_files/mpl-v11.txt
@@ -0,0 +1,470 @@
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the "License"); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
diff --git a/make/lib/swt/win32-win32-x86/swt-debug.jar b/make/lib/swt/win32-win32-x86/swt-debug.jar
new file mode 100644
index 0000000..30ce492
Binary files /dev/null and b/make/lib/swt/win32-win32-x86/swt-debug.jar differ
diff --git a/make/lib/swt/win32-win32-x86_64/about.html b/make/lib/swt/win32-win32-x86_64/about.html
new file mode 100644
index 0000000..7a5cfd1
--- /dev/null
+++ b/make/lib/swt/win32-win32-x86_64/about.html
@@ -0,0 +1,171 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p>August 17, 2006</p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content").  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL").  A copy of the EPL is available 
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+<h3>Third Party Content</h3>
+
+<p>The Content includes items that have been sourced from third parties as set out below. If you 
+did not receive this Content directly from the Eclipse Foundation, the following is provided 
+for informational purposes only, and you should look to the Redistributor’s license for 
+terms and conditions of use.</p>
+
+<h4>Mozilla Binding</h4>
+
+<p>The "Mozilla Binding" is a binding to the Mozilla API.  The Content may include any or all of the following files:</p>
+
+<p>The following files in the plug-in JAR shall be defined as the native code portion of the Mozilla Binding:</p>
+<ul>
+	<li>swt-xulrunner-win32-xxxx.so (where "xxxx" is the version number)</li>
+	<li>swt-xpcominit-win32-xxxx.so (where "xxxx" is the version number)</li>
+</ul>
+
+<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Mozilla Binding:</p>
+<ul>
+	<li>The contents of the directory org/eclipse/swt/internal/mozilla (but not including any sub-directories)</li>
+</ul>
+
+<p>The Mozilla Binding contains portions of Mozilla ("Mozilla").  Mozilla is made available by Mozilla.org.  Use of Mozilla is governed by the terms and
+conditions of the Mozilla Public License Version 1.1 ("MPL").  A copy of the MPL is provided with the Content (<a href="about_files/mpl-v11.txt" target="_blank">mpl-v11.txt</a>) and is also available at
+<a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html</a>.</p>
+
+<h4>Independent JPEG Group's JPEG software release 6b</h4>
+
+<p>This software is based in part on the work of the Independent JPEG Group's JPEG software release 6b ("LIBJPEG").
+LIBJPEG was used to implement the decoding of JPEG format files in Java (TM).  The Content does NOT include any portion of the LIBJPEG file ansi2knr.c.</p>
+
+<p>Your use of LIBJPEG is subject to the terms and conditions located in the <a href="about_files/IJG_README">about_files/IJG_README</a> file which is included
+with the Content.</p>
+
+<p>The IJG's website is located at <a href="http://ijg.org/" target="_blank">http://ijg.org</a>.</p>
+
+<p>The class org.eclipse.swt.internal.image.JPEGFileFormat is based on following files from LIBJPEG:</p>
+
+<ul>
+    <li>cderror.h</li>
+    <li>cdjpeg.h</li>
+    <li>jchuff.h</li>
+    <li>jdcolor.c</li>
+    <li>jdct.h</li>
+    <li>jdhuff.h</li>
+    <li>jerror.h</li>
+    <li>jidctint.c</li>
+    <li>jinclude.h</li>
+    <li>jmemsys.h</li>
+    <li>jmorecfg.h</li>
+    <li>jpegint.h</li>
+    <li>jpeglib.h</li>
+    <li>jversion.h</li>
+    <li>transupp.h</li>
+</ul>
+
+<p>The class org.eclipse.swt.internal.image.JPEGDecoder is based on the following files from LIBJPEG:</p>
+
+<ul>
+	<li>jcapimin.c</li>
+	<li>jcapistd.c</li>
+	<li>jccoefct.c</li>
+	<li>jccolor.c</li>
+	<li>jcdctmgr.c</li>
+	<li>jchuff.c</li>
+	<li>jcinit.c</li>
+	<li>jcmainct.c</li>
+	<li>jcmarker.c</li>
+	<li>jcmaster.c</li>
+	<li>jcomapi.c</li>
+	<li>jcparam.c</li>
+	<li>jcphuff.c</li>
+	<li>jcprepct.c</li>
+	<li>jcsample.c</li>
+	<li>jctrans.c</li>
+	<li>jdapimin.c</li>
+	<li>jdapistd.c</li>
+	<li>jdatadst.c</li>
+	<li>jdatasrc.c</li>
+	<li>jdcoefct.c</li>
+	<li>jdcolor.c</li>
+	<li>jddctmgr.c</li>
+	<li>jdhuff.c</li>
+	<li>jdinput.c</li>
+	<li>jdmainct.c</li>
+	<li>jdmarker.c</li>
+	<li>jdmaster.c</li>
+	<li>jdmerge.c</li>
+	<li>jdphuff.c</li>
+	<li>jdpostct.c</li>
+	<li>jdsample.c</li>
+	<li>jdtrans.c</li>
+	<li>jerror.c</li>
+	<li>jfdctflt.c</li>
+	<li>jfdctfst.c</li>
+	<li>jfdctint.c</li>
+	<li>jidctflt.c</li>
+	<li>jidctfst.c</li>
+	<li>jidctint.c</li>
+	<li>jidctred.c</li>
+	<li>jpegtran.c</li>
+	<li>jquant1.c</li>
+	<li>jquant2.c</li>
+	<li>jutils.c</li>
+	<li>cderror.h</li>
+	<li>cdjpeg.h</li>
+	<li>jchuff.h</li>
+	<li>jconfig.h</li>
+	<li>jdct.h</li>
+	<li>jdhuff.h</li>
+	<li>jerror.h</li>
+	<li>jinclude.h</li>
+	<li>jmorecfg.h</li>
+	<li>jpegint.h</li>
+	<li>jpeglib.h</li>
+	<li>jversion.h</li>
+	<li>transupp.h</li>
+</ul>
+	
+<p>The following changes were made to the LIBJPEG code in the Content:</p>
+
+<ol>
+	<li>In Java, pointer math is not allowed so indexing was used instead.</li>
+	<li>Function pointers were replaced with switch statements.</li>
+	<li>The virtual memory, tracing and progress monitoring were removed.</li>
+	<li>The error handling was simplified and now uses Java exceptions.</li>
+</ol>
+
+<h4>PuTTY 0.58 (derivative work)</h4>
+
+<p>Portions of the SWT class org/eclipse/swt/internal/image/PngDeflater are based on PuTTY's sshzlib.c. PuTTY is made available by Mozilla.org.  Use of PuTTY is governed by the terms and
+conditions of the the following MIT-style license:  </p>
+<blockquote>
+  <p><em>PuTTY is copyright 1997-2007 Simon Tatham.</em> </p>
+  <p><em>Portions copyright Robert de Bath, Joris van Rantwijk, Delian  Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,  Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn,  and CORE SDI S.A.</em> </p>
+  <p><em>Permission is hereby granted, free of charge, to any person  obtaining a copy of this software and associated documentation files  (the "Software"), to deal in the Software without restriction,  including without limitation the rights to use, copy, modify, merge,  publish, distribute, sublicense, and/or sell copies of the Software,  and to permit persons to whom the Software is furnished to do so,  subject to the following conditions:</em> </p>
+  <p><em>The above copyright notice and this permission notice shall be  included in all copies or substantial portions of the Software.</em> </p>
+  <p><em>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND  NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR ANY  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</em> </p>
+</blockquote>
+<p>A copy of the license is also available at <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html" target="_blank">http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html</a>.</p>
+
+<p><small>Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.</small></p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/make/lib/swt/win32-win32-x86_64/about_files/IJG_README b/make/lib/swt/win32-win32-x86_64/about_files/IJG_README
new file mode 100644
index 0000000..86cc206
--- /dev/null
+++ b/make/lib/swt/win32-win32-x86_64/about_files/IJG_README
@@ -0,0 +1,385 @@
+The Independent JPEG Group's JPEG software
+==========================================
+
+README for release 6b of 27-Mar-1998
+====================================
+
+This distribution contains the sixth public release of the Independent JPEG
+Group's free JPEG software.  You are welcome to redistribute this software and
+to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
+
+Serious users of this software (particularly those incorporating it into
+larger programs) should contact IJG at jpeg-info at uunet.uu.net to be added to
+our electronic mailing list.  Mailing list members are notified of updates
+and have a chance to participate in technical discussions, etc.
+
+This software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
+Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
+Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
+Group.
+
+IJG is not affiliated with the official ISO JPEG standards committee.
+
+
+DOCUMENTATION ROADMAP
+=====================
+
+This file contains the following sections:
+
+OVERVIEW            General description of JPEG and the IJG software.
+LEGAL ISSUES        Copyright, lack of warranty, terms of distribution.
+REFERENCES          Where to learn more about JPEG.
+ARCHIVE LOCATIONS   Where to find newer versions of this software.
+RELATED SOFTWARE    Other stuff you should get.
+FILE FORMAT WARS    Software *not* to get.
+TO DO               Plans for future IJG releases.
+
+Other documentation files in the distribution are:
+
+User documentation:
+  install.doc       How to configure and install the IJG software.
+  usage.doc         Usage instructions for cjpeg, djpeg, jpegtran,
+                    rdjpgcom, and wrjpgcom.
+  *.1               Unix-style man pages for programs (same info as usage.doc).
+  wizard.doc        Advanced usage instructions for JPEG wizards only.
+  change.log        Version-to-version change highlights.
+Programmer and internal documentation:
+  libjpeg.doc       How to use the JPEG library in your own programs.
+  example.c         Sample code for calling the JPEG library.
+  structure.doc     Overview of the JPEG library's internal structure.
+  filelist.doc      Road map of IJG files.
+  coderules.doc     Coding style rules --- please read if you contribute code.
+
+Please read at least the files install.doc and usage.doc.  Useful information
+can also be found in the JPEG FAQ (Frequently Asked Questions) article.  See
+ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
+
+If you want to understand how the JPEG code works, we suggest reading one or
+more of the REFERENCES, then looking at the documentation files (in roughly
+the order listed) before diving into the code.
+
+
+OVERVIEW
+========
+
+This package contains C software to implement JPEG image compression and
+decompression.  JPEG (pronounced "jay-peg") is a standardized compression
+method for full-color and gray-scale images.  JPEG is intended for compressing
+"real-world" scenes; line drawings, cartoons and other non-realistic images
+are not its strong suit.  JPEG is lossy, meaning that the output image is not
+exactly identical to the input image.  Hence you must not use JPEG if you
+have to have identical output bits.  However, on typical photographic images,
+very good compression levels can be obtained with no visible change, and
+remarkably high compression levels are possible if you can tolerate a
+low-quality image.  For more details, see the references, or just experiment
+with various compression settings.
+
+This software implements JPEG baseline, extended-sequential, and progressive
+compression processes.  Provision is made for supporting all variants of these
+processes, although some uncommon parameter settings aren't implemented yet.
+For legal reasons, we are not distributing code for the arithmetic-coding
+variants of JPEG; see LEGAL ISSUES.  We have made no provision for supporting
+the hierarchical or lossless processes defined in the standard.
+
+We provide a set of library routines for reading and writing JPEG image files,
+plus two sample applications "cjpeg" and "djpeg", which use the library to
+perform conversion between JPEG and some other popular image file formats.
+The library is intended to be reused in other applications.
+
+In order to support file conversion and viewing software, we have included
+considerable functionality beyond the bare JPEG coding/decoding capability;
+for example, the color quantization modules are not strictly part of JPEG
+decoding, but they are essential for output to colormapped file formats or
+colormapped displays.  These extra functions can be compiled out of the
+library if not required for a particular application.  We have also included
+"jpegtran", a utility for lossless transcoding between different JPEG
+processes, and "rdjpgcom" and "wrjpgcom", two simple applications for
+inserting and extracting textual comments in JFIF files.
+
+The emphasis in designing this software has been on achieving portability and
+flexibility, while also making it fast enough to be useful.  In particular,
+the software is not intended to be read as a tutorial on JPEG.  (See the
+REFERENCES section for introductory material.)  Rather, it is intended to
+be reliable, portable, industrial-strength code.  We do not claim to have
+achieved that goal in every aspect of the software, but we strive for it.
+
+We welcome the use of this software as a component of commercial products.
+No royalty is required, but we do ask for an acknowledgement in product
+documentation, as described under LEGAL ISSUES.
+
+
+LEGAL ISSUES
+============
+
+In plain English:
+
+1. We don't promise that this software works.  (But if you find any bugs,
+   please let us know!)
+2. You can use this software for whatever you want.  You don't have to pay us.
+3. You may not pretend that you wrote this software.  If you use it in a
+   program, you must acknowledge somewhere in your documentation that
+   you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose.  This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library.  If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it.  This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+
+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
+by the usual distribution terms of the Free Software Foundation; principally,
+that you must include source code if you redistribute it.  (See the file
+ansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
+of any program generated from the IJG code, this does not limit you more than
+the foregoing paragraphs do.
+
+The Unix configuration script "configure" was produced with GNU Autoconf.
+It is copyright by the Free Software Foundation but is freely distributable.
+The same holds for its supporting scripts (config.guess, config.sub,
+ltconfig, ltmain.sh).  Another support script, install-sh, is copyright
+by M.I.T. but is also freely distributable.
+
+It appears that the arithmetic coding option of the JPEG spec is covered by
+patents owned by IBM, AT&T, and Mitsubishi.  Hence arithmetic coding cannot
+legally be used without obtaining one or more licenses.  For this reason,
+support for arithmetic coding has been removed from the free JPEG software.
+(Since arithmetic coding provides only a marginal gain over the unpatented
+Huffman mode, it is unlikely that very many implementations will support it.)
+So far as we are aware, there are no patent restrictions on the remaining
+code.
+
+The IJG distribution formerly included code to read and write GIF files.
+To avoid entanglement with the Unisys LZW patent, GIF reading support has
+been removed altogether, and the GIF writer has been simplified to produce
+"uncompressed GIFs".  This technique does not use the LZW algorithm; the
+resulting GIF files are larger than usual, but are readable by all standard
+GIF decoders.
+
+We are required to state that
+    "The Graphics Interchange Format(c) is the Copyright property of
+    CompuServe Incorporated.  GIF(sm) is a Service Mark property of
+    CompuServe Incorporated."
+
+
+REFERENCES
+==========
+
+We highly recommend reading one or more of these references before trying to
+understand the innards of the JPEG software.
+
+The best short technical introduction to the JPEG compression algorithm is
+	Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
+	Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
+(Adjacent articles in that issue discuss MPEG motion picture compression,
+applications of JPEG, and related topics.)  If you don't have the CACM issue
+handy, a PostScript file containing a revised version of Wallace's article is
+available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz.  The file (actually
+a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
+omits the sample images that appeared in CACM, but it includes corrections
+and some added material.  Note: the Wallace article is copyright ACM and IEEE,
+and it may not be used for commercial purposes.
+
+A somewhat less technical, more leisurely introduction to JPEG can be found in
+"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
+M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides
+good explanations and example C code for a multitude of compression methods
+including JPEG.  It is an excellent source if you are comfortable reading C
+code but don't know much about data compression in general.  The book's JPEG
+sample code is far from industrial-strength, but when you are ready to look
+at a full implementation, you've got one here...
+
+The best full description of JPEG is the textbook "JPEG Still Image Data
+Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
+by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.  Price US$59.95, 638 pp.
+The book includes the complete text of the ISO JPEG standards (DIS 10918-1
+and draft DIS 10918-2).  This is by far the most complete exposition of JPEG
+in existence, and we highly recommend it.
+
+The JPEG standard itself is not available electronically; you must order a
+paper copy through ISO or ITU.  (Unless you feel a need to own a certified
+official copy, we recommend buying the Pennebaker and Mitchell book instead;
+it's much cheaper and includes a great deal of useful explanatory material.)
+In the USA, copies of the standard may be ordered from ANSI Sales at (212)
+642-4900, or from Global Engineering Documents at (800) 854-7179.  (ANSI
+doesn't take credit card orders, but Global does.)  It's not cheap: as of
+1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
+shipping/handling.  The standard is divided into two parts, Part 1 being the
+actual specification, while Part 2 covers compliance testing methods.  Part 1
+is titled "Digital Compression and Coding of Continuous-tone Still Images,
+Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
+10918-1, ITU-T T.81.  Part 2 is titled "Digital Compression and Coding of
+Continuous-tone Still Images, Part 2: Compliance testing" and has document
+numbers ISO/IEC IS 10918-2, ITU-T T.83.
+
+Some extensions to the original JPEG standard are defined in JPEG Part 3,
+a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84.  IJG
+currently does not support any Part 3 extensions.
+
+The JPEG standard does not specify all details of an interchangeable file
+format.  For the omitted details we follow the "JFIF" conventions, revision
+1.02.  A copy of the JFIF spec is available from:
+	Literature Department
+	C-Cube Microsystems, Inc.
+	1778 McCarthy Blvd.
+	Milpitas, CA 95035
+	phone (408) 944-6300,  fax (408) 944-6314
+A PostScript version of this document is available by FTP at
+ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz.  There is also a plain text
+version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
+the figures.
+
+The TIFF 6.0 file format specification can be obtained by FTP from
+ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme
+found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
+IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
+Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
+(Compression tag 7).  Copies of this Note can be obtained from ftp.sgi.com or
+from ftp://ftp.uu.net/graphics/jpeg/.  It is expected that the next revision
+of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
+Although IJG's own code does not support TIFF/JPEG, the free libtiff library
+uses our library to implement TIFF/JPEG per the Note.  libtiff is available
+from ftp://ftp.sgi.com/graphics/tiff/.
+
+
+ARCHIVE LOCATIONS
+=================
+
+The "official" archive site for this software is ftp.uu.net (Internet
+address 192.48.96.9).  The most recent released version can always be found
+there in directory graphics/jpeg.  This particular version will be archived
+as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz.  If you don't have
+direct Internet access, UUNET's archives are also available via UUCP; contact
+help at uunet.uu.net for information on retrieving files that way.
+
+Numerous Internet sites maintain copies of the UUNET files.  However, only
+ftp.uu.net is guaranteed to have the latest official version.
+
+You can also obtain this software in DOS-compatible "zip" archive format from
+the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or
+on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12
+"JPEG Tools".  Again, these versions may sometimes lag behind the ftp.uu.net
+release.
+
+The JPEG FAQ (Frequently Asked Questions) article is a useful source of
+general information about JPEG.  It is updated constantly and therefore is
+not included in this distribution.  The FAQ is posted every two weeks to
+Usenet newsgroups comp.graphics.misc, news.answers, and other groups.
+It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
+and other news.answers archive sites, including the official news.answers
+archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
+If you don't have Web or FTP access, send e-mail to mail-server at rtfm.mit.edu
+with body
+	send usenet/news.answers/jpeg-faq/part1
+	send usenet/news.answers/jpeg-faq/part2
+
+
+RELATED SOFTWARE
+================
+
+Numerous viewing and image manipulation programs now support JPEG.  (Quite a
+few of them use this library to do so.)  The JPEG FAQ described above lists
+some of the more popular free and shareware viewers, and tells where to
+obtain them on Internet.
+
+If you are on a Unix machine, we highly recommend Jef Poskanzer's free
+PBMPLUS software, which provides many useful operations on PPM-format image
+files.  In particular, it can convert PPM images to and from a wide range of
+other formats, thus making cjpeg/djpeg considerably more useful.  The latest
+version is distributed by the NetPBM group, and is available from numerous
+sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
+Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
+you are likely to have difficulty making it work on any non-Unix machine.
+
+A different free JPEG implementation, written by the PVRG group at Stanford,
+is available from ftp://havefun.stanford.edu/pub/jpeg/.  This program
+is designed for research and experimentation rather than production use;
+it is slower, harder to use, and less portable than the IJG code, but it
+is easier to read and modify.  Also, the PVRG code supports lossless JPEG,
+which we do not.  (On the other hand, it doesn't do progressive JPEG.)
+
+
+FILE FORMAT WARS
+================
+
+Some JPEG programs produce files that are not compatible with our library.
+The root of the problem is that the ISO JPEG committee failed to specify a
+concrete file format.  Some vendors "filled in the blanks" on their own,
+creating proprietary formats that no one else could read.  (For example, none
+of the early commercial JPEG implementations for the Macintosh were able to
+exchange compressed files.)
+
+The file format we have adopted is called JFIF (see REFERENCES).  This format
+has been agreed to by a number of major commercial JPEG vendors, and it has
+become the de facto standard.  JFIF is a minimal or "low end" representation.
+We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
+Technical Note #2) for "high end" applications that need to record a lot of
+additional data about an image.  TIFF/JPEG is fairly new and not yet widely
+supported, unfortunately.
+
+The upcoming JPEG Part 3 standard defines a file format called SPIFF.
+SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
+be able to read the most common variant of SPIFF.  SPIFF has some technical
+advantages over JFIF, but its major claim to fame is simply that it is an
+official standard rather than an informal one.  At this point it is unclear
+whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
+standard.  IJG intends to support SPIFF once the standard is frozen, but we
+have not decided whether it should become our default output format or not.
+(In any case, our decoder will remain capable of reading JFIF indefinitely.)
+
+Various proprietary file formats incorporating JPEG compression also exist.
+We have little or no sympathy for the existence of these formats.  Indeed,
+one of the original reasons for developing this free software was to help
+force convergence on common, open format standards for JPEG files.  Don't
+use a proprietary file format!
+
+
+TO DO
+=====
+
+The major thrust for v7 will probably be improvement of visual quality.
+The current method for scaling the quantization tables is known not to be
+very good at low Q values.  We also intend to investigate block boundary
+smoothing, "poor man's variable quantization", and other means of improving
+quality-vs-file-size performance without sacrificing compatibility.
+
+In future versions, we are considering supporting some of the upcoming JPEG
+Part 3 extensions --- principally, variable quantization and the SPIFF file
+format.
+
+As always, speeding things up is of great interest.
+
+Please send bug reports, offers of help, etc. to jpeg-info at uunet.uu.net.
diff --git a/make/lib/swt/win32-win32-x86_64/about_files/mpl-v11.txt b/make/lib/swt/win32-win32-x86_64/about_files/mpl-v11.txt
new file mode 100644
index 0000000..7714141
--- /dev/null
+++ b/make/lib/swt/win32-win32-x86_64/about_files/mpl-v11.txt
@@ -0,0 +1,470 @@
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+
+                              ---------------
+
+1. Definitions.
+
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+
+     1.8. "License" means this document.
+
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+
+2. Source Code License.
+
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+
+3. Distribution Obligations.
+
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+
+               (c)    Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+
+5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+
+11. MISCELLANEOUS.
+
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the "License"); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+
+     The Original Code is ______________________________________.
+
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+
+     Contributor(s): ______________________________________.
+
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
+
diff --git a/make/lib/swt/win32-win32-x86_64/swt-debug.jar b/make/lib/swt/win32-win32-x86_64/swt-debug.jar
new file mode 100644
index 0000000..a1deaf7
Binary files /dev/null and b/make/lib/swt/win32-win32-x86_64/swt-debug.jar differ
diff --git a/make/native-taglet.properties b/make/native-taglet.properties
index 22cc232..64d9ab9 100644
--- a/make/native-taglet.properties
+++ b/make/native-taglet.properties
@@ -1,355 +1,477 @@
-##OpenGL Reference Manual method name mapping
-#Fri Apr 06 02:25:27 PDT 2007
-nativetaglet.baseUrl=http://www.opengl.org/sdk/docs/man/xhtml/
-glAccum=glAccum.xml
-glActiveTexture=glActiveTexture.xml
-glAlphaFunc=glAlphaFunc.xml
-glAreTexturesResident=glAreTexturesResident.xml
-glArrayElement=glArrayElement.xml
-glAttachShader=glAttachShader.xml
-glBegin=glBegin.xml
-glBeginQuery=glBeginQuery.xml
-glBindAttribLocation=glBindAttribLocation.xml
-glBindBuffer=glBindBuffer.xml
-glBindTexture=glBindTexture.xml
-glBitmap=glBitmap.xml
-glBlendColor=glBlendColor.xml
-glBlendEquation=glBlendEquation.xml
-glBlendEquationSeparate=glBlendEquationSeparate.xml
-glBlendFunc=glBlendFunc.xml
-glBlendFuncSeparate=glBlendFuncSeparate.xml
-glBufferData=glBufferData.xml
-glBufferSubData=glBufferSubData.xml
-glCallList=glCallList.xml
-glCallLists=glCallLists.xml
-glClear=glClear.xml
-glClearAccum=glClearAccum.xml
-glClearColor=glClearColor.xml
-glClearDepth=glClearDepth.xml
-glClearIndex=glClearIndex.xml
-glClearStencil=glClearStencil.xml
-glClientActiveTexture=glClientActiveTexture.xml
-glClipPlane=glClipPlane.xml
-glColor=glColor.xml
-glColorMask=glColorMask.xml
-glColorMaterial=glColorMaterial.xml
-glColorPointer=glColorPointer.xml
-glColorSubTable=glColorSubTable.xml
-glColorTable=glColorTable.xml
-glColorTableParameter=glColorTableParameter.xml
-glCompileShader=glCompileShader.xml
-glCompressedTexImage1D=glCompressedTexImage1D.xml
-glCompressedTexImage2D=glCompressedTexImage2D.xml
-glCompressedTexImage3D=glCompressedTexImage3D.xml
-glCompressedTexSubImage1D=glCompressedTexSubImage1D.xml
-glCompressedTexSubImage2D=glCompressedTexSubImage2D.xml
-glCompressedTexSubImage3D=glCompressedTexSubImage3D.xml
-glConvolutionFilter1D=glConvolutionFilter1D.xml
-glConvolutionFilter2D=glConvolutionFilter2D.xml
-glConvolutionParameter=glConvolutionParameter.xml
-glCopyColorSubTable=glCopyColorSubTable.xml
-glCopyColorTable=glCopyColorTable.xml
-glCopyConvolutionFilter1D=glCopyConvolutionFilter1D.xml
-glCopyConvolutionFilter2D=glCopyConvolutionFilter2D.xml
-glCopyPixels=glCopyPixels.xml
-glCopyTexImage1D=glCopyTexImage1D.xml
-glCopyTexImage2D=glCopyTexImage2D.xml
-glCopyTexSubImage1D=glCopyTexSubImage1D.xml
-glCopyTexSubImage2D=glCopyTexSubImage2D.xml
-glCopyTexSubImage3D=glCopyTexSubImage3D.xml
-glCreateProgram=glCreateProgram.xml
-glCreateShader=glCreateShader.xml
-glCullFace=glCullFace.xml
-glDeleteBuffers=glDeleteBuffers.xml
-glDeleteLists=glDeleteLists.xml
-glDeleteProgram=glDeleteProgram.xml
-glDeleteQueries=glDeleteQueries.xml
-glDeleteShader=glDeleteShader.xml
-glDeleteTextures=glDeleteTextures.xml
-glDepthFunc=glDepthFunc.xml
-glDepthMask=glDepthMask.xml
-glDepthRange=glDepthRange.xml
-glDetachShader=glDetachShader.xml
-glDisable=glDisable.xml
-glDisableClientState=glDisableClientState.xml
-glDisableVertexAttribArray=glDisableVertexAttribArray.xml
-glDrawArrays=glDrawArrays.xml
-glDrawBuffer=glDrawBuffer.xml
-glDrawBuffers=glDrawBuffers.xml
-glDrawElements=glDrawElements.xml
-glDrawPixels=glDrawPixels.xml
-glDrawRangeElements=glDrawRangeElements.xml
-glEdgeFlag=glEdgeFlag.xml
-glEdgeFlagPointer=glEdgeFlagPointer.xml
-glEnable=glEnable.xml
-glEnableClientState=glEnableClientState.xml
-glEnableVertexAttribArray=glEnableVertexAttribArray.xml
-glEnd=glEnd.xml
-glEndList=glEndList.xml
-glEndQuery=glEndQuery.xml
-glEvalCoord=glEvalCoord.xml
-glEvalMesh=glEvalMesh.xml
-glEvalPoint=glEvalPoint.xml
-glFeedbackBuffer=glFeedbackBuffer.xml
-glFinish=glFinish.xml
-glFlush=glFlush.xml
-glFog=glFog.xml
-glFogCoord=glFogCoord.xml
-glFogCoordPointer=glFogCoordPointer.xml
-glFrontFace=glFrontFace.xml
-glFrustum=glFrustum.xml
-glGenBuffers=glGenBuffers.xml
-glGenLists=glGenLists.xml
-glGenQueries=glGenQueries.xml
-glGenTextures=glGenTextures.xml
-glGet=glGet.xml
-glGetActiveAttrib=glGetActiveAttrib.xml
-glGetActiveUniform=glGetActiveUniform.xml
-glGetAttachedShaders=glGetAttachedShaders.xml
-glGetAttribLocation=glGetAttribLocation.xml
-glGetBufferParameteriv=glGetBufferParameteriv.xml
-glGetBufferPointerv=glGetBufferPointerv.xml
-glGetBufferSubData=glGetBufferSubData.xml
-glGetClipPlane=glGetClipPlane.xml
-glGetColorTable=glGetColorTable.xml
-glGetColorTableParameter=glGetColorTableParameter.xml
-glGetCompressedTexImage=glGetCompressedTexImage.xml
-glGetConvolutionFilter=glGetConvolutionFilter.xml
-glGetConvolutionParameter=glGetConvolutionParameter.xml
-glGetError=glGetError.xml
-glGetHistogram=glGetHistogram.xml
-glGetHistogramParameter=glGetHistogramParameter.xml
-glGetLight=glGetLight.xml
-glGetMap=glGetMap.xml
-glGetMaterial=glGetMaterial.xml
-glGetMinmax=glGetMinmax.xml
-glGetMinmaxParameter=glGetMinmaxParameter.xml
-glGetPixelMap=glGetPixelMap.xml
-glGetPointerv=glGetPointerv.xml
-glGetPolygonStipple=glGetPolygonStipple.xml
-glGetProgram=glGetProgram.xml
-glGetProgramInfoLog=glGetProgramInfoLog.xml
-glGetQueryObject=glGetQueryObject.xml
-glGetQueryiv=glGetQueryiv.xml
-glGetSeparableFilter=glGetSeparableFilter.xml
-glGetShader=glGetShader.xml
-glGetShaderInfoLog=glGetShaderInfoLog.xml
-glGetShaderSource=glGetShaderSource.xml
-glGetString=glGetString.xml
-glGetTexEnv=glGetTexEnv.xml
-glGetTexGen=glGetTexGen.xml
-glGetTexImage=glGetTexImage.xml
-glGetTexLevelParameter=glGetTexLevelParameter.xml
-glGetTexParameter=glGetTexParameter.xml
-glGetUniform=glGetUniform.xml
-glGetUniformLocation=glGetUniformLocation.xml
-glGetVertexAttrib=glGetVertexAttrib.xml
-glGetVertexAttribPointerv=glGetVertexAttribPointerv.xml
-glHint=glHint.xml
-glHistogram=glHistogram.xml
-glIndex=glIndex.xml
-glIndexMask=glIndexMask.xml
-glIndexPointer=glIndexPointer.xml
-glInitNames=glInitNames.xml
-glInterleavedArrays=glInterleavedArrays.xml
-glIsBuffer=glIsBuffer.xml
-glIsEnabled=glIsEnabled.xml
-glIsList=glIsList.xml
-glIsProgram=glIsProgram.xml
-glIsQuery=glIsQuery.xml
-glIsShader=glIsShader.xml
-glIsTexture=glIsTexture.xml
-glLight=glLight.xml
-glLightModel=glLightModel.xml
-glLineStipple=glLineStipple.xml
-glLineWidth=glLineWidth.xml
-glLinkProgram=glLinkProgram.xml
-glListBase=glListBase.xml
-glLoadIdentity=glLoadIdentity.xml
-glLoadMatrix=glLoadMatrix.xml
-glLoadName=glLoadName.xml
-glLoadTransposeMatrix=glLoadTransposeMatrix.xml
-glLogicOp=glLogicOp.xml
-glMap1=glMap1.xml
-glMap2=glMap2.xml
-glMapBuffer=glMapBuffer.xml
-glMapGrid=glMapGrid.xml
-glMaterial=glMaterial.xml
-glMatrixMode=glMatrixMode.xml
-glMinmax=glMinmax.xml
-glMultMatrix=glMultMatrix.xml
-glMultTransposeMatrix=glMultTransposeMatrix.xml
-glMultiDrawArrays=glMultiDrawArrays.xml
-glMultiDrawElements=glMultiDrawElements.xml
-glMultiTexCoord=glMultiTexCoord.xml
-glNewList=glNewList.xml
-glNormal=glNormal.xml
-glNormalPointer=glNormalPointer.xml
-glOrtho=glOrtho.xml
-glPassThrough=glPassThrough.xml
-glPixelMap=glPixelMap.xml
-glPixelStore=glPixelStore.xml
-glPixelTransfer=glPixelTransfer.xml
-glPixelZoom=glPixelZoom.xml
-glPointParameter=glPointParameter.xml
-glPointSize=glPointSize.xml
-glPolygonMode=glPolygonMode.xml
-glPolygonOffset=glPolygonOffset.xml
-glPolygonStipple=glPolygonStipple.xml
-glPopAttrib=glPopAttrib.xml
-glPopClientAttrib=glPopClientAttrib.xml
-glPopMatrix=glPopMatrix.xml
-glPopName=glPopName.xml
-glPrioritizeTextures=glPrioritizeTextures.xml
-glPushAttrib=glPushAttrib.xml
-glPushClientAttrib=glPushClientAttrib.xml
-glPushMatrix=glPushMatrix.xml
-glPushName=glPushName.xml
-glRasterPos=glRasterPos.xml
-glReadBuffer=glReadBuffer.xml
-glReadPixels=glReadPixels.xml
-glRect=glRect.xml
-glRenderMode=glRenderMode.xml
-glResetHistogram=glResetHistogram.xml
-glResetMinmax=glResetMinmax.xml
-glRotate=glRotate.xml
-glSampleCoverage=glSampleCoverage.xml
-glScale=glScale.xml
-glScissor=glScissor.xml
-glSecondaryColor=glSecondaryColor.xml
-glSecondaryColorPointer=glSecondaryColorPointer.xml
-glSelectBuffer=glSelectBuffer.xml
-glSeparableFilter2D=glSeparableFilter2D.xml
-glShadeModel=glShadeModel.xml
-glShaderSource=glShaderSource.xml
-glStencilFunc=glStencilFunc.xml
-glStencilFuncSeparate=glStencilFuncSeparate.xml
-glStencilMask=glStencilMask.xml
-glStencilMaskSeparate=glStencilMaskSeparate.xml
-glStencilOp=glStencilOp.xml
-glStencilOpSeparate=glStencilOpSeparate.xml
-glTexCoord=glTexCoord.xml
-glTexCoordPointer=glTexCoordPointer.xml
-glTexEnv=glTexEnv.xml
-glTexGen=glTexGen.xml
-glTexImage1D=glTexImage1D.xml
-glTexImage2D=glTexImage2D.xml
-glTexImage3D=glTexImage3D.xml
-glTexParameter=glTexParameter.xml
-glTexSubImage1D=glTexSubImage1D.xml
-glTexSubImage2D=glTexSubImage2D.xml
-glTexSubImage3D=glTexSubImage3D.xml
-glTranslate=glTranslate.xml
-glUniform=glUniform.xml
-glUnmapBuffer=glUnmapBuffer.xml
-glUseProgram=glUseProgram.xml
-glValidateProgram=glValidateProgram.xml
-glVertex=glVertex.xml
-glVertexAttrib=glVertexAttrib.xml
-glVertexAttribPointer=glVertexAttribPointer.xml
-glVertexPointer=glVertexPointer.xml
-glViewport=glViewport.xml
-glWindowPos=glWindowPos.xml
-gluBeginCurve=gluBeginCurve.xml
-gluBeginPolygon=gluBeginPolygon.xml
-gluBeginSurface=gluBeginSurface.xml
-gluBeginTrim=gluBeginTrim.xml
-gluBuild1DMipmapLevels=gluBuild1DMipmapLevels.xml
-gluBuild1DMipmaps=gluBuild1DMipmaps.xml
-gluBuild2DMipmapLevels=gluBuild2DMipmapLevels.xml
-gluBuild2DMipmaps=gluBuild2DMipmaps.xml
-gluBuild3DMipmapLevels=gluBuild3DMipmapLevels.xml
-gluBuild3DMipmaps=gluBuild3DMipmaps.xml
-gluCheckExtension=gluCheckExtension.xml
-gluCylinder=gluCylinder.xml
-gluDeleteNurbsRenderer=gluDeleteNurbsRenderer.xml
-gluDeleteQuadric=gluDeleteQuadric.xml
-gluDeleteTess=gluDeleteTess.xml
-gluDisk=gluDisk.xml
-gluEndCurve=gluEndCurve.xml
-gluEndPolygon=gluEndPolygon.xml
-gluEndSurface=gluEndSurface.xml
-gluEndTrim=gluEndTrim.xml
-gluErrorString=gluErrorString.xml
-gluGetNurbsProperty=gluGetNurbsProperty.xml
-gluGetString=gluGetString.xml
-gluGetTessProperty=gluGetTessProperty.xml
-gluLoadSamplingMatrices=gluLoadSamplingMatrices.xml
-gluLookAt=gluLookAt.xml
-gluNewNurbsRenderer=gluNewNurbsRenderer.xml
-gluNewQuadric=gluNewQuadric.xml
-gluNewTess=gluNewTess.xml
-gluNextContour=gluNextContour.xml
-gluNurbsCallback=gluNurbsCallback.xml
-gluNurbsCallbackData=gluNurbsCallbackData.xml
-gluNurbsCallbackDataEXT=gluNurbsCallbackDataEXT.xml
-gluNurbsCurve=gluNurbsCurve.xml
-gluNurbsProperty=gluNurbsProperty.xml
-gluNurbsSurface=gluNurbsSurface.xml
-gluOrtho2D=gluOrtho2D.xml
-gluPartialDisk=gluPartialDisk.xml
-gluPerspective=gluPerspective.xml
-gluPickMatrix=gluPickMatrix.xml
-gluProject=gluProject.xml
-gluPwlCurve=gluPwlCurve.xml
-gluQuadricCallback=gluQuadricCallback.xml
-gluQuadricDrawStyle=gluQuadricDrawStyle.xml
-gluQuadricNormals=gluQuadricNormals.xml
-gluQuadricOrientation=gluQuadricOrientation.xml
-gluQuadricTexture=gluQuadricTexture.xml
-gluScaleImage=gluScaleImage.xml
-gluSphere=gluSphere.xml
-gluTessBeginContour=gluTessBeginContour.xml
-gluTessBeginPolygon=gluTessBeginPolygon.xml
-gluTessCallback=gluTessCallback.xml
-gluTessEndContour=gluTessEndContour.xml
-gluTessEndPolygon=gluTessEndPolygon.xml
-gluTessNormal=gluTessNormal.xml
-gluTessProperty=gluTessProperty.xml
-gluTessVertex=gluTessVertex.xml
-gluUnProject=gluUnProject.xml
-gluUnProject4=gluUnProject4.xml
-glXChooseFBConfig=glXChooseFBConfig.xml
-glXChooseVisual=glXChooseVisual.xml
-glXCopyContext=glXCopyContext.xml
-glXCreateContext=glXCreateContext.xml
-glXCreateGLXPixmap=glXCreateGLXPixmap.xml
-glXCreateNewContext=glXCreateNewContext.xml
-glXCreatePbuffer=glXCreatePbuffer.xml
-glXCreatePixmap=glXCreatePixmap.xml
-glXCreateWindow=glXCreateWindow.xml
-glXDestroyContext=glXDestroyContext.xml
-glXDestroyGLXPixmap=glXDestroyGLXPixmap.xml
-glXDestroyPbuffer=glXDestroyPbuffer.xml
-glXDestroyPixmap=glXDestroyPixmap.xml
-glXDestroyWindow=glXDestroyWindow.xml
-glXFreeContextEXT=glXFreeContextEXT.xml
-glXGetClientString=glXGetClientString.xml
-glXGetConfig=glXGetConfig.xml
-glXGetContextIDEXT=glXGetContextIDEXT.xml
-glXGetCurrentContext=glXGetCurrentContext.xml
-glXGetCurrentDisplay=glXGetCurrentDisplay.xml
-glXGetCurrentDrawable=glXGetCurrentDrawable.xml
-glXGetCurrentReadDrawable=glXGetCurrentReadDrawable.xml
-glXGetFBConfigAttrib=glXGetFBConfigAttrib.xml
-glXGetFBConfigs=glXGetFBConfigs.xml
-glXGetProcAddress=glXGetProcAddress.xml
-glXGetSelectedEvent=glXGetSelectedEvent.xml
-glXGetVisualFromFBConfig=glXGetVisualFromFBConfig.xml
-glXImportContextEXT=glXImportContextEXT.xml
-glXIntro=glXIntro.xml
-glXIsDirect=glXIsDirect.xml
-glXMakeContextCurrent=glXMakeContextCurrent.xml
-glXMakeCurrent=glXMakeCurrent.xml
-glXQueryContext=glXQueryContext.xml
-glXQueryContextInfoEXT=glXQueryContextInfoEXT.xml
-glXQueryDrawable=glXQueryDrawable.xml
-glXQueryExtension=glXQueryExtension.xml
-glXQueryExtensionsString=glXQueryExtensionsString.xml
-glXQueryServerString=glXQueryServerString.xml
-glXQueryVersion=glXQueryVersion.xml
-glXSelectEvent=glXSelectEvent.xml
-glXSwapBuffers=glXSwapBuffers.xml
-glXUseXFont=glXUseXFont.xml
-glXWaitGL=glXWaitGL.xml
-glXWaitX=glXWaitX.xml
+#Generated, do not edit, edit createTagletProps.sh instead.
+#This file is used in NativeTaglet and maps the generated method names
+#to the function specific OpenGL documentation man pages.
+nativetaglet.baseUrl=http://www.opengl.org/sdk/docs/
+glAccum=man/xhtml/glAccum.xml
+glActiveShaderProgram=man4/xhtml/glActiveShaderProgram.xml
+glActiveTexture=man4/xhtml/glActiveTexture.xml
+glAlphaFunc=man/xhtml/glAlphaFunc.xml
+glAreTexturesResident=man/xhtml/glAreTexturesResident.xml
+glArrayElement=man/xhtml/glArrayElement.xml
+glAttachShader=man4/xhtml/glAttachShader.xml
+glBeginConditionalRender=man4/xhtml/glBeginConditionalRender.xml
+glBegin=man/xhtml/glBegin.xml
+glBeginQueryIndexed=man4/xhtml/glBeginQueryIndexed.xml
+glBeginQuery=man4/xhtml/glBeginQuery.xml
+glBeginTransformFeedback=man4/xhtml/glBeginTransformFeedback.xml
+glBindAttribLocation=man4/xhtml/glBindAttribLocation.xml
+glBindBufferBase=man4/xhtml/glBindBufferBase.xml
+glBindBuffer=man4/xhtml/glBindBuffer.xml
+glBindBufferRange=man4/xhtml/glBindBufferRange.xml
+glBindFragDataLocationIndexed=man4/xhtml/glBindFragDataLocationIndexed.xml
+glBindFragDataLocation=man4/xhtml/glBindFragDataLocation.xml
+glBindFramebuffer=man4/xhtml/glBindFramebuffer.xml
+glBindProgramPipeline=man4/xhtml/glBindProgramPipeline.xml
+glBindRenderbuffer=man4/xhtml/glBindRenderbuffer.xml
+glBindSampler=man4/xhtml/glBindSampler.xml
+glBindTexture=man4/xhtml/glBindTexture.xml
+glBindTransformFeedback=man4/xhtml/glBindTransformFeedback.xml
+glBindVertexArray=man4/xhtml/glBindVertexArray.xml
+glBitmap=man/xhtml/glBitmap.xml
+glBlendColor=man4/xhtml/glBlendColor.xml
+glBlendEquation=man4/xhtml/glBlendEquation.xml
+glBlendEquationSeparate=man4/xhtml/glBlendEquationSeparate.xml
+glBlendFunc=man4/xhtml/glBlendFunc.xml
+glBlendFuncSeparate=man4/xhtml/glBlendFuncSeparate.xml
+glBlitFramebuffer=man4/xhtml/glBlitFramebuffer.xml
+glBufferData=man4/xhtml/glBufferData.xml
+glBufferSubData=man4/xhtml/glBufferSubData.xml
+glCallList=man/xhtml/glCallList.xml
+glCallLists=man/xhtml/glCallLists.xml
+glCheckFramebufferStatus=man4/xhtml/glCheckFramebufferStatus.xml
+glClampColor=man4/xhtml/glClampColor.xml
+glClearAccum=man/xhtml/glClearAccum.xml
+glClearBuffer=man4/xhtml/glClearBuffer.xml
+glClearColor=man4/xhtml/glClearColor.xml
+glClearDepth=man4/xhtml/glClearDepth.xml
+glClearIndex=man/xhtml/glClearIndex.xml
+glClear=man4/xhtml/glClear.xml
+glClearStencil=man4/xhtml/glClearStencil.xml
+glClientActiveTexture=man/xhtml/glClientActiveTexture.xml
+glClientWaitSync=man4/xhtml/glClientWaitSync.xml
+glClipPlane=man/xhtml/glClipPlane.xml
+glColor=man/xhtml/glColor.xml
+glColorMask=man4/xhtml/glColorMask.xml
+glColorMaterial=man/xhtml/glColorMaterial.xml
+glColorPointer=man/xhtml/glColorPointer.xml
+glColorSubTable=man/xhtml/glColorSubTable.xml
+glColorTable=man/xhtml/glColorTable.xml
+glColorTableParameter=man/xhtml/glColorTableParameter.xml
+glCompileShader=man4/xhtml/glCompileShader.xml
+glCompressedTexImage1D=man4/xhtml/glCompressedTexImage1D.xml
+glCompressedTexImage2D=man4/xhtml/glCompressedTexImage2D.xml
+glCompressedTexImage3D=man4/xhtml/glCompressedTexImage3D.xml
+glCompressedTexSubImage1D=man4/xhtml/glCompressedTexSubImage1D.xml
+glCompressedTexSubImage2D=man4/xhtml/glCompressedTexSubImage2D.xml
+glCompressedTexSubImage3D=man4/xhtml/glCompressedTexSubImage3D.xml
+glConvolutionFilter1D=man/xhtml/glConvolutionFilter1D.xml
+glConvolutionFilter2D=man/xhtml/glConvolutionFilter2D.xml
+glConvolutionParameter=man/xhtml/glConvolutionParameter.xml
+glCopyBufferSubData=man4/xhtml/glCopyBufferSubData.xml
+glCopyColorSubTable=man/xhtml/glCopyColorSubTable.xml
+glCopyColorTable=man/xhtml/glCopyColorTable.xml
+glCopyConvolutionFilter1D=man/xhtml/glCopyConvolutionFilter1D.xml
+glCopyConvolutionFilter2D=man/xhtml/glCopyConvolutionFilter2D.xml
+glCopyPixels=man/xhtml/glCopyPixels.xml
+glCopyTexImage1D=man4/xhtml/glCopyTexImage1D.xml
+glCopyTexImage2D=man4/xhtml/glCopyTexImage2D.xml
+glCopyTexSubImage1D=man4/xhtml/glCopyTexSubImage1D.xml
+glCopyTexSubImage2D=man4/xhtml/glCopyTexSubImage2D.xml
+glCopyTexSubImage3D=man4/xhtml/glCopyTexSubImage3D.xml
+glCreateProgram=man4/xhtml/glCreateProgram.xml
+glCreateShader=man4/xhtml/glCreateShader.xml
+glCreateShaderProgram=man4/xhtml/glCreateShaderProgram.xml
+glCullFace=man4/xhtml/glCullFace.xml
+glDeleteBuffers=man4/xhtml/glDeleteBuffers.xml
+glDeleteFramebuffers=man4/xhtml/glDeleteFramebuffers.xml
+glDeleteLists=man/xhtml/glDeleteLists.xml
+glDeleteProgram=man4/xhtml/glDeleteProgram.xml
+glDeleteProgramPipelines=man4/xhtml/glDeleteProgramPipelines.xml
+glDeleteQueries=man4/xhtml/glDeleteQueries.xml
+glDeleteRenderbuffers=man4/xhtml/glDeleteRenderbuffers.xml
+glDeleteSamplers=man4/xhtml/glDeleteSamplers.xml
+glDeleteShader=man4/xhtml/glDeleteShader.xml
+glDeleteSync=man4/xhtml/glDeleteSync.xml
+glDeleteTextures=man4/xhtml/glDeleteTextures.xml
+glDeleteTransformFeedbacks=man4/xhtml/glDeleteTransformFeedbacks.xml
+glDeleteVertexArrays=man4/xhtml/glDeleteVertexArrays.xml
+glDepthFunc=man4/xhtml/glDepthFunc.xml
+glDepthMask=man4/xhtml/glDepthMask.xml
+glDepthRangeArray=man4/xhtml/glDepthRangeArray.xml
+glDepthRangeIndexed=man4/xhtml/glDepthRangeIndexed.xml
+glDepthRange=man4/xhtml/glDepthRange.xml
+glDetachShader=man4/xhtml/glDetachShader.xml
+glDisableClientState=man/xhtml/glDisableClientState.xml
+glDisablei=man3/xhtml/glDisablei.xml
+glDisable=man4/xhtml/glDisable.xml
+glDisableVertexAttribArray=man4/xhtml/glDisableVertexAttribArray.xml
+glDrawArraysIndirect=man4/xhtml/glDrawArraysIndirect.xml
+glDrawArraysInstanced=man4/xhtml/glDrawArraysInstanced.xml
+glDrawArrays=man4/xhtml/glDrawArrays.xml
+glDrawBuffer=man4/xhtml/glDrawBuffer.xml
+glDrawBuffers=man4/xhtml/glDrawBuffers.xml
+glDrawElementsBaseVertex=man4/xhtml/glDrawElementsBaseVertex.xml
+glDrawElementsIndirect=man4/xhtml/glDrawElementsIndirect.xml
+glDrawElementsInstancedBaseVertex=man4/xhtml/glDrawElementsInstancedBaseVertex.xml
+glDrawElementsInstanced=man4/xhtml/glDrawElementsInstanced.xml
+glDrawElements=man4/xhtml/glDrawElements.xml
+glDrawPixels=man/xhtml/glDrawPixels.xml
+glDrawRangeElementsBaseVertex=man4/xhtml/glDrawRangeElementsBaseVertex.xml
+glDrawRangeElements=man4/xhtml/glDrawRangeElements.xml
+glDrawTransformFeedback=man4/xhtml/glDrawTransformFeedback.xml
+glDrawTransformFeedbackStream=man4/xhtml/glDrawTransformFeedbackStream.xml
+glEdgeFlag=man/xhtml/glEdgeFlag.xml
+glEdgeFlagPointer=man/xhtml/glEdgeFlagPointer.xml
+glEnableClientState=man/xhtml/glEnableClientState.xml
+glEnable=man4/xhtml/glEnable.xml
+glEnableVertexAttribArray=man4/xhtml/glEnableVertexAttribArray.xml
+glEndConditionalRender=man4/xhtml/glEndConditionalRender.xml
+glEndList=man/xhtml/glEndList.xml
+glEnd=man/xhtml/glEnd.xml
+glEndQueryIndexed=man4/xhtml/glEndQueryIndexed.xml
+glEndQuery=man4/xhtml/glEndQuery.xml
+glEndTransformFeedback=man4/xhtml/glEndTransformFeedback.xml
+glEvalCoord=man/xhtml/glEvalCoord.xml
+glEvalMesh=man/xhtml/glEvalMesh.xml
+glEvalPoint=man/xhtml/glEvalPoint.xml
+glFeedbackBuffer=man/xhtml/glFeedbackBuffer.xml
+glFenceSync=man4/xhtml/glFenceSync.xml
+glFinish=man4/xhtml/glFinish.xml
+glFlush=man4/xhtml/glFlush.xml
+glFlushMappedBufferRange=man4/xhtml/glFlushMappedBufferRange.xml
+glFogCoord=man/xhtml/glFogCoord.xml
+glFogCoordPointer=man/xhtml/glFogCoordPointer.xml
+glFog=man/xhtml/glFog.xml
+glFramebufferRenderbuffer=man4/xhtml/glFramebufferRenderbuffer.xml
+glFramebufferTextureLayer=man4/xhtml/glFramebufferTextureLayer.xml
+glFramebufferTexture=man4/xhtml/glFramebufferTexture.xml
+glFrontFace=man4/xhtml/glFrontFace.xml
+glFrustum=man/xhtml/glFrustum.xml
+glGenBuffers=man4/xhtml/glGenBuffers.xml
+glGenerateMipmap=man4/xhtml/glGenerateMipmap.xml
+glGenFramebuffers=man4/xhtml/glGenFramebuffers.xml
+glGenLists=man/xhtml/glGenLists.xml
+glGenProgramPipelines=man4/xhtml/glGenProgramPipelines.xml
+glGenQueries=man4/xhtml/glGenQueries.xml
+glGenRenderbuffers=man4/xhtml/glGenRenderbuffers.xml
+glGenSamplers=man4/xhtml/glGenSamplers.xml
+glGenTextures=man4/xhtml/glGenTextures.xml
+glGenTransformFeedbacks=man4/xhtml/glGenTransformFeedbacks.xml
+glGenVertexArrays=man4/xhtml/glGenVertexArrays.xml
+glGetActiveAttrib=man4/xhtml/glGetActiveAttrib.xml
+glGetActiveSubroutineName=man4/xhtml/glGetActiveSubroutineName.xml
+glGetActiveSubroutineUniform=man4/xhtml/glGetActiveSubroutineUniform.xml
+glGetActiveSubroutineUniformName=man4/xhtml/glGetActiveSubroutineUniformName.xml
+glGetActiveUniformBlock=man4/xhtml/glGetActiveUniformBlock.xml
+glGetActiveUniformBlockName=man4/xhtml/glGetActiveUniformBlockName.xml
+glGetActiveUniform=man4/xhtml/glGetActiveUniform.xml
+glGetActiveUniformName=man4/xhtml/glGetActiveUniformName.xml
+glGetActiveUniformsiv=man4/xhtml/glGetActiveUniformsiv.xml
+glGetAttachedShaders=man4/xhtml/glGetAttachedShaders.xml
+glGetAttribLocation=man4/xhtml/glGetAttribLocation.xml
+glGetBufferParameteriv=man/xhtml/glGetBufferParameteriv.xml
+glGetBufferParameter=man4/xhtml/glGetBufferParameter.xml
+glGetBufferPointerv=man4/xhtml/glGetBufferPointerv.xml
+glGetBufferSubData=man4/xhtml/glGetBufferSubData.xml
+glGetClipPlane=man/xhtml/glGetClipPlane.xml
+glGetColorTable=man/xhtml/glGetColorTable.xml
+glGetColorTableParameter=man/xhtml/glGetColorTableParameter.xml
+glGetCompressedTexImage=man4/xhtml/glGetCompressedTexImage.xml
+glGetConvolutionFilter=man/xhtml/glGetConvolutionFilter.xml
+glGetConvolutionParameter=man/xhtml/glGetConvolutionParameter.xml
+glGetError=man4/xhtml/glGetError.xml
+glGetFragDataIndex=man4/xhtml/glGetFragDataIndex.xml
+glGetFragDataLocation=man4/xhtml/glGetFragDataLocation.xml
+glGetFramebufferAttachmentParameter=man4/xhtml/glGetFramebufferAttachmentParameter.xml
+glGetHistogram=man/xhtml/glGetHistogram.xml
+glGetHistogramParameter=man/xhtml/glGetHistogramParameter.xml
+glGetLight=man/xhtml/glGetLight.xml
+glGet=man4/xhtml/glGet.xml
+glGetMap=man/xhtml/glGetMap.xml
+glGetMaterial=man/xhtml/glGetMaterial.xml
+glGetMinmax=man/xhtml/glGetMinmax.xml
+glGetMinmaxParameter=man/xhtml/glGetMinmaxParameter.xml
+glGetMultisample=man4/xhtml/glGetMultisample.xml
+glGetPixelMap=man/xhtml/glGetPixelMap.xml
+glGetPointerv=man/xhtml/glGetPointerv.xml
+glGetPolygonStipple=man/xhtml/glGetPolygonStipple.xml
+glGetProgramBinary=man4/xhtml/glGetProgramBinary.xml
+glGetProgramInfoLog=man4/xhtml/glGetProgramInfoLog.xml
+glGetProgram=man4/xhtml/glGetProgram.xml
+glGetProgramPipelineInfoLog=man4/xhtml/glGetProgramPipelineInfoLog.xml
+glGetProgramPipeline=man4/xhtml/glGetProgramPipeline.xml
+glGetProgramStage=man4/xhtml/glGetProgramStage.xml
+glGetQueryIndexed=man4/xhtml/glGetQueryIndexed.xml
+glGetQueryiv=man4/xhtml/glGetQueryiv.xml
+glGetQueryObject=man4/xhtml/glGetQueryObject.xml
+glGetRenderbufferParameter=man4/xhtml/glGetRenderbufferParameter.xml
+glGetSamplerParameter=man4/xhtml/glGetSamplerParameter.xml
+glGetSeparableFilter=man/xhtml/glGetSeparableFilter.xml
+glGetShaderInfoLog=man4/xhtml/glGetShaderInfoLog.xml
+glGetShader=man4/xhtml/glGetShader.xml
+glGetShaderPrecisionFormat=man4/xhtml/glGetShaderPrecisionFormat.xml
+glGetShaderSource=man4/xhtml/glGetShaderSource.xml
+glGetString=man4/xhtml/glGetString.xml
+glGetSubroutineIndex=man4/xhtml/glGetSubroutineIndex.xml
+glGetSubroutineUniformLocation=man4/xhtml/glGetSubroutineUniformLocation.xml
+glGetSync=man4/xhtml/glGetSync.xml
+glGetTexEnv=man/xhtml/glGetTexEnv.xml
+glGetTexGen=man/xhtml/glGetTexGen.xml
+glGetTexImage=man4/xhtml/glGetTexImage.xml
+glGetTexLevelParameter=man4/xhtml/glGetTexLevelParameter.xml
+glGetTexParameter=man4/xhtml/glGetTexParameter.xml
+glGetTransformFeedbackVarying=man4/xhtml/glGetTransformFeedbackVarying.xml
+glGetUniformBlockIndex=man4/xhtml/glGetUniformBlockIndex.xml
+glGetUniformIndices=man4/xhtml/glGetUniformIndices.xml
+glGetUniformLocation=man4/xhtml/glGetUniformLocation.xml
+glGetUniform=man4/xhtml/glGetUniform.xml
+glGetUniformSubroutine=man4/xhtml/glGetUniformSubroutine.xml
+glGetVertexAttrib=man4/xhtml/glGetVertexAttrib.xml
+glGetVertexAttribPointerv=man4/xhtml/glGetVertexAttribPointerv.xml
+glHint=man4/xhtml/glHint.xml
+glHistogram=man/xhtml/glHistogram.xml
+glIndex=man/xhtml/glIndex.xml
+glIndexMask=man/xhtml/glIndexMask.xml
+glIndexPointer=man/xhtml/glIndexPointer.xml
+glInitNames=man/xhtml/glInitNames.xml
+glInterleavedArrays=man/xhtml/glInterleavedArrays.xml
+glIsBuffer=man4/xhtml/glIsBuffer.xml
+glIsEnabled=man4/xhtml/glIsEnabled.xml
+glIsFramebuffer=man4/xhtml/glIsFramebuffer.xml
+glIsList=man/xhtml/glIsList.xml
+glIsProgram=man4/xhtml/glIsProgram.xml
+glIsProgramPipeline=man4/xhtml/glIsProgramPipeline.xml
+glIsQuery=man4/xhtml/glIsQuery.xml
+glIsRenderbuffer=man4/xhtml/glIsRenderbuffer.xml
+glIsSampler=man4/xhtml/glIsSampler.xml
+glIsShader=man4/xhtml/glIsShader.xml
+glIsSync=man4/xhtml/glIsSync.xml
+glIsTexture=man4/xhtml/glIsTexture.xml
+glIsTransformFeedback=man4/xhtml/glIsTransformFeedback.xml
+glIsVertexArray=man4/xhtml/glIsVertexArray.xml
+glLight=man/xhtml/glLight.xml
+glLightModel=man/xhtml/glLightModel.xml
+glLineStipple=man/xhtml/glLineStipple.xml
+glLineWidth=man4/xhtml/glLineWidth.xml
+glLinkProgram=man4/xhtml/glLinkProgram.xml
+glListBase=man/xhtml/glListBase.xml
+glLoadIdentity=man/xhtml/glLoadIdentity.xml
+glLoadMatrix=man/xhtml/glLoadMatrix.xml
+glLoadName=man/xhtml/glLoadName.xml
+glLoadTransposeMatrix=man/xhtml/glLoadTransposeMatrix.xml
+glLogicOp=man4/xhtml/glLogicOp.xml
+glMap1=man/xhtml/glMap1.xml
+glMap2=man/xhtml/glMap2.xml
+glMapBuffer=man4/xhtml/glMapBuffer.xml
+glMapBufferRange=man4/xhtml/glMapBufferRange.xml
+glMapGrid=man/xhtml/glMapGrid.xml
+glMaterial=man/xhtml/glMaterial.xml
+glMatrixMode=man/xhtml/glMatrixMode.xml
+glMinmax=man/xhtml/glMinmax.xml
+glMinSampleShading=man4/xhtml/glMinSampleShading.xml
+glMultiDrawArrays=man4/xhtml/glMultiDrawArrays.xml
+glMultiDrawElementsBaseVertex=man4/xhtml/glMultiDrawElementsBaseVertex.xml
+glMultiDrawElements=man4/xhtml/glMultiDrawElements.xml
+glMultiTexCoord=man/xhtml/glMultiTexCoord.xml
+glMultMatrix=man/xhtml/glMultMatrix.xml
+glMultTransposeMatrix=man/xhtml/glMultTransposeMatrix.xml
+glNewList=man/xhtml/glNewList.xml
+glNormal=man/xhtml/glNormal.xml
+glNormalPointer=man/xhtml/glNormalPointer.xml
+glOrtho=man/xhtml/glOrtho.xml
+glPassThrough=man/xhtml/glPassThrough.xml
+glPatchParameter=man4/xhtml/glPatchParameter.xml
+glPauseTransformFeedback=man4/xhtml/glPauseTransformFeedback.xml
+glPixelMap=man/xhtml/glPixelMap.xml
+glPixelStore=man4/xhtml/glPixelStore.xml
+glPixelTransfer=man/xhtml/glPixelTransfer.xml
+glPixelZoom=man/xhtml/glPixelZoom.xml
+glPointParameter=man4/xhtml/glPointParameter.xml
+glPointSize=man4/xhtml/glPointSize.xml
+glPolygonMode=man4/xhtml/glPolygonMode.xml
+glPolygonOffset=man4/xhtml/glPolygonOffset.xml
+glPolygonStipple=man/xhtml/glPolygonStipple.xml
+glPopAttrib=man/xhtml/glPopAttrib.xml
+glPopClientAttrib=man/xhtml/glPopClientAttrib.xml
+glPopMatrix=man/xhtml/glPopMatrix.xml
+glPopName=man/xhtml/glPopName.xml
+glPrimitiveRestartIndex=man4/xhtml/glPrimitiveRestartIndex.xml
+glPrioritizeTextures=man/xhtml/glPrioritizeTextures.xml
+glProgramBinary=man4/xhtml/glProgramBinary.xml
+glProgramParameter=man4/xhtml/glProgramParameter.xml
+glProgramUniform=man4/xhtml/glProgramUniform.xml
+glProvokingVertex=man4/xhtml/glProvokingVertex.xml
+glPushAttrib=man/xhtml/glPushAttrib.xml
+glPushClientAttrib=man/xhtml/glPushClientAttrib.xml
+glPushMatrix=man/xhtml/glPushMatrix.xml
+glPushName=man/xhtml/glPushName.xml
+glQueryCounter=man4/xhtml/glQueryCounter.xml
+glRasterPos=man/xhtml/glRasterPos.xml
+glReadBuffer=man4/xhtml/glReadBuffer.xml
+glReadPixels=man4/xhtml/glReadPixels.xml
+glRect=man/xhtml/glRect.xml
+glReleaseShaderCompiler=man4/xhtml/glReleaseShaderCompiler.xml
+glRenderbufferStorage=man4/xhtml/glRenderbufferStorage.xml
+glRenderbufferStorageMultisample=man4/xhtml/glRenderbufferStorageMultisample.xml
+glRenderMode=man/xhtml/glRenderMode.xml
+glResetHistogram=man/xhtml/glResetHistogram.xml
+glResetMinmax=man/xhtml/glResetMinmax.xml
+glResumeTransformFeedback=man4/xhtml/glResumeTransformFeedback.xml
+glRotate=man/xhtml/glRotate.xml
+glSampleCoverage=man4/xhtml/glSampleCoverage.xml
+glSampleMaski=man4/xhtml/glSampleMaski.xml
+glSamplerParameter=man4/xhtml/glSamplerParameter.xml
+glScale=man/xhtml/glScale.xml
+glScissorArray=man4/xhtml/glScissorArray.xml
+glScissorIndexed=man4/xhtml/glScissorIndexed.xml
+glScissor=man4/xhtml/glScissor.xml
+glSecondaryColor=man/xhtml/glSecondaryColor.xml
+glSecondaryColorPointer=man/xhtml/glSecondaryColorPointer.xml
+glSelectBuffer=man/xhtml/glSelectBuffer.xml
+glSeparableFilter2D=man/xhtml/glSeparableFilter2D.xml
+glShadeModel=man/xhtml/glShadeModel.xml
+glShaderBinary=man4/xhtml/glShaderBinary.xml
+glShaderSource=man4/xhtml/glShaderSource.xml
+glStencilFunc=man4/xhtml/glStencilFunc.xml
+glStencilFuncSeparate=man4/xhtml/glStencilFuncSeparate.xml
+glStencilMask=man4/xhtml/glStencilMask.xml
+glStencilMaskSeparate=man4/xhtml/glStencilMaskSeparate.xml
+glStencilOp=man4/xhtml/glStencilOp.xml
+glStencilOpSeparate=man4/xhtml/glStencilOpSeparate.xml
+glTexBuffer=man4/xhtml/glTexBuffer.xml
+glTexCoord=man/xhtml/glTexCoord.xml
+glTexCoordPointer=man/xhtml/glTexCoordPointer.xml
+glTexEnv=man/xhtml/glTexEnv.xml
+glTexGen=man/xhtml/glTexGen.xml
+glTexImage1D=man4/xhtml/glTexImage1D.xml
+glTexImage2D=man4/xhtml/glTexImage2D.xml
+glTexImage2DMultisample=man4/xhtml/glTexImage2DMultisample.xml
+glTexImage3D=man4/xhtml/glTexImage3D.xml
+glTexImage3DMultisample=man4/xhtml/glTexImage3DMultisample.xml
+glTexParameter=man4/xhtml/glTexParameter.xml
+glTexSubImage1D=man4/xhtml/glTexSubImage1D.xml
+glTexSubImage2D=man4/xhtml/glTexSubImage2D.xml
+glTexSubImage3D=man4/xhtml/glTexSubImage3D.xml
+glTransformFeedbackVaryings=man4/xhtml/glTransformFeedbackVaryings.xml
+glTranslate=man/xhtml/glTranslate.xml
+gluBeginCurve=man/xhtml/gluBeginCurve.xml
+gluBeginPolygon=man/xhtml/gluBeginPolygon.xml
+gluBeginSurface=man/xhtml/gluBeginSurface.xml
+gluBeginTrim=man/xhtml/gluBeginTrim.xml
+gluBuild1DMipmapLevels=man/xhtml/gluBuild1DMipmapLevels.xml
+gluBuild1DMipmaps=man/xhtml/gluBuild1DMipmaps.xml
+gluBuild2DMipmapLevels=man/xhtml/gluBuild2DMipmapLevels.xml
+gluBuild2DMipmaps=man/xhtml/gluBuild2DMipmaps.xml
+gluBuild3DMipmapLevels=man/xhtml/gluBuild3DMipmapLevels.xml
+gluBuild3DMipmaps=man/xhtml/gluBuild3DMipmaps.xml
+gluCheckExtension=man/xhtml/gluCheckExtension.xml
+gluCylinder=man/xhtml/gluCylinder.xml
+gluDeleteNurbsRenderer=man/xhtml/gluDeleteNurbsRenderer.xml
+gluDeleteQuadric=man/xhtml/gluDeleteQuadric.xml
+gluDeleteTess=man/xhtml/gluDeleteTess.xml
+gluDisk=man/xhtml/gluDisk.xml
+gluEndCurve=man/xhtml/gluEndCurve.xml
+gluEndPolygon=man/xhtml/gluEndPolygon.xml
+gluEndSurface=man/xhtml/gluEndSurface.xml
+gluEndTrim=man/xhtml/gluEndTrim.xml
+gluErrorString=man/xhtml/gluErrorString.xml
+gluGetNurbsProperty=man/xhtml/gluGetNurbsProperty.xml
+gluGetString=man/xhtml/gluGetString.xml
+gluGetTessProperty=man/xhtml/gluGetTessProperty.xml
+gluLoadSamplingMatrices=man/xhtml/gluLoadSamplingMatrices.xml
+gluLookAt=man/xhtml/gluLookAt.xml
+gluNewNurbsRenderer=man/xhtml/gluNewNurbsRenderer.xml
+gluNewQuadric=man/xhtml/gluNewQuadric.xml
+gluNewTess=man/xhtml/gluNewTess.xml
+gluNextContour=man/xhtml/gluNextContour.xml
+glUniformBlockBinding=man4/xhtml/glUniformBlockBinding.xml
+glUniform=man4/xhtml/glUniform.xml
+glUniformSubroutines=man4/xhtml/glUniformSubroutines.xml
+glUnmapBuffer=man4/xhtml/glUnmapBuffer.xml
+gluNurbsCallbackDataEXT=man/xhtml/gluNurbsCallbackDataEXT.xml
+gluNurbsCallbackData=man/xhtml/gluNurbsCallbackData.xml
+gluNurbsCallback=man/xhtml/gluNurbsCallback.xml
+gluNurbsCurve=man/xhtml/gluNurbsCurve.xml
+gluNurbsProperty=man/xhtml/gluNurbsProperty.xml
+gluNurbsSurface=man/xhtml/gluNurbsSurface.xml
+gluOrtho2D=man/xhtml/gluOrtho2D.xml
+gluPartialDisk=man/xhtml/gluPartialDisk.xml
+gluPerspective=man/xhtml/gluPerspective.xml
+gluPickMatrix=man/xhtml/gluPickMatrix.xml
+gluProject=man/xhtml/gluProject.xml
+gluPwlCurve=man/xhtml/gluPwlCurve.xml
+gluQuadricCallback=man/xhtml/gluQuadricCallback.xml
+gluQuadricDrawStyle=man/xhtml/gluQuadricDrawStyle.xml
+gluQuadricNormals=man/xhtml/gluQuadricNormals.xml
+gluQuadricOrientation=man/xhtml/gluQuadricOrientation.xml
+gluQuadricTexture=man/xhtml/gluQuadricTexture.xml
+gluScaleImage=man/xhtml/gluScaleImage.xml
+glUseProgram=man4/xhtml/glUseProgram.xml
+glUseProgramStages=man4/xhtml/glUseProgramStages.xml
+gluSphere=man/xhtml/gluSphere.xml
+gluTessBeginContour=man/xhtml/gluTessBeginContour.xml
+gluTessBeginPolygon=man/xhtml/gluTessBeginPolygon.xml
+gluTessCallback=man/xhtml/gluTessCallback.xml
+gluTessEndContour=man/xhtml/gluTessEndContour.xml
+gluTessEndPolygon=man/xhtml/gluTessEndPolygon.xml
+gluTessNormal=man/xhtml/gluTessNormal.xml
+gluTessProperty=man/xhtml/gluTessProperty.xml
+gluTessVertex=man/xhtml/gluTessVertex.xml
+gluUnProject4=man/xhtml/gluUnProject4.xml
+gluUnProject=man/xhtml/gluUnProject.xml
+glValidateProgram=man4/xhtml/glValidateProgram.xml
+glValidateProgramPipeline=man4/xhtml/glValidateProgramPipeline.xml
+glVertexAttribDivisor=man4/xhtml/glVertexAttribDivisor.xml
+glVertexAttrib=man4/xhtml/glVertexAttrib.xml
+glVertexAttribPointer=man4/xhtml/glVertexAttribPointer.xml
+glVertex=man/xhtml/glVertex.xml
+glVertexPointer=man/xhtml/glVertexPointer.xml
+glViewportArray=man4/xhtml/glViewportArray.xml
+glViewportIndexed=man4/xhtml/glViewportIndexed.xml
+glViewport=man4/xhtml/glViewport.xml
+glWaitSync=man4/xhtml/glWaitSync.xml
+glWindowPos=man/xhtml/glWindowPos.xml
+glXChooseFBConfig=man/xhtml/glXChooseFBConfig.xml
+glXChooseVisual=man/xhtml/glXChooseVisual.xml
+glXCopyContext=man/xhtml/glXCopyContext.xml
+glXCreateContext=man/xhtml/glXCreateContext.xml
+glXCreateGLXPixmap=man/xhtml/glXCreateGLXPixmap.xml
+glXCreateNewContext=man/xhtml/glXCreateNewContext.xml
+glXCreatePbuffer=man/xhtml/glXCreatePbuffer.xml
+glXCreatePixmap=man/xhtml/glXCreatePixmap.xml
+glXCreateWindow=man/xhtml/glXCreateWindow.xml
+glXDestroyContext=man/xhtml/glXDestroyContext.xml
+glXDestroyGLXPixmap=man/xhtml/glXDestroyGLXPixmap.xml
+glXDestroyPbuffer=man/xhtml/glXDestroyPbuffer.xml
+glXDestroyPixmap=man/xhtml/glXDestroyPixmap.xml
+glXDestroyWindow=man/xhtml/glXDestroyWindow.xml
+glXFreeContextEXT=man/xhtml/glXFreeContextEXT.xml
+glXGetClientString=man/xhtml/glXGetClientString.xml
+glXGetConfig=man/xhtml/glXGetConfig.xml
+glXGetContextIDEXT=man/xhtml/glXGetContextIDEXT.xml
+glXGetCurrentContext=man/xhtml/glXGetCurrentContext.xml
+glXGetCurrentDisplay=man/xhtml/glXGetCurrentDisplay.xml
+glXGetCurrentDrawable=man/xhtml/glXGetCurrentDrawable.xml
+glXGetCurrentReadDrawable=man/xhtml/glXGetCurrentReadDrawable.xml
+glXGetFBConfigAttrib=man/xhtml/glXGetFBConfigAttrib.xml
+glXGetFBConfigs=man/xhtml/glXGetFBConfigs.xml
+glXGetProcAddress=man/xhtml/glXGetProcAddress.xml
+glXGetSelectedEvent=man/xhtml/glXGetSelectedEvent.xml
+glXGetVisualFromFBConfig=man/xhtml/glXGetVisualFromFBConfig.xml
+glXImportContextEXT=man/xhtml/glXImportContextEXT.xml
+glXIntro=man/xhtml/glXIntro.xml
+glXIsDirect=man/xhtml/glXIsDirect.xml
+glXMakeContextCurrent=man/xhtml/glXMakeContextCurrent.xml
+glXMakeCurrent=man/xhtml/glXMakeCurrent.xml
+glXQueryContextInfoEXT=man/xhtml/glXQueryContextInfoEXT.xml
+glXQueryContext=man/xhtml/glXQueryContext.xml
+glXQueryDrawable=man/xhtml/glXQueryDrawable.xml
+glXQueryExtension=man/xhtml/glXQueryExtension.xml
+glXQueryExtensionsString=man/xhtml/glXQueryExtensionsString.xml
+glXQueryServerString=man/xhtml/glXQueryServerString.xml
+glXQueryVersion=man/xhtml/glXQueryVersion.xml
+glXSelectEvent=man/xhtml/glXSelectEvent.xml
+glXSwapBuffers=man/xhtml/glXSwapBuffers.xml
+glXUseXFont=man/xhtml/glXUseXFont.xml
+glXWaitGL=man/xhtml/glXWaitGL.xml
+glXWaitX=man/xhtml/glXWaitX.xml
diff --git a/make/nativewindowversion-cdc b/make/nativewindowversion-cdc
deleted file mode 100644
index 78098c9..0000000
--- a/make/nativewindowversion-cdc
+++ /dev/null
@@ -1,12 +0,0 @@
-Specification-Title: Native Window Interface API Specification CDC
-Specification-Version: @BASEVERSION@
-Specification-Vendor: JogAmp Community
-Implementation-Title: Native Window Interface Runtime Environment CDC
-Implementation-Version: @VERSION@
-Implementation-Branch: @SCM_BRANCH@
-Implementation-Commit: @SCM_COMMIT@
-Implementation-Vendor: JogAmp Community
-Implementation-URL: http://jogamp.org/
-Extension-Name: javax.media.nativewindow
-Implementation-Vendor-Id: com.jogamp
-Trusted-Library: true
diff --git a/make/newtversion-cdc b/make/newtversion-cdc
deleted file mode 100644
index d687ca3..0000000
--- a/make/newtversion-cdc
+++ /dev/null
@@ -1,12 +0,0 @@
-Specification-Title: NEWT API Specification CDC
-Specification-Version: @BASEVERSION@
-Specification-Vendor: JogAmp Community
-Implementation-Title: NEWT Runtime Environment CDC
-Implementation-Version: @VERSION@
-Implementation-Branch: @SCM_BRANCH@
-Implementation-Commit: @SCM_COMMIT@
-Implementation-Vendor: JogAmp Community
-Implementation-URL: http://jogamp.org/
-Extension-Name: com.jogamp.newt
-Implementation-Vendor-Id: com.jogamp
-Trusted-Library: true
diff --git a/make/scripts/cmpOld2New.sh b/make/scripts/cmpOld2New.sh
old mode 100644
new mode 100755
diff --git a/make/scripts/count-lock.sh b/make/scripts/count-lock.sh
old mode 100644
new mode 100755
diff --git a/make/scripts/cpp-gluegen-test.sh b/make/scripts/cpp-gluegen-test.sh
old mode 100644
new mode 100755
diff --git a/make/scripts/java-win32-dbg.bat b/make/scripts/java-win32-dbg.bat
index 92bc62d..2b15410 100755
--- a/make/scripts/java-win32-dbg.bat
+++ b/make/scripts/java-win32-dbg.bat
@@ -1,15 +1,15 @@
 
 set BLD_SUB=build-win32
-set J2RE_HOME=c:\jre1.6.0_22_x32
-set JAVA_HOME=c:\jdk1.6.0_22_x32
-set ANT_PATH=C:\apache-ant-1.8.0
+set J2RE_HOME=c:\jre1.6.0_24_x32
+set JAVA_HOME=c:\jdk1.6.0_24_x32
+set ANT_PATH=C:\apache-ant-1.8.2
 
 set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
 
 set BLD_DIR=..\%BLD_SUB%
 set LIB_DIR=..\..\gluegen\%BLD_SUB%\obj;%BLD_DIR%\nativewindow\obj;%BLD_DIR%\jogl\obj;%BLD_DIR%\newt\obj
 
-set CP_ALL=.;%BLD_DIR%\jogl\jogl.all.jar;%BLD_DIR%\nativewindow\nativewindow.all.jar;%BLD_DIR%\newt\newt.all.jar;%BLD_DIR%\jogl\jogl.test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar
+set CP_ALL=.;%BLD_DIR%\jogl\jogl.all.jar;%BLD_DIR%\nativewindow\nativewindow.all.jar;%BLD_DIR%\newt\newt.all.jar;%BLD_DIR%\jogl\jogl.test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86\swt-debug.jar
 
 echo CP_ALL %CP_ALL%
 
@@ -17,7 +17,8 @@ REM set D_ARGS="-Djogamp.debug.JNILibLoader=true" "-Djogamp.debug.NativeLibrary=
 REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all"
 REM set D_ARGS="-Dnewt.debug.Window" "-Dnativewindow.debug.TraceLock"
 REM set D_ARGS="-Dnativewindow.debug.TraceLock"
-set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display"
+REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display"
+set D_ARGS="-Djogl.debug=all"
 REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display" "-Dnewt.test.Window.reparent.incompatible=true"
 
 set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true"
diff --git a/make/scripts/java-win32.bat b/make/scripts/java-win32.bat
index 63d69b8..368501c 100755
--- a/make/scripts/java-win32.bat
+++ b/make/scripts/java-win32.bat
@@ -1,15 +1,15 @@
 
 set BLD_SUB=build-win32
-set J2RE_HOME=c:\jre1.6.0_22_x32
-set JAVA_HOME=c:\jdk1.6.0_22_x32
-set ANT_PATH=C:\apache-ant-1.8.0
+set J2RE_HOME=c:\jre1.6.0_24_x32
+set JAVA_HOME=c:\jdk1.6.0_24_x32
+set ANT_PATH=C:\apache-ant-1.8.2
 
 set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
 
 set BLD_DIR=..\%BLD_SUB%
 set LIB_DIR=..\..\gluegen\%BLD_SUB%\obj;%BLD_DIR%\nativewindow\obj;%BLD_DIR%\jogl\obj;%BLD_DIR%\newt\obj
 
-set CP_ALL=.;%BLD_DIR%\jogl\jogl.all.jar;%BLD_DIR%\nativewindow\nativewindow.all.jar;%BLD_DIR%\newt\newt.all.jar;%BLD_DIR%\jogl\jogl.test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar
+set CP_ALL=.;%BLD_DIR%\jogl\jogl.all.jar;%BLD_DIR%\nativewindow\nativewindow.all.jar;%BLD_DIR%\newt\newt.all.jar;%BLD_DIR%\jogl\jogl.test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86\swt-debug.jar
 
 echo CP_ALL %CP_ALL%
 
diff --git a/make/scripts/java-win64-dbg.bat b/make/scripts/java-win64-dbg.bat
index 72119d1..34a2fdc 100755
--- a/make/scripts/java-win64-dbg.bat
+++ b/make/scripts/java-win64-dbg.bat
@@ -1,26 +1,29 @@
 
 set BLD_SUB=build-win64
-set J2RE_HOME=c:\jre1.6.0_22_x64
-set JAVA_HOME=c:\jdk1.6.0_22_x64
-set ANT_PATH=C:\apache-ant-1.8.0
+set J2RE_HOME=c:\jre1.6.0_24_x64
+set JAVA_HOME=c:\jdk1.6.0_24_x64
+set ANT_PATH=C:\apache-ant-1.8.2
 
 set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
 
 set BLD_DIR=..\%BLD_SUB%
 set LIB_DIR=%BLD_DIR%\lib;..\..\gluegen\%BLD_SUB%\obj
 
-set CP_ALL=.;%BLD_DIR%\jogl\jogl.all.jar;%BLD_DIR%\nativewindow\nativewindow.all.jar;%BLD_DIR%\newt\newt.all.jar;%BLD_DIR%\jogl\jogl.test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar
+set CP_ALL=.;%BLD_DIR%\jogl\jogl.all.jar;%BLD_DIR%\nativewindow\nativewindow.all.jar;%BLD_DIR%\newt\newt.all.jar;%BLD_DIR%\jogl\jogl.test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86_64\swt-debug.jar
 
 echo CP_ALL %CP_ALL%
 
 REM set D_ARGS="-Djogl.debug.ExtensionAvailabilityCache" "-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug.ProcAddressHelper=true" "-Djogamp.debug.NativeLibrary=true" "-Djogamp.debug.NativeLibrary.Lookup=true"
 REM set D_ARGS="-Djogl.debug.GLContext" "-Djogl.debug.ExtensionAvailabilityCache" "-Djogamp.debug.ProcAddressHelper=true"
-set D_ARGS="-Djogl.debug.GraphicsConfiguration"
+REM set D_ARGS="-Djogl.debug.GraphicsConfiguration"
 REM set D_ARGS="-Djogamp.debug.JNILibLoader=true" "-Djogamp.debug.NativeLibrary=true" "-Djogamp.debug.NativeLibrary.Lookup=true" "-Djogl.debug.GLProfile=true"
 REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug.Lock" "-Djogamp.debug.Lock.TraceLock"
+REM set D_ARGS="-Djogl.debug=all" "-Dnativewindow.debug=all"
+set D_ARGS="-Djogl.debug=all"
+REM set D_ARGS="-Djogl.debug.GLContext" "-Dnewt.debug=all"
 REM set D_ARGS="-Dnewt.debug.Window" "-Dnativewindow.debug.TraceLock"
 REM set D_ARGS="-Dnativewindow.debug.TraceLock"
-REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display"
+REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display" "-Dnewt.debug.EDT" "-Djogl.debug.GLContext"
 REM set D_ARGS="-Dnewt.debug.Screen" "-Dnewt.debug.EDT" "-Dnativewindow.debug=all"
 REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display" "-Dnewt.test.Window.reparent.incompatible=true"
 
diff --git a/make/scripts/java-win64.bat b/make/scripts/java-win64.bat
index f1275f4..320db57 100755
--- a/make/scripts/java-win64.bat
+++ b/make/scripts/java-win64.bat
@@ -1,15 +1,15 @@
 
 set BLD_SUB=build-win64
-set J2RE_HOME=c:\jre1.6.0_22_x64
-set JAVA_HOME=c:\jdk1.6.0_22_x64
-set ANT_PATH=C:\apache-ant-1.8.0
+set J2RE_HOME=c:\jre1.6.0_24_x64
+set JAVA_HOME=c:\jdk1.6.0_24_x64
+set ANT_PATH=C:\apache-ant-1.8.2
 
 set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
 
 set BLD_DIR=..\%BLD_SUB%
 set LIB_DIR=%BLD_DIR%\lib;..\..\gluegen\%BLD_SUB%\obj
 
-set CP_ALL=.;%BLD_DIR%\jogl\jogl.all.jar;%BLD_DIR%\nativewindow\nativewindow.all.jar;%BLD_DIR%\newt\newt.all.jar;%BLD_DIR%\jogl\jogl.test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar
+set CP_ALL=.;%BLD_DIR%\jogl\jogl.all.jar;%BLD_DIR%\nativewindow\nativewindow.all.jar;%BLD_DIR%\newt\newt.all.jar;%BLD_DIR%\jogl\jogl.test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86_64\swt-debug.jar
 echo CP_ALL %CP_ALL%
 
 set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true"
diff --git a/make/scripts/junit-singletest-x64.bat b/make/scripts/junit-singletest-x64.bat
new file mode 100644
index 0000000..78aff8b
--- /dev/null
+++ b/make/scripts/junit-singletest-x64.bat
@@ -0,0 +1 @@
+scripts\make.jogl.all.win64.bat -Dtestclass=com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListAWT -f build-test.xml junit.run.awt.singletest
diff --git a/make/scripts/junit-singletest-x64.sh b/make/scripts/junit-singletest-x64.sh
new file mode 100644
index 0000000..4cc51be
--- /dev/null
+++ b/make/scripts/junit-singletest-x64.sh
@@ -0,0 +1 @@
+scripts/make.jogl.all.linux-x86_64.sh -Dtestclass=com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListAWT -f build-test.xml junit.run.awt.singletest
diff --git a/make/scripts/lstjars.sh b/make/scripts/lstjars.sh
index 2a2f67b..c72a48a 100755
--- a/make/scripts/lstjars.sh
+++ b/make/scripts/lstjars.sh
@@ -7,15 +7,15 @@ shift
 BUILDDIR_GLUEGEN=$1
 shift
 if [ -z "$BUILDDIR" -o -z "$BUILDDIR_GLUEGEN" ] ; then 
-    echo "usage $0 <BUILDDIR-JOGL> <BUILDDIR-GLUEGEN> [-skippack200]"
+    echo "usage $0 <BUILDDIR-JOGL> <BUILDDIR-GLUEGEN> [-pack200]"
     exit 1
 fi
 
 STATDIR=$BUILDDIR-stats
 
-skippack200=0
-if [ "$1" = "-skippack200" ] ; then
-    skippack200=1
+pack200=0
+if [ "$1" = "-pack200" ] ; then
+    pack200=1
 fi
 
 function report() {
@@ -66,18 +66,6 @@ function listdeployment() {
     report gluegen-rt.$JAR_SUFFIX nativewindow.all-noawt.$JAR_SUFFIX jogl.all-noawt.$JAR_SUFFIX newt.all-noawt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_desktop.so.gz libnativewindow_$OSS.so.gz libnewt.so.gz
     echo
 
-    echo JOGL CDCFP DESKTOP
-    report gluegen-rt-cdc.$JAR_SUFFIX nativewindow.all.$JAR_SUFFIX jogl.all.cdc.$JAR_SUFFIX newt.all.cdc.$JAR_SUFFIX libgluegen-rt.so.gz libnativewindow_$OSS.so.gz libnewt.so.gz
-    echo
-
-    echo JOGL CDCFP ES1 MOBILE
-    report gluegen-rt-cdc.$JAR_SUFFIX jogl.core.cdc.$JAR_SUFFIX jogl.egl.cdc.$JAR_SUFFIX jogl.gles1.cdc.$JAR_SUFFIX jogl.util.cdc.$JAR_SUFFIX nativewindow.all.cdc.$JAR_SUFFIX newt.all.cdc.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_es1.so.gz libnewt.so.gz
-    echo
-
-    echo JOGL CDCFP ES2 MOBILE
-    report gluegen-rt-cdc.$JAR_SUFFIX jogl.core.cdc.$JAR_SUFFIX jogl.egl.cdc.$JAR_SUFFIX jogl.gles2.cdc.$JAR_SUFFIX jogl.util.cdc.$JAR_SUFFIX nativewindow.all.cdc.$JAR_SUFFIX newt.all.cdc.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_es2.so.gz libnewt.so.gz
-    echo
-
     echo JOGL GLU
     report jogl.glu.*$JAR_SUFFIX
     echo
@@ -96,9 +84,7 @@ cp -a $BUILDDIR/nativewindow/*.jar $STATDIR
 cp -a $BUILDDIR/jogl/*.jar $STATDIR
 cp -a $BUILDDIR/newt/*.jar $STATDIR
 cp -a $BUILDDIR_GLUEGEN/gluegen-rt.jar $STATDIR
-cp -a $BUILDDIR_GLUEGEN/gluegen-rt-cdc.jar $STATDIR
 cp -a $BUILDDIR_GLUEGEN/gluegen-rt-natives-linux-i586.jar $STATDIR
-cp -a $BUILDDIR_GLUEGEN/gluegen-rt-natives-linux-i586-cdc.jar $STATDIR
 cp -a $BUILDDIR_GLUEGEN/obj/libgluegen-rt.so $STATDIR
 
 cd $STATDIR
@@ -123,7 +109,7 @@ done
 rm -rf nope
 mkdir -p nope
 
-mv jogl.test.lst *-noawt.lst *.cdc.lst *.all*.lst nope/
+mv jogl.test.lst *-noawt.lst *.all*.lst nope/
 
 mv jogl.gl2es12.*.lst jogl.gldesktop.*.lst nope/
 echo duplicates - w/o gl2es12.* gldesktop.*
@@ -131,11 +117,10 @@ echo
 sort jogl*.lst | uniq -d
 mv nope/* .
 
-mv jogl.test.lst *.cdc.lst *.all*.lst nope/
+mv jogl.test.lst *.all*.lst gluegen-gl.lst nope/
 cat *.lst | sort -u > allparts.lst
 mv nope/* .
 cat *.all.lst gluegen-rt.lst   | sort -u > allall.lst
-cat jogl.all.cdc.lst newt.all.cdc.lst nativewindow.core.lst | sort -u > allcdc.lst
 
 echo all vs allparts delta
 echo
@@ -143,7 +128,7 @@ diff -Nur allparts.lst allall.lst
 
 listdeployment jar
 
-if [ $skippack200 -eq 0 ] ; then
+if [ $pack200 -eq 1 ] ; then
     for i in *.jar ; do
         fname=$i
         bname=$(basename $fname .jar)
diff --git a/make/scripts/make-runtime-properties.sh b/make/scripts/make-runtime-properties.sh
old mode 100644
new mode 100755
diff --git a/make/scripts/make.jogl.all.linux-x86.sh b/make/scripts/make.jogl.all.linux-x86.sh
index 76b46a0..03dedb9 100755
--- a/make/scripts/make.jogl.all.linux-x86.sh
+++ b/make/scripts/make.jogl.all.linux-x86.sh
@@ -31,7 +31,6 @@ fi
 # -Djogl.cg=1
 #    -Dc.compiler.debug=true 
 #    -DuseOpenMAX=true \
-#    -Dbuild.noarchives=true
 #    -Dgluegen.cpptasks.detected.os=true \
 #    -DisUnix=true \
 #    -DisLinux=true \
@@ -53,9 +52,7 @@ echo LIBGL_DEBUG: $LIBGL_DEBUG 2>&1 | tee -a $LOGF
 
 ant \
     $CUSTOMLIBDIR \
-    -Dbuild.noarchives=true \
     -Dgluegen-cpptasks.file=`pwd`/../../gluegen/make/lib/gluegen-cpptasks-linux-32bit.xml \
-    -Dbuild.noarchives=true \
     -Djogl.cg=1 \
     -Drootrel.build=build-x86 \
     -Dos.arch=x86 \
diff --git a/make/scripts/make.jogl.all.linux-x86_64.sh b/make/scripts/make.jogl.all.linux-x86_64.sh
index 2b63ef0..577caeb 100755
--- a/make/scripts/make.jogl.all.linux-x86_64.sh
+++ b/make/scripts/make.jogl.all.linux-x86_64.sh
@@ -29,14 +29,12 @@ fi
 
 # -Djogl.cg=1
 #    -Dc.compiler.debug=true \
-#    -Dbuild.noarchives=true \
 
 #    -Dgluegen.cpptasks.detected.os=true \
 #    -DisUnix=true \
 #    -DisLinux=true \
 #    -DisLinuxAMD64=true \
 #    -DisX11=true \
-#    -Dbuild.noarchives=true \
 
 #LD_LIBRARY_PATH=/opt-linux-x86_64/mesa-7.8.1/lib64
 #export LD_LIBRARY_PATH
@@ -50,7 +48,6 @@ echo LIBXCB_ALLOW_SLOPPY_LOCK: $LIBXCB_ALLOW_SLOPPY_LOCK 2>&1 | tee -a $LOGF
 echo LIBGL_DRIVERS_PATH: $LIBGL_DRIVERS_PATH 2>&1 | tee -a $LOGF
 echo LIBGL_DEBUG: $LIBGL_DEBUG 2>&1 | tee -a $LOGF
 
-#    -Dbuild.noarchives=true \
 #    -Dc.compiler.debug=true \
 #    -Djavacdebug="true" \
 #    -Djavacdebuglevel="source,lines,vars" \
@@ -58,7 +55,6 @@ echo LIBGL_DEBUG: $LIBGL_DEBUG 2>&1 | tee -a $LOGF
 ant  \
     $CUSTOMLIBDIR \
     -Djavacdebuglevel="source,lines,vars" \
-    -Dbuild.noarchives=true \
     -Djogl.cg=1 \
     -Drootrel.build=build-x86_64 \
     -DuseKD=true \
diff --git a/make/scripts/make.jogl.all.macosx.sh b/make/scripts/make.jogl.all.macosx.sh
index a85f934..967790b 100755
--- a/make/scripts/make.jogl.all.macosx.sh
+++ b/make/scripts/make.jogl.all.macosx.sh
@@ -1,15 +1,13 @@
 #! /bin/sh
 
-if [ -e /devtools/etc/profile.ant ] ; then
-    . /devtools/etc/profile.ant
+if [ -e /opt-share/etc/profile.ant ] ; then
+    . /opt-share/etc/profile.ant
 fi
 
 
 #    -Dc.compiler.debug=true 
-#    -Dbuild.noarchives=true
 
 ant \
-    -Dbuild.noarchives=true \
     -Djogl.cg=1 \
     -Drootrel.build=build-macosx \
     $* 2>&1 | tee make.jogl.all.macosx.log
diff --git a/make/scripts/make.jogl.all.win32.bat b/make/scripts/make.jogl.all.win32.bat
index 39db2a4..f73a332 100755
--- a/make/scripts/make.jogl.all.win32.bat
+++ b/make/scripts/make.jogl.all.win32.bat
@@ -1,8 +1,8 @@
 set THISDIR="C:\JOGL"
 
-set J2RE_HOME=c:\jre1.6.0_22_x32
-set JAVA_HOME=c:\jdk1.6.0_22_x32
-set ANT_PATH=C:\apache-ant-1.8.0
+set J2RE_HOME=c:\jre1.6.0_24_x32
+set JAVA_HOME=c:\jdk1.6.0_24_x32
+set ANT_PATH=C:\apache-ant-1.8.2
 
 set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
 
@@ -12,6 +12,5 @@ REM    -Dc.compiler.debug=true
 REM    -DuseOpenMAX=true 
 REM    -DuseKD=true
 REM    -Djogl.cg=1
-REM    -Dbuild.noarchives=true
 
-ant -Dbuild.noarchives=true -Drootrel.build=build-win32 -Djogl.cg=1 %1 %2 %3 %4 %5 %6 %7 %8 %9 > make.jogl.all.win32.log 2>&1
+ant -Drootrel.build=build-win32 -Djogl.cg=1 %1 %2 %3 %4 %5 %6 %7 %8 %9 > make.jogl.all.win32.log 2>&1
diff --git a/make/scripts/make.jogl.all.win64.bat b/make/scripts/make.jogl.all.win64.bat
index 4241d4d..76e459a 100755
--- a/make/scripts/make.jogl.all.win64.bat
+++ b/make/scripts/make.jogl.all.win64.bat
@@ -1,8 +1,8 @@
 set THISDIR="C:\JOGL"
 
-set J2RE_HOME=c:\jre1.6.0_22_x64
-set JAVA_HOME=c:\jdk1.6.0_22_x64
-set ANT_PATH=C:\apache-ant-1.8.0
+set J2RE_HOME=c:\jre1.6.0_24_x64
+set JAVA_HOME=c:\jdk1.6.0_24_x64
+set ANT_PATH=C:\apache-ant-1.8.2
 
 set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw64\bin;c:\mingw\bin;%PATH%
 
@@ -12,6 +12,5 @@ REM    -Dc.compiler.debug=true
 REM    -DuseOpenMAX=true 
 REM    -DuseKD=true
 REM    -Djogl.cg=1
-REM    -Dbuild.noarchives=true
 
-ant -Dc.compiler.debug=true -Dbuild.noarchives=true -Drootrel.build=build-win64 -Djogl.cg=1 %1 %2 %3 %4 %5 %6 %7 %8 %9 > make.jogl.all.win64.log 2>&1
+ant -Dc.compiler.debug=true -Drootrel.build=build-win64 -Djogl.cg=1 %1 %2 %3 %4 %5 %6 %7 %8 %9 > make.jogl.all.win64.log 2>&1
diff --git a/make/scripts/make.jogl.cdcfp.linux-x86.sh b/make/scripts/make.jogl.cdcfp.linux-x86.sh
deleted file mode 100755
index ad80f19..0000000
--- a/make/scripts/make.jogl.cdcfp.linux-x86.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /bin/sh
-
-if [ -e ../../setenv-build-jogl-x86.sh ] ; then
-    . ../../setenv-build-jogl-x86.sh
-fi
-
-#    -Dc.compiler.debug=true 
-#
-#    -Djavacdebug="false" \
-#    -Djavacdebuglevel="none" \
-#
-#    -Djava.generate.skip=true \
-#    -Dbuild.noarchives=true
-
-BUILD_SUBDIR=build-cdcfp-x86
-
-ant -v \
-    -Dgluegen-cpptasks.file=`pwd`/../../gluegen/make/lib/gluegen-cpptasks-linux-32bit.xml \
-    -Dbuild.noarchives=true \
-    -Drootrel.build=$BUILD_SUBDIR \
-    -Dsetup.cdcfp=true \
-    -Dgluegen.cpptasks.detected.os=true \
-    -DisUnix=true \
-    -DisLinux=true \
-    -DisLinuxX86=true \
-    -DisX11=true \
-    -DuseOpenMAX=true \
-    $* 2>&1 | tee make.jogl.cdcfp.linux-x86.log
-
-rm -rf ../$BUILD_SUBDIR/lib
-mkdir -p ../$BUILD_SUBDIR/lib
-for i in `find ../$BUILD_SUBDIR/ -name \*so` ; do
-    cp -v $i ../$BUILD_SUBDIR/lib/$(basename $i .so).so
-done
-for i in `find ../../gluegen/$BUILD_SUBDIR/ -name \*so` ; do
-    cp -v $i ../$BUILD_SUBDIR/lib/$(basename $i .so).so
-done
-
diff --git a/make/scripts/make.jogl.cdcfp.macosx.sh b/make/scripts/make.jogl.cdcfp.macosx.sh
deleted file mode 100755
index d36f0bb..0000000
--- a/make/scripts/make.jogl.cdcfp.macosx.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /bin/sh
-
-if [ -e /devtools/etc/profile.ant ] ; then
-    . /devtools/etc/profile.ant
-fi
-
-
-#    -Dc.compiler.debug=true 
-#    -Dbuild.noarchives=true
-
-BUILD_SUBDIR=build-cdcfp-macosx
-
-ant \
-    -Dbuild.noarchives=true \
-    -Dsetup.cdcfp=true \
-    -Drootrel.build=$BUILD_SUBDIR \
-    $* 2>&1 | tee make.jogl.cdcfp.macosx.log
-
-rm -rf ../$BUILD_SUBDIR/lib
-mkdir -p ../$BUILD_SUBDIR/lib
-for i in `find ../$BUILD_SUBDIR/ -name \*jnilib` ; do
-    cp -v $i ../$BUILD_SUBDIR/lib/$(basename $i .jnilib).so
-done
-for i in `find ../../gluegen/$BUILD_SUBDIR/ -name \*jnilib` ; do
-    cp -v $i ../$BUILD_SUBDIR/lib/$(basename $i .jnilib).so
-done
-
diff --git a/make/scripts/make.jogl.doc.all.x86_64.sh b/make/scripts/make.jogl.doc.all.x86_64.sh
index 3711171..5e111d5 100755
--- a/make/scripts/make.jogl.doc.all.x86_64.sh
+++ b/make/scripts/make.jogl.doc.all.x86_64.sh
@@ -6,6 +6,5 @@ fi
 
 
 ant -v  \
-    -Dbuild.noarchives=true \
     -Drootrel.build=build-x86_64 \
     javadoc.spec javadoc javadoc.dev $* 2>&1 | tee make.jogl.doc.all.x86_64.log
diff --git a/make/scripts/make.jogl.doc.x86_64.sh b/make/scripts/make.jogl.doc.x86_64.sh
index daf09ec..677de39 100755
--- a/make/scripts/make.jogl.doc.x86_64.sh
+++ b/make/scripts/make.jogl.doc.x86_64.sh
@@ -6,6 +6,5 @@ fi
 
 
 ant -v  \
-    -Dbuild.noarchives=true \
     -Drootrel.build=build-x86_64 \
     javadoc $* 2>&1 | tee make.jogl.doc.x86_64.log
diff --git a/make/scripts/setenv-jogl.sh b/make/scripts/setenv-jogl.sh
index 2b6985c..586b667 100755
--- a/make/scripts/setenv-jogl.sh
+++ b/make/scripts/setenv-jogl.sh
@@ -10,8 +10,8 @@ if [ -z "$1" ] ; then
     exit
 fi
 
-if [ -e /devtools/etc/profile.ant ] ; then
-    . /devtools/etc/profile.ant
+if [ -e /opt-share/etc/profile.ant ] ; then
+    . /opt-share/etc/profile.ant
 fi
 
 JOGL_BUILDDIR=$1
@@ -82,7 +82,6 @@ CP_SEP=:
 
 . $JOGL_DIR/etc/profile.jogl $JOGL_PROFILE $JOGL_BUILDDIR 
 
-SWT_CLASSPATH=$HOME/.java/swt.jar
 LIB=$THISDIR/lib
 
 CLASSPATH=.:$GLUEGEN_JAR:$JOGL_CLASSPATH:$SWT_CLASSPATH:$JUNIT_JAR:$ANT_JARS
diff --git a/make/scripts/setvc9-jogl.bat b/make/scripts/setvc9-jogl.bat
index 2e83383..26cdf8f 100755
--- a/make/scripts/setvc9-jogl.bat
+++ b/make/scripts/setvc9-jogl.bat
@@ -1,7 +1,7 @@
 
 
-set PATH=C:\cygwin\devtools\share\apache-ant-1.8.0\bin;%PATH%
-set ANT_PATH=C:\cygwin\devtools\share\apache-ant-1.8.0
+set PATH=C:\apache-ant-1.8.2\bin;%PATH%
+set ANT_PATH=C:\apache-ant-1.8.2
 
 c:
 cd C:\SUN\JOGL2\jogl\make
diff --git a/make/scripts/tests-javaws-x64.bat b/make/scripts/tests-javaws-x64.bat
new file mode 100755
index 0000000..c25ccf3
--- /dev/null
+++ b/make/scripts/tests-javaws-x64.bat
@@ -0,0 +1,18 @@
+set JRE_PATH=C:\jre1.6.0_24_x64\bin
+set LOG_PATH=%USERPROFILE%\AppData\LocalLow\Sun\Java\Deployment\log
+
+%JRE_PATH%\javaws -uninstall
+del /F /Q %LOG_PATH%\*.*
+
+set JNLP=Gears.jnlp
+REM set JNLP=TextCube.jnlp
+REM set JNLP=JRefractNoOGL.jnlp
+
+set D_FLAGS="-J-Djnlp.nativewindow.debug=all" "-J-Djnlp.jogl.debug=all" "-J-Djnlp.newt.debug=all"
+
+REM set X_FLAGS="-J-Dsun.java2d.noddraw=true" "-J-Dsun.awt.noerasebackground=true" "-J-Dsun.java2d.opengl=false"
+REM set X_FLAGS="-J-verbose:jni"
+set X_FLAGS=
+
+%JRE_PATH%\javaws %X_FLAGS% %D_FLAGS% http://risa/deployment/test/jau01s/jogl-demos/%JNLP% > tests-javaws.log 2>&1
+
diff --git a/make/scripts/tests-javaws.sh b/make/scripts/tests-javaws.sh
new file mode 100755
index 0000000..a1b1b1e
--- /dev/null
+++ b/make/scripts/tests-javaws.sh
@@ -0,0 +1,16 @@
+javaws -uninstall
+
+rm -f ~/.java/deployment/log/*
+
+JNLP=Gears.jnlp
+# JNLP=TextCube.jnlp
+# JNLP=JRefractNoOGL.jnlp
+
+D_FLAGS="-J-Djnlp.nativewindow.debug=all -J-Djnlp.jogl.debug=all -J-Djnlp.newt.debug=all"
+
+#X_FLAGS="-J-Dsun.java2d.noddraw=true -J-Dsun.awt.noerasebackground=true -J-Dsun.java2d.opengl=false"
+#X_FLAGS="-J-verbose:jni"
+X_FLAGS=
+
+javaws $X_FLAGS $D_FLAGS http://risa/deployment/test/jau01s/jogl-demos/$JNLP 2>&1 | tee tests-javaws.log
+
diff --git a/make/scripts/tests-osx.sh b/make/scripts/tests-osx.sh
new file mode 100755
index 0000000..c6e8336
--- /dev/null
+++ b/make/scripts/tests-osx.sh
@@ -0,0 +1,7 @@
+#! /bin/bash
+
+spath=`dirname $0`
+
+. $spath/tests.sh  /usr/bin/java ../build-macosx $*
+
+
diff --git a/make/scripts/tests-x32.bat b/make/scripts/tests-x32.bat
old mode 100644
new mode 100755
index e8734a0..07a60d9
--- a/make/scripts/tests-x32.bat
+++ b/make/scripts/tests-x32.bat
@@ -1,31 +1,38 @@
 REM scripts\java-win32-dbg.bat com.jogamp.newt.opengl.GLWindow
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT -time 30000
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.jogl.glsl.TestTransformFeedbackVaryingsBug407NEWT
-scripts\java-win32.bat com.jogamp.test.junit.jogl.glsl.TestGLSLSimple01NEWT -time 2000
+REM scripts\java-win32-dbg.bat com.jogamp.newt.opengl.GLWindow
+REM scripts\java-win32.bat com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen01GLPBufferNEWT -time 5000
+REM scripts\java-win32.bat com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT -time 5000
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT -time 30000
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.jogl.glsl.TestTransformFeedbackVaryingsBug407NEWT
+REM scripts\java-win32.bat com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLSimple01NEWT -time 2000
+
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.TestParenting01AWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting01cAWT -time 50000
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.TestListenerCom01AWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting01NEWT
 
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.TestParenting01AWT
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting01cAWT -time 50000
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.TestListenerCom01AWT
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting01NEWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.TestGLWindows01NEWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.TestGLWindows02NEWTAnimated
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting01NEWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.TestFocus02SwingAWTRobot
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.TestFocus01SwingAWTRobot
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.nativewindow.TestRecursiveToolkitLockCORE
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting03AWT -time 100000
 
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.TestGLWindows01NEWT
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.TestGLWindows02NEWTAnimated
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting01NEWT
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.TestFocus02SwingAWTRobot
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.TestFocus01SwingAWTRobot
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.nativewindow.TestRecursiveToolkitLockCORE
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting03AWT -time 100000
+REM scripts\java-win32.bat com.jogamp.opengl.test.junit.newt.TestFocus02SwingAWTRobot
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.TestScreenMode00NEWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.TestScreenMode01NEWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.TestScreenMode02NEWT
 
-REM scripts\java-win32.bat com.jogamp.test.junit.newt.TestFocus02SwingAWTRobot
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.TestScreenMode00NEWT
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.TestScreenMode01NEWT
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.TestScreenMode02NEWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle01NEWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting01NEWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting02NEWT
+REM scripts\java-win32.bat com.jogamp.opengl.test.junit.newt.TestCloseNewtAWT
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleAWT -time 10000
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleNEWT -time 10000
 
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.TestDisplayLifecycle01NEWT
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting01NEWT
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting02NEWT
-REM scripts\java-win32.bat com.jogamp.test.junit.newt.TestCloseNewtAWT
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.jogl.caps.TestMultisampleAWT -time 10000
-REM scripts\java-win32-dbg.bat com.jogamp.test.junit.jogl.caps.TestMultisampleNEWT -time 10000
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWT01GLn %1 %2 %3 %4
+scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWT02GLn %1 %2 %3 %4
+REM scripts\java-win32-dbg.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWTAWT01GLn $*
diff --git a/make/scripts/tests-x32.sh b/make/scripts/tests-x32.sh
new file mode 100755
index 0000000..edbab5a
--- /dev/null
+++ b/make/scripts/tests-x32.sh
@@ -0,0 +1,7 @@
+#! /bin/bash
+
+spath=`dirname $0`
+
+. $spath/tests.sh  /opt-linux-x86/j2se6/bin/java ../build-x86 $*
+
+
diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat
old mode 100644
new mode 100755
index 2b8edec..3318b20
--- a/make/scripts/tests-x64.bat
+++ b/make/scripts/tests-x64.bat
@@ -1,32 +1,57 @@
+REM scripts\java-win64-dbg.bat jogamp.newt.awt.opengl.VersionApplet
 REM scripts\java-win64-dbg.bat com.jogamp.newt.opengl.GLWindow
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT -time 30000
-scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsGLJPanelAWT -time 5000
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.glsl.TestTransformFeedbackVaryingsBug407NEWT
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.glsl.TestGLSLSimple01NEWT -time 2000
-
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestParenting01AWT
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting01cAWT -time 50000
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestListenerCom01AWT
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting01NEWT
-
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestGLWindows01NEWT
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestGLWindows02NEWTAnimated
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting01NEWT
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestFocus02SwingAWTRobot
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestFocus01SwingAWTRobot
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.nativewindow.TestRecursiveToolkitLockCORE
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting03AWT -time 100000
-
-REM scripts\java-win64.bat com.jogamp.test.junit.newt.TestFocus02SwingAWTRobot
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestScreenMode00NEWT
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestScreenMode01NEWT
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestScreenMode02NEWT
-
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestDisplayLifecycle01NEWT
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting01NEWT
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting02NEWT
-REM scripts\java-win64.bat com.jogamp.test.junit.newt.TestCloseNewtAWT
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.caps.TestMultisampleAWT -time 10000
-REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.caps.TestMultisampleNEWT -time 10000
+REM scripts\java-win64-dbg.bat javax.media.opengl.awt.GLCanvas
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen01GLPBufferNEWT -time 5000
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.awt.TestAWT01GLn
+REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.awt.TestSwingAWT01GLn
+REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListAWT -time 5000
+REM scripts\java-win64.bat com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListNEWT -time 5000
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT
+
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT -time 30000
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.TestGearsGLJPanelAWT -time 5000
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.awt.TestAWT03GLCanvasRecreate01
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.glsl.TestTransformFeedbackVaryingsBug407NEWT
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLSimple01NEWT -time 2000
+
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestParenting01AWT
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting01cAWT -time 50000
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestListenerCom01AWT
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting01NEWT
+
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestGLWindows01NEWT
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestGLWindows02NEWTAnimated
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting01NEWT
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestFocus02SwingAWTRobot
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestFocus01SwingAWTRobot
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.nativewindow.TestRecursiveToolkitLockCORE
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting03AWT -time 100000
+
+REM scripts\java-win64.bat com.jogamp.opengl.test.junit.newt.TestFocus02SwingAWTRobot
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestScreenMode00NEWT
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestScreenMode01NEWT
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestScreenMode02NEWT
+
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle01NEWT
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting01NEWT
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenting02NEWT
+REM scripts\java-win64.bat com.jogamp.opengl.test.junit.newt.TestCloseNewtAWT
+
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleAWT -time 10000
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleNEWT -time 10000
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.awt.TestBug461OffscreenSupersamplingSwingAWT
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.glsl.TestShaderCompilationBug459AWT
+
+REM scripts\java-win64.bat com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol01AWT $*
+REM scripts\java-win64.bat com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol02NEWT $*
+REM scripts\java-win64.bat com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol03NewtAWT $*
+
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWT01GLn %1 %2 %3 %4
+scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWT02GLn %1 %2 %3 %4
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWTAWT01GLn $*
+
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT -time 5000
+
+REM scripts\java-win64-dbg.bat com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT
+
diff --git a/make/scripts/tests-x64.sh b/make/scripts/tests-x64.sh
new file mode 100755
index 0000000..48c71c5
--- /dev/null
+++ b/make/scripts/tests-x64.sh
@@ -0,0 +1,7 @@
+#! /bin/bash
+
+spath=`dirname $0`
+
+. $spath/tests.sh  /opt-linux-x86_64/j2se6/bin/java ../build-x86_64 $*
+
+
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
old mode 100644
new mode 100755
index 3976c08..52dd65a
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -1,6 +1,23 @@
 #! /bin/bash
 
-bdir=../build-x86_64
+if [ -z "$1" -o -z "$2" ] ; then
+    echo Usage $0 java-exe build-dir
+    exit 0
+fi
+
+javaexe=$1
+shift
+bdir=$1
+shift
+
+if [ ! -x $javaexe ] ; then
+    echo java-exe $javaexe is not an executable
+    exit 1
+fi
+if [ ! -d $bdir ] ; then
+    echo build-dir $bdir is not a directory
+    exit 1
+fi
 
 rm -f java-run.log
 
@@ -8,15 +25,25 @@ spath=`dirname $0`
 
 . $spath/setenv-jogl.sh $bdir JOGL_ALL
 
-which java 2>&1 | tee -a java-run.log
-java -version 2>&1 | tee -a java-run.log
+MOSX=0
+MOSX_MT=0
+uname -a | grep -i Darwin && MOSX=1
+if [ $MOSX -eq 1 ] ; then
+    MOSX_MT=1
+fi
+
+which $javaexe 2>&1 | tee -a java-run.log
+$javaexe -version 2>&1 | tee -a java-run.log
 echo LIBXCB_ALLOW_SLOPPY_LOCK: $LIBXCB_ALLOW_SLOPPY_LOCK 2>&1 | tee -a java-run.log
 echo LIBGL_DRIVERS_PATH: $LIBGL_DRIVERS_PATH 2>&1 | tee -a java-run.log
 echo LIBGL_DEBUG: $LIBGL_DEBUG 2>&1 | tee -a java-run.log
-echo java $X_ARGS $D_ARGS $* 2>&1 | tee -a java-run.log
+echo SWT_CLASSPATH: $SWT_CLASSPATH 2>&1 | tee -a java-run.log
+echo $javaexe $X_ARGS $D_ARGS $* 2>&1 | tee -a java-run.log
+echo CLASSPATH $CLASSPATH 2>&1 | tee -a java-run.log
+echo MacOsX $MOSX
 
 function jrun() {
-    awtarg=$1
+    awton=$1
     shift
 
     #D_ARGS="-Djogl.debug.ExtensionAvailabilityCache -Djogl.debug=all -Dnativewindow.debug=all -Djogamp.debug.ProcAddressHelper=true -Djogamp.debug.NativeLibrary=true -Djogamp.debug.NativeLibrary.Lookup=true"
@@ -24,93 +51,150 @@ function jrun() {
     #D_ARGS="-Djogl.debug.GLContext -Djogl.debug.ExtensionAvailabilityCache"
     #D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile -Djogl.debug.GLDrawable"
     #D_ARGS="-Djogl.debug.GLProfile"
-    #D_ARGS="-Dnewt.debug.Window -Djogamp.common.utils.locks.Lock.timeout=600000 -Djogl.debug.Animator"
     # D_ARGS="-Dnewt.debug.EDT -Dnativewindow.debug.ToolkitLock.TraceLock -Dnativewindow.debug.NativeWindow"
     #D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT"
     # D_ARGS="-Dnewt.debug.EDT -Dnativewindow.debug.ToolkitLock.TraceLock -Dnativewindow.debug.X11Util.TraceDisplayLifecycle=true"
     #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000 -Djogamp.debug.Lock -Djogamp.debug.Lock.TraceLock"
+    #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=1000 -Djogamp.debug.Lock -Djogamp.debug.Lock.TraceLock"
     # D_ARGS="-Dnewt.debug.Window -Dnewt.debug.EDT -Dnewt.debug.Display "
     #D_ARGS="-Dnewt.debug.EDT -Djogamp.common.utils.locks.Lock.timeout=600000 -Djogl.debug.Animator -Dnewt.debug.Display -Dnewt.debug.Screen"
+    #D_ARGS="-Dnewt.debug.Window -Djogamp.common.utils.locks.Lock.timeout=600000 -Djogl.debug.Animator"
+    #D_ARGS="-Djogl.debug.Animator -Dnewt.debug=all"
     #D_ARGS="-Dnewt.debug.EDT -Dnewt.debug.Display -Dnativewindow.debug.X11Util -Djogl.debug.GLDrawable -Djogl.debug.GLCanvas"
-    #D_ARGS="-Dnewt.debug.EDT -Djogl.debug.GLContext"
+    #D_ARGS="-Djogl.debug.GLContext -Dnewt.debug=all"
     #D_ARGS="-Dnewt.debug.Screen -Dnewt.debug.EDT -Djogamp.debug.Lock"
     #D_ARGS="-Dnewt.debug.EDT"
     #D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all -Dnewt.debug=all"
-    #D_ARGS="-Djogl.debug=all"
+    #D_ARGS="-Djogl.debug=all -Dnewt.debug=all"
+    #D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT -Djogl.debug.GLContext"
+    #D_ARGS="-Dnewt.debug=all"
+    #D_ARGS="-Dnativewindow.debug=all"
     #D_ARGS="-Djogl.debug.GraphicsConfiguration"
+    #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.GraphicsConfiguration"
+    #D_ARGS="-Djogl.debug.GLCanvas"
+    #D_ARGS="-Dnativewindow.debug.ToolkitLock.TraceLock"
     #X_ARGS="-Dsun.java2d.noddraw=true -Dsun.java2d.opengl=true"
-    java $awtarg $X_ARGS $D_ARGS $* 2>&1 | tee -a java-run.log
+    #X_ARGS="-verbose:jni"
+
+    if [ $awton -eq 1 ] ; then
+        X_ARGS="-Djava.awt.headless=false"
+    else
+        X_ARGS="-Djava.awt.headless=true"
+    fi
+    if [ $MOSX_MT -eq 1 ] ; then
+        X_ARGS="-XstartOnFirstThread $X_ARGS"
+        C_ARG="com.jogamp.newt.util.MainThread"
+    fi
+    echo
+    echo "Test Start: $*"
+    echo
+    $javaexe $X_ARGS $D_ARGS $C_ARG $*
+    echo
+    echo "Test End: $*"
+    echo
 }
 
 function testnoawt() {
-    jrun -Djava.awt.headless=true $*
+    jrun 0 $* 2>&1 | tee -a java-run.log
 }
 
 function testawt() {
-    jrun -Djava.awt.headless=false $*
+    MOSX_MT=0
+    jrun 1 $* 2>&1 | tee -a java-run.log
+}
+
+function testawtmt() {
+    jrun 1 $* 2>&1 | tee -a java-run.log
 }
 
 #
 # newt (testnoawt and testawt)
 #
+#testnoawt com.jogamp.nativewindow.NativeWindowVersion $*
+#testnoawt com.jogamp.opengl.JoglVersion $*
+#testnoawt com.jogamp.newt.NewtVersion $*
 #testnoawt com.jogamp.newt.opengl.GLWindow $*
-#testawt com.jogamp.newt.opengl.GLWindow $*
-#testnoawt com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT $*
-#testawt com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT $*
-#testnoawt com.jogamp.test.junit.jogl.glsl.TestTransformFeedbackVaryingsBug407NEWT $*
-#testnoawt com.jogamp.test.junit.jogl.glsl.TestGLSLSimple01NEWT $*
-#testnoawt com.jogamp.test.junit.newt.TestRemoteWindow01NEWT -time 1000000
-#testnoawt com.jogamp.test.junit.newt.TestRemoteGLWindows01NEWT -time 1000000
-#testawt com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT
-#testawt com.jogamp.test.junit.newt.TestDisplayLifecycle01NEWT
-#testawt com.jogamp.test.junit.newt.TestDisplayLifecycle02NEWT
-#testawt com.jogamp.test.junit.newt.parenting.TestParenting01NEWT
-#testawt com.jogamp.test.junit.newt.parenting.TestParenting02NEWT
-#testawt com.jogamp.test.junit.newt.TestScreenMode00NEWT
-#testnoawt com.jogamp.test.junit.newt.TestScreenMode01NEWT
-#testnoawt com.jogamp.test.junit.newt.TestScreenMode02NEWT
-#testawt com.jogamp.test.junit.newt.TestGLWindows01NEWT -time 1000000
-#testawt -Djava.awt.headless=true com.jogamp.test.junit.newt.TestGLWindows01NEWT
-#testawt com.jogamp.test.junit.newt.TestGLWindows02NEWTAnimated
+#testnoawt com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen01GLPBufferNEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListNEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestTransformFeedbackVaryingsBug407NEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLSimple01NEWT $*
+#testnoawt com.jogamp.opengl.test.junit.newt.TestRemoteWindow01NEWT $*
+#testnoawt com.jogamp.opengl.test.junit.newt.TestRemoteGLWindows01NEWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT $*
+#testawt com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle01NEWT
+#testawt com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle02NEWT
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting01NEWT
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting02NEWT
+#testawt com.jogamp.opengl.test.junit.newt.TestScreenMode00NEWT
+#testnoawt com.jogamp.opengl.test.junit.newt.TestScreenMode01NEWT
+#testnoawt com.jogamp.opengl.test.junit.newt.TestScreenMode02NEWT
+#testawt com.jogamp.opengl.test.junit.newt.TestGLWindows01NEWT -time 1000000
+#testawt -Djava.awt.headless=true com.jogamp.opengl.test.junit.newt.TestGLWindows01NEWT
+#testawt com.jogamp.opengl.test.junit.newt.TestGLWindows02NEWTAnimated
+#testnoawt com.jogamp.opengl.test.junit.jogl.swt.TestSWT01GLn $*
+testnoawt com.jogamp.opengl.test.junit.jogl.swt.TestSWT02GLn $*
 
 
 #
 # awt (testawt)
 #
+#testawt jogamp.newt.awt.opengl.VersionApplet $*
 #testawt javax.media.opengl.awt.GLCanvas $*
-#testawt com.jogamp.test.junit.jogl.awt.TestAWT01GLn $*
-#testawt com.jogamp.test.junit.jogl.awt.TestAWT02WindowClosing
-#testawt com.jogamp.test.junit.jogl.awt.TestSwingAWT01GLn
-#testawt com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsAWT
-#testawt com.jogamp.test.junit.jogl.demos.gl2.gears.TestGearsGLJPanelAWT
-#testawt com.jogamp.test.junit.jogl.texture.TestTexture01AWT
+#testawt com.jogamp.opengl.test.junit.jogl.awt.TestAWT01GLn $*
+#testawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.awt.TestSwingAWT01GLn
+#testawt com.jogamp.opengl.test.junit.jogl.awt.TestAWT03GLCanvasRecreate01 $*
+#testawt com.jogamp.opengl.test.junit.jogl.awt.TestAWT02WindowClosing
+#testawt com.jogamp.opengl.test.junit.jogl.awt.text.TestAWTTextRendererUseVertexArrayBug464
+#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.TestGearsAWT
+#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.TestGearsGLJPanelAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.texture.TestTexture01AWT
+#testawt com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleAWT
+#testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug461OffscreenSupersamplingSwingAWT
+#testawt com.jogamp.opengl.test.junit.jogl.texture.TestGrayTextureFromFileAWTBug417
+#testawtmt com.jogamp.opengl.test.junit.jogl.swt.TestSWTAWT01GLn $*
 
 #
 # newt.awt (testawt)
 #
-#testawt com.jogamp.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411
-#testawt com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNewtAWTWrapper
-#testawt com.jogamp.test.junit.newt.TestEventSourceNotAWTBug
-#testawt com.jogamp.test.junit.newt.TestFocus01SwingAWTRobot
-#testawt com.jogamp.test.junit.newt.TestFocus02SwingAWTRobot
-#testawt com.jogamp.test.junit.newt.TestListenerCom01AWT
-#testawt com.jogamp.test.junit.newt.parenting.TestParenting01aAWT
-#testawt com.jogamp.test.junit.newt.parenting.TestParenting01bAWT
-#testawt com.jogamp.test.junit.newt.parenting.TestParenting01cAWT
-testawt com.jogamp.test.junit.newt.parenting.TestParenting01cSwingAWT
-#testawt com.jogamp.test.junit.newt.parenting.TestParenting02AWT
-#testawt com.jogamp.test.junit.newt.parenting.TestParenting03AWT
-#testawt com.jogamp.test.junit.newt.parenting.TestParenting03AWT -time 100000
-#testawt com.jogamp.test.junit.newt.parenting.TestParenting03bAWT -time 100000
-#testawt com.jogamp.test.junit.newt.TestCloseNewtAWT
-#testawt com.jogamp.test.junit.jogl.caps.TestMultisampleAWT $*
-#testawt com.jogamp.test.junit.jogl.caps.TestMultisampleNEWT $*
-
-#testawt com.jogamp.test.junit.newt.TestGLWindows02NEWTAnimated $*
-#testawt com.jogamp.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411 $*
-#testawt com.jogamp.test.junit.newt.parenting.TestParenting01NEWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411
+#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.newt.TestGearsNewtAWTWrapper
+#testawt com.jogamp.opengl.test.junit.newt.TestEventSourceNotAWTBug
+#testawt com.jogamp.opengl.test.junit.newt.TestFocus01SwingAWTRobot
+#testawt com.jogamp.opengl.test.junit.newt.TestFocus02SwingAWTRobot
+#testawt com.jogamp.opengl.test.junit.newt.TestListenerCom01AWT
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting01aAWT
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting01bAWT
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting01cAWT
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting01cSwingAWT
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting02AWT
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting03AWT
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting03AWT -time 100000
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting03bAWT -time 100000
+#testawt com.jogamp.opengl.test.junit.newt.TestCloseNewtAWT
+#testawt com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleNEWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.glsl.TestShaderCompilationBug459AWT
+
+#testawt com.jogamp.opengl.test.junit.newt.TestGLWindows02NEWTAnimated $*
+#testawt com.jogamp.opengl.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411 $*
+#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting01NEWT $*
+
+#testawt com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol01AWT $*
+#testawt com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol02NEWT $*
+#testawt com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol03NewtAWT $*
 
 #testawt $*
 
+#testnoawt com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT
+#
+
+#testawt com.jogamp.opengl.test.junit.newt.TestFocus01SwingAWTRobot
+#testawt com.jogamp.opengl.test.junit.newt.TestFocus02SwingAWTRobot
+#testawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListAWT $*
+
 $spath/count-edt-start.sh java-run.log
 
diff --git a/make/stub_includes/win32/windows.h b/make/stub_includes/win32/windows.h
index d9f9e69..c30f99e 100644
--- a/make/stub_includes/win32/windows.h
+++ b/make/stub_includes/win32/windows.h
@@ -12,9 +12,9 @@
 typedef int                 BOOL;
 typedef unsigned char       BYTE;
 typedef char                CHAR;
-typedef unsigned int        DWORD;
+typedef unsigned __int32    DWORD;
 typedef int                 INT;
-typedef int                 INT32;
+typedef __int32             INT32;
 typedef __int64             INT64;
 typedef float               FLOAT;
 typedef struct _handle*     HANDLE;
@@ -26,14 +26,18 @@ typedef HANDLE              HMODULE;
 typedef HANDLE              HINSTANCE;
 typedef HANDLE              HPALETTE;
 typedef HANDLE              HWND;
-typedef long                LONG;
+typedef __int32             LONG;
 typedef const char*         LPCSTR;
 typedef void*               LPVOID;
+typedef unsigned __int64    ULONG_PTR;
 typedef struct _proc*       PROC;
 typedef unsigned int*       PUINT;
 typedef unsigned int        UINT;
 typedef unsigned short      USHORT;
 typedef unsigned short      WORD;
+typedef unsigned short      ATOM;
+typedef intptr_t            DWORD_PTR;
+typedef intptr_t*           PDWORD_PTR;
 
 /* Necessary handle typedefs for parsing wglext.h */
 
@@ -48,3 +52,6 @@ typedef struct tagRECT {
     LONG bottom;
 } RECT;
 
+typedef RECT*               PRECT;
+typedef RECT*               LPRECT;
+
diff --git a/make/stub_includes/win32/wingdi.h b/make/stub_includes/win32/wingdi.h
index e31cd8c..23ac428 100644
--- a/make/stub_includes/win32/wingdi.h
+++ b/make/stub_includes/win32/wingdi.h
@@ -105,8 +105,9 @@ typedef struct tagPIXELFORMATDESCRIPTOR {
 #define PFD_DOUBLEBUFFER_DONTCARE 0x40000000
 #define PFD_STEREO_DONTCARE 0x80000000
 
-/* OpenGL error codes (from winerror.h) */
+/* error codes (from winerror.h) */
 /* FIXME: these should have a trailing "L" but apparently PCPP doesn't handle that syntax */
+#define ERROR_SUCCESS                    0
 #define ERROR_INVALID_PIXEL_FORMAT       2000
 #define ERROR_NO_SYSTEM_RESOURCES        1450
 #define ERROR_INVALID_DATA               13
@@ -132,6 +133,24 @@ typedef struct tagPIXELFORMATDESCRIPTOR {
 #define SW_FORCEMINIMIZE    11
 #define SW_MAX              11
 
+/**
+ * GetObjectType() Command
+ */
+#define OBJ_PEN 1
+#define OBJ_BRUSH 2
+#define OBJ_DC 3
+#define OBJ_METADC 4
+#define OBJ_PAL 5
+#define OBJ_FONT 6
+#define OBJ_BITMAP 7
+#define OBJ_REGION 8
+#define OBJ_METAFILE 9
+#define OBJ_MEMDC 10
+#define OBJ_EXTPEN 11
+#define OBJ_ENHMETADC 12
+#define OBJ_ENHMETAFILE 13
+#define OBJ_COLORSPACE 14
+
 #endif /*  WGL_GDI_VERSION_1_X */
 
 #ifndef WGL_GDI_VERSION_1_X
@@ -168,11 +187,19 @@ WINGDIAPI HGDIOBJ WINAPI SelectObject(HDC, HGDIOBJ);
 // Routines for creation of a dummy window, device context and OpenGL
 // context for the purposes of getting wglChoosePixelFormatARB and
 // associated routines
-           HWND        CreateDummyWindow0( HINSTANCE hInstance, int x, int y, int width, int height ) ;
+           HINSTANCE   GetApplicationHandle();
 WINUSERAPI BOOL WINAPI ShowWindow(HWND hWnd, int nCmdShow);
 WINUSERAPI HDC  WINAPI GetDC(HWND);
 WINUSERAPI int  WINAPI ReleaseDC(HWND hWnd, HDC hDC);
+WINUSERAPI HWND WINAPI WindowFromDC(HDC hDC); // avail in >= Win2k
+WINUSERAPI BOOL WINAPI GetClientRect(HWND hwnd, LPRECT lpRect);
 WINUSERAPI BOOL WINAPI DestroyWindow(HWND hWnd);
+WINUSERAPI DWORD WINAPI GetObjectType(HGDIOBJ h);
+
+WINUSERAPI HANDLE WINAPI GetCurrentProcess(void);
+WINUSERAPI BOOL WINAPI GetProcessAffinityMask(HANDLE hProcess,PDWORD_PTR lpProcessAffinityMask,PDWORD_PTR lpSystemAffinityMask);
+WINUSERAPI BOOL WINAPI SetProcessAffinityMask(HANDLE hProcess,DWORD_PTR dwProcessAffinityMask);
+
 
 // Routines for changing gamma ramp of display device
 WINGDIAPI BOOL        WINAPI GetDeviceGammaRamp(HDC,LPVOID);
diff --git a/nativewindow.iml b/nativewindow.iml
index 8e058bf..9c8acbc 100644
--- a/nativewindow.iml
+++ b/nativewindow.iml
@@ -3,7 +3,6 @@
   <component name="NewModuleRootManager" inherit-compiler-output="true">
     <exclude-output />
     <content url="file://$MODULE_DIR$/build/nativewindow">
-      <sourceFolder url="file://$MODULE_DIR$/build/nativewindow/gensrc/classes-cdc" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/build/nativewindow/gensrc/classes" isTestSource="false" />
     </content>
     <content url="file://$MODULE_DIR$/src/nativewindow">
diff --git a/nbproject/ide-file-targets.xml b/nbproject/ide-file-targets.xml
index dd98d30..666cf01 100644
--- a/nbproject/ide-file-targets.xml
+++ b/nbproject/ide-file-targets.xml
@@ -18,14 +18,14 @@
     </target>
     <target name="compile-test" depends="init">
         <mkdir dir="build/test/build/classes"/>
-        <javac debug="true" debuglevel="lines,vars,source" destdir="build/test/build/classes" failonerror="false" source="1.5" srcdir="src/junit" includeantruntime="false">
+        <javac debug="true" debuglevel="lines,vars,source" destdir="build/test/build/classes" failonerror="false" source="1.5" srcdir="src/test" includeantruntime="false">
             <classpath refid="cp"/>
         </javac>
     </target>
     <target name="compile-selected-files-in-junit" depends="init">
         <fail unless="files">Must set property 'files'</fail>
         <mkdir dir="build/test/build/classes"/>
-        <javac debug="true" debuglevel="lines,vars,source" destdir="build/test/build/classes" includes="${files}" source="1.5" srcdir="src/junit" includeantruntime="false">
+        <javac debug="true" debuglevel="lines,vars,source" destdir="build/test/build/classes" includes="${files}" source="1.5" srcdir="src/test" includeantruntime="false">
             <classpath refid="cp"/>
         </javac>
     </target>
diff --git a/nbproject/project.xml b/nbproject/project.xml
index ce65091..32d850e 100644
--- a/nbproject/project.xml
+++ b/nbproject/project.xml
@@ -13,6 +13,11 @@
             </properties>
             <folders>
                 <source-folder>
+                    <label>JOGL</label>
+                    <location>.</location>
+                    <encoding>UTF-8</encoding>
+                </source-folder>
+                <source-folder>
                     <label>nativewindow gensrc</label>
                     <type>java</type>
                     <location>build/nativewindow/gensrc/classes</location>
@@ -43,14 +48,9 @@
                     <encoding>UTF-8</encoding>
                 </source-folder>
                 <source-folder>
-                    <label>src/junit</label>
+                    <label>src/test</label>
                     <type>java</type>
-                    <location>src/junit</location>
-                    <encoding>UTF-8</encoding>
-                </source-folder>
-                <source-folder>
-                    <label>JOGL</label>
-                    <location>.</location>
+                    <location>src/test</location>
                     <encoding>UTF-8</encoding>
                 </source-folder>
             </folders>
@@ -94,7 +94,7 @@
                     <target>run-selected-file-in-junit</target>
                     <context>
                         <property>run.class</property>
-                        <folder>src/junit</folder>
+                        <folder>src/test</folder>
                         <pattern>\.java$</pattern>
                         <format>java-name</format>
                         <arity>
@@ -107,7 +107,7 @@
                     <target>debug-selected-file-in-junit</target>
                     <context>
                         <property>debug.class</property>
-                        <folder>src/junit</folder>
+                        <folder>src/test</folder>
                         <pattern>\.java$</pattern>
                         <format>java-name</format>
                         <arity>
@@ -120,7 +120,7 @@
                     <target>debug-selected-file-in-junit</target>
                     <context>
                         <property>debug.class</property>
-                        <folder>src/junit</folder>
+                        <folder>src/test</folder>
                         <pattern>\.java$</pattern>
                         <format>java-name</format>
                         <arity>
@@ -133,7 +133,7 @@
                     <target>compile-selected-files-in-junit</target>
                     <context>
                         <property>files</property>
-                        <folder>src/junit</folder>
+                        <folder>src/test</folder>
                         <pattern>\.java$</pattern>
                         <format>relative-path</format>
                         <arity>
@@ -177,8 +177,8 @@
                         <location>src/newt/classes</location>
                     </source-folder>
                     <source-folder style="packages">
-                        <label>src/junit</label>
-                        <location>src/junit</location>
+                        <label>src/test</label>
+                        <location>src/test</location>
                     </source-folder>
                     <source-file>
                         <location>${ant.script}</location>
@@ -201,14 +201,14 @@
                 <package-root>src/nativewindow/classes</package-root>
                 <package-root>build/jogl/gensrc/classes</package-root>
                 <package-root>build/nativewindow/gensrc/classes</package-root>
-                <classpath mode="compile">../gluegen/build/gluegen.jar:../gluegen/build/gluegen-rt.jar</classpath>
+                <classpath mode="compile">../gluegen/build/gluegen.jar:../gluegen/build/gluegen-rt.jar:make/lib/swt/gtk-linux-x86_64/swt-debug.jar</classpath>
                 <built-to>bin</built-to>
-                <source-level>1.4</source-level>
+                <source-level>1.5</source-level>
             </compilation-unit>
             <compilation-unit>
-                <package-root>src/junit</package-root>
+                <package-root>src/test</package-root>
                 <unit-tests/>
-                <classpath mode="compile">build/jogl/classes:build/jogl/gensrc/classes:build/newt/classes:build/nativewindow/classes:build/nativewindow/gensrc/classes:build/test/build/classes:${jdk.home}/lib/tools.jar:${ant.core.lib}:${ant.home}/lib/ant-junit.jar:../gluegen/make/lib/antlr.jar:../gluegen/make/lib/junit.jar:../gluegen/build/gluegen-rt.jar</classpath>
+                <classpath mode="compile">build/jogl/classes:build/jogl/gensrc/classes:build/newt/classes:build/nativewindow/classes:build/nativewindow/gensrc/classes:build/test/build/classes:${jdk.home}/lib/tools.jar:${ant.core.lib}:${ant.home}/lib/ant-junit.jar:../gluegen/make/lib/antlr.jar:../gluegen/make/lib/junit.jar:../gluegen/build/gluegen-rt.jar:make/lib/swt/gtk-linux-x86_64/swt-debug.jar</classpath>
                 <built-to>bin</built-to>
                 <source-level>1.5</source-level>
             </compilation-unit>
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
index 7acba95..d11504a 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
@@ -550,7 +550,7 @@ public class BuildComposablePipeline {
          * method wrappers have been generated.
          */
         protected void preMethodEmissionHook(PrintWriter output) {
-            output.println("  public static final boolean DEBUG = com.jogamp.opengl.impl.Debug.debug(\"" + getOutputName() + "\");");
+            output.println("  public static final boolean DEBUG = jogamp.opengl.Debug.debug(\"" + getOutputName() + "\");");
         }
 
         /**
diff --git a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
index 8bd3c47..34108bc 100644
--- a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
+++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
@@ -28,11 +28,14 @@
  
 package com.jogamp.opengl;
 
+import com.jogamp.common.GlueGenVersion;
 import javax.media.opengl.*;
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.VersionUtil;
 import com.jogamp.common.util.JogampVersion;
+import com.jogamp.nativewindow.NativeWindowVersion;
 import java.util.jar.Manifest;
+import javax.media.nativewindow.AbstractGraphicsDevice;
 
 public class JoglVersion extends JogampVersion {
 
@@ -43,7 +46,7 @@ public class JoglVersion extends JogampVersion {
     }
 
     public static JoglVersion getInstance() {
-        if(null == jogampCommonVersionInfo) {
+        if(null == jogampCommonVersionInfo) { // volatile: ok
             synchronized(JoglVersion.class) {
                 if( null == jogampCommonVersionInfo ) {
                     final String packageName = "javax.media.opengl";
@@ -55,13 +58,9 @@ public class JoglVersion extends JogampVersion {
         return jogampCommonVersionInfo;
     }
 
-    public StringBuffer toString(GL gl, StringBuffer sb) {
-        sb = super.toString(sb);
-
+    public StringBuilder toString(GL gl, StringBuilder sb) {
+        sb = super.toString(sb).append(Platform.getNewline());
         getGLInfo(gl, sb);
-        sb.append("-----------------------------------------------------------------------------------------------------");
-        sb.append(Platform.getNewline());
-
         return sb;
     }
 
@@ -69,14 +68,18 @@ public class JoglVersion extends JogampVersion {
         return toString(gl, null).toString();
     }
 
-    public static StringBuffer getGLInfo(GL gl, StringBuffer sb) {
+    public static StringBuilder getGLInfo(GL gl, StringBuilder sb) {
+        AbstractGraphicsDevice device = gl.getContext().getGLDrawable().getNativeSurface()
+                                            .getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice();
         if(null==sb) {
-            sb = new StringBuffer();
+            sb = new StringBuilder();
         }
+        GLContext ctx = gl.getContext();
 
-        sb.append("Default Desktop ").append(GLProfile.getDefaultDesktopDevice().getConnection()).append(": ").append(GLProfile.glAvailabilityToString(GLProfile.getDefaultDesktopDevice()));
-        sb.append(Platform.getNewline());
-        sb.append("Default EGL ").append(GLProfile.getDefaultEGLDevice().getConnection()).append(": ").append(GLProfile.glAvailabilityToString(GLProfile.getDefaultEGLDevice()));
+        sb.append(VersionUtil.SEPERATOR).append(Platform.getNewline());
+        sb.append(device.getClass().getSimpleName()).append("[type ")
+                .append(device.getType()).append(", connection ").append(device.getConnection()).append("]: ")
+                .append(GLProfile.glAvailabilityToString(device));
         sb.append(Platform.getNewline());
         sb.append("Swap Interval ").append(gl.getSwapInterval());
         sb.append(Platform.getNewline());
@@ -86,18 +89,27 @@ public class JoglVersion extends JogampVersion {
         sb.append(Platform.getNewline());
         sb.append("GL            ").append(gl);
         sb.append(Platform.getNewline());
+        sb.append("GL_VENDOR     ").append(gl.glGetString(gl.GL_VENDOR));
+        sb.append(Platform.getNewline());
         sb.append("GL_VERSION    ").append(gl.glGetString(gl.GL_VERSION));
         sb.append(Platform.getNewline());
         sb.append("GL_EXTENSIONS ");
         sb.append(Platform.getNewline());
-        sb.append("              ").append(gl.glGetString(gl.GL_EXTENSIONS));
+        sb.append("              ").append(ctx.getGLExtensionsString());
+        sb.append(Platform.getNewline());
+        sb.append("GLX_EXTENSIONS ");
+        sb.append(Platform.getNewline());
+        sb.append("              ").append(ctx.getPlatformExtensionsString());
         sb.append(Platform.getNewline());
+        sb.append(VersionUtil.SEPERATOR);
 
         return sb;
     }
 
     public static void main(String args[]) {
         System.err.println(VersionUtil.getPlatformInfo());
+        System.err.println(GlueGenVersion.getInstance());
+        System.err.println(NativeWindowVersion.getInstance());
         System.err.println(JoglVersion.getInstance());
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
index c414e66..5655d1a 100644
--- a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
@@ -28,13 +28,8 @@
  
 package com.jogamp.opengl.cg;
 
-import com.jogamp.common.os.DynamicLookupHelper;
 import com.jogamp.common.os.DynamicLibraryBundleInfo;
-import com.jogamp.common.os.NativeLibrary;
-import com.jogamp.common.os.Platform;
 import java.util.*;
-import java.security.*;
-import javax.media.opengl.GLException;
 
 public class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
     private static List/*<String>*/ glueLibNames;
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/Debug.java b/src/jogl/classes/com/jogamp/opengl/impl/Debug.java
deleted file mode 100644
index 82a5f2f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/Debug.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import java.security.*;
-
-/** Helper routines for logging and debugging. */
-
-public class Debug {
-  // Some common properties
-  private static boolean verbose;
-  private static boolean debugAll;
-  private static AccessControlContext localACC;
-  
-  static {
-    localACC=AccessController.getContext();
-    verbose = isPropertyDefined("jogl.verbose", true);
-    debugAll = isPropertyDefined("jogl.debug", true);
-    if (verbose) {
-       Package p = Package.getPackage("javax.media.opengl");
-       System.err.println("JOGL specification version " + p.getSpecificationVersion());
-       System.err.println("JOGL implementation version " + p.getImplementationVersion());
-       System.err.println("JOGL implementation vendor " + p.getImplementationVendor());
-    }
-  }
-
-  static int getIntProperty(final String property, final boolean jnlpAlias) {
-      return getIntProperty(property, jnlpAlias, localACC);
-  }
-
-  public static int getIntProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    int i=0;
-    try {
-        Integer iv = Integer.valueOf(Debug.getProperty(property, jnlpAlias, acc));
-        i = iv.intValue();
-    } catch (NumberFormatException nfe) {}
-    return i;
-  }
-
-  static boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
-    return getBooleanProperty(property, jnlpAlias, localACC);
-  }
-
-  public static boolean getBooleanProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    Boolean b = Boolean.valueOf(Debug.getProperty(property, jnlpAlias, acc));
-    return b.booleanValue();
-  }
-
-  static boolean isPropertyDefined(final String property, final boolean jnlpAlias) {
-    return isPropertyDefined(property, jnlpAlias, localACC);
-  }
-
-  public static boolean isPropertyDefined(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    return (Debug.getProperty(property, jnlpAlias, acc) != null) ? true : false;
-  }
-
-  static String getProperty(final String property, final boolean jnlpAlias) {
-    return getProperty(property, jnlpAlias, localACC);
-  }
-
-  public static String getProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    String s=null;
-    if(null!=acc && acc.equals(localACC)) {
-        s = (String) AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() {
-              String val=null;
-              try {
-                  val = System.getProperty(property);
-              } catch (Exception e) {}
-              if(null==val && jnlpAlias && !property.startsWith(jnlp_prefix)) {
-                  try {
-                      val = System.getProperty(jnlp_prefix + property);
-                  } catch (Exception e) {}
-              }
-              return val;
-            }
-          });
-    } else {
-        try {
-            s = System.getProperty(property);
-        } catch (Exception e) {}
-        if(null==s && jnlpAlias && !property.startsWith(jnlp_prefix)) {
-            try {
-                s = System.getProperty(jnlp_prefix + property);
-            } catch (Exception e) {}
-        }
-    }
-    return s;
-  }
-  public static final String jnlp_prefix = "jnlp." ;
-
-  public static boolean verbose() {
-    return verbose;
-  }
-
-  public static boolean debugAll() {
-    return debugAll;
-  }
-
-  public static boolean debug(String subcomponent) {
-    return debugAll() || isPropertyDefined("jogl.debug." + subcomponent, true);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/DesktopGLDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/impl/DesktopGLDynamicLibraryBundleInfo.java
deleted file mode 100644
index 5cacf50..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/DesktopGLDynamicLibraryBundleInfo.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl;
-
-import java.util.List;
-import java.util.ArrayList;
-
-public abstract class DesktopGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundleInfo {
-    private static int posGlueLibGLDESKTOP;
-    private static List/*<String>*/ glueLibNames;
-    static {
-        glueLibNames = new ArrayList();
-
-        glueLibNames.addAll(getGlueLibNamesPreload());
-
-        posGlueLibGLDESKTOP = glueLibNames.size();
-        glueLibNames.add("jogl_desktop");
-    }
-
-    public static final int getGlueLibPosGLDESKTOP() { 
-        return posGlueLibGLDESKTOP; 
-    }
-
-    public DesktopGLDynamicLibraryBundleInfo() {
-        super();
-    }
-
-    public final List/*<String>*/ getGlueLibNames() {
-        return glueLibNames;
-    }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/DesktopGLDynamicLookupHelper.java b/src/jogl/classes/com/jogamp/opengl/impl/DesktopGLDynamicLookupHelper.java
deleted file mode 100644
index 0882191..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/DesktopGLDynamicLookupHelper.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl;
-
-import com.jogamp.common.os.DynamicLibraryBundle;
-import com.jogamp.common.os.DynamicLibraryBundleInfo;
-import com.jogamp.common.os.DynamicLookupHelper;
-import com.jogamp.common.os.NativeLibrary;
-import java.util.*;
-import java.security.*;
-import javax.media.opengl.GLException;
-
-public class DesktopGLDynamicLookupHelper extends GLDynamicLookupHelper {
-
-    public DesktopGLDynamicLookupHelper(DesktopGLDynamicLibraryBundleInfo info) {
-        super(info);
-    }
-
-    public DesktopGLDynamicLibraryBundleInfo getDesktopGLBundleInfo() { return (DesktopGLDynamicLibraryBundleInfo) getBundleInfo(); }
-
-    public boolean hasGLBinding() {
-        return isToolLibLoaded() && isGlueLibLoaded(DesktopGLDynamicLibraryBundleInfo.getGlueLibPosGLDESKTOP());
-    }
-
-    public synchronized boolean loadGLULibrary() {
-        /** hacky code .. where all platform GLU libs are tried ..*/
-        if(null==gluLib) {
-            List/*<String>*/ gluLibNames = new ArrayList();
-            gluLibNames.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib"); // osx
-            gluLibNames.add("libGLU.so"); // unix
-            gluLibNames.add("GLU32"); // windows
-            gluLibNames.add("GLU"); // generic
-            gluLib = loadFirstAvailable(gluLibNames, null, true);
-            if(null != gluLib) {
-                nativeLibraries.add(gluLib);
-            }
-        }
-        return null != gluLib ;
-    }
-    NativeLibrary gluLib = null;
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java b/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java
deleted file mode 100644
index 0cc7929..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import javax.media.opengl.*;
-import java.util.*;
-
-/**
- * A utility object intended to be used by implementations to act as a cache
- * of which OpenGL extensions are currently available on both the host machine
- * and display.
- */
-public final class ExtensionAvailabilityCache {
-  protected static final boolean DEBUG = GLContextImpl.DEBUG;
-  private static final boolean DEBUG_AVAILABILITY = Debug.isPropertyDefined("jogl.debug.ExtensionAvailabilityCache", true);
-
-  ExtensionAvailabilityCache(GLContextImpl context)
-  {
-    this.context = context;
-  }
-
-  /**
-   * Flush the cache. The cache will be rebuilt lazily as calls to {@link
-   * #isExtensionAvailable(String)} are received.
-   */
-  public void flush()
-  {
-    if(DEBUG) {
-        System.out.println("ExtensionAvailabilityCache: Flush availability OpenGL "+context.getGLVersion());
-    }
-    availableExtensionCache.clear();
-    initialized = false;
-  }
-
-  /**
-   * Flush the cache and rebuild the cache.
-   */
-  public void reset() {
-    flush();
-    initAvailableExtensions();
-  }
-
-  public boolean isInitialized() {
-    return initialized && !availableExtensionCache.isEmpty() ;
-  }
-
-  public boolean isExtensionAvailable(String glExtensionName) {
-    initAvailableExtensions();
-    return availableExtensionCache.contains(mapGLExtensionName(glExtensionName));
-  }
-
-  public String getPlatformExtensionsString() {
-    initAvailableExtensions();
-    return glXExtensions;
-  }
-
-  public String getGLExtensions() {
-    initAvailableExtensions();
-    if(DEBUG) {
-        System.err.println("ExtensionAvailabilityCache: getGLExtensions() called");
-    }
-    return glExtensions;
-  }
-
-  private void initAvailableExtensions() {
-    GL gl = context.getGL();
-    // if hash is empty (meaning it was flushed), pre-cache it with the list
-    // of extensions that are in the GL_EXTENSIONS string
-    if (availableExtensionCache.isEmpty() || !initialized) {
-      if (DEBUG) {
-         System.err.println(getThreadName() + ":ExtensionAvailabilityCache: Pre-caching init "+gl+", OpenGL "+context.getGLVersion());
-      }
-
-      boolean useGetStringi = false;
-
-      // Use 'glGetStringi' only for ARB GL3 context,
-      // on GL2 platforms the function might be available, but not working.
-      if ( context.isGL3() ) {
-          if ( ! context.isFunctionAvailable("glGetStringi") ) {
-            if(DEBUG) {
-                System.err.println("GLContext: GL >= 3.1 usage, but no glGetStringi");
-            }
-          } else {
-              useGetStringi = true;
-          }
-      }
-
-      if (DEBUG) {
-        System.err.println(getThreadName() + ":ExtensionAvailabilityCache: Pre-caching extension availability OpenGL "+context.getGLVersion()+
-                           ", use "+ ( useGetStringi ? "glGetStringi" : "glGetString" ) );
-      }
-
-      StringBuffer sb = new StringBuffer();
-      if(useGetStringi) {
-        GL2GL3 gl2gl3 = gl.getGL2GL3();
-        int[] numExtensions = { 0 } ;
-        gl2gl3.glGetIntegerv(gl2gl3.GL_NUM_EXTENSIONS, numExtensions, 0);
-        for (int i = 0; i < numExtensions[0]; i++) {
-            sb.append(gl2gl3.glGetStringi(gl2gl3.GL_EXTENSIONS, i));
-            if(i < numExtensions[0]) {
-                sb.append(" ");
-            }
-        }
-        if (DEBUG) {
-            System.err.println(getThreadName() + ":ExtensionAvailabilityCache: GL_EXTENSIONS: "+numExtensions[0]);
-        }
-        if(0==numExtensions[0]) {
-            // fall back ..
-            useGetStringi=false;
-        }
-      }
-      if(!useGetStringi) {
-        sb.append(gl.glGetString(GL.GL_EXTENSIONS));
-      }
-      glExtensions = sb.toString();
-      glXExtensions = context.getPlatformExtensionsString();
-
-      sb.append(" ");
-      sb.append(glXExtensions);
-
-      String allAvailableExtensions = sb.toString();
-      if (DEBUG_AVAILABILITY) {
-        System.err.println(getThreadName() + ":ExtensionAvailabilityCache: GL vendor: " + gl.glGetString(GL.GL_VENDOR));
-      }
-      StringTokenizer tok = new StringTokenizer(allAvailableExtensions);
-      while (tok.hasMoreTokens()) {
-        String availableExt = tok.nextToken().trim();
-        availableExt = availableExt.intern();
-        availableExtensionCache.add(availableExt);
-        if (DEBUG_AVAILABILITY) {
-          System.err.println(getThreadName() + ":ExtensionAvailabilityCache: Available: " + availableExt);
-        }
-      }
-      if (DEBUG) {
-        System.err.println(getThreadName() + ":ExtensionAvailabilityCache: ALL EXTENSIONS: "+availableExtensionCache.size());
-      }
-
-      int major[] = new int[] { context.getGLVersionMajor() };
-      int minor[] = new int[] { context.getGLVersionMinor() };
-      while (GLContext.isValidGLVersion(major[0], minor[0])) {
-        availableExtensionCache.add("GL_VERSION_" + major[0] + "_" + minor[0]);
-        if (DEBUG) {
-            System.err.println(getThreadName() + ":ExtensionAvailabilityCache: Added GL_VERSION_" + major[0] + "_" + minor[0] + " to known extensions");
-        }
-        if(!GLContext.decrementGLVersion(major, minor)) break;
-      }
-
-      // put a dummy var in here so that the cache is no longer empty even if
-      // no extensions are in the GL_EXTENSIONS string
-      availableExtensionCache.add("<INTERNAL_DUMMY_PLACEHOLDER>");
-
-      initialized = true;
-    }
-  }
-
-  // FIXME: hack to re-enable GL_NV_vertex_array_range extension after
-  // recent upgrade to new wglext.h and glxext.h headers
-  private static String mapGLExtensionName(String extensionName) {
-    if (extensionName != null &&
-        (extensionName.equals("WGL_NV_vertex_array_range") ||
-         extensionName.equals("GLX_NV_vertex_array_range"))) 
-      return "GL_NV_vertex_array_range";
-    return extensionName;
-  }
-
-  //----------------------------------------------------------------------
-  // Internals only below this point
-  //
-
-  private boolean initialized = false;
-  private String glExtensions = null;
-  private String glXExtensions = null;
-  private HashSet availableExtensionCache = new HashSet(50);
-  private GLContextImpl context;
-
-  protected static String getThreadName() {
-    return Thread.currentThread().getName();
-  }
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLBufferSizeTracker.java b/src/jogl/classes/com/jogamp/opengl/impl/GLBufferSizeTracker.java
deleted file mode 100644
index 6ebda22..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLBufferSizeTracker.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import javax.media.opengl.*;
-import com.jogamp.common.util.IntLongHashMap;
-
-/**
- * Tracks as closely as possible the sizes of allocated OpenGL buffer
- * objects. When glMapBuffer or glMapBufferARB is called, in order to
- * turn the resulting base address into a java.nio.ByteBuffer, we need
- * to know the size in bytes of the allocated OpenGL buffer object.
- * Previously we would compute this size by using
- * glGetBufferParameterivARB with a pname of GL_BUFFER_SIZE, but
- * it appears doing so each time glMapBuffer is called is too costly
- * on at least Apple's new multithreaded OpenGL implementation. <P>
- *
- * Instead we now try to track the sizes of allocated buffer objects.
- * We watch calls to glBindBuffer to see which buffer is bound to
- * which target and to glBufferData to see how large the buffer's
- * allocated size is. When glMapBuffer is called, we consult our table
- * of buffer sizes to see if we can return an answer without a glGet
- * call. <P>
- *
- * We share the GLBufferSizeTracker objects among all GLContexts for
- * which sharing is enabled, because the namespace for buffer objects
- * is the same for these contexts. <P>
- *
- * Tracking the state of which buffer objects are bound is done in the
- * GLBufferStateTracker and is not completely trivial. In the face of
- * calls to glPushClientAttrib / glPopClientAttrib we currently punt
- * and re-fetch the bound buffer object for the state in question;
- * see, for example, glVertexPointer and the calls down to
- * GLBufferStateTracker.getBoundBufferObject(). Note that we currently
- * ignore new binding targets such as GL_TRANSFORM_FEEDBACK_BUFFER_NV;
- * the fact that new binding targets may be added in the future makes
- * it impossible to cache state for these new targets. <P>
- *
- * Ignoring new binding targets, the primary situation in which we may
- * not be able to return a cached answer is in the case of an error,
- * where glBindBuffer may not have been called before trying to call
- * glBufferData. Also, if external native code modifies a buffer
- * object, we may return an incorrect answer. (FIXME: this case
- * requires more thought, and perhaps stochastic and
- * exponential-fallback checking. However, note that it can only occur
- * in the face of external native code which requires that the
- * application be signed anyway, so there is no security risk in this
- * area.)
- */
-
-public class GLBufferSizeTracker {
-  // Map from buffer names to sizes.
-  // Note: should probably have some way of shrinking this map, but
-  // can't just make it a WeakHashMap because nobody holds on to the
-  // keys; would have to always track creation and deletion of buffer
-  // objects, which is probably sub-optimal. The expected usage
-  // pattern of buffer objects indicates that the fact that this map
-  // never shrinks is probably not that bad.
-  private IntLongHashMap bufferSizeMap;
-
-  protected static final boolean DEBUG = Debug.debug("GLStatusTracker");
-
-  public GLBufferSizeTracker() {
-      bufferSizeMap = new IntLongHashMap();
-      bufferSizeMap.setKeyNotFoundValue(-1);
-  }
-
-  public void setBufferSize(GLBufferStateTracker bufferStateTracker,
-                            int target, GL caller, long size) {
-    // Need to do some similar queries to getBufferSize below
-    int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
-    boolean valid = bufferStateTracker.isBoundBufferObjectKnown(target);
-    if (valid) {
-      if (buffer == 0) {
-        // FIXME: this really should not happen if we know what's
-        // going on. Very likely there is an OpenGL error in the
-        // application if we get here. Could silently return 0, but it
-        // seems better to get an early warning that something is
-        // wrong.
-        throw new GLException("Error: no OpenGL buffer object appears to be bound to target 0x" +
-                              Integer.toHexString(target));
-      }
-      setDirectStateBufferSize(buffer, caller, size);
-    }
-    // We don't know the current buffer state. Note that the buffer
-    // state tracker will have made the appropriate OpenGL query if it
-    // didn't know what was going on, so at this point we have nothing
-    // left to do except drop this piece of information on the floor.
-  }
-
-  public void setDirectStateBufferSize(int buffer, GL caller, long size) {
-      bufferSizeMap.put(buffer, size);
-  }
-
-  public long getBufferSize(GLBufferStateTracker bufferStateTracker,
-                           int target,
-                           GL caller) {
-    // See whether we know what buffer is currently bound to the given
-    // state
-    int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
-    boolean valid = bufferStateTracker.isBoundBufferObjectKnown(target);
-    if (valid) {
-      if (0 == buffer) {
-        // FIXME: this really should not happen if we know what's
-        // going on. Very likely there is an OpenGL error in the
-        // application if we get here. Could silently return 0, but it
-        // seems better to get an early warning that something is
-        // wrong.
-        throw new GLException("Error: no OpenGL buffer object appears to be bound to target 0x" +
-                              Integer.toHexString(target));
-      }
-      return getBufferSizeImpl(target, buffer, caller);
-    }
-    // We don't know what's going on in this case; query the GL for an answer
-    // FIXME: both functions return 'int' types, which is not suitable,
-    // since buffer lenght is 64bit ?
-    int[] tmp = new int[1];
-    caller.glGetBufferParameteriv(target, GL.GL_BUFFER_SIZE, tmp, 0);
-    if (DEBUG) {
-      System.err.println("GLBufferSizeTracker.getBufferSize(): no cached buffer information");
-    }
-    return (long) tmp[0];
-  }
-
-  public long getDirectStateBufferSize(int buffer, GL caller) {
-      return getBufferSizeImpl(0, buffer, caller);
-  }
-
-  private long getBufferSizeImpl(int target, int buffer, GL caller) {
-      // See whether we know the size of this buffer object; at this
-      // point we almost certainly should if the application is
-      // written correctly
-      long sz = bufferSizeMap.get(buffer);
-      if (0 > sz) {
-        // For robustness, try to query this value from the GL as we used to
-        // FIXME: both functions return 'int' types, which is not suitable,
-        // since buffer lenght is 64bit ?
-        int[] tmp = new int[1];
-        if(0==target) {
-            // DirectState ..
-            if(caller.isFunctionAvailable("glGetNamedBufferParameterivEXT")) {
-                caller.getGL2().glGetNamedBufferParameterivEXT(buffer, GL.GL_BUFFER_SIZE, tmp, 0);
-            } else {
-                throw new GLException("Error: getDirectStateBufferSize called with unknown state and GL function 'glGetNamedBufferParameterivEXT' n/a to query size");
-            }
-        } else {
-            caller.glGetBufferParameteriv(target, GL.GL_BUFFER_SIZE, tmp, 0);
-        }
-        if (tmp[0] == 0) {
-          // Assume something is wrong rather than silently going along
-          throw new GLException("Error: buffer size returned by "+
-                                ((0==target)?"glGetNamedBufferParameterivEXT":"glGetBufferParameteriv")+
-                                " was zero; probably application error");
-        }
-        // Assume we just don't know what's happening
-        sz = (long) tmp[0];
-        bufferSizeMap.put(buffer, sz);
-        if (DEBUG) {
-          System.err.println("GLBufferSizeTracker.getBufferSize(): made slow query to cache size " +
-                             sz +
-                             " for buffer " +
-                             buffer);
-        }
-      }
-      return sz;
-  }
-
-  // This should be called on any major event where we might start
-  // producing wrong answers, such as OpenGL context creation and
-  // destruction if we don't know whether there are other currently-
-  // created contexts that might be keeping the buffer objects alive
-  // that we're dealing with
-  public void clearCachedBufferSizes() {
-    bufferSizeMap.clear();
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLBufferStateTracker.java b/src/jogl/classes/com/jogamp/opengl/impl/GLBufferStateTracker.java
deleted file mode 100644
index 680fdc9..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLBufferStateTracker.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import javax.media.opengl.*;
-import com.jogamp.common.util.IntIntHashMap;
-
-/**
- * Tracks as closely as possible which OpenGL buffer object is bound
- * to which binding target in the current OpenGL context.
- * GLBufferStateTracker objects are allocated on a per-OpenGL-context basis.
- * This class is used to verify that e.g. the vertex
- * buffer object extension is in use when the glVertexPointer variant
- * taking a long as argument is called. <P>
- * 
- * Note that because the enumerated value used for the binding of a
- * buffer object (e.g. GL_ARRAY_BUFFER) is different than that used to
- * query the binding using glGetIntegerv (e.g.
- * GL_ARRAY_BUFFER_BINDING), then in the face of new binding targets
- * being added to the GL (e.g. GL_TRANSFORM_FEEDBACK_BUFFER_NV) it is
- * impossible to set up a query of the buffer object currently bound
- * to a particular state. It turns out that for some uses, such as
- * finding the size of the currently bound buffer, this doesn't
- * matter, though of course without knowing the buffer object we can't
- * re-associate the queried size with the buffer object ID. <P>
- *
- * Because the namespace of buffer objects is the unsigned integers
- * with 0 reserved by the GL, and because we have to be able to return
- * both 0 and other integers as valid answers from
- * getBoundBufferObject(), we need a second query, which is to ask
- * whether we know the state of the binding for a given target. For
- * "unknown" targets such as GL_TRANSFORM_FEEDBACK_BUFFER_NV we return
- * false from this, but we also clear the valid bit and later refresh
- * the binding state if glPushClientAttrib / glPopClientAttrib are
- * called, since we don't want the complexity of tracking stacks of
- * these attributes.
- *
- */
-
-public class GLBufferStateTracker {
-  protected static final boolean DEBUG = GLBufferSizeTracker.DEBUG;
-
-  // Maps binding targets to buffer objects. A null value indicates
-  // that the binding is unknown. A zero value indicates that it is
-  // known that no buffer is bound to the target, according to the 
-  // OpenGL specifications. 
-  // http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml
-  private IntIntHashMap bindingMap;
-
-  private int[] bufTmp = new int[1];
-
-  public GLBufferStateTracker() {
-    bindingMap = new IntIntHashMap();
-    bindingMap.setKeyNotFoundValue(-1);
-
-    // Start with known unbound targets for known keys
-    bindingMap.put(GL.GL_ARRAY_BUFFER,         0);
-    bindingMap.put(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
-    bindingMap.put(GL2.GL_PIXEL_PACK_BUFFER,   0);
-    bindingMap.put(GL2.GL_PIXEL_UNPACK_BUFFER, 0);
-  }
-
-  public void setBoundBufferObject(int target, int buffer) {
-    bindingMap.put(target, buffer);
-  }
-
-  /** Note: returns an unspecified value if the binding for the
-      specified target (e.g. GL_ARRAY_BUFFER) is currently unknown.
-      You must use isBoundBufferObjectKnown() to see whether the
-      return value is valid. */
-  public int getBoundBufferObject(int target, GL caller) {
-    int value = bindingMap.get(target);
-    if (0 > value) {
-      // User probably either called glPushClientAttrib /
-      // glPopClientAttrib or is querying an unknown target. See
-      // whether we know how to fetch this state.
-      boolean gotQueryTarget = true;
-      int queryTarget = 0;
-      switch (target) {
-        case GL.GL_ARRAY_BUFFER:          queryTarget = GL.GL_ARRAY_BUFFER_BINDING;         break;
-        case GL.GL_ELEMENT_ARRAY_BUFFER:  queryTarget = GL.GL_ELEMENT_ARRAY_BUFFER_BINDING; break;
-        case GL2.GL_PIXEL_PACK_BUFFER:    queryTarget = GL2.GL_PIXEL_PACK_BUFFER_BINDING;    break;
-        case GL2.GL_PIXEL_UNPACK_BUFFER:  queryTarget = GL2.GL_PIXEL_UNPACK_BUFFER_BINDING;  break;
-        default:                          gotQueryTarget = false; break;
-      }
-      if (gotQueryTarget) {
-        caller.glGetIntegerv(queryTarget, bufTmp, 0);
-        if (DEBUG) {
-          System.err.println("GLBufferStateTracker.getBoundBufferObject(): queried bound buffer " +
-                             bufTmp[0] +
-                             " for query target 0x" + Integer.toHexString(queryTarget));
-        }
-        setBoundBufferObject(target, bufTmp[0]);
-        return bufTmp[0];
-      }
-      return 0;
-    }
-    return value;
-  }
-
-  /** Indicates whether the binding state for the specified target is
-      currently known, ie it could be bound or not but it must be tracked.<br>
-      Should be called after getBoundBufferObject()
-      because that method may change the answer for a given target. */
-  public boolean isBoundBufferObjectKnown(int target) {
-    return 0 < bindingMap.get(target) ;
-  }
-
-  /** Clears out the known/unknown state of the various buffer object
-      binding states. These will be refreshed later on an as-needed
-      basis. This is called by the implementations of
-      glPushClientAttrib / glPopClientAttrib. Might want to call this
-      from GLContext.makeCurrent() in the future to possibly increase
-      the robustness of these caches in the face of external native
-      code manipulating OpenGL state. */
-  public void clearBufferObjectState() {
-    bindingMap.clear();
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java
deleted file mode 100644
index 4892303..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java
+++ /dev/null
@@ -1,1224 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import com.jogamp.common.os.DynamicLookupHelper;
-import com.jogamp.common.util.ReflectionUtil;
-import com.jogamp.gluegen.runtime.FunctionAddressResolver;
-import com.jogamp.gluegen.runtime.ProcAddressTable;
-import com.jogamp.gluegen.runtime.opengl.GLExtensionNames;
-import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.NativeSurface;
-import javax.media.opengl.GL;
-import javax.media.opengl.GLCapabilitiesImmutable;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLDrawable;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
-
-public abstract class GLContextImpl extends GLContext {
-  protected static final boolean DEBUG = Debug.debug("GLContext");
-  protected static final boolean VERBOSE = Debug.verbose();
-
-  protected GLContextLock lock = new GLContextLock();
-
-  /**
-   * Context full qualified name: display_type + display_connection + major + minor + ctp.
-   * This is the key for all cached ProcAddressTables, etc, to support multi display/device setups.
-   */
-  protected String contextFQN;
-
-  // Cache of the functions that are available to be called at the current
-  // moment in time
-  protected ExtensionAvailabilityCache extensionAvailability;
-  // Table that holds the addresses of the native C-language entry points for
-  // OpenGL functions.
-  private ProcAddressTable glProcAddressTable;
-
-  // Tracks creation and initialization of buffer objects to avoid
-  // repeated glGet calls upon glMapBuffer operations
-  private GLBufferSizeTracker bufferSizeTracker; // Singleton - Set by GLContextShareSet
-  private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker();
-  private GLStateTracker glStateTracker = new GLStateTracker();
-
-  protected GLDrawableImpl drawable;
-  protected GLDrawableImpl drawableRead;
-
-  protected GL gl;
-
-  protected static final Object mappedContextTypeObjectLock;
-  protected static final HashMap mappedExtensionAvailabilityCache;
-  protected static final HashMap mappedGLProcAddress;
-  protected static final HashMap mappedGLXProcAddress;
-
-  static {
-      mappedContextTypeObjectLock = new Object();
-      mappedExtensionAvailabilityCache = new HashMap();
-      mappedGLProcAddress = new HashMap();
-      mappedGLXProcAddress = new HashMap();
-  }
-
-  public GLContextImpl(GLDrawableImpl drawable, GLDrawableImpl drawableRead, GLContext shareWith) {
-    super();
-
-    if (shareWith != null) {
-      GLContextShareSet.registerSharing(this, shareWith);
-    }
-    GLContextShareSet.registerForBufferObjectSharing(shareWith, this);
-
-    this.drawable = drawable;
-    setGLDrawableRead(drawableRead);
-  }
-
-  public GLContextImpl(GLDrawableImpl drawable, GLContext shareWith) {
-    this(drawable, null, shareWith);
-  }
-
-  protected void resetStates() {
-      // Because we don't know how many other contexts we might be
-      // sharing with (and it seems too complicated to implement the
-      // GLObjectTracker's ref/unref scheme for the buffer-related
-      // optimizations), simply clear the cache of known buffers' sizes
-      // when we destroy contexts
-      if (bufferSizeTracker != null) {
-          bufferSizeTracker.clearCachedBufferSizes();
-      }
-
-      if (bufferStateTracker != null) {
-          bufferStateTracker.clearBufferObjectState();
-      }
-
-      if (glStateTracker != null) {
-          glStateTracker.clearStates(false);
-      }
-
-      extensionAvailability = null;
-      glProcAddressTable = null;
-      gl = null;
-      contextFQN = null;
-
-      super.resetStates();
-  }
-
-  public void setGLDrawableRead(GLDrawable read) {
-    boolean lockHeld = lock.isHeld();
-    if(lockHeld) {
-        release();
-    }
-    drawableRead = ( null != read ) ? (GLDrawableImpl) read : drawable;
-    if(lockHeld) {
-        makeCurrent();
-    }
-  }
-
-  public GLDrawable getGLDrawable() {
-    return drawable;
-  }
-
-  public GLDrawable getGLDrawableRead() {
-    return drawableRead;
-  }
-
-  public GLDrawableImpl getDrawableImpl() {
-    return (GLDrawableImpl) getGLDrawable();
-  }
-
-  public final GL getGL() {
-    return gl;
-  }
-
-  public GL setGL(GL gl) {
-    if(DEBUG) {
-        String sgl1 = (null!=this.gl)?this.gl.getClass().toString()+", "+this.gl.toString():"<null>";
-        String sgl2 = (null!=gl)?gl.getClass().toString()+", "+gl.toString():"<null>";
-        Exception e = new Exception("Info: setGL (OpenGL "+getGLVersion()+"): "+Thread.currentThread()+", "+sgl1+" -> "+sgl2);
-        e.printStackTrace();
-    }
-    this.gl = gl;
-    return gl;
-  }
-
-  // This is only needed for Mac OS X on-screen contexts
-  protected void update() throws GLException { }
-
-  public boolean isSynchronized() {
-    return !lock.getFailFastMode();
-  }
-
-  public void setSynchronized(boolean isSynchronized) {
-    lock.setFailFastMode(!isSynchronized);
-  }
-
-  public abstract Object getPlatformGLExtensions();
-
-  // Note: the surface is locked within [makeCurrent .. swap .. release]
-  public void release() throws GLException {
-    if (!lock.isHeld()) {
-      throw new GLException("Context not current on current thread");
-    }
-    setCurrent(null);
-    try {
-        releaseImpl();
-    } finally {
-      if (drawable.isSurfaceLocked()) {
-          drawable.unlockSurface();
-      }
-      lock.unlock();
-    }
-  }
-  protected abstract void releaseImpl() throws GLException;
-
-  public final void destroy() {
-    if (lock.isHeld()) {
-        // release current context 
-        release();
-    }
-
-    // Must hold the lock around the destroy operation to make sure we
-    // don't destroy the context out from under another thread rendering to it
-    lock.lock();
-    try {
-      /* FIXME: refactor dependence on Java 2D / JOGL bridge
-      if (tracker != null) {
-        // Don't need to do anything for contexts that haven't been
-        // created yet
-        if (isCreated()) {
-          // If we are tracking creation and destruction of server-side
-          // OpenGL objects, we must decrement the reference count of the
-          // GLObjectTracker upon context destruction.
-          //
-          // Note that we can only eagerly delete these server-side
-          // objects if there is another context currrent right now
-          // which shares textures and display lists with this one.
-          tracker.unref(deletedObjectTracker);
-        }
-      }
-      */
-
-      if (contextHandle != 0) {
-          int lockRes = drawable.lockSurface();
-          if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) {
-                // this would be odd ..
-                throw new GLException("Surface not ready to lock: "+drawable);
-          }
-          try {
-              destroyImpl();
-              contextHandle = 0;
-              GLContextShareSet.contextDestroyed(this);
-          } finally {
-              drawable.unlockSurface();
-          }
-      }
-    } finally {
-      lock.unlock();
-    }
-
-    resetStates();
-  }
-  protected abstract void destroyImpl() throws GLException;
-
-  public final void copy(GLContext source, int mask) throws GLException {
-    if (source.getHandle() == 0) {
-      throw new GLException("Source OpenGL context has not been created");
-    }
-    if (getHandle() == 0) {
-      throw new GLException("Destination OpenGL context has not been created");
-    }
-
-    int lockRes = drawable.lockSurface();
-    if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) {
-        // this would be odd ..
-        throw new GLException("Surface not ready to lock");
-    }
-    try {
-        copyImpl(source, mask);
-    } finally {
-      drawable.unlockSurface();
-    }
-  }
-  protected abstract void copyImpl(GLContext source, int mask) throws GLException;
-
-  //----------------------------------------------------------------------
-  //
-
-  /**
-   * MakeCurrent functionality, which also issues the creation of the actual OpenGL context.<br>
-   * The complete callgraph for general OpenGL context creation is:<br>
-   * <ul>
-   *    <li> {@link #makeCurrent} <i>GLContextImpl</i></li>
-   *    <li> {@link #makeCurrentImpl} <i>Platform Implementation</i></li>
-   *    <li> {@link #create} <i>Platform Implementation</i></li>
-   *    <li> If <code>ARB_create_context</code> is supported:
-   *    <ul>
-   *        <li> {@link #createContextARB} <i>GLContextImpl</i></li>
-   *        <li> {@link #createContextARBImpl} <i>Platform Implementation</i></li>
-   *    </ul></li>
-   * </ul><br>
-   *
-   * Once at startup, ie triggered by the singleton constructor of a {@link GLDrawableFactoryImpl} specialization,
-   * calling {@link #createContextARB} will query all available OpenGL versions:<br>
-   * <ul>
-   *    <li> <code>FOR ALL GL* DO</code>:
-   *    <ul>
-   *        <li> {@link #createContextARBMapVersionsAvailable}
-   *        <ul>
-   *            <li> {@link #createContextARBVersions}</li>
-   *        </ul></li>
-   *        <li> {@link #mapVersionAvailable}</li>
-   *    </ul></li>
-   * </ul><br>
-   *
-   * @see #makeCurrentImpl
-   * @see #create
-   * @see #createContextARB
-   * @see #createContextARBImpl
-   * @see #mapVersionAvailable
-   * @see #destroyContextARBImpl
-   */
-  public int makeCurrent() throws GLException {
-    // One context can only be current by one thread,
-    // and one thread can only have one context current!
-    GLContext current = getCurrent();
-    if (current != null) {
-      if (current == this) {
-        // Assume we don't need to make this context current again
-        // For Mac OS X, however, we need to update the context to track resizes
-        update();
-        return CONTEXT_CURRENT;
-      } else {
-        current.release();
-      }
-    }
-
-    if (GLWorkerThread.isStarted() &&
-        !GLWorkerThread.isWorkerThread()) {
-      // Kick the GLWorkerThread off its current context
-      GLWorkerThread.invokeLater(new Runnable() { public void run() {} });
-    }
-
-    if (!isCreated()) {
-        // verify if the drawable has chosen Capabilities
-        if (null == getGLDrawable().getChosenGLCapabilities()) {
-            throw new GLException("drawable has no chosen GLCapabilities: "+getGLDrawable());
-        }
-    }
-
-    lock.lock();
-    int res = 0;
-    try {
-      res = makeCurrentLocking();
-
-      /* FIXME: refactor dependence on Java 2D / JOGL bridge
-      if ((tracker != null) &&
-          (res == CONTEXT_CURRENT_NEW)) {
-        // Increase reference count of GLObjectTracker
-        tracker.ref();
-      }
-      */
-    } catch (GLException e) {
-      lock.unlock();
-      throw(e);
-    }
-    if (res == CONTEXT_NOT_CURRENT) {
-      lock.unlock();
-    } else {
-      if(res == CONTEXT_CURRENT_NEW) {
-        // check if the drawable's and the GL's GLProfile are equal
-        // throws an GLException if not 
-        getGLDrawable().getGLProfile().verifyEquality(gl.getGLProfile());
-      }
-      setCurrent(this);
-
-      /* FIXME: refactor dependence on Java 2D / JOGL bridge
-
-      // Try cleaning up any stale server-side OpenGL objects
-      // FIXME: not sure what to do here if this throws
-      if (deletedObjectTracker != null) {
-        deletedObjectTracker.clean(getGL());
-      }
-      */
-    }
-    return res;
-  }
-
-  // Note: the surface is locked within [makeCurrent .. swap .. release]
-  protected final int makeCurrentLocking() throws GLException {
-    boolean exceptionOccurred = false;
-    int lockRes = drawable.lockSurface();
-    try {
-      if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) {
-        return CONTEXT_NOT_CURRENT;
-      }
-      try {
-          if (NativeSurface.LOCK_SURFACE_CHANGED == lockRes) {
-            drawable.updateHandle();
-          }
-          if (0 == drawable.getHandle()) {
-              throw new GLException("drawable has invalid handle: "+drawable);
-          }
-          boolean newCreated = false;
-          if (!isCreated()) {
-            GLProfile.initProfiles(
-                    getGLDrawable().getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice());
-            newCreated = createImpl(); // may throws exception if fails!
-            if (DEBUG) {
-                if(newCreated) {
-                    System.err.println(getThreadName() + ": !!! Create GL context OK: " + toHexString(contextHandle) + " for " + getClass().getName());
-                } else {
-                    System.err.println(getThreadName() + ": !!! Create GL context FAILED for " + getClass().getName());
-                }
-            }
-            if(!newCreated) {
-                return CONTEXT_NOT_CURRENT;
-            }
-            GLContextShareSet.contextCreated(this);
-          }
-          makeCurrentImpl(newCreated);
-          return newCreated ? CONTEXT_CURRENT_NEW : CONTEXT_CURRENT ;
-      } catch (RuntimeException e) {
-        exceptionOccurred = true;
-        throw e;
-      }
-    } finally {
-      if (exceptionOccurred) {
-        drawable.unlockSurface();
-      }
-    }
-  }
-  protected abstract void makeCurrentImpl(boolean newCreatedContext) throws GLException;
-  protected abstract boolean createImpl() throws GLException ;
-
-  /** 
-   * Platform dependent but harmonized implementation of the <code>ARB_create_context</code>
-   * mechanism to create a context.<br>
-   *
-   * This method is called from {@link #createContextARB}.<br>
-   *
-   * The implementation shall verify this context with a 
-   * <code>MakeContextCurrent</code> call.<br>
-   *
-   * The implementation shall leave the context current.<br>
-   *
-   * @param share the shared context or null
-   * @param direct flag if direct is requested
-   * @param ctxOptionFlags <code>ARB_create_context</code> related, see references below
-   * @param major major number
-   * @param minor minor number
-   * @return the valid context if successfull, or null
-   *
-   * @see #makeCurrent
-   * @see #CTX_PROFILE_COMPAT
-   * @see #CTX_OPTION_FORWARD
-   * @see #CTX_OPTION_DEBUG
-   * @see #makeCurrentImpl
-   * @see #create
-   * @see #createContextARB
-   * @see #createContextARBImpl
-   * @see #destroyContextARBImpl
-   */
-  protected abstract long createContextARBImpl(long share, boolean direct, int ctxOptionFlags, 
-                                               int major, int minor);
-
-  /**
-   * Destroy the context created by {@link #createContextARBImpl}.
-   *
-   * @see #makeCurrent
-   * @see #makeCurrentImpl
-   * @see #create
-   * @see #createContextARB
-   * @see #createContextARBImpl
-   * @see #destroyContextARBImpl
-   */
-  protected abstract void destroyContextARBImpl(long context);
-
-  /**
-   * Platform independent part of using the <code>ARB_create_context</code>
-   * mechanism to create a context.<br>
-   *
-   * The implementation of {@link #create} shall use this protocol in case the platform supports <code>ARB_create_context</code>.<br>
-   *
-   * This method may call {@link #createContextARBImpl} and {@link #destroyContextARBImpl}. <br>
-   *
-   * This method will also query all available native OpenGL context when first called,<br>
-   * usually the first call should happen with the shared GLContext of the DrawableFactory.<br>
-   *
-   * The implementation makes the context current, if successful<br>
-   *
-   * @see #makeCurrentImpl
-   * @see #create
-   * @see #createContextARB
-   * @see #createContextARBImpl
-   * @see #destroyContextARBImpl
-   */
-  protected final long createContextARB(long share, boolean direct,
-                                        int major[], int minor[], int ctp[]) 
-  {
-    AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    AbstractGraphicsDevice device = config.getScreen().getDevice();
-    GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
-    GLProfile glp = glCaps.getGLProfile();
-
-    if (DEBUG) {
-      System.err.println(getThreadName() + ": !!! createContextARB: mappedVersionsAvailableSet("+device.getConnection()+"): "+
-               GLContext.getAvailableGLVersionsSet(device));
-    }
-
-    mapGLVersions(device);
-
-    int reqMajor;
-    if(glp.isGL4()) {
-        reqMajor=4;
-    } else if (glp.isGL3()) {
-        reqMajor=3;
-    } else /* if (glp.isGL2()) */ {
-        reqMajor=2;
-    }
-
-    boolean compat = glp.isGL2(); // incl GL3bc and GL4bc
-    int _major[] = { 0 };
-    int _minor[] = { 0 };
-    int _ctp[] = { 0 };
-    long _ctx = 0;
-
-    if( GLContext.getAvailableGLVersion(device, reqMajor, compat?CTX_PROFILE_COMPAT:CTX_PROFILE_CORE,
-                                        _major, _minor, _ctp)) {
-        _ctx = createContextARBImpl(share, direct, _ctp[0], _major[0], _minor[0]);
-        if(0!=_ctx) {
-            setGLFunctionAvailability(true, _major[0], _minor[0], _ctp[0]);
-        }
-    }
-    return _ctx;
-  }
-
-  private final void mapGLVersions(AbstractGraphicsDevice device) {
-    if ( !GLContext.getAvailableGLVersionsSet(device) ) {
-        synchronized (GLContext.deviceVersionAvailable) {
-            createContextARBMapVersionsAvailable(4, false /* core   */);  // GL4
-            createContextARBMapVersionsAvailable(4, true  /* compat */);  // GL4bc
-            createContextARBMapVersionsAvailable(3, false /* core   */);  // GL3
-            createContextARBMapVersionsAvailable(3, true  /* compat */);  // GL3bc
-            createContextARBMapVersionsAvailable(2, true  /* compat */);  // GL2
-            GLContext.setAvailableGLVersionsSet(device);
-        }
-    } else {
-        if(DEBUG) {
-            System.err.println(getThreadName() + ": no mapping, all versions set "+device.getConnection());
-        }
-    }
-  }
-
-  private final void createContextARBMapVersionsAvailable(int reqMajor, boolean compat)
-  {
-    resetStates();
-
-    long _context;
-    int reqProfile = compat ? CTX_PROFILE_COMPAT : CTX_PROFILE_CORE ;
-    int ctp = CTX_IS_ARB_CREATED | CTX_PROFILE_CORE | CTX_OPTION_ANY; // default
-    if(compat) {
-        ctp &= ~CTX_PROFILE_CORE ;
-        ctp |=  CTX_PROFILE_COMPAT ;
-    }
-
-    // FIXME GL3GL4:
-    // To avoid OpenGL implementation bugs and raise compatibility
-    // within JOGL, we map to the proper GL version.
-    // This may change later when GL3 and GL4 drivers become more mature!
-    // Bug: To ensure GL profile compatibility within the JOGL application
-    // Bug: we always try to map against the highest GL version,
-    // Bug: so the use can always cast to a higher one
-    // Bug: int majorMax=GLContext.getMaxMajor(); 
-    // Bug: int minorMax=GLContext.getMaxMinor(majorMax);
-    int majorMax, minorMax;
-    int majorMin, minorMin;
-    int major[] = new int[1];
-    int minor[] = new int[1];
-    if( 4 == reqMajor ) {
-        majorMax=4; minorMax=GLContext.getMaxMinor(majorMax);
-        majorMin=4; minorMin=0;
-    } else if( 3 == reqMajor ) {
-        majorMax=3; minorMax=GLContext.getMaxMinor(majorMax);
-        majorMin=3; minorMin=1;
-    } else /* if( glp.isGL2() ) */ {
-        majorMax=3; minorMax=0;
-        majorMin=1; minorMin=1; // our minimum desktop OpenGL runtime requirements
-    }
-    _context = createContextARBVersions(0, true, ctp, 
-                                        /* max */ majorMax, minorMax,
-                                        /* min */ majorMin, minorMin,
-                                        /* res */ major, minor);
-
-    if(0==_context && !compat) {
-        ctp &= ~CTX_PROFILE_COMPAT ;
-        ctp |=  CTX_PROFILE_CORE ;
-        ctp &= ~CTX_OPTION_ANY ;
-        ctp |=  CTX_OPTION_FORWARD ;
-        _context = createContextARBVersions(0, true, ctp, 
-                                            /* max */ majorMax, minorMax,
-                                            /* min */ majorMin, minorMin,
-                                            /* res */ major, minor);
-       if(0==_context) {
-            // Try a compatible one .. even though not requested .. last resort
-            ctp &= ~CTX_PROFILE_CORE ;
-            ctp |=  CTX_PROFILE_COMPAT ;
-            ctp &= ~CTX_OPTION_FORWARD ;
-            ctp |=  CTX_OPTION_ANY ;
-            _context = createContextARBVersions(0, true, ctp, 
-                                       /* max */ majorMax, minorMax,
-                                       /* min */ majorMin, minorMin,
-                                       /* res */ major, minor);
-       }
-    }
-    if(0!=_context) {
-        AbstractGraphicsDevice device = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice();
-        GLContext.mapAvailableGLVersion(device, reqMajor, reqProfile, major[0], minor[0], ctp);
-        setGLFunctionAvailability(true, major[0], minor[0], ctp);
-        destroyContextARBImpl(_context);
-        resetStates();
-        if (DEBUG) {
-          System.err.println(getThreadName() + ": !!! createContextARBMapVersionsAvailable HAVE: "+
-                  GLContext.getAvailableGLVersionAsString(device, reqMajor, reqProfile));
-        }
-    } else if (DEBUG) {
-        System.err.println(getThreadName() + ": !!! createContextARBMapVersionsAvailable NOPE: "+reqMajor+"."+reqProfile);
-    }
-  }
-
-  private final long createContextARBVersions(long share, boolean direct, int ctxOptionFlags, 
-                                              int majorMax, int minorMax, 
-                                              int majorMin, int minorMin, 
-                                              int major[], int minor[]) {
-    major[0]=majorMax;
-    minor[0]=minorMax;
-    long _context=0;
-
-    while ( 0==_context &&
-            GLContext.isValidGLVersion(major[0], minor[0]) &&
-            ( major[0]>majorMin || major[0]==majorMin && minor[0] >=minorMin ) ) {
-
-        if (DEBUG) {
-            System.err.println(getThreadName() + ": createContextARBVersions: share "+share+", direct "+direct+", version "+major[0]+"."+minor[0]);
-        }
-        _context = createContextARBImpl(share, direct, ctxOptionFlags, major[0], minor[0]);
-
-        if(0==_context) {
-            if(!GLContext.decrementGLVersion(major, minor)) break;
-        }
-    }
-    return _context;
-  }
-
-  //----------------------------------------------------------------------
-  // Managing the actual OpenGL version, usually figured at creation time.
-  // As a last resort, the GL_VERSION string may be used ..
-  //
-
-  /** 
-   * If major > 0 || minor > 0 : Use passed values, determined at creation time 
-   * If major==0 && minor == 0 : Use GL_VERSION
-   * Otherwise .. don't touch ..
-   */
-  private final void setContextVersion(int major, int minor, int ctp) {
-      if (0==ctp) {
-        throw new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
-      }
-      if(major>0 || minor>0) {
-          if (!GLContext.isValidGLVersion(major, minor)) {
-            GLException e = new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
-            throw e;
-          }
-          ctxMajorVersion = major;
-          ctxMinorVersion = minor;
-          ctxOptions = ctp;
-          ctxVersionString = getGLVersion(ctxMajorVersion, ctxMinorVersion, ctxOptions, getGL().glGetString(GL.GL_VERSION));
-          return;
-      }
-
-      if(major==0 && minor==0) {
-          String versionStr = getGL().glGetString(GL.GL_VERSION);
-          if(null==versionStr) {
-            throw new GLException("GL_VERSION is NULL: "+this);
-          }
-          ctxOptions = ctp;
-
-          // Set version
-          Version version = new Version(versionStr);
-          if (version.isValid()) {
-            ctxMajorVersion = version.getMajor();
-            ctxMinorVersion = version.getMinor();
-            // We cannot promote a non ARB context to >= 3.1,
-            // reduce it to 3.0 then.
-            if ( ( ctxMajorVersion>3 || ctxMajorVersion==3 && ctxMinorVersion>=1 )
-                 && 0 == (ctxOptions & CTX_IS_ARB_CREATED) ) {
-                ctxMajorVersion = 3;
-                ctxMinorVersion = 0;
-            }
-            ctxVersionString = getGLVersion(ctxMajorVersion, ctxMinorVersion, ctxOptions, versionStr);
-            return;
-          }
-      }
-  }
-
-  //----------------------------------------------------------------------
-  // Helpers for various context implementations
-  //
-
-  private Object createInstance(GLProfile glp, String suffix, Class[] cstrArgTypes, Object[] cstrArgs) {
-    return ReflectionUtil.createInstance(glp.getGLImplBaseClassName()+suffix, cstrArgTypes, cstrArgs, getClass().getClassLoader());
-  }
-
-  private boolean verifyInstance(GLProfile glp, String suffix, Object instance) {
-    return ReflectionUtil.instanceOf(instance, glp.getGLImplBaseClassName()+suffix);
-  }
-
-  /** Create the GL for this context. */
-  protected GL createGL(GLProfile glp) {
-    GL gl = (GL) createInstance(glp, "Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { glp, this } );
-
-    /* FIXME: refactor dependence on Java 2D / JOGL bridge
-    if (tracker != null) {
-      gl.setObjectTracker(tracker);
-    }
-    */
-    return gl;
-  }
-  
-  public final ProcAddressTable getGLProcAddressTable() {
-    return glProcAddressTable;
-  }
-  
-  /**
-   * Shall return the platform extension ProcAddressTable,
-   * ie for GLXExt, EGLExt, ..
-   */
-  public abstract ProcAddressTable getPlatformExtProcAddressTable();
-
-  /**
-   * Pbuffer support; given that this is a GLContext associated with a
-   * pbuffer, binds this pbuffer to its texture target.
-   */
-  public abstract void bindPbufferToTexture();
-
-  /**
-   * Pbuffer support; given that this is a GLContext associated with a
-   * pbuffer, releases this pbuffer from its texture target.
-   */
-  public abstract void releasePbufferFromTexture();
-
-  public abstract ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3);
-
-  public final void setSwapInterval(final int interval) {
-    GLContext current = getCurrent();
-    if (current != this) {
-        throw new GLException("This context is not current. Current context: "+current+
-                              ", this context "+this);
-    }
-    setSwapIntervalImpl(interval);
-  }
-  protected void setSwapIntervalImpl(final int interval) { /** nop per default .. **/  }
-  protected int currentSwapInterval = -1; // default: not set yet ..
-  public int getSwapInterval() {
-    return currentSwapInterval;
-  }
-
-  /** Maps the given "platform-independent" function name to a real function
-      name. Currently this is only used to map "glAllocateMemoryNV" and
-      associated routines to wglAllocateMemoryNV / glXAllocateMemoryNV. */
-  protected String mapToRealGLFunctionName(String glFunctionName) {
-    Map/*<String, String>*/ map = getFunctionNameMap();
-    String lookup = ( null != map ) ? (String) map.get(glFunctionName) : null;
-    if (lookup != null) {
-      return lookup;
-    }
-    return glFunctionName;
-  }
-  protected abstract Map/*<String, String>*/ getFunctionNameMap() ;
-
-  /** Maps the given "platform-independent" extension name to a real
-      function name. Currently this is only used to map
-      "GL_ARB_pbuffer"      to  "WGL_ARB_pbuffer/GLX_SGIX_pbuffer" and 
-      "GL_ARB_pixel_format" to  "WGL_ARB_pixel_format/n.a." 
-   */
-  protected String mapToRealGLExtensionName(String glExtensionName) {
-    Map/*<String, String>*/ map = getExtensionNameMap();
-    String lookup = ( null != map ) ? (String) map.get(glExtensionName) : null;
-    if (lookup != null) {
-      return lookup;
-    }
-    return glExtensionName;
-  }
-  protected abstract Map/*<String, String>*/ getExtensionNameMap() ;
-
-  /** Helper routine which resets a ProcAddressTable generated by the
-      GLEmitter by looking up anew all of its function pointers. */
-  protected void resetProcAddressTable(ProcAddressTable table) {
-    table.reset(getDrawableImpl().getGLDynamicLookupHelper() );
-  }
-
-  /**
-   * Sets the OpenGL implementation class and
-   * the cache of which GL functions are available for calling through this
-   * context. See {@link #isFunctionAvailable(String)} for more information on
-   * the definition of "available".
-   * <br>
-   * All ProcaddressTables are being determined, the GL version is being set
-   * and the extension cache is determined as well.
-   *
-   * @param force force the setting, even if is already being set.
-   *              This might be useful if you change the OpenGL implementation.
-   *
-   * @see #setContextVersion
-   */
-
-  protected final void setGLFunctionAvailability(boolean force, int major, int minor, int ctp) {
-    if(null!=this.gl && null!=glProcAddressTable && !force) {
-        return; // already done and not forced
-    }
-    if(null==this.gl || force) {
-        setGL(createGL(getGLDrawable().getGLProfile()));
-    }
-
-    AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice();
-    contextFQN = getContextFQN(adevice, major, minor, ctp);
-    if (DEBUG) {
-      System.err.println(getThreadName() + ": !!! Context FQN: "+contextFQN);
-    }
-
-    updateGLXProcAddressTable(major, minor, ctp);
-
-    //
-    // UpdateGLProcAddressTable functionality
-    //
-    if(null==this.gl) {
-        throw new GLException("setGLFunctionAvailability not called yet");
-    }
-
-    ProcAddressTable table = null;
-    synchronized(mappedContextTypeObjectLock) {
-        table = (ProcAddressTable) mappedGLProcAddress.get( contextFQN );
-        if(null != table && !verifyInstance(gl.getGLProfile(), "ProcAddressTable", table)) {
-            throw new InternalError("GLContext GL ProcAddressTable mapped key("+contextFQN+") -> "+
-                  table.getClass().getName()+" not matching "+gl.getGLProfile().getGLImplBaseClassName());
-        }
-    }
-    if(null != table) {
-        glProcAddressTable = table;
-        if(DEBUG) {
-            System.err.println(getThreadName() + ": !!! GLContext GL ProcAddressTable reusing key("+contextFQN+") -> "+table.hashCode());
-        }
-    } else {
-        if (glProcAddressTable == null) {
-          glProcAddressTable = (ProcAddressTable) createInstance(gl.getGLProfile(), "ProcAddressTable",
-                                                                 new Class[] { FunctionAddressResolver.class } ,
-                                                                 new Object[] { new GLProcAddressResolver() } );
-        }
-        resetProcAddressTable(getGLProcAddressTable());
-        synchronized(mappedContextTypeObjectLock) {
-            mappedGLProcAddress.put(contextFQN, getGLProcAddressTable());
-            if(DEBUG) {
-                System.err.println(getThreadName() + ": !!! GLContext GL ProcAddressTable mapping key("+contextFQN+") -> "+getGLProcAddressTable().hashCode());
-            }
-        }
-    }
-
-    //
-    // Set GL Version
-    //
-    setContextVersion(major, minor, ctp);
-
-    //
-    // Update ExtensionAvailabilityCache
-    //
-    ExtensionAvailabilityCache eCache;
-    synchronized(mappedContextTypeObjectLock) {
-        eCache = (ExtensionAvailabilityCache) mappedExtensionAvailabilityCache.get( contextFQN );
-    }
-    if(null !=  eCache) {
-        extensionAvailability = eCache;
-        if(DEBUG) {
-            System.err.println(getThreadName() + ": !!! GLContext GL ExtensionAvailabilityCache reusing key("+contextFQN+") -> "+eCache.hashCode());
-        }
-    } else {
-        if(null==extensionAvailability) {
-            extensionAvailability = new ExtensionAvailabilityCache(this);
-        }
-        extensionAvailability.reset();
-        synchronized(mappedContextTypeObjectLock) {
-            mappedExtensionAvailabilityCache.put(contextFQN, extensionAvailability);
-            if(DEBUG) {
-                System.err.println(getThreadName() + ": !!! GLContext GL ExtensionAvailabilityCache mapping key("+contextFQN+") -> "+extensionAvailability.hashCode());
-            }
-        }
-    }
-
-    hasNativeES2Methods = isGLES2() || isExtensionAvailable("GL_ARB_ES2_compatibility") ;
-  }
-
-  /**
-   * Updates the platform's 'GLX' function cache
-   */
-  protected abstract void updateGLXProcAddressTable(int major, int minor, int ctp);
-
-  protected boolean hasNativeES2Methods = false;
-
-  public final boolean hasNativeES2Methods() { return hasNativeES2Methods; }
-
-  /**
-   * Returns true if the specified OpenGL core- or extension-function can be
-   * successfully called using this GL context given the current host (OpenGL
-   * <i>client</i>) and display (OpenGL <i>server</i>) configuration.
-   *
-   * See {@link GL#isFunctionAvailable(String)} for more details.
-   *
-   * @param glFunctionName the name of the OpenGL function (e.g., use
-   * "glPolygonOffsetEXT" or "glPolygonOffset" to check if the {@link
-   * javax.media.opengl.GL#glPolygonOffset(float,float)} is available).
-   */
-  public boolean isFunctionAvailable(String glFunctionName) {
-    // Check GL 1st (cached)
-    ProcAddressTable pTable = getGLProcAddressTable(); // null if ctx not created once
-    if(null!=pTable) {
-        try {
-            if(0!=pTable.getAddressFor(glFunctionName)) {
-                return true;
-            }
-        } catch (Exception e) {}
-    }
-
-    // Check platform extensions 2nd (cached) - had to be enabled once
-    pTable = getPlatformExtProcAddressTable(); // null if ctx not created once
-    if(null!=pTable) {
-        try {
-            if(0!=pTable.getAddressFor(glFunctionName)) {
-                return true;
-            }
-        } catch (Exception e) {}
-    }
-
-    // dynamic function lookup at last incl name aliasing (not cached)
-    DynamicLookupHelper dynLookup = getDrawableImpl().getGLDynamicLookupHelper();
-    String tmpBase = GLExtensionNames.normalizeVEN(GLExtensionNames.normalizeARB(glFunctionName, true), true);
-    long addr = 0;
-    int  variants = GLExtensionNames.getFuncNamePermutationNumber(tmpBase);
-    for(int i = 0; 0==addr && i < variants; i++) {
-        String tmp = GLExtensionNames.getFuncNamePermutation(tmpBase, i);
-        try {
-            addr = dynLookup.dynamicLookupFunction(tmp);
-        } catch (Exception e) { }
-    }
-    if(0!=addr) {
-        return true;
-    }
-    return false;
-  }
-
-  /**
-   * Returns true if the specified OpenGL extension can be
-   * successfully called using this GL context given the current host (OpenGL
-   * <i>client</i>) and display (OpenGL <i>server</i>) configuration.
-   *
-   * See {@link GL#isExtensionAvailable(String)} for more details.
-   *
-   * @param glExtensionName the name of the OpenGL extension (e.g.,
-   * "GL_VERTEX_PROGRAM_ARB").
-   */
-  public boolean isExtensionAvailable(String glExtensionName) {
-      if(null!=extensionAvailability) {
-        return extensionAvailability.isExtensionAvailable(mapToRealGLExtensionName(glExtensionName));
-      }
-      return false;
-  }
-
-  public String getPlatformExtensionsString() {
-      if(null!=extensionAvailability) {
-        return extensionAvailability.getPlatformExtensionsString();
-      }
-      return null;
-  }
-
-  public String getGLExtensions() {
-      if(null!=extensionAvailability) {
-        return extensionAvailability.getGLExtensions();
-      }
-      return null;
-  }
-
-  public boolean isExtensionCacheInitialized() {
-      if(null!=extensionAvailability) {
-        return extensionAvailability.isInitialized();
-      }
-      return false;
-  }
-
-  /** Indicates which floating-point pbuffer implementation is in
-      use. Returns one of GLPbuffer.APPLE_FLOAT, GLPbuffer.ATI_FLOAT,
-      or GLPbuffer.NV_FLOAT. */
-  public int getFloatingPointMode() throws GLException {
-    throw new GLException("Not supported on non-pbuffer contexts");
-  }
-
-  /** On some platforms the mismatch between OpenGL's coordinate
-      system (origin at bottom left) and the window system's
-      coordinate system (origin at top left) necessitates a vertical
-      flip of pixels read from offscreen contexts. */
-  public abstract boolean offscreenImageNeedsVerticalFlip();
-
-  /** Only called for offscreen contexts; needed by glReadPixels */
-  public abstract int getOffscreenContextPixelDataType();
-
-  //----------------------------------------------------------------------
-  // Helpers for buffer object optimizations
-  
-  public void setBufferSizeTracker(GLBufferSizeTracker bufferSizeTracker) {
-    this.bufferSizeTracker = bufferSizeTracker;
-  }
-
-  public GLBufferSizeTracker getBufferSizeTracker() {
-    return bufferSizeTracker;
-  }
-
-  public GLBufferStateTracker getBufferStateTracker() {
-    return bufferStateTracker;
-  }
-
-  public GLStateTracker getGLStateTracker() {
-    return glStateTracker;
-  }
-
-  //---------------------------------------------------------------------------
-  // Helpers for context optimization where the last context is left
-  // current on the OpenGL worker thread
-  //
-
-  public boolean hasWaiters() {
-    return lock.hasWaiters();
-  }
-
-  /* FIXME: needed only by the Java 2D / JOGL bridge; refactor
-
-  public GLContextImpl(GLContext shareWith) {
-    this(shareWith, false);
-  }
-  
-  public GLContextImpl(GLContext shareWith, boolean dontShareWithJava2D) {
-    extensionAvailability = new ExtensionAvailabilityCache(this);
-    GLContext shareContext = shareWith;
-    if (!dontShareWithJava2D) {
-      shareContext = Java2D.filterShareContext(shareWith);
-    }
-    if (shareContext != null) {
-      GLContextShareSet.registerSharing(this, shareContext);
-    }
-    // Always indicate real behind-the-scenes sharing to track deleted objects
-    if (shareContext == null) {
-      shareContext = Java2D.filterShareContext(shareWith);
-    }
-    GLContextShareSet.registerForObjectTracking(shareWith, this, shareContext);
-    GLContextShareSet.registerForBufferObjectSharing(shareWith, this);
-    // This must occur after the above calls into the
-    // GLContextShareSet, which set up state needed by the GL object
-    setGL(createGL());
-  }
-
-  //---------------------------------------------------------------------------
-  // Helpers for integration with Java2D/OpenGL pipeline when FBOs are
-  // being used
-  //
-
-  public void setObjectTracker(GLObjectTracker tracker) {
-    this.tracker = tracker;
-  }
-  
-  public GLObjectTracker getObjectTracker() {
-    return tracker;
-  }
-
-  public void setDeletedObjectTracker(GLObjectTracker deletedObjectTracker) {
-    this.deletedObjectTracker = deletedObjectTracker;
-  }
-
-  public GLObjectTracker getDeletedObjectTracker() {
-    return deletedObjectTracker;
-  }
-
-  // Tracks creation and deletion of server-side OpenGL objects when
-  // the Java2D/OpenGL pipeline is active and using FBOs to render
-  private GLObjectTracker tracker;
-  // Supports deletion of these objects when no other context is
-  // current which can support immediate deletion of them
-  private GLObjectTracker deletedObjectTracker;
-
-  */
-
-  /**
-   * A class for storing and comparing OpenGL version numbers.
-   * This only works for desktop OpenGL at the moment.
-   */
-  private static class Version implements Comparable
-  {
-    private boolean valid;
-    private int major, minor, sub;
-    public Version(int majorRev, int minorRev, int subMinorRev)
-    {
-      major = majorRev;
-      minor = minorRev;
-      sub = subMinorRev;
-    }
-
-    /**
-     * @param versionString must be of the form "GL_VERSION_X" or
-     * "GL_VERSION_X_Y" or "GL_VERSION_X_Y_Z" or "X.Y", where X, Y,
-     * and Z are integers.
-     *
-     * @exception IllegalArgumentException if the argument is not a valid
-     * OpenGL version identifier
-     */
-    public Version(String versionString)
-    {
-      try 
-      {
-        if (versionString.startsWith("GL_VERSION_"))
-        {
-          StringTokenizer tok = new StringTokenizer(versionString, "_");
-
-          tok.nextToken(); // GL_
-          tok.nextToken(); // VERSION_ 
-          if (!tok.hasMoreTokens()) { major = 0; return; }
-          major = Integer.valueOf(tok.nextToken()).intValue();
-          if (!tok.hasMoreTokens()) { minor = 0; return; }
-          minor = Integer.valueOf(tok.nextToken()).intValue();
-          if (!tok.hasMoreTokens()) { sub = 0; return; }
-          sub = Integer.valueOf(tok.nextToken()).intValue();
-        }
-        else
-        {
-          int radix = 10;
-          if (versionString.length() > 2) {
-            if (Character.isDigit(versionString.charAt(0)) &&
-                versionString.charAt(1) == '.' &&
-                Character.isDigit(versionString.charAt(2))) {
-              major = Character.digit(versionString.charAt(0), radix);
-              minor = Character.digit(versionString.charAt(2), radix);
-
-              // See if there's version-specific information which might
-              // imply a more recent OpenGL version
-              StringTokenizer tok = new StringTokenizer(versionString, " ");
-              if (tok.hasMoreTokens()) {
-                tok.nextToken();
-                if (tok.hasMoreTokens()) {
-                  String token = tok.nextToken();
-                  int i = 0;
-                  while (i < token.length() && !Character.isDigit(token.charAt(i))) {
-                    i++;
-                  }
-                  if (i < token.length() - 2 &&
-                      Character.isDigit(token.charAt(i)) &&
-                      token.charAt(i+1) == '.' &&
-                      Character.isDigit(token.charAt(i+2))) {
-                    int altMajor = Character.digit(token.charAt(i), radix);
-                    int altMinor = Character.digit(token.charAt(i+2), radix);
-                    // Avoid possibly confusing situations by putting some
-                    // constraints on the upgrades we do to the major and
-                    // minor versions
-                    if ((altMajor == major && altMinor > minor) ||
-                        altMajor == major + 1) {
-                      major = altMajor;
-                      minor = altMinor;
-                    }
-                  }
-                }
-              }
-            }
-          }
-        }
-        valid = true;
-      }
-      catch (Exception e)
-      {
-        e.printStackTrace();
-        // FIXME: refactor desktop OpenGL dependencies and make this
-        // class work properly for OpenGL ES
-        System.err.println("Info: ExtensionAvailabilityCache: FunctionAvailabilityCache.Version.<init>: "+e);
-        major = 1;
-        minor = 0;
-        /*
-        throw (IllegalArgumentException)
-          new IllegalArgumentException(
-            "Illegally formatted version identifier: \"" + versionString + "\"")
-              .initCause(e);
-        */
-      }
-    }
-
-    public boolean isValid() {
-      return valid;
-    }
-
-    public int compareTo(Object o)
-    {
-      Version vo = (Version)o;
-      if (major > vo.major) return 1; 
-      else if (major < vo.major) return -1; 
-      else if (minor > vo.minor) return 1; 
-      else if (minor < vo.minor) return -1; 
-      else if (sub > vo.sub) return 1; 
-      else if (sub < vo.sub) return -1; 
-
-      return 0; // they are equal
-    }
-
-    public int getMajor() {
-      return major;
-    }
-
-    public int getMinor() {
-      return minor;
-    }
-    
-  } // end class Version
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLContextLock.java b/src/jogl/classes/com/jogamp/opengl/impl/GLContextLock.java
deleted file mode 100644
index ea78f52..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLContextLock.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import javax.media.opengl.*;
-
-/** Implements the makeCurrent / release locking behavior of the
-    GLContext class. When "fail fast mode" is enabled, attempts to
-    lock the same GLContextLock on more than one thread cause
-    GLException to be raised. This lock is not recursive. Attempts to
-    lock it more than once on a given thread will cause GLException to
-    be raised. */
-
-public class GLContextLock {
-  protected static final boolean DEBUG = GLContextImpl.DEBUG;
-
-  static class SyncData {
-      boolean failFastMode = true;
-      Thread owner = null;
-      int waiters = 0;
-      Exception lockedStack = null; // only enabled if DEBUG
-  }
-  private SyncData sdata = new SyncData(); // synchronized (flow/mem)  mutable access
-
-  /** Locks this GLContextLock on the current thread. If fail fast
-      mode is enabled and the GLContextLock is already owned by
-      another thread, throws GLException. */
-  public final void lock() throws GLException {
-    synchronized(sdata) {
-      Thread current = Thread.currentThread();
-      if (sdata.owner == null) {
-        sdata.owner = current;
-        if(DEBUG) {
-            sdata.lockedStack = new Exception("Error: Previously made current (1) by "+sdata.owner+", lock: "+this);
-        }
-      } else if (sdata.owner != current) {
-        while (sdata.owner != null) {
-          if (sdata.failFastMode) {
-            if(null!=sdata.lockedStack) {
-                sdata.lockedStack.printStackTrace();
-            }
-            throw new GLException("Error: Attempt to make context current on thread " + current +
-                                  " which is already current on thread " + sdata.owner);
-          } else {
-            try {
-              ++sdata.waiters;
-              sdata.wait();
-            } catch (InterruptedException e) {
-              throw new GLException(e);
-            } finally {
-              --sdata.waiters;
-            }
-          }
-        }
-        sdata.owner = current;
-        if(DEBUG) {
-            sdata.lockedStack = new Exception("Previously made current (2) by "+sdata.owner+", lock: "+this);
-        }
-      } else {
-        throw new GLException("Attempt to make the same context current twice on thread " + current);
-      }
-    }
-  }
-
-  /** Unlocks this GLContextLock. */
-  public final void unlock() throws GLException {
-    synchronized (sdata) {
-      Thread current = Thread.currentThread();
-      if (sdata.owner == current) {
-        sdata.owner = null;
-        sdata.lockedStack = null;
-        // Assuming notify() implementation weaks up the longest waiting thread, to avoid starvation. 
-        // Otherwise we would need to have a Thread queue implemented, using sleep(timeout) and interrupt.
-        sdata.notify();
-      } else {
-        if (sdata.owner != null) {
-          throw new GLException("Attempt by thread " + current +
-                                " to release context owned by thread " + sdata.owner);
-        } else {
-          throw new GLException("Attempt by thread " + current +
-                                " to release unowned context");
-        }
-      }
-    }
-  }
-
-  /** Indicates whether this lock is held by the current thread. */
-  public final boolean isHeld() {
-    synchronized(sdata) {
-      return (Thread.currentThread() == sdata.owner);
-    }
-  }
-
-  public final void setFailFastMode(boolean onOrOff) {
-    synchronized(sdata) {
-        sdata.failFastMode = onOrOff;
-    }
-  }
-
-  public final boolean getFailFastMode() {
-    synchronized(sdata) {
-        return sdata.failFastMode;
-    }
-  }
-
-  public final boolean hasWaiters() {
-    synchronized(sdata) {
-        return (0 != sdata.waiters);
-    }
-  }
-
-  /** holding the owners stack trace when lock is acquired and DEBUG is true */
-  public final Exception getLockedStack() {
-    synchronized(sdata) {
-        return sdata.lockedStack;
-    }
-  }
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLContextShareSet.java b/src/jogl/classes/com/jogamp/opengl/impl/GLContextShareSet.java
deleted file mode 100644
index 7be06b6..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLContextShareSet.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-// FIXME: refactor Java SE dependencies
-// import java.awt.GraphicsConfiguration;
-// import java.awt.GraphicsDevice;
-// import java.awt.GraphicsEnvironment;
-import java.lang.ref.*;
-import java.util.*;
-import javax.media.opengl.*;
-
-/** Provides a mechanism by which OpenGL contexts can share textures
-    and display lists in the face of multithreading and asynchronous
-    context creation as is inherent in the AWT and Swing. */
-
-public class GLContextShareSet {
-  // FIXME: refactor Java SE dependencies
-  //  private static boolean forceTracking = Debug.isPropertyDefined("jogl.glcontext.forcetracking");
-  private static final boolean DEBUG = Debug.debug("GLContext");
-
-  // This class is implemented with a WeakHashMap that goes from the
-  // contexts as keys to a complex data structure as value that tracks
-  // context creation and deletion.
-
-  private static Map/*<GLContext, ShareSet>*/ shareMap = new WeakHashMap();
-  private static Object dummyValue = new Object();
-
-  private static class ShareSet {
-    private Map allShares       = new WeakHashMap();
-    private Map createdShares   = new WeakHashMap();
-    private Map destroyedShares = new WeakHashMap();
-
-    public void add(GLContext ctx) {
-      if (allShares.put(ctx, dummyValue) == null) {
-        // FIXME: downcast to GLContextImpl undesirable
-        if (((GLContextImpl) ctx).isCreated()) {
-          createdShares.put(ctx, dummyValue);
-        } else {
-          destroyedShares.put(ctx, dummyValue);
-        }
-      }      
-    }
-
-    public GLContext getCreatedShare(GLContext ignore) {
-      for (Iterator iter = createdShares.keySet().iterator(); iter.hasNext(); ) {
-        GLContext ctx = (GLContext) iter.next();
-        if (ctx != ignore) {
-          return ctx;
-        }
-      }
-      return null;
-    }
-
-    public void contextCreated(GLContext ctx) {
-      Object res = destroyedShares.remove(ctx);
-      assert res != null : "State of ShareSet corrupted; thought context " +
-        ctx + " should have been in destroyed set but wasn't";
-      res = createdShares.put(ctx, dummyValue);
-      assert res == null : "State of ShareSet corrupted; thought context " +
-        ctx + " shouldn't have been in created set but was";
-    }
-
-    public void contextDestroyed(GLContext ctx) {
-      Object res = createdShares.remove(ctx);
-      assert res != null : "State of ShareSet corrupted; thought context " +
-        ctx + " should have been in created set but wasn't";
-      res = destroyedShares.put(ctx, dummyValue);
-      assert res == null : "State of ShareSet corrupted; thought context " +
-        ctx + " shouldn't have been in destroyed set but was";
-    }
-  }
-
-  /** Indicate that contexts <code>share1</code> and
-      <code>share2</code> will share textures and display lists. Both
-      must be non-null. */
-  public static synchronized void registerSharing(GLContext share1, GLContext share2) {
-    if (share1 == null || share2 == null) {
-      throw new IllegalArgumentException("Both share1 and share2 must be non-null");
-    }
-    ShareSet share = entryFor(share1);
-    if (share == null) {
-      share = entryFor(share2);
-    }
-    if (share == null) {
-      share = new ShareSet();
-    }
-    share.add(share1);
-    share.add(share2);
-    addEntry(share1, share);
-    addEntry(share2, share);
-  }
-
-  public static synchronized GLContext getShareContext(GLContext contextToCreate) {
-    ShareSet share = entryFor(contextToCreate);
-    if (share == null) {
-      return null;
-    }
-    return share.getCreatedShare(contextToCreate);
-  }
-
-  public static synchronized void contextCreated(GLContext context) {
-    ShareSet share = entryFor(context);
-    if (share != null) {
-      share.contextCreated(context);
-    }
-  }
-
-  public static synchronized void contextDestroyed(GLContext context) {
-    ShareSet share = entryFor(context);
-    if (share != null) {
-      share.contextDestroyed(context);
-    }
-  }
-
-  /** In order to avoid glGet calls for buffer object checks related
-      to glVertexPointer, etc. calls as well as glMapBuffer calls, we
-      need to share the same GLBufferSizeTracker object between
-      contexts sharing textures and display lists. For now we keep
-      this mechanism orthogonal to the GLObjectTracker to hopefully
-      keep things easier to understand. (The GLObjectTracker is
-      currently only needed in a fairly esoteric case, when the
-      Java2D/JOGL bridge is active, but the GLBufferSizeTracker
-      mechanism is now always required.) */
-  public static void registerForBufferObjectSharing(GLContext olderContextOrNull, GLContext newContext) {
-    // FIXME: downcasts to GLContextImpl undesirable
-    GLContextImpl older = (GLContextImpl) olderContextOrNull;
-    GLContextImpl newer = (GLContextImpl) newContext;
-    GLBufferSizeTracker tracker = null;
-    if (older != null) {
-      tracker = older.getBufferSizeTracker();
-      assert (tracker != null)
-        : "registerForBufferObjectSharing was not called properly for the older context, or has a bug in it";
-    }
-    if (tracker == null) {
-      tracker = new GLBufferSizeTracker();
-    }
-    newer.setBufferSizeTracker(tracker);
-  }
-
-  // FIXME: refactor Java SE dependencies
-  //  /** Indicates that the two supplied contexts (which must be able to
-  //      share textures and display lists) should be in the same
-  //      namespace for tracking of server-side object creation and
-  //      deletion. Because the sharing necessary behind the scenes is
-  //      different than that requested at the user level, the two notions
-  //      are different. This must be called immediately after the
-  //      creation of the new context (which is the second argument)
-  //      before any server-side OpenGL objects have been created in that
-  //      context. */
-  //  public static void registerForObjectTracking(GLContext olderContextOrNull,
-  //                                               GLContext newContext,
-  //                                               GLContext realShareContext) {
-  //    if (isObjectTrackingEnabled() || isObjectTrackingDebuggingEnabled()) {
-  //      GLContextImpl impl1 = null;      
-  //      GLContextImpl impl2 = null;      
-  //      GLObjectTracker tracker = null;
-  //
-  //      synchronized (GLContextShareSet.class) {
-  //        if (olderContextOrNull != null &&
-  //            newContext != null) {
-  //          if (entryFor(olderContextOrNull) != entryFor(newContext)) {
-  //            throw new IllegalArgumentException("old and new contexts must be able to share textures and display lists");
-  //          }
-  //        }
-  //
-  //        // FIXME: downcast to GLContextImpl undesirable
-  //        impl1 = (GLContextImpl) olderContextOrNull;
-  //        impl2 = (GLContextImpl) newContext;
-  //
-  //        GLObjectTracker deletedObjectTracker = null;
-  //        GLContextImpl shareImpl = (GLContextImpl) realShareContext;
-  //        // Before we zap the "user-level" object trackers, make sure
-  //        // that all contexts in the share set share the destroyed object
-  //        // tracker
-  //        if (shareImpl != null) {
-  //          deletedObjectTracker = shareImpl.getDeletedObjectTracker();
-  //        }
-  //        if (deletedObjectTracker == null) {
-  //          // Must create one and possibly set it up in the older context
-  //          deletedObjectTracker = new GLObjectTracker();
-  //          if (DEBUG) {
-  //            System.err.println("Created deletedObjectTracker " + deletedObjectTracker + " because " +
-  //                               ((shareImpl == null) ? "shareImpl was null" : "shareImpl's (" + shareImpl + ") deletedObjectTracker was null"));
-  //          }
-  //
-  //          if (shareImpl != null) {
-  //            // FIXME: think should really assert in this case
-  //            shareImpl.setDeletedObjectTracker(deletedObjectTracker);
-  //            if (DEBUG) {
-  //              System.err.println("Set deletedObjectTracker " + deletedObjectTracker + " in shareImpl context " + shareImpl);
-  //            }
-  //          }
-  //        }
-  //        impl2.setDeletedObjectTracker(deletedObjectTracker);
-  //        if (DEBUG) {
-  //          System.err.println("Set deletedObjectTracker " + deletedObjectTracker + " in impl2 context " + impl2);
-  //        }
-  //      }
-  //
-  //      // Must not hold lock around this operation
-  //      // Don't share object trackers with the primordial share context from Java2D
-  //      if (Java2D.isOGLPipelineActive()) {
-  //        // FIXME: probably need to do something different here
-  //        // Need to be able to figure out the GraphicsDevice for the
-  //        // older context if it's on-screen
-  //        GraphicsDevice device = GraphicsEnvironment.
-  //          getLocalGraphicsEnvironment().
-  //          getDefaultScreenDevice();
-  //        GLContext j2dShareContext = Java2D.getShareContext(device);
-  //        if (impl1 != null && impl1 == j2dShareContext) {
-  //          impl1 = null;
-  //        }
-  //      }
-  //
-  //      synchronized (GLContextShareSet.class) {
-  //        if (impl1 != null) {
-  //          tracker = impl1.getObjectTracker();
-  //          assert (tracker != null)
-  //            : "registerForObjectTracking was not called properly for the older context";
-  //        }
-  //        if (tracker == null) {
-  //          tracker = new GLObjectTracker();
-  //        }
-  //        // Note that we don't assert that the tracker is non-null for
-  //        // impl2 because the way we use this functionality we actually
-  //        // overwrite the initially-set object tracker in the new context
-  //        impl2.setObjectTracker(tracker);
-  //      }
-  //    }
-  //  }
-  
-  //----------------------------------------------------------------------
-  // Internals only below this point
-  
-
-  private static ShareSet entryFor(GLContext context) {
-    return (ShareSet) shareMap.get(context);
-  }
-
-  private static void addEntry(GLContext context, ShareSet share) {
-    if (shareMap.get(context) == null) {
-      shareMap.put(context, share);
-    }
-  }
-
-  // FIXME: refactor Java SE dependencies
-  //  private static boolean isObjectTrackingEnabled() {
-  //    return ((Java2D.isOGLPipelineActive() && Java2D.isFBOEnabled()) ||
-  //            isObjectTrackingDebuggingEnabled());
-  //  }
-  //
-  //  private static boolean isObjectTrackingDebuggingEnabled() {
-  //    return forceTracking;
-  //  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java
deleted file mode 100644
index ef5f670..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import java.nio.*;
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-
-/** Extends GLDrawableFactory with a few methods for handling
-    typically software-accelerated offscreen rendering (Device
-    Independent Bitmaps on Windows, pixmaps on X11). Direct access to
-    these GLDrawables is not supplied directly to end users, though
-    they may be instantiated by the GLJPanel implementation. */
-public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
-  protected static final boolean DEBUG = GLDrawableImpl.DEBUG;
-
-  protected GLDrawableFactoryImpl() {
-    super();
-  }
-  
-  /** 
-   * Returns the GLDynamicLookupHelper
-   * @param profile if EGL/ES, profile <code>1</code> refers to ES1 and <code>2</code> to ES2,
-   *        otherwise the profile is ignored.
-   */
-  public abstract GLDynamicLookupHelper getGLDynamicLookupHelper(int profile);
-
-  //---------------------------------------------------------------------------
-  // Dispatching GLDrawable construction in respect to the NativeSurface Capabilities
-  //
-  public GLDrawable createGLDrawable(NativeSurface target) {
-    if (target == null) {
-      throw new IllegalArgumentException("Null target");
-    }
-    AbstractGraphicsConfiguration config = target.getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
-    AbstractGraphicsDevice adevice = config.getScreen().getDevice();
-    GLDrawable result = null;
-    adevice.lock();
-    try {
-        if(caps.isOnscreen()) {
-            if(DEBUG) {
-                System.err.println("GLDrawableFactoryImpl.createGLDrawable -> OnscreenDrawable: "+target);
-            }
-            result = createOnscreenDrawableImpl(target);
-        } else {
-            if( ! ( target instanceof SurfaceChangeable ) ) {
-                throw new IllegalArgumentException("Passed NativeSurface must implement SurfaceChangeable for offscreen: "+target);
-            }
-            if(caps.isPBuffer() && canCreateGLPbuffer(adevice)) {
-                if(DEBUG) {
-                    System.err.println("GLDrawableFactoryImpl.createGLDrawable -> PbufferDrawable: "+target);
-                }
-                result = createGLPbufferDrawable(target);
-            }
-            if(null==result) {
-                if(DEBUG) {
-                    System.err.println("GLDrawableFactoryImpl.createGLDrawable -> OffScreenDrawable: "+target);
-                }
-                result = createOffscreenDrawableImpl(target);
-            }
-        }
-    } finally {
-        adevice.unlock();
-    }
-    if(DEBUG) {
-        System.err.println("GLDrawableFactoryImpl.createGLDrawable: "+result);
-    }
-    return result;
-  }
-
-  //---------------------------------------------------------------------------
-  //
-  // Onscreen GLDrawable construction 
-  //
-
-  protected abstract GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target);
-
-  //---------------------------------------------------------------------------
-  //
-  // PBuffer GLDrawable construction 
-  //
-
-  public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device);
-
-  /** Target must implement SurfaceChangeable */
-  protected abstract GLDrawableImpl createGLPbufferDrawableImpl(NativeSurface target);
-
-  private GLDrawableImpl createGLPbufferDrawable(NativeSurface target) {
-    if (!canCreateGLPbuffer(target.getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice())) {
-        throw new GLException("Pbuffer support not available with current graphics card");
-    }
-    return createGLPbufferDrawableImpl(target);
-  }
-  
-  public GLDrawable createGLPbufferDrawable(GLCapabilitiesImmutable capsRequested,
-                                            GLCapabilitiesChooser chooser,
-                                            int width,
-                                            int height) {
-    if(height<=0 || height<=0) {
-        throw new GLException("Width and height of pbuffer must be positive (were (" +
-                        width + ", " + height + "))");
-    }
-
-    GLCapabilitiesImmutable capsChosen;
-
-    if( capsRequested.getDoubleBuffered() || capsRequested.isOnscreen() || !capsRequested.isPBuffer()) {
-        // fix caps ..
-        GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
-        caps2.setDoubleBuffered(false); // FIXME DBLBUFOFFSCRN
-        caps2.setOnscreen(false);
-        caps2.setPBuffer(true);
-        capsChosen = caps2;
-    } else {
-        capsChosen = capsRequested;
-    }
-    NativeWindowFactory.getDefaultToolkitLock().lock();
-    try {
-        return createGLPbufferDrawable( createOffscreenSurfaceImpl(capsChosen, capsRequested, chooser, height, height) );
-    } finally {
-        NativeWindowFactory.getDefaultToolkitLock().unlock();
-    }
-  }
-
-  public GLPbuffer createGLPbuffer(GLCapabilitiesImmutable capabilities,
-                                   GLCapabilitiesChooser chooser,
-                                   int width,
-                                   int height,
-                                   GLContext shareWith) {
-    return new GLPbufferImpl( (GLDrawableImpl) createGLPbufferDrawable(capabilities, chooser, height, height),
-                              shareWith);
-  }
-
-
-  //---------------------------------------------------------------------------
-  //
-  // Offscreen GLDrawable construction 
-  //
-
-  protected abstract GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) ;
-
-  public GLDrawable createOffscreenDrawable(GLCapabilitiesImmutable capsRequested,
-                                            GLCapabilitiesChooser chooser,
-                                            int width,
-                                            int height) {
-    if(width<=0 || height<=0) {
-        throw new GLException("Width and height of pbuffer must be positive (were (" +
-                        width + ", " + height + "))");
-    }
-    GLCapabilitiesImmutable capsChosen;
-
-    if( capsRequested.getDoubleBuffered() || capsRequested.isOnscreen() || capsRequested.isPBuffer()) {
-        // fix caps ..
-        GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
-        caps2.setDoubleBuffered(false); // FIXME DBLBUFOFFSCRN
-        caps2.setOnscreen(false);
-        caps2.setPBuffer(false);
-        capsChosen = caps2;
-    } else {
-        capsChosen = capsRequested;
-    }
-    NativeWindowFactory.getDefaultToolkitLock().lock();
-    try {
-        return createOffscreenDrawableImpl( createOffscreenSurfaceImpl(capsChosen, capsRequested, chooser, width, height) );
-    } finally {
-        NativeWindowFactory.getDefaultToolkitLock().unlock();
-    }
-  }
-
-  /**
-   * creates an offscreen NativeSurface, which must implement SurfaceChangeable as well,
-   * so the windowing system related implementation is able to set the surface handle.
-   */
-  protected abstract NativeSurface createOffscreenSurfaceImpl(GLCapabilitiesImmutable capabilities, GLCapabilitiesImmutable capsRequested,
-                                                              GLCapabilitiesChooser chooser,
-                                                              int width, int height);
-
-  //---------------------------------------------------------------------------
-  //
-  // External GLDrawable construction
-  //
-
-  protected abstract GLContext createExternalGLContextImpl();
-  
-  public GLContext createExternalGLContext() {
-    NativeWindowFactory.getDefaultToolkitLock().lock();
-    try {
-        return createExternalGLContextImpl();
-    } finally {
-        NativeWindowFactory.getDefaultToolkitLock().unlock();
-    }
-  }
-
-  protected abstract GLDrawable createExternalGLDrawableImpl();
-
-  public GLDrawable createExternalGLDrawable() {
-    NativeWindowFactory.getDefaultToolkitLock().lock();
-    try {
-        return createExternalGLDrawableImpl();
-    } finally {
-        NativeWindowFactory.getDefaultToolkitLock().unlock();
-    }
-  }
-
-
-  //---------------------------------------------------------------------------
-  //
-  // GLDrawableFactoryImpl details
-  //
-
-  protected void maybeDoSingleThreadedWorkaround(Runnable action) {
-    if (Threading.isSingleThreaded() &&
-        !Threading.isOpenGLThread()) {
-      Threading.invokeOnOpenGLThread(action);
-    } else {
-      action.run();
-    }
-  }
-
-  /**
-   * Returns the sole GLDrawableFactoryImpl instance.
-   *
-   * @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
-   *                or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
-   */
-  public static GLDrawableFactoryImpl getFactoryImpl(GLProfile glp) {
-    return (GLDrawableFactoryImpl) getFactory(glp);
-  }
-
-  //---------------------------------------------------------------------------
-  // Support for Java2D/JOGL bridge on Mac OS X; the external
-  // GLDrawable mechanism in the public API is sufficient to
-  // implement this functionality on all other platforms
-  //
-
-  public abstract boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device);
-
-  public abstract GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
-    throws GLException;
-
-  //----------------------------------------------------------------------
-  // Gamma adjustment support
-  // Thanks to the LWJGL team for illustrating how to make these
-  // adjustments on various OSs.
-
-  /*
-   * Portions Copyright (c) 2002-2004 LWJGL Project
-   * All rights reserved.
-   *
-   * Redistribution and use in source and binary forms, with or without
-   * modification, are permitted provided that the following conditions are
-   * met:
-   *
-   * * Redistributions of source code must retain the above copyright
-   *   notice, this list of conditions and the following disclaimer.
-   *
-   * * Redistributions in binary form must reproduce the above copyright
-   *   notice, this list of conditions and the following disclaimer in the
-   *   documentation and/or other materials provided with the distribution.
-   *
-   * * Neither the name of 'LWJGL' nor the names of
-   *   its contributors may be used to endorse or promote products derived
-   *   from this software without specific prior written permission.
-   *
-   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-   * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-   * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-   * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-   * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-   * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-   * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-   * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-   * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-   */
-
-  /**
-   * Sets the gamma, brightness, and contrast of the current main
-   * display. Returns true if the settings were changed, false if
-   * not. If this method returns true, the display settings will
-   * automatically be reset upon JVM exit (assuming the JVM does not
-   * crash); if the user wishes to change the display settings back to
-   * normal ahead of time, use resetDisplayGamma(). Throws
-   * IllegalArgumentException if any of the parameters were
-   * out-of-bounds.
-   * 
-   * @param gamma The gamma value, typically > 1.0 (default value is
-   *   1.0)
-   * @param brightness The brightness value between -1.0 and 1.0,
-   *   inclusive (default value is 0)
-   * @param contrast The contrast, greater than 0.0 (default value is 1)
-   * @throws IllegalArgumentException if any of the parameters were
-   *   out-of-bounds
-   */
-  public boolean setDisplayGamma(float gamma, float brightness, float contrast) throws IllegalArgumentException {
-    if ((brightness < -1.0f) || (brightness > 1.0f)) {
-      throw new IllegalArgumentException("Brightness must be between -1.0 and 1.0");
-    }
-    if (contrast < 0) {
-      throw new IllegalArgumentException("Contrast must be greater than 0.0");
-    }
-    // FIXME: ensure gamma is > 1.0? Are smaller / negative values legal?
-    int rampLength = getGammaRampLength();
-    if (rampLength == 0) {
-      return false;
-    }
-    float[] gammaRamp = new float[rampLength];
-    for (int i = 0; i < rampLength; i++) {
-      float intensity = (float) i / (float) (rampLength - 1);
-      // apply gamma
-      float rampEntry = (float) java.lang.Math.pow(intensity, gamma);
-      // apply brightness
-      rampEntry += brightness;
-      // apply contrast
-      rampEntry = (rampEntry - 0.5f) * contrast + 0.5f;
-      // Clamp entry to [0, 1]
-      if (rampEntry > 1.0f)
-        rampEntry = 1.0f;
-      else if (rampEntry < 0.0f)
-        rampEntry = 0.0f;
-      gammaRamp[i] = rampEntry;
-    }
-    registerGammaShutdownHook();
-    return setGammaRamp(gammaRamp);
-  }
-
-  public synchronized void resetDisplayGamma() {
-    if (gammaShutdownHook == null) {
-      throw new IllegalArgumentException("Should not call this unless setDisplayGamma called first");
-    }
-    resetGammaRamp(originalGammaRamp);
-    unregisterGammaShutdownHook();
-  }
-
-  //------------------------------------------------------
-  // Gamma-related methods to be implemented by subclasses
-  //
-
-  /** Returns the length of the computed gamma ramp for this OS and
-      hardware. Returns 0 if gamma changes are not supported. */
-  protected int getGammaRampLength() {
-    return 0;
-  }
-
-  /** Sets the gamma ramp for the main screen. Returns false if gamma
-      ramp changes were not supported. */
-  protected boolean setGammaRamp(float[] ramp) {
-    return false;
-  }
-
-  /** Gets the current gamma ramp. This is basically an opaque value
-      used only on some platforms to reset the gamma ramp to its
-      original settings. */
-  protected Buffer getGammaRamp() {
-    return null;
-  }
-
-  /** Resets the gamma ramp, potentially using the specified Buffer as
-      data to restore the original values. */
-  protected void resetGammaRamp(Buffer originalGammaRamp) {
-  }
-
-  // Shutdown hook mechanism for resetting gamma
-  private boolean gammaShutdownHookRegistered;
-  private Thread  gammaShutdownHook;
-  private Buffer  originalGammaRamp;
-  private synchronized void registerGammaShutdownHook() {
-    if (gammaShutdownHookRegistered)
-      return;
-    if (gammaShutdownHook == null) {
-      gammaShutdownHook = new Thread(new Runnable() {
-          public void run() {
-            synchronized (GLDrawableFactoryImpl.this) {
-              resetGammaRamp(originalGammaRamp);
-            }
-          }
-        });
-      originalGammaRamp = getGammaRamp();
-    }
-    Runtime.getRuntime().addShutdownHook(gammaShutdownHook);
-    gammaShutdownHookRegistered = true;
-  }
-
-  private synchronized void unregisterGammaShutdownHook() {
-    if (!gammaShutdownHookRegistered)
-      return;
-    if (gammaShutdownHook == null) {
-      throw new InternalError("Error in gamma shutdown hook logic");
-    }
-    Runtime.getRuntime().removeShutdownHook(gammaShutdownHook);
-    gammaShutdownHookRegistered = false;
-    // Leave the original gamma ramp data alone
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableHelper.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableHelper.java
deleted file mode 100644
index 45b04fa..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableHelper.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import java.util.*;
-import javax.media.opengl.*;
-
-/** Encapsulates the implementation of most of the GLAutoDrawable's
-    methods to be able to share it between GLCanvas and GLJPanel. */
-
-public class GLDrawableHelper {
-  protected static final boolean DEBUG = GLDrawableImpl.DEBUG;
-  private static final boolean VERBOSE = Debug.verbose();
-  private Object listenersLock = new Object();
-  private List listeners;
-  private volatile boolean listenersIter; // avoid java.util.ConcurrentModificationException
-  private Set listenersToBeInit;
-  private boolean autoSwapBufferMode;
-  private Object glRunnablesLock = new Object();
-  private ArrayList glRunnables;
-  private GLAnimatorControl animatorCtrl;
-
-  public GLDrawableHelper() {
-    reset();
-  }
-
-  public final void reset() {
-    synchronized(listenersLock) {
-        listeners = new ArrayList();
-        listenersIter = false;
-        listenersToBeInit = new HashSet();
-    }
-    autoSwapBufferMode = true;
-    synchronized(glRunnablesLock) {
-        glRunnables = new ArrayList();
-    }
-    animatorCtrl = null;
-  }
-
-  public final String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.append("GLAnimatorControl: "+animatorCtrl+", ");
-    synchronized(listenersLock) {
-        sb.append("GLEventListeners num "+listeners.size()+" [");
-        listenersIter = true;
-        for (int i=0; i < listeners.size(); i++) {
-          Object l = listeners.get(i);
-          sb.append(l);
-          sb.append("[init ");
-          sb.append( !listenersToBeInit.contains(l) );
-          sb.append("], ");
-        }
-        listenersIter = false;
-    }
-    sb.append("]");
-    return sb.toString();
-  }
-
-  public final void addGLEventListener(GLEventListener listener) {
-    addGLEventListener(-1, listener);
-  }
-
-  public final void addGLEventListener(int index, GLEventListener listener) {
-    synchronized(listenersLock) {
-        if(0>index) {
-            index = listeners.size();
-        }
-        listenersToBeInit.add(listener);
-        if(!listenersIter) {
-            // fast path
-            listeners.add(index, listener);
-        } else {
-            // copy mode in case this is issued while iterating, eg via init, display, ..
-            List newListeners = (List) ((ArrayList) listeners).clone();
-            newListeners.add(index, listener);
-            listeners = newListeners;
-        }
-    }
-  }
-  
-  public final void removeGLEventListener(GLEventListener listener) {
-    synchronized(listenersLock) {
-        if(!listenersIter) {
-            // fast path
-            listeners.remove(listener);
-        } else {
-            // copy mode in case this is issued while iterating, eg via init, display, ..
-            List newListeners = (List) ((ArrayList) listeners).clone();
-            newListeners.remove(listener);
-            listeners = newListeners;
-        }
-        listenersToBeInit.remove(listener);
-    }
-  }
-
-  /**
-   * Issues {@link javax.media.opengl.GLEventListener#dispose(javax.media.opengl.GLAutoDrawable)}
-   * to all listeners.
-   * @param drawable
-   */
-  public final void dispose(GLAutoDrawable drawable) {
-    synchronized(listenersLock) {
-        listenersIter = true;
-        for (int i=0; i < listeners.size(); i++) {
-          GLEventListener listener = (GLEventListener) listeners.get(i) ;
-          listener.dispose(drawable);
-          listenersToBeInit.add(listener);
-        }
-        listenersIter = false;
-    }
-  }
-
-  private final boolean init(GLEventListener l, GLAutoDrawable drawable, boolean sendReshape) {
-      if(listenersToBeInit.remove(l)) {
-          l.init(drawable);
-          if(sendReshape) {
-              reshape(l, drawable, 0, 0, drawable.getWidth(), drawable.getHeight(), true /* setViewport */);
-          }
-          return true;
-      }
-      return false;
-  }
-
-  public final void init(GLAutoDrawable drawable) {
-    synchronized(listenersLock) {
-        listenersIter = true;
-        for (int i=0; i < listeners.size(); i++) {
-          GLEventListener listener = (GLEventListener) listeners.get(i) ;
-          if ( ! init( listener, drawable, false ) ) {
-            throw new GLException("GLEventListener "+listener+" already initialized: "+drawable);
-          }
-        }
-        listenersIter = false;
-    }
-  }
-
-  public final void display(GLAutoDrawable drawable) {
-    synchronized(listenersLock) {
-        listenersIter = true;
-        for (int i=0; i < listeners.size(); i++) {
-          GLEventListener listener = (GLEventListener) listeners.get(i) ;
-          // GLEventListener may need to be init, 
-          // in case this one is added after the realization of the GLAutoDrawable
-          init( listener, drawable, true ) ; 
-          listener.display(drawable);
-        }
-        listenersIter = false;
-    }
-    execGLRunnables(drawable);
-  }
-
-  private final void reshape(GLEventListener listener, GLAutoDrawable drawable,
-                             int x, int y, int width, int height, boolean setViewport) {
-    if(setViewport) {
-        drawable.getGL().glViewport(x, y, width, height);
-    }
-    listener.reshape(drawable, x, y, width, height);
-  }
-
-  public final void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-    synchronized(listenersLock) {
-        listenersIter = true;
-        for (int i=0; i < listeners.size(); i++) {
-          reshape((GLEventListener) listeners.get(i), drawable, x, y, width, height, 0==i);
-        }
-        listenersIter = false;
-    }
-  }
-
-  private final void execGLRunnables(GLAutoDrawable drawable) {
-    if(glRunnables.size()>0) {
-        // swap one-shot list asap
-        ArrayList _glRunnables = null;
-        synchronized(glRunnablesLock) {
-            if(glRunnables.size()>0) {
-                _glRunnables = glRunnables;
-                glRunnables = new ArrayList();
-            }
-        }
-        if(null!=_glRunnables) {
-            for (int i=0; i < _glRunnables.size(); i++) {
-              ((GLRunnable) _glRunnables.get(i)).run(drawable);
-            }
-        }
-    }
-  }
-
-  public final void setAnimator(GLAnimatorControl animator) throws GLException {
-    synchronized(glRunnablesLock) {
-        if(animatorCtrl!=animator && null!=animator && null!=animatorCtrl) {
-            throw new GLException("Trying to register GLAnimatorControl "+animator+", where "+animatorCtrl+" is already registered. Unregister first.");
-        }
-        animatorCtrl = animator;
-    }
-  }
-
-  public final GLAnimatorControl getAnimator() {
-    synchronized(glRunnablesLock) {
-        return animatorCtrl;
-    }
-  }
-
-  public final boolean isExternalAnimatorRunning() {
-    return ( null != animatorCtrl ) ? animatorCtrl.isStarted() && animatorCtrl.getThread() != Thread.currentThread() : false ;
-  }
-
-  public final boolean isExternalAnimatorAnimating() {
-    return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() && animatorCtrl.getThread() != Thread.currentThread() : false ;
-  }
-
-  public final void invoke(GLAutoDrawable drawable, boolean wait, GLRunnable glRunnable) {
-    if( null == drawable || null == glRunnable ) {
-        return;
-    }
-    Throwable throwable = null;
-    GLRunnableTask rTask = null;
-    Object rTaskLock = new Object();
-    synchronized(rTaskLock) {
-        boolean deferred;
-        synchronized(glRunnablesLock) {
-            deferred = isExternalAnimatorAnimating();
-            if(!deferred) {
-                wait = false; // don't wait if exec immediatly
-            }
-            rTask = new GLRunnableTask(glRunnable,
-                                       wait ? rTaskLock : null,
-                                       wait  /* catch Exceptions if waiting for result */);
-            glRunnables.add(rTask);
-        }
-        if( !deferred ) {
-            drawable.display();
-        } else if( wait ) {
-            try {
-                rTaskLock.wait(); // free lock, allow execution of rTask
-            } catch (InterruptedException ie) {
-                throwable = ie;
-            }
-            if(null==throwable) {
-                throwable = rTask.getThrowable();
-            }
-            if(null!=throwable) {
-                throw new RuntimeException(throwable);
-            }
-        }
-    }
-  }
-
-  public final void setAutoSwapBufferMode(boolean onOrOff) {
-    autoSwapBufferMode = onOrOff;
-  }
-
-  public final boolean getAutoSwapBufferMode() {
-    return autoSwapBufferMode;
-  }
-
-  private static final ThreadLocal perThreadInitAction = new ThreadLocal();
-
-  /** Principal helper method which runs a Runnable with the context
-      made current. This could have been made part of GLContext, but a
-      desired goal is to be able to implement GLAutoDrawable's in terms of
-      the GLContext's public APIs, and putting it into a separate
-      class helps ensure that we don't inadvertently use private
-      methods of the GLContext or its implementing classes.<br>
-   * <br>
-   * Remark: In case this method is called to dispose the GLDrawable/GLAutoDrawable,
-   * <code>initAction</code> shall be <code>null</code> to mark this cause.<br>
-   *
-   * @param drawable
-   * @param context
-   * @param runnable
-   * @param initAction
-   */
-  public final void invokeGL(GLDrawable drawable,
-                             GLContext context,
-                             Runnable  runnable,
-                             Runnable  initAction) {
-    if(null==context) {
-        if (DEBUG) {
-            Exception e = new GLException(Thread.currentThread().getName()+"Info: GLDrawableHelper " + this + ".invokeGL(): NULL GLContext");
-            e.printStackTrace();
-        }
-        return;
-    }
-
-    if(null==initAction) {
-        // disposal case
-        if(!context.isCreated()) {
-            throw new GLException("Dispose case (no init action given): Native context must be created: "+context);
-        }
-    }
-
-    // Support for recursive makeCurrent() calls as well as calling
-    // other drawables' display() methods from within another one's
-    GLContext lastContext    = GLContext.getCurrent();
-    Runnable  lastInitAction = (Runnable) perThreadInitAction.get();
-    if (lastContext != null) {
-      lastContext.release();
-    }
-  
-    int res = 0;
-    try {
-      res = context.makeCurrent();
-      if (res != GLContext.CONTEXT_NOT_CURRENT) {
-        if(null!=initAction) {
-            perThreadInitAction.set(initAction);
-            if (res == GLContext.CONTEXT_CURRENT_NEW) {
-              if (DEBUG) {
-                System.err.println("GLDrawableHelper " + this + ".invokeGL(): Running initAction");
-              }
-              initAction.run();
-            }
-        }
-        if(null!=runnable) {
-            if (DEBUG && VERBOSE) {
-              System.err.println("GLDrawableHelper " + this + ".invokeGL(): Running runnable");
-            }
-            runnable.run();
-            if (autoSwapBufferMode && null != initAction) {
-              if (drawable != null) {
-                drawable.swapBuffers();
-              }
-            }
-        }
-      }
-    } finally {
-      try {
-        if (res != GLContext.CONTEXT_NOT_CURRENT) {
-          context.release();
-        }
-      } catch (Exception e) {
-      }
-      if (lastContext != null) {
-        int res2 = lastContext.makeCurrent();
-        if (res2 == GLContext.CONTEXT_CURRENT_NEW) {
-          lastInitAction.run();
-        }
-      }
-    }
-  }
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableImpl.java
deleted file mode 100644
index d7d2836..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableImpl.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-
-public abstract class GLDrawableImpl implements GLDrawable {
-  protected static final boolean DEBUG = Debug.debug("GLDrawable");
-
-  protected GLDrawableImpl(GLDrawableFactory factory,
-                           NativeSurface comp,
-                           boolean realized) {
-      this.factory = factory;
-      this.surface = comp;
-      this.realized = realized;
-      this.requestedCapabilities = (GLCapabilitiesImmutable) surface.getGraphicsConfiguration().getNativeGraphicsConfiguration().getRequestedCapabilities();
-  }
-
-  /** 
-   * Returns the DynamicLookupHelper
-   */
-  public abstract GLDynamicLookupHelper getGLDynamicLookupHelper();
-
-  public GLDrawableFactoryImpl getFactoryImpl() {
-    return (GLDrawableFactoryImpl) getFactory();
-  }
-
-  /** For offscreen GLDrawables (pbuffers and "pixmap" drawables),
-      indicates that native resources should be reclaimed. */
-  public void destroy() {
-      surface.getGraphicsConfiguration().getScreen().getDevice().lock();
-      try {
-          destroyImpl();
-      } finally {
-          surface.getGraphicsConfiguration().getScreen().getDevice().unlock();
-      }
-  }
-  protected void destroyImpl() {
-    throw new GLException("Should not call this (should only be called for offscreen GLDrawables)");
-  }
-
-  public final void swapBuffers() throws GLException {
-    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)surface.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
-    if ( caps.getDoubleBuffered() ) {
-        if(!surface.surfaceSwap()) {
-            int lockRes = lockSurface(); // it's recursive, so it's ok within [makeCurrent .. release]
-            if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) {
-                return;
-            }
-            try {
-                AbstractGraphicsDevice aDevice = getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
-                if (NativeSurface.LOCK_SURFACE_CHANGED == lockRes) {
-                    updateHandle();
-                }
-                swapBuffersImpl();
-            } finally {
-                unlockSurface();
-            }
-        }
-    } else {
-        GLContext ctx = GLContext.getCurrent();
-        if(null!=ctx && ctx.getGLDrawable()==this) { 
-            ctx.getGL().glFinish();
-        }
-    }
-    surface.surfaceUpdated(this, surface, System.currentTimeMillis());
-  }
-  protected abstract void swapBuffersImpl();
-
-  public static String toHexString(long hex) {
-    return "0x" + Long.toHexString(hex);
-  }
-
-  public GLProfile getGLProfile() {
-    return requestedCapabilities.getGLProfile();
-  }
-
-  public GLCapabilitiesImmutable getChosenGLCapabilities() {
-    return  (GLCapabilitiesImmutable) surface.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
-  }
-
-  public GLCapabilitiesImmutable getRequestedGLCapabilities() {
-    return requestedCapabilities;
-  }
-
-  public NativeSurface getNativeSurface() {
-    return surface;
-  }
-
-  protected void destroyHandle() {}
-  protected void updateHandle() {}
-
-  public long getHandle() {
-    return surface.getSurfaceHandle();
-  }
-
-  public GLDrawableFactory getFactory() {
-    return factory;
-  }
-
-  public final synchronized void setRealized(boolean realizedArg) {
-    if ( realized != realizedArg ) {
-        if(DEBUG) {
-            System.err.println("setRealized: "+getClass().getName()+" "+realized+" -> "+realizedArg);
-        }
-        realized = realizedArg;
-        AbstractGraphicsDevice aDevice = surface.getGraphicsConfiguration().getScreen().getDevice();
-        if(realizedArg) {
-            if(NativeSurface.LOCK_SURFACE_NOT_READY >= lockSurface()) {
-                throw new GLException("X11GLXDrawable.setRealized(true): already realized, but surface not ready (lockSurface)");
-            }
-        } else {
-            aDevice.lock();
-        }
-        try {            
-            setRealizedImpl();
-            if(realizedArg) {
-                updateHandle();
-            } else {
-                destroyHandle();
-            }
-        } finally {
-            if(realizedArg) {
-                unlockSurface();
-            } else {
-                aDevice.unlock();
-            }
-        }
-    } else if(DEBUG) {
-        System.err.println("setRealized: "+getClass().getName()+" "+this.realized+" == "+realizedArg);
-    }
-  }
-  protected abstract void setRealizedImpl();
-  
-  public synchronized boolean isRealized() {
-    return realized;
-  }
-
-  public int getWidth() {
-    return surface.getWidth();
-  }
-  
-  public int getHeight() {
-    return surface.getHeight();
-  }
-
-  public int lockSurface() throws GLException {
-    return surface.lockSurface();
-  }
-
-  public void unlockSurface() {
-    surface.unlockSurface();
-  }
-
-  public boolean isSurfaceLocked() {
-    return surface.isSurfaceLocked();
-  }
-
-  public String toString() {
-    return getClass().getName()+"[Realized "+isRealized()+
-                ",\n\tFactory   "+getFactory()+
-                ",\n\thandle    "+toHexString(getHandle())+
-                ",\n\tWindow    "+getNativeSurface()+"]";
-  }
-
-  protected GLDrawableFactory factory;
-  protected NativeSurface surface;
-  protected GLCapabilitiesImmutable requestedCapabilities;
-
-  // Indicates whether the surface (if an onscreen context) has been
-  // realized. Plausibly, before the surface is realized the JAWT
-  // should return an error or NULL object from some of its
-  // operations; this appears to be the case on Win32 but is not true
-  // at least with Sun's current X11 implementation (1.4.x), which
-  // crashes with no other error reported if the DrawingSurfaceInfo is
-  // fetched from a locked DrawingSurface during the validation as a
-  // result of calling show() on the main thread. To work around this
-  // we prevent any JAWT or OpenGL operations from being done until
-  // addNotify() is called on the surface.
-  protected boolean realized;
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDynamicLibraryBundleInfo.java
deleted file mode 100644
index 34d1e9f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLDynamicLibraryBundleInfo.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl;
-
-import com.jogamp.common.os.DynamicLibraryBundleInfo;
-import java.util.*;
-
-public abstract class GLDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
-    static List/*<String>*/ glueLibNamesPreload;
-    static {
-        glueLibNamesPreload = new ArrayList();
-        glueLibNamesPreload.add("nativewindow_x11");
-    }
-
-    protected GLDynamicLibraryBundleInfo() {
-    }
-
-    /** default **/
-    public boolean shallLinkGlobal() { return false; }
-
-    /** default **/
-    public boolean shallLookupGlobal() { return false; }
-
-    public static List/*<String>*/ getGlueLibNamesPreload() {
-        return glueLibNamesPreload;
-    }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLDynamicLookupHelper.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDynamicLookupHelper.java
deleted file mode 100644
index e94a9c6..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLDynamicLookupHelper.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl;
-
-import com.jogamp.common.os.DynamicLibraryBundle;
-import com.jogamp.common.os.DynamicLibraryBundleInfo;
-import com.jogamp.common.os.DynamicLookupHelper;
-import com.jogamp.common.os.NativeLibrary;
-import java.util.*;
-import java.security.*;
-import javax.media.opengl.GLException;
-
-public class GLDynamicLookupHelper extends DynamicLibraryBundle {
-
-    public GLDynamicLookupHelper(GLDynamicLibraryBundleInfo info) {
-        super(info);
-    }
-
-    public GLDynamicLibraryBundleInfo getGLBundleInfo() { return (GLDynamicLibraryBundleInfo) getBundleInfo(); }
-
-    /** NOP per default */
-    public boolean loadGLULibrary() { return false; }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLJNILibLoader.java b/src/jogl/classes/com/jogamp/opengl/impl/GLJNILibLoader.java
deleted file mode 100644
index 1daf335..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLJNILibLoader.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-// FIXME: refactor Java SE dependencies
-//import java.awt.Toolkit;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.HashSet;
-import com.jogamp.common.jvm.JNILibLoaderBase;
-
-public class GLJNILibLoader extends JNILibLoaderBase {
-  public static void loadNEWT() {
-    AccessController.doPrivileged(new PrivilegedAction() {
-      public Object run() {
-        loadLibrary("newt", nativeOSPreload, true);
-        return null;
-      }
-    });
-  }
-
-  private static final String[] nativeOSPreload = { "nativewindow_x11" };
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLPbufferImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLPbufferImpl.java
deleted file mode 100644
index d282d2f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLPbufferImpl.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-/**
-import java.awt.Dimension;
-import java.awt.EventQueue;
-import java.awt.event.*;
-import java.beans.PropertyChangeListener;
- */
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.common.util.locks.RecursiveLock;
-
-/** Platform-independent class exposing pbuffer functionality to
-    applications. This class is not exposed in the public API as it
-    would probably add no value; however it implements the GLDrawable
-    interface so can be interacted with via its display() method. */
-
-public class GLPbufferImpl implements GLPbuffer {
-  private GLDrawableImpl pbufferDrawable;
-  private GLContextImpl context;
-  private GLDrawableHelper drawableHelper = new GLDrawableHelper();
-  private int floatMode;
-
-  public GLPbufferImpl(GLDrawableImpl pbufferDrawable,
-                       GLContext parentContext) {
-    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)
-         pbufferDrawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
-    if(caps.isOnscreen()) {
-        if(caps.isPBuffer()) {
-            throw new IllegalArgumentException("Error: Given drawable is Onscreen and Pbuffer: "+pbufferDrawable);
-        }
-        throw new IllegalArgumentException("Error: Given drawable is Onscreen: "+pbufferDrawable);
-    } else {
-        if(!caps.isPBuffer()) {
-            throw new IllegalArgumentException("Error: Given drawable is not Pbuffer: "+pbufferDrawable);
-        }
-    }
-    this.pbufferDrawable = pbufferDrawable;
-    context = (GLContextImpl) pbufferDrawable.createContext(parentContext);
-    context.setSynchronized(true);
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    return pbufferDrawable.createContext(shareWith);
-  }
-
-  public void setRealized(boolean realized) {
-  }
-
-  public boolean isRealized() {
-    return true;
-  }
-
-  public void setSize(int width, int height) {
-    // FIXME
-    throw new GLException("Not yet implemented");
-  }
-
-  public NativeSurface getNativeSurface() {
-      return pbufferDrawable.getNativeSurface();
-  }
-
-  public long getHandle() {
-    return pbufferDrawable.getHandle();
-  }
-
-  public GLDrawableFactory getFactory() {
-      return pbufferDrawable.getFactory();
-  }
-
-  public int getWidth() {
-    return pbufferDrawable.getWidth();
-  }
-
-  public int getHeight() {
-    return pbufferDrawable.getHeight();
-  }
-
-  public void display() {
-    maybeDoSingleThreadedWorkaround(displayOnEventDispatchThreadAction,
-                                    displayAction,
-                                    false);
-  }
-
-  public void repaint() {
-    display();
-  }
-
-  public void addGLEventListener(GLEventListener listener) {
-    drawableHelper.addGLEventListener(listener);
-  }
-
-  public void addGLEventListener(int index, GLEventListener listener) {
-    drawableHelper.addGLEventListener(index, listener);
-  }
-
-  public void removeGLEventListener(GLEventListener listener) {
-    drawableHelper.removeGLEventListener(listener);
-  }
-
-  public void setAnimator(GLAnimatorControl animatorControl) {
-    drawableHelper.setAnimator(animatorControl);
-  }
-
-  public GLAnimatorControl getAnimator() {
-    return drawableHelper.getAnimator();
-  }
-
-  public void invoke(boolean wait, GLRunnable glRunnable) {
-    drawableHelper.invoke(this, wait, glRunnable);
-  }
-
-  public void setContext(GLContext ctx) {
-    context=(GLContextImpl)ctx;
-  }
-
-  public GLContext getContext() {
-    return context;
-  }
-
-  public GLDrawable getDrawable() {
-    return pbufferDrawable;
-  }
-
-  public GL getGL() {
-    return getContext().getGL();
-  }
-
-  public GL setGL(GL gl) {
-    return getContext().setGL(gl);
-  }
-
-  public void setAutoSwapBufferMode(boolean onOrOff) {
-    drawableHelper.setAutoSwapBufferMode(onOrOff);
-  }
-
-  public boolean getAutoSwapBufferMode() {
-    return drawableHelper.getAutoSwapBufferMode();
-  }
-
-  public void swapBuffers() {
-    maybeDoSingleThreadedWorkaround(swapBuffersOnEventDispatchThreadAction, swapBuffersAction, false);
-  }
-
-  public void bindTexture() {
-    // Doesn't make much sense to try to do this on the event dispatch
-    // thread given that it has to be called while the context is current
-    context.bindPbufferToTexture();
-  }
-
-  public void releaseTexture() {
-    // Doesn't make much sense to try to do this on the event dispatch
-    // thread given that it has to be called while the context is current
-    context.releasePbufferFromTexture();
-  }
-
-  public GLCapabilitiesImmutable getChosenGLCapabilities() {
-    if (pbufferDrawable == null)
-      return null;
-
-    return pbufferDrawable.getChosenGLCapabilities();
-  }
-
-  public GLCapabilitiesImmutable getRequestedGLCapabilities() {
-    if (pbufferDrawable == null)
-      return null;
-
-    return pbufferDrawable.getRequestedGLCapabilities();
-  }
-
-  public GLProfile getGLProfile() {
-    if (pbufferDrawable == null)
-      return null;
-
-    return pbufferDrawable.getGLProfile();
-  }
-
-  private RecursiveLock recurLock = new RecursiveLock();
-
-  public int lockSurface() throws GLException {
-    recurLock.lock();
-    return NativeSurface.LOCK_SUCCESS;
-  }
-
-  public void unlockSurface() {
-    recurLock.unlock();
-  }
-
-  public boolean isSurfaceLocked() {
-    return recurLock.isLocked();
-  }
-
-  public Throwable getLockedStack() {
-    return recurLock.getLockedStack();
-  }
-
-  //----------------------------------------------------------------------
-  // No-ops for ComponentEvents
-  //
-
-  /*
-  public void addComponentListener(ComponentListener l) {}
-  public void removeComponentListener(ComponentListener l) {}
-  public void addFocusListener(FocusListener l) {}
-  public void removeFocusListener(FocusListener l) {}
-  public void addHierarchyBoundsListener(HierarchyBoundsListener l) {}
-  public void removeHierarchyBoundsListener(HierarchyBoundsListener l) {}
-  public void addHierarchyListener(HierarchyListener l) {}
-  public void removeHierarchyListener(HierarchyListener l) {}
-  public void addInputMethodListener(InputMethodListener l) {}
-  public void removeInputMethodListener(InputMethodListener l) {}
-  public void addKeyListener(KeyListener l) {}
-  public void removeKeyListener(KeyListener l) {}
-  public void addMouseListener(MouseListener l) {}
-  public void removeMouseListener(MouseListener l) {}
-  public void addMouseMotionListener(MouseMotionListener l) {}
-  public void removeMouseMotionListener(MouseMotionListener l) {}
-  public void addMouseWheelListener(MouseWheelListener l) {}
-  public void removeMouseWheelListener(MouseWheelListener l) {}
-  public void addPropertyChangeListener(PropertyChangeListener listener) {}
-  public void removePropertyChangeListener(PropertyChangeListener listener) {}
-  public void addPropertyChangeListener(String propertyName,
-                                        PropertyChangeListener listener) {}
-  public void removePropertyChangeListener(String propertyName,
-                                           PropertyChangeListener listener) {}
-                                           */
-
-  public void destroy() {
-    // FIXME: not calling event listeners .. see GLAutoDrawable spec
-    if (Threading.isSingleThreaded() &&
-        !Threading.isOpenGLThread()) {
-      Threading.invokeOnOpenGLThread(destroyAction);
-    } else {
-      destroyAction.run();
-    }
-  }
-
-  public int getFloatingPointMode() {
-    if (floatMode == 0) {
-      throw new GLException("Pbuffer not initialized, or floating-point support not requested");
-    }
-    return floatMode;
-  }
-
-  //----------------------------------------------------------------------
-  // Internals only below this point
-  //
-
-  private void maybeDoSingleThreadedWorkaround(Runnable eventDispatchThreadAction,
-                                               Runnable invokeGLAction,
-                                               boolean  isReshape) {
-    if (Threading.isSingleThreaded() &&
-        !Threading.isOpenGLThread()) {
-      Threading.invokeOnOpenGLThread(eventDispatchThreadAction);
-    } else {
-      drawableHelper.invokeGL(pbufferDrawable, context, invokeGLAction, initAction);
-    }
-  }
-
-  class InitAction implements Runnable {
-    public void run() {
-      floatMode = context.getFloatingPointMode();
-      drawableHelper.init(GLPbufferImpl.this);
-    }
-  }
-  private InitAction initAction = new InitAction();
-  
-  class DisplayAction implements Runnable {
-    public void run() {
-      drawableHelper.display(GLPbufferImpl.this);
-    }
-  }
-  private DisplayAction displayAction = new DisplayAction();
-
-  class SwapBuffersAction implements Runnable {
-    public void run() {
-      pbufferDrawable.swapBuffers();
-    }
-  }
-  private SwapBuffersAction swapBuffersAction = new SwapBuffersAction();
-
-  // Workaround for ATI driver bugs related to multithreading issues
-  // like simultaneous rendering via Animators to canvases that are
-  // being resized on the AWT event dispatch thread
-  class DisplayOnEventDispatchThreadAction implements Runnable {
-    public void run() {
-      drawableHelper.invokeGL(pbufferDrawable, context, displayAction, initAction);
-    }
-  }
-  private DisplayOnEventDispatchThreadAction displayOnEventDispatchThreadAction =
-    new DisplayOnEventDispatchThreadAction();
-  class SwapBuffersOnEventDispatchThreadAction implements Runnable {
-    public void run() {
-      drawableHelper.invokeGL(pbufferDrawable, context, swapBuffersAction, initAction);
-    }
-  }
-  private SwapBuffersOnEventDispatchThreadAction swapBuffersOnEventDispatchThreadAction =
-    new SwapBuffersOnEventDispatchThreadAction();
-
-  class DestroyAction implements Runnable {
-    public void run() {
-      if (null != context) {
-          context.destroy();
-      }
-      pbufferDrawable.destroy();
-    }
-  }
-  private DestroyAction destroyAction = new DestroyAction();
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLRunnableTask.java b/src/jogl/classes/com/jogamp/opengl/impl/GLRunnableTask.java
deleted file mode 100644
index a2a6939..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLRunnableTask.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl;
-
-import javax.media.opengl.GLRunnable;
-import javax.media.opengl.GLAutoDrawable;
-
-/**
- * Helper class to provide a Runnable queue implementation with a Runnable wrapper
- * which notifies after execution for the <code>invokeAndWait()</code> semantics.
- */
-public class GLRunnableTask implements GLRunnable {
-    GLRunnable runnable;
-    Object notifyObject;
-    boolean catchExceptions;
-    boolean isExecuted;
-
-    Throwable runnableException;
-
-    public GLRunnableTask(GLRunnable runnable, Object notifyObject, boolean catchExceptions) {
-        this.runnable = runnable ;
-        this.notifyObject = notifyObject ;
-        this.catchExceptions = catchExceptions;
-        isExecuted = false;
-    }
-
-    public void run(GLAutoDrawable drawable) {
-        if(null == notifyObject) {
-            try {
-                runnable.run(drawable);
-            } catch (Throwable t) {
-                runnableException = t;
-                if(catchExceptions) {
-                    runnableException.printStackTrace();
-                } else {
-                    throw new RuntimeException(runnableException);
-                }
-            } finally {
-                isExecuted=true;
-            }
-        } else {
-            synchronized (notifyObject) {
-                try {
-                    runnable.run(drawable);
-                } catch (Throwable t) {
-                    runnableException = t;
-                    if(catchExceptions) {
-                        runnableException.printStackTrace();
-                    } else {
-                        throw new RuntimeException(runnableException);
-                    }
-                } finally {
-                    isExecuted=true;
-                    notifyObject.notifyAll();
-                }
-            }
-        }
-    }
-
-    public boolean isExecuted() { return isExecuted; }
-    public Throwable getThrowable() { return runnableException; }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLStateTracker.java b/src/jogl/classes/com/jogamp/opengl/impl/GLStateTracker.java
deleted file mode 100644
index 9d896b7..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLStateTracker.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import java.util.List;
-import java.util.ArrayList;
-import javax.media.opengl.*;
-import com.jogamp.common.util.IntIntHashMap;
-
-/**
- * Tracks as closely as possible OpenGL states.
- * GLStateTracker objects are allocated on a per-OpenGL-context basis.
- * <p>
- * Currently supported states: PixelStorei
- */
-
-public class GLStateTracker {
-  private static final boolean DEBUG = Debug.debug("GLStateTracker");
-
-  private volatile boolean enabled = true;
-
-  private IntIntHashMap pixelStateMap;
-
-  static class SavedState {
-    SavedState() {
-        this.pixelStateMap = null;
-    }
-    void putPixelStateMap(IntIntHashMap pixelStateMap) {
-        this.pixelStateMap = new IntIntHashMap();
-        this.pixelStateMap.setKeyNotFoundValue(-1);
-        this.pixelStateMap.putAll(pixelStateMap);
-    }
-    IntIntHashMap getPixelStateMap() { return pixelStateMap; }
-
-    private IntIntHashMap pixelStateMap;
-    // private Map otherStateMap;
-  }
-  private List/*<SavedState>*/ stack = new ArrayList();
-
-  public GLStateTracker() {
-    pixelStateMap = new IntIntHashMap();
-    pixelStateMap.setKeyNotFoundValue(-1);
-    resetStates();
-  }
-
-  public void clearStates(boolean enable) {
-    enabled = enable;    
-    pixelStateMap.clear();
-  }
-
-  public void setEnabled(boolean on) {
-    enabled = on;    
-  }
-
-  public boolean isEnabled() {
-    return enabled;
-  }
-
-  /** @return true if found in our map, otherwise false, 
-   *  which forces the caller to query GL. */
-  public boolean getInt(int pname, int[] params, int params_offset) {
-    if(enabled) {
-        int value = pixelStateMap.get(pname);
-        if(0 <= value) {
-            params[params_offset] = value;
-            return true;
-        }
-    }
-    return false;
-  }
-
-  /** @return true if found in our map, otherwise false, 
-   *  which forces the caller to query GL. */
-  public boolean getInt(int pname, java.nio.IntBuffer params, int dummy) {
-    if(enabled) {
-        int value = pixelStateMap.get(pname);
-        if(0 <= value) {
-            params.put(params.position(), value);
-            return true;
-        }
-    }
-    return false;
-  }
-
-  public void setInt(int pname, int param) {
-    if(enabled) {
-        pixelStateMap.put(pname, param);
-    }
-  }
-
-  public void pushAttrib(int flags) {
-    if(enabled) {
-        SavedState state = new SavedState();
-        if( 0 != (flags&GL2.GL_CLIENT_PIXEL_STORE_BIT) ) {
-            state.putPixelStateMap(pixelStateMap);
-        }
-        stack.add(0, state);
-    }
-  }
-
-  public void popAttrib() {
-    if(enabled) {
-        if(stack.size()==0) {
-            throw new GLException("stack contains no elements");
-        }
-        SavedState state = (SavedState) stack.remove(0);
-        if(null==state) {
-            throw new GLException("null stack element (remaining stack size "+stack.size()+")");
-        }
-
-        IntIntHashMap pixelStateMapNew = new IntIntHashMap();
-        pixelStateMapNew.setKeyNotFoundValue(-1);
-        if ( null != state.getPixelStateMap() ) {
-            pixelStateMapNew.putAll(state.getPixelStateMap());
-        }
-        pixelStateMap = pixelStateMapNew;
-    }
-  }
-
-  public void resetStates() {
-    pixelStateMap.clear();
-
-    pixelStateMap.put(GL.GL_PACK_ALIGNMENT,          4);
-    pixelStateMap.put(GL2GL3.GL_PACK_SWAP_BYTES,     0 /* GL_FALSE */);
-    pixelStateMap.put(GL2GL3.GL_PACK_LSB_FIRST,      0 /* GL_FALSE */);
-    pixelStateMap.put(GL2GL3.GL_PACK_ROW_LENGTH,     0);
-    pixelStateMap.put(GL2GL3.GL_PACK_SKIP_ROWS,      0);
-    pixelStateMap.put(GL2GL3.GL_PACK_SKIP_PIXELS,    0);
-    pixelStateMap.put(GL2GL3.GL_PACK_IMAGE_HEIGHT,   0);
-    pixelStateMap.put(GL2GL3.GL_PACK_SKIP_IMAGES,    0);
-
-    pixelStateMap.put(GL.GL_UNPACK_ALIGNMENT,        4);
-    pixelStateMap.put(GL2GL3.GL_UNPACK_SWAP_BYTES,   0 /* GL_FALSE */);
-    pixelStateMap.put(GL2GL3.GL_UNPACK_LSB_FIRST,    0 /* GL_FALSE */);
-    pixelStateMap.put(GL2GL3.GL_UNPACK_ROW_LENGTH,   0);
-    pixelStateMap.put(GL2GL3.GL_UNPACK_SKIP_ROWS,    0);
-    pixelStateMap.put(GL2GL3.GL_UNPACK_SKIP_PIXELS,  0);
-    pixelStateMap.put(GL2GL3.GL_UNPACK_IMAGE_HEIGHT, 0);
-    pixelStateMap.put(GL2GL3.GL_UNPACK_SKIP_IMAGES,  0);
-  }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLWorkerThread.java b/src/jogl/classes/com/jogamp/opengl/impl/GLWorkerThread.java
deleted file mode 100644
index c292de7..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLWorkerThread.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import java.lang.reflect.InvocationTargetException;
-import java.security.*;
-import java.util.*;
-import javax.media.opengl.*;
-
-/** Singleton thread upon which all OpenGL work is performed by
-    default. Unfortunately many vendors' OpenGL drivers are not really
-    thread-safe and stability is much improved by performing OpenGL
-    work on at most one thread. This is the default behavior of the
-    GLAutoDrawable implementations according to the {@link
-    javax.media.opengl.Threading Threading} class. The GLWorkerThread
-    replaces the original AWT event queue thread-based mechanism for
-    two reasons: first, more than one AWT event queue thread may be
-    spawned, for example if a dialog is being shown; second, it avoids
-    blocking the AWT event queue thread during OpenGL rendering. */
-
-public class GLWorkerThread {
-  private static volatile boolean started;
-  private static volatile Thread thread;
-  private static Object lock;
-  private static volatile boolean shouldTerminate;
-  private static volatile Throwable exception;
-
-  // The Runnable to execute immediately on the worker thread
-  private static volatile Runnable work;
-  // Queue of Runnables to be asynchronously invoked
-  private static List queue = new LinkedList();
-  
-  /** Should only be called by Threading class if creation of the
-      GLWorkerThread was requested via the opengl.1thread system
-      property. */
-  public static void start() {
-    if (!started) {
-      synchronized (GLWorkerThread.class) {
-        if (!started) {
-          lock = new Object();
-          thread = new Thread(new WorkerRunnable(),
-                              "JOGL GLWorkerThread");
-          thread.setDaemon(true);
-          started = true;
-          synchronized (lock) {
-            thread.start();
-            try {
-              lock.wait();
-            } catch (InterruptedException e) {
-            }
-          }
-
-          /*
-
-          // Note: it appears that there is a bug in NVidia's current
-          // drivers where if a context was ever made current on a
-          // given thread and that thread has exited before program
-          // exit, a crash occurs in the drivers. Releasing the
-          // context from the given thread does not work around the
-          // problem.
-          //
-          // For the time being, we're going to work around this
-          // problem by not terminating the GLWorkerThread. In theory,
-          // shutting down the GLWorkerThread cleanly could be a good
-          // general solution to the problem of needing to
-          // cooperatively terminate all Animators at program exit.
-          //
-          // It appears that this doesn't even work around all of the
-          // kinds of crashes. Causing the context to be unilaterally
-          // released from the GLWorkerThread after each invocation
-          // seems to work around all of the kinds of crashes seen.
-          //
-          // These appear to be similar to the kinds of crashes seen
-          // when the Java2D/OpenGL pipeline terminates, and those are
-          // a known issue being fixed, so presumably these will be
-          // fixed in NVidia's next driver set.
-
-          // Install shutdown hook to terminate daemon thread more or
-          // less cooperatively
-          AccessController.doPrivileged(new PrivilegedAction() {
-              public Object run() {
-                Runtime.getRuntime().addShutdownHook(new Thread() {
-                    public void run() {
-                      Object lockTemp = lock;
-                      if (lockTemp == null) {
-                        // Already terminating (?)
-                        return;
-                      }
-                      synchronized (lockTemp) {
-                        shouldTerminate = true;
-                        lockTemp.notifyAll();
-                        try {
-                          lockTemp.wait(500);
-                        } catch (InterruptedException e) {
-                        }
-                      }
-                    }
-                  });
-                return null;
-              }
-            });
-
-          */
-
-        } else {
-          throw new RuntimeException("Should not start GLWorkerThread twice");
-        }
-      }
-    }
-  }
-
-  public static void invokeAndWait(Runnable runnable)
-    throws InvocationTargetException, InterruptedException {
-    if (!started) {
-      throw new RuntimeException("May not invokeAndWait on worker thread without starting it first");
-    }
-
-    Object lockTemp = lock;
-    if (lockTemp == null) {
-      return; // Terminating
-    }
-
-    synchronized (lockTemp) {
-      if (thread == null) {
-        // Terminating
-        return;
-      }
-
-      work = runnable;
-      lockTemp.notifyAll();
-      lockTemp.wait();
-      if (exception != null) {
-        Throwable localException = exception;
-        exception = null;
-        throw new InvocationTargetException(localException);
-      }
-    }
-  }
-
-  public static void invokeLater(Runnable runnable) {
-    if (!started) {
-      throw new RuntimeException("May not invokeLater on worker thread without starting it first");
-    }
-
-    Object lockTemp = lock;
-    if (lockTemp == null) {
-      return; // Terminating
-    }
-
-    synchronized (lockTemp) {
-      if (thread == null) {
-        // Terminating
-        return;
-      }
-
-      queue.add(runnable);
-      lockTemp.notifyAll();
-    }
-  }
-
-  /** Indicates whether the OpenGL worker thread was started, i.e.,
-      whether it is currently in use. */
-  public static boolean isStarted() {
-    return started;
-  }
-
-  /** Indicates whether the current thread is the OpenGL worker
-      thread. */
-  public static boolean isWorkerThread() {
-    return (Thread.currentThread() == thread);
-  }
-
-  static class WorkerRunnable implements Runnable {
-    public void run() {
-      // Notify starting thread that we're ready
-      synchronized (lock) {
-        lock.notifyAll();
-      }
-
-      while (!shouldTerminate) {
-        synchronized (lock) {
-          while (!shouldTerminate &&
-                 (work == null) &&
-                 queue.isEmpty()) {
-            try {
-              // Avoid race conditions with wanting to release contexts on this thread
-              lock.wait(1000);
-            } catch (InterruptedException e) {
-            }
-
-            if (GLContext.getCurrent() != null) {
-              // Test later to see whether we need to release this context
-              break;
-            }
-          }
-          
-          if (shouldTerminate) {
-            lock.notifyAll();
-            thread = null;
-            lock = null;
-            return;
-          }
-
-          if (work != null) {
-            try {
-              work.run();
-            } catch (Throwable t) {
-              exception = t;
-            } finally {
-              work = null;
-              lock.notifyAll();
-            }
-          }
-
-          while (!queue.isEmpty()) {
-            try {
-              Runnable curAsync = (Runnable) queue.remove(0);
-              curAsync.run();
-            } catch (Throwable t) {
-              System.err.println("Exception occurred on JOGL OpenGL worker thread:");
-              t.printStackTrace();
-            }
-          }
-
-          // See about releasing current context
-          GLContext curContext = GLContext.getCurrent();
-          if (curContext != null &&
-              (curContext instanceof GLContextImpl)) {
-            GLContextImpl impl = (GLContextImpl) curContext;
-            if (impl.hasWaiters()) {
-              impl.release();
-            }
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/MemoryObject.java b/src/jogl/classes/com/jogamp/opengl/impl/MemoryObject.java
deleted file mode 100644
index a691a61..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/MemoryObject.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.opengl.impl;
-
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-
-/**
- *
- */
-public class MemoryObject {
-    private long addr;
-    private long size;
-    private int  hash32;
-    private ByteBuffer buffer=null;
-
-    public MemoryObject(long addr, long size) {
-        this.addr = addr;
-        this.size = size;
-        this.hash32 = getHash32(addr, size);
-    }
-
-    public void setBuffer(ByteBuffer buffer) {
-        this.buffer = buffer;
-    }
-
-    public ByteBuffer getBuffer() {
-        return this.buffer;
-    }
-
-    /**
-     * @return the 32bit hash value generated via {@link #getHash32(long, long)}
-     */
-    public int hashCode() {
-        return hash32;
-    }
-
-    /**
-     * Ignores the optional attached <code>ByteBuffer</code> intentionally.<br>
-     * 
-     * @return true of reference is equal or <code>obj</code> is of type <code>MemoryObject</code>
-     *         and <code>addr</code> and <code>size</code> is equal.<br>
-     */
-    public boolean equals(Object obj) {
-        if(this == obj) { return true; }
-        if(obj instanceof MemoryObject) {
-            MemoryObject m = (MemoryObject) obj;
-            return addr == m.addr && size == m.size ;
-        }
-        return false;
-    }
-
-    /**
-     * Generates a 32bit hash value by <code>addr</code> and <code>size</code>.<br>
-     * Ignores the optional attached <code>ByteBuffer</code> intentionally.<br>
-     */
-    public static int getHash32(long addr, long size) {
-        // avoid xor collisions of eg low/high parts
-        // 31 * x == (x << 5) - x
-        int  hash = 31 +              (int)   addr          ; // lo addr
-        hash = ((hash << 5) - hash) + (int) ( addr >>> 32 ) ; // hi addr
-        hash = ((hash << 5) - hash) + (int)   size          ; // lo size
-        hash = ((hash << 5) - hash) + (int) ( size >>> 32 ) ; // hi size
-
-        return hash;
-    }
-
-    /**
-     * Generates a 64bit hash value by <code>addr</code> and <code>size</code>.<br>
-     * Ignores the optional attached <code>ByteBuffer</code> intentionally.<br>
-     */
-    public static long getHash64(long addr, long size) {
-        // 31 * x == (x << 5) - x
-        final long hash = 31 + addr;
-        return ((hash << 5) - hash) + size;
-    }
-
-    public String toString() {
-        return "MemoryObject[addr 0x"+Long.toHexString(addr)+", size 0x"+Long.toHexString(size)+", hash32: 0x"+Integer.toHexString(hash32)+"]";
-    }
-
-    /**
-     * Verifies the hash map operation, ie
-     * <ul>
-     *  <li>slow add: if !map.contains(obj0), the values are verified (slow)</li>
-     *  <li>fast get: if map.contains(obj0), the mapped value is compared with equals (fast) </li>
-     * </ul>
-     * In case the above verification fails, a RuntimeException is thrown.<br>
-     * In such case the calculation of the hash value should either be tuned,<br>
-     * or we just cannot use hash mapping.<br>
-     *
-     * @param map the identity HashMap mapping MemoryObject to MemoryObject
-     * @param obj0 the MemoryObject to get or add in the map
-     * @return either the already mapped one where <code>obj0</code> != <code>return</code>,
-     *         or the added <code>obj0</code> == <code>return</code>.
-     * @throws RuntimeException if hash collision occurs
-     */
-    public static MemoryObject getOrAddSafe(HashMap/*<MemoryObject,MemoryObject>*/ map, MemoryObject obj0) {
-        MemoryObject obj1 = (MemoryObject) map.get(obj0); // get identity (fast)
-        if(null == obj1) {
-            // verify hash collision (slow)
-            if( map.values().contains(obj0) ) {
-                throw new RuntimeException("Hash collision, hash !exist, but in values: "+obj0);
-            }
-            map.put(obj0, obj0);
-            obj1 = obj0;
-        } else {
-            // verify hash collision (ok)
-            if( !obj1.equals(obj0) ) {
-                throw new RuntimeException("Hash collision, hash equals, but objects not: query "+obj0+" != contained "+obj1);
-            }
-        }
-        return obj1;
-    }
-
-}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/ProjectFloat.java b/src/jogl/classes/com/jogamp/opengl/impl/ProjectFloat.java
deleted file mode 100644
index ab277e7..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/ProjectFloat.java
+++ /dev/null
@@ -1,1058 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-** 
-** http://oss.sgi.com/projects/FreeB
-** 
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-** 
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-** 
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2009-03-13 22:20:29 -0700 (Fri, 13 Mar 2009) $ $Revision: 1867 $
-** $Header$
-*/
-
-/* 
- * Copyright (c) 2002-2004 LWJGL Project
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are 
- * met:
- * 
- * * Redistributions of source code must retain the above copyright 
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'LWJGL' nor the names of 
- *   its contributors may be used to endorse or promote products derived 
- *   from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-package com.jogamp.opengl.impl;
-
-import java.nio.*;
-
-import javax.media.opengl.*;
-import javax.media.opengl.fixedfunc.GLMatrixFunc;
-import com.jogamp.common.nio.Buffers;
-
-/**
- * ProjectFloat.java
- * <p/>
- * <p/>
- * Created 11-jan-2004
- * 
- * @author Erik Duijs
- * @author Kenneth Russell
- */
-public class ProjectFloat {
-  private static final float[] IDENTITY_MATRIX =
-    new float[] {
-      1.0f, 0.0f, 0.0f, 0.0f,
-      0.0f, 1.0f, 0.0f, 0.0f,
-      0.0f, 0.0f, 1.0f, 0.0f,
-      0.0f, 0.0f, 0.0f, 1.0f };
-
-  private static final float[] ZERO_MATRIX =
-    new float[] {
-      0.0f, 0.0f, 0.0f, 0.0f,
-      0.0f, 0.0f, 0.0f, 0.0f,
-      0.0f, 0.0f, 0.0f, 0.0f,
-      0.0f, 0.0f, 0.0f, 0.0f };
-
-  // Note that we have cloned parts of the implementation in order to
-  // support incoming Buffers. The reason for this is to avoid loading
-  // non-direct buffer subclasses unnecessarily, because doing so can
-  // cause performance decreases on direct buffer operations, at least
-  // on the current HotSpot JVM. It would be nicer (and make the code
-  // simpler) to simply have the array-based entry points delegate to
-  // the versions taking Buffers by wrapping the arrays.
-
-  // Array-based implementation
-  private final float[] matrix = new float[16];
-  private final float[][] tempInvertMatrix = new float[4][4];
-
-  private final float[] in = new float[4];
-  private final float[] out = new float[4];
-
-  private final float[] forward = new float[3];
-  private final float[] side = new float[3];
-  private final float[] up = new float[3];
-  
-  // Buffer-based implementation
-  private FloatBuffer locbuf;
-  private final FloatBuffer matrixBuf;
-  private final FloatBuffer tempInvertMatrixBuf;
-
-  private final FloatBuffer inBuf;
-  private final FloatBuffer outBuf;
-
-  private final FloatBuffer forwardBuf;
-  private final FloatBuffer sideBuf;
-  private final FloatBuffer upBuf;
-
-  public ProjectFloat() {
-    // Use direct buffers to avoid loading indirect buffer
-    // implementations for applications trying to avoid doing so.
-    // Slice up one big buffer because some NIO implementations
-    // allocate a huge amount of memory to back even the smallest of
-    // buffers.
-    locbuf = Buffers.newDirectFloatBuffer(2*16+2*4+3*3);
-    int pos = 0;
-    int sz = 16;
-    matrixBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    tempInvertMatrixBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    sz = 4;
-    inBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    outBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    sz = 3;
-    forwardBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    sideBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    upBuf = slice(locbuf, pos, sz);
-  }
-
-  public void destroy() {
-    if(locbuf!=null) {
-        locbuf.clear();
-        locbuf=null;
-    }
-  }
-
-  private static FloatBuffer slice(FloatBuffer buf, int pos, int len) {
-    buf.position(pos);
-    buf.limit(pos + len);
-    return buf.slice();
-  }
-
-  /**
-   * Make matrix an identity matrix
-   */
-  public static void gluMakeIdentityf(FloatBuffer m) {
-    int oldPos = m.position();
-    m.put(IDENTITY_MATRIX);
-    m.position(oldPos);
-  }
-
-  /**
-   * Make matrix an zero matrix
-   */
-  public static void gluMakeZero(FloatBuffer m) {
-    int oldPos = m.position();
-    m.put(ZERO_MATRIX);
-    m.position(oldPos);
-  }
-
-  /**
-   * Make matrix an identity matrix
-   */
-  public static void gluMakeIdentityf(float[] m) {
-    for (int i = 0; i < 16; i++) {
-      m[i] = IDENTITY_MATRIX[i];
-    }
-  }
-
-  /**
-   * Method __gluMultMatrixVecf
-   * 
-   * @param matrix
-   * @param in
-   * @param out
-   */
-  private void __gluMultMatrixVecf(float[] matrix, int matrix_offset, float[] in, float[] out) {
-    for (int i = 0; i < 4; i++) {
-      out[i] =
-        in[0] * matrix[0*4+i+matrix_offset] +
-        in[1] * matrix[1*4+i+matrix_offset] +
-        in[2] * matrix[2*4+i+matrix_offset] +
-        in[3] * matrix[3*4+i+matrix_offset];
-    }
-  }
-
-  /**
-   * Method __gluMultMatrixVecf
-   * 
-   * @param matrix
-   * @param in
-   * @param out
-   */
-  private void __gluMultMatrixVecf(FloatBuffer matrix, FloatBuffer in, FloatBuffer out) {
-    int inPos = in.position();
-    int outPos = out.position();
-    int matrixPos = matrix.position();
-    for (int i = 0; i < 4; i++) {
-      out.put(i + outPos,
-              in.get(0+inPos) * matrix.get(0*4+i+matrixPos) +
-              in.get(1+inPos) * matrix.get(1*4+i+matrixPos) +
-              in.get(2+inPos) * matrix.get(2*4+i+matrixPos) +
-              in.get(3+inPos) * matrix.get(3*4+i+matrixPos));
-    }
-  }
-
-  /**
-   * @param src
-   * @param inverse
-   * 
-   * @return
-   */
-  public boolean gluInvertMatrixf(float[] src, float[] inverse) {
-    int i, j, k, swap;
-    float t;
-    float[][] temp = tempInvertMatrix;
-
-    for (i = 0; i < 4; i++) {
-      for (j = 0; j < 4; j++) {
-        temp[i][j] = src[i*4+j];
-      }
-    }
-    gluMakeIdentityf(inverse);
-
-    for (i = 0; i < 4; i++) {
-      //
-      // Look for largest element in column
-      //
-      swap = i;
-      for (j = i + 1; j < 4; j++) {
-        if (Math.abs(temp[j][i]) > Math.abs(temp[i][i])) {
-          swap = j;
-        }
-      }
-
-      if (swap != i) {
-        //
-        // Swap rows.
-        //
-        for (k = 0; k < 4; k++) {
-          t = temp[i][k];
-          temp[i][k] = temp[swap][k];
-          temp[swap][k] = t;
-
-          t = inverse[i*4+k];
-          inverse[i*4+k] = inverse[swap*4+k];
-          inverse[swap*4+k] = t;
-        }
-      }
-
-      if (temp[i][i] == 0) {
-        //
-        // No non-zero pivot. The matrix is singular, which shouldn't
-        // happen. This means the user gave us a bad matrix.
-        //
-        return false;
-      }
-
-      t = temp[i][i];
-      for (k = 0; k < 4; k++) {
-        temp[i][k] /= t;
-        inverse[i*4+k] /= t;
-      }
-      for (j = 0; j < 4; j++) {
-        if (j != i) {
-          t = temp[j][i];
-          for (k = 0; k < 4; k++) {
-            temp[j][k] -= temp[i][k] * t;
-            inverse[j*4+k] -= inverse[i*4+k]*t;
-          }
-        }
-      }
-    }
-    return true;
-  }
-
-  /**
-   * @param src
-   * @param inverse
-   * 
-   * @return
-   */
-  public boolean gluInvertMatrixf(FloatBuffer src, FloatBuffer inverse) {
-    int i, j, k, swap;
-    float t;
-
-    int srcPos = src.position();
-    int invPos = inverse.position();
-
-    FloatBuffer temp = tempInvertMatrixBuf;
-
-    for (i = 0; i < 4; i++) {
-      for (j = 0; j < 4; j++) {
-        temp.put(i*4+j, src.get(i*4+j + srcPos));
-      }
-    }
-    gluMakeIdentityf(inverse);
-
-    for (i = 0; i < 4; i++) {
-      //
-      // Look for largest element in column
-      //
-      swap = i;
-      for (j = i + 1; j < 4; j++) {
-        if (Math.abs(temp.get(j*4+i)) > Math.abs(temp.get(i*4+i))) {
-          swap = j;
-        }
-      }
-
-      if (swap != i) {
-        //
-        // Swap rows.
-        //
-        for (k = 0; k < 4; k++) {
-          t = temp.get(i*4+k);
-          temp.put(i*4+k, temp.get(swap*4+k));
-          temp.put(swap*4+k, t);
-
-          t = inverse.get(i*4+k + invPos);
-          inverse.put(i*4+k + invPos, inverse.get(swap*4+k + invPos));
-          inverse.put(swap*4+k + invPos, t);
-        }
-      }
-
-      if (temp.get(i*4+i) == 0) {
-        //
-        // No non-zero pivot. The matrix is singular, which shouldn't
-        // happen. This means the user gave us a bad matrix.
-        //
-        return false;
-      }
-
-      t = temp.get(i*4+i);
-      for (k = 0; k < 4; k++) {
-        temp.put(i*4+k, temp.get(i*4+k) / t);
-        inverse.put(i*4+k + invPos, inverse.get(i*4+k + invPos) / t);
-      }
-      for (j = 0; j < 4; j++) {
-        if (j != i) {
-          t = temp.get(j*4+i);
-          for (k = 0; k < 4; k++) {
-            temp.put(j*4+k, temp.get(j*4+k) - temp.get(i*4+k) * t);
-            inverse.put(j*4+k + invPos, inverse.get(j*4+k + invPos) - inverse.get(i*4+k + invPos) * t);
-          }
-        }
-      }
-    }
-    return true;
-  }
-
-
-  /**
-   * @param a
-   * @param b
-   * @param r
-   */
-  private void gluMultMatricesf(float[] a, int a_offset, float[] b, int b_offset, float[] r) {
-    for (int i = 0; i < 4; i++) {
-      for (int j = 0; j < 4; j++) {
-        r[i*4+j] =
-          a[i*4+0+a_offset]*b[0*4+j+b_offset] +
-          a[i*4+1+a_offset]*b[1*4+j+b_offset] +
-          a[i*4+2+a_offset]*b[2*4+j+b_offset] +
-          a[i*4+3+a_offset]*b[3*4+j+b_offset];
-      }
-    }
-  }
-
-
-  /**
-   * @param a
-   * @param b
-   * @param r
-   */
-  public static void gluMultMatricesf(FloatBuffer a, FloatBuffer b, FloatBuffer r) {
-    int aPos = a.position();
-    int bPos = b.position();
-    int rPos = r.position();
-
-    for (int i = 0; i < 4; i++) {
-      for (int j = 0; j < 4; j++) {
-        r.put(i*4+j + rPos,
-          a.get(i*4+0+aPos)*b.get(0*4+j+bPos) +
-          a.get(i*4+1+aPos)*b.get(1*4+j+bPos) +
-          a.get(i*4+2+aPos)*b.get(2*4+j+bPos) +
-          a.get(i*4+3+aPos)*b.get(3*4+j+bPos));
-      }
-    }
-  }
-
-  /**
-   * Normalize vector
-   *
-   * @param v
-   */
-  public static void normalize(float[] v) {
-    float r;
-
-    r = (float) Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-    if ( r == 0.0 || r == 1.0)
-      return;
-
-    r = 1.0f / r;
-
-    v[0] *= r;
-    v[1] *= r;
-    v[2] *= r;
-
-    return;
-  }
-
-  /**
-   * Normalize vector
-   *
-   * @param v
-   */
-  public static void normalize(FloatBuffer v) {
-    float r;
-
-    int vPos = v.position();
-
-    r = (float) Math.sqrt(v.get(0+vPos) * v.get(0+vPos) +
-                          v.get(1+vPos) * v.get(1+vPos) +
-                          v.get(2+vPos) * v.get(2+vPos));
-    if ( r == 0.0 || r == 1.0)
-      return;
-
-    r = 1.0f / r;
-
-    v.put(0+vPos, v.get(0+vPos) * r);
-    v.put(1+vPos, v.get(1+vPos) * r);
-    v.put(2+vPos, v.get(2+vPos) * r);
-
-    return;
-  }
-
-
-  /**
-   * Calculate cross-product
-   *
-   * @param v1
-   * @param v2
-   * @param result
-   */
-  private static void cross(float[] v1, float[] v2, float[] result) {
-    result[0] = v1[1] * v2[2] - v1[2] * v2[1];
-    result[1] = v1[2] * v2[0] - v1[0] * v2[2];
-    result[2] = v1[0] * v2[1] - v1[1] * v2[0];
-  }
-
-  /**
-   * Calculate cross-product
-   *
-   * @param v1
-   * @param v2
-   * @param result
-   */
-  private static void cross(FloatBuffer v1, FloatBuffer v2, FloatBuffer result) {
-    int v1Pos = v1.position();
-    int v2Pos = v2.position();
-    int rPos  = result.position();
-
-    result.put(0+rPos, v1.get(1+v1Pos) * v2.get(2+v2Pos) - v1.get(2+v1Pos) * v2.get(1+v2Pos));
-    result.put(1+rPos, v1.get(2+v1Pos) * v2.get(0+v2Pos) - v1.get(0+v1Pos) * v2.get(2+v2Pos));
-    result.put(2+rPos, v1.get(0+v1Pos) * v2.get(1+v2Pos) - v1.get(1+v1Pos) * v2.get(0+v2Pos));
-  }
-
-  /**
-   * Method gluOrtho2D.
-   * 
-   * @param left
-   * @param right
-   * @param bottom
-   * @param top
-   */
-  public void gluOrtho2D(GLMatrixFunc gl, float left, float right, float bottom, float top) {
-    gl.glOrthof(left, right, bottom, top, -1, 1);
-  }
-
-  /**
-   * Method gluPerspective.
-   * 
-   * @param fovy
-   * @param aspect
-   * @param zNear
-   * @param zFar
-   */
-  public void gluPerspective(GLMatrixFunc gl, float fovy, float aspect, float zNear, float zFar) {
-    float sine, cotangent, deltaZ;
-    float radians = fovy / 2 * (float) Math.PI / 180;
-
-    deltaZ = zFar - zNear;
-    sine = (float) Math.sin(radians);
-
-    if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) {
-      return;
-    }
-
-    cotangent = (float) Math.cos(radians) / sine;
-
-    gluMakeIdentityf(matrixBuf);
-
-    matrixBuf.put(0 * 4 + 0, cotangent / aspect);
-    matrixBuf.put(1 * 4 + 1, cotangent);
-    matrixBuf.put(2 * 4 + 2, - (zFar + zNear) / deltaZ);
-    matrixBuf.put(2 * 4 + 3, -1);
-    matrixBuf.put(3 * 4 + 2, -2 * zNear * zFar / deltaZ);
-    matrixBuf.put(3 * 4 + 3, 0);
-
-    gl.glMultMatrixf(matrixBuf);
-  }
-
-  /**
-   * Method gluLookAt
-   * 
-   * @param eyex
-   * @param eyey
-   * @param eyez
-   * @param centerx
-   * @param centery
-   * @param centerz
-   * @param upx
-   * @param upy
-   * @param upz
-   */
-  public void gluLookAt(GLMatrixFunc gl,
-                        float eyex,
-                        float eyey,
-                        float eyez,
-                        float centerx,
-                        float centery,
-                        float centerz,
-                        float upx,
-                        float upy,
-                        float upz) {
-    FloatBuffer forward = this.forwardBuf;
-    FloatBuffer side = this.sideBuf;
-    FloatBuffer up = this.upBuf;
-
-    forward.put(0, centerx - eyex);
-    forward.put(1, centery - eyey);
-    forward.put(2, centerz - eyez);
-
-    up.put(0, upx);
-    up.put(1, upy);
-    up.put(2, upz);
-
-    normalize(forward);
-
-    /* Side = forward x up */
-    cross(forward, up, side);
-    normalize(side);
-
-    /* Recompute up as: up = side x forward */
-    cross(side, forward, up);
-
-    gluMakeIdentityf(matrixBuf);
-    matrixBuf.put(0 * 4 + 0, side.get(0));
-    matrixBuf.put(1 * 4 + 0, side.get(1));
-    matrixBuf.put(2 * 4 + 0, side.get(2));
-
-    matrixBuf.put(0 * 4 + 1, up.get(0));
-    matrixBuf.put(1 * 4 + 1, up.get(1));
-    matrixBuf.put(2 * 4 + 1, up.get(2));
-
-    matrixBuf.put(0 * 4 + 2, -forward.get(0));
-    matrixBuf.put(1 * 4 + 2, -forward.get(1));
-    matrixBuf.put(2 * 4 + 2, -forward.get(2));
-
-    gl.glMultMatrixf(matrixBuf);
-    gl.glTranslatef(-eyex, -eyey, -eyez);
-  }
-
-  /**
-   * Method gluProject
-   * 
-   * @param objx
-   * @param objy
-   * @param objz
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param win_pos
-   * 
-   * @return
-   */
-  public boolean gluProject(float objx,
-                            float objy,
-                            float objz,
-                            float[] modelMatrix,
-                            int modelMatrix_offset,
-                            float[] projMatrix,
-                            int projMatrix_offset,
-                            int[] viewport,
-                            int viewport_offset,
-                            float[] win_pos,
-                            int win_pos_offset ) {
-
-    float[] in = this.in;
-    float[] out = this.out;
-
-    in[0] = objx;
-    in[1] = objy;
-    in[2] = objz;
-    in[3] = 1.0f;
-
-    __gluMultMatrixVecf(modelMatrix, modelMatrix_offset, in, out);
-    __gluMultMatrixVecf(projMatrix, projMatrix_offset, out, in);
-
-    if (in[3] == 0.0f)
-      return false;
-
-    in[3] = (1.0f / in[3]) * 0.5f;
-
-    // Map x, y and z to range 0-1
-    in[0] = in[0] * in[3] + 0.5f;
-    in[1] = in[1] * in[3] + 0.5f;
-    in[2] = in[2] * in[3] + 0.5f;
-
-    // Map x,y to viewport
-    win_pos[0+win_pos_offset] = in[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
-    win_pos[1+win_pos_offset] = in[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
-    win_pos[2+win_pos_offset] = in[2];
-
-    return true;
-  }
-
-  /**
-   * Method gluProject
-   * 
-   * @param objx
-   * @param objy
-   * @param objz
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param win_pos
-   * 
-   * @return
-   */
-  public boolean gluProject(float objx,
-                            float objy,
-                            float objz,
-                            FloatBuffer modelMatrix,
-                            FloatBuffer projMatrix,
-                            IntBuffer viewport,
-                            FloatBuffer win_pos) {
-
-    FloatBuffer in = this.inBuf;
-    FloatBuffer out = this.outBuf;
-
-    in.put(0, objx);
-    in.put(1, objy);
-    in.put(2, objz);
-    in.put(3, 1.0f);
-
-    __gluMultMatrixVecf(modelMatrix, in, out);
-    __gluMultMatrixVecf(projMatrix, out, in);
-
-    if (in.get(3) == 0.0f)
-      return false;
-
-    in.put(3, (1.0f / in.get(3)) * 0.5f);
-
-    // Map x, y and z to range 0-1
-    in.put(0, in.get(0) * in.get(3) + 0.5f);
-    in.put(1, in.get(1) * in.get(3) + 0.5f);
-    in.put(2, in.get(2) * in.get(3) + 0.5f);
-
-    // Map x,y to viewport
-    int vPos = viewport.position();
-    int wPos = win_pos.position();
-    win_pos.put(0+wPos, in.get(0) * viewport.get(2+vPos) + viewport.get(0+vPos));
-    win_pos.put(1+wPos, in.get(1) * viewport.get(3+vPos) + viewport.get(1+vPos));
-    win_pos.put(2+wPos, in.get(2));
-
-    return true;
-  }
-
-
-  /**
-   * Method gluUnproject
-   * 
-   * @param winx
-   * @param winy
-   * @param winz
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param obj_pos
-   * 
-   * @return
-   */
-  public boolean gluUnProject(float winx,
-                              float winy,
-                              float winz,
-                              float[] modelMatrix,
-                              int modelMatrix_offset,
-                              float[] projMatrix,
-                              int projMatrix_offset,
-                              int[] viewport,
-                              int viewport_offset,
-                              float[] obj_pos,
-                              int obj_pos_offset) {
-    float[] in = this.in;
-    float[] out = this.out;
-
-    gluMultMatricesf(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
-
-    if (!gluInvertMatrixf(matrix, matrix))
-      return false;
-
-    in[0] = winx;
-    in[1] = winy;
-    in[2] = winz;
-    in[3] = 1.0f;
-
-    // Map x and y from window coordinates
-    in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
-    in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
-
-    // Map to range -1 to 1
-    in[0] = in[0] * 2 - 1;
-    in[1] = in[1] * 2 - 1;
-    in[2] = in[2] * 2 - 1;
-
-    __gluMultMatrixVecf(matrix, 0, in, out);
-
-    if (out[3] == 0.0)
-      return false;
-
-    out[3] = 1.0f / out[3];
-
-    obj_pos[0+obj_pos_offset] = out[0] * out[3];
-    obj_pos[1+obj_pos_offset] = out[1] * out[3];
-    obj_pos[2+obj_pos_offset] = out[2] * out[3];
-
-    return true;
-  }
-
-
-  /**
-   * Method gluUnproject
-   * 
-   * @param winx
-   * @param winy
-   * @param winz
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param obj_pos
-   * 
-   * @return
-   */
-  public boolean gluUnProject(float winx,
-                              float winy,
-                              float winz,
-                              FloatBuffer modelMatrix,
-                              FloatBuffer projMatrix,
-                              IntBuffer viewport,
-                              FloatBuffer obj_pos) {
-    FloatBuffer in = this.inBuf;
-    FloatBuffer out = this.outBuf;
-
-    gluMultMatricesf(modelMatrix, projMatrix, matrixBuf);
-
-    if (!gluInvertMatrixf(matrixBuf, matrixBuf))
-      return false;
-
-    in.put(0, winx);
-    in.put(1, winy);
-    in.put(2, winz);
-    in.put(3, 1.0f);
-
-    // Map x and y from window coordinates
-    int vPos = viewport.position();
-    int oPos = obj_pos.position();
-    in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
-    in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
-
-    // Map to range -1 to 1
-    in.put(0, in.get(0) * 2 - 1);
-    in.put(1, in.get(1) * 2 - 1);
-    in.put(2, in.get(2) * 2 - 1);
-
-    __gluMultMatrixVecf(matrixBuf, in, out);
-
-    if (out.get(3) == 0.0f)
-      return false;
-
-    out.put(3, 1.0f / out.get(3));
-
-    obj_pos.put(0+oPos, out.get(0) * out.get(3));
-    obj_pos.put(1+oPos, out.get(1) * out.get(3));
-    obj_pos.put(2+oPos, out.get(2) * out.get(3));
-
-    return true;
-  }
-
-
-  /**
-   * Method gluUnproject4
-   * 
-   * @param winx
-   * @param winy
-   * @param winz
-   * @param clipw
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param near
-   * @param far
-   * @param obj_pos
-   * 
-   * @return
-   */
-  public boolean gluUnProject4(float winx,
-                               float winy,
-                               float winz,
-                               float clipw,
-                               float[] modelMatrix,
-                               int modelMatrix_offset,
-                               float[] projMatrix,
-                               int projMatrix_offset,
-                               int[] viewport,
-                               int viewport_offset,
-                               float near,
-                               float far,
-                               float[] obj_pos,
-                               int obj_pos_offset ) {
-    float[] in = this.in;
-    float[] out = this.out;
-
-    gluMultMatricesf(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
-
-    if (!gluInvertMatrixf(matrix, matrix))
-      return false;
-
-    in[0] = winx;
-    in[1] = winy;
-    in[2] = winz;
-    in[3] = clipw;
-
-    // Map x and y from window coordinates
-    in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
-    in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
-    in[2] = (in[2] - near) / (far - near);
-
-    // Map to range -1 to 1
-    in[0] = in[0] * 2 - 1;
-    in[1] = in[1] * 2 - 1;
-    in[2] = in[2] * 2 - 1;
-
-    __gluMultMatrixVecf(matrix, 0, in, out);
-
-    if (out[3] == 0.0f)
-      return false;
-
-    obj_pos[0+obj_pos_offset] = out[0];
-    obj_pos[1+obj_pos_offset] = out[1];
-    obj_pos[2+obj_pos_offset] = out[2];
-    obj_pos[3+obj_pos_offset] = out[3];
-    return true;
-  }
-
-  /**
-   * Method gluUnproject4
-   * 
-   * @param winx
-   * @param winy
-   * @param winz
-   * @param clipw
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param near
-   * @param far
-   * @param obj_pos
-   * 
-   * @return
-   */
-  public boolean gluUnProject4(float winx,
-                               float winy,
-                               float winz,
-                               float clipw,
-                               FloatBuffer modelMatrix,
-                               FloatBuffer projMatrix,
-                               IntBuffer viewport,
-                               float near,
-                               float far,
-                               FloatBuffer obj_pos) {
-    FloatBuffer in = this.inBuf;
-    FloatBuffer out = this.outBuf;
-
-    gluMultMatricesf(modelMatrix, projMatrix, matrixBuf);
-
-    if (!gluInvertMatrixf(matrixBuf, matrixBuf))
-      return false;
-
-    in.put(0, winx);
-    in.put(1, winy);
-    in.put(2, winz);
-    in.put(3, clipw);
-
-    // Map x and y from window coordinates
-    int vPos = viewport.position();
-    in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
-    in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
-    in.put(2, (in.get(2) - near) / (far - near));
-
-    // Map to range -1 to 1
-    in.put(0, in.get(0) * 2 - 1);
-    in.put(1, in.get(1) * 2 - 1);
-    in.put(2, in.get(2) * 2 - 1);
-
-    __gluMultMatrixVecf(matrixBuf, in, out);
-
-    if (out.get(3) == 0.0f)
-      return false;
-
-    int oPos = obj_pos.position();
-    obj_pos.put(0+oPos, out.get(0));
-    obj_pos.put(1+oPos, out.get(1));
-    obj_pos.put(2+oPos, out.get(2));
-    obj_pos.put(3+oPos, out.get(3));
-    return true;
-  }
-
-
-  /**
-   * Method gluPickMatrix
-   * 
-   * @param x
-   * @param y
-   * @param deltaX
-   * @param deltaY
-   * @param viewport
-   */
-  public void gluPickMatrix(GLMatrixFunc gl,
-                            float x,
-                            float y,
-                            float deltaX,
-                            float deltaY,
-                            IntBuffer viewport) {
-    if (deltaX <= 0 || deltaY <= 0) {
-      return;
-    }
-
-    /* Translate and scale the picked region to the entire window */
-    int vPos = viewport.position();
-    gl.glTranslatef((viewport.get(2+vPos) - 2 * (x - viewport.get(0+vPos))) / deltaX,
-                    (viewport.get(3+vPos) - 2 * (y - viewport.get(1+vPos))) / deltaY,
-                    0);
-    gl.glScalef(viewport.get(2) / deltaX, viewport.get(3) / deltaY, 1.0f);
-  }
-
-  /**
-   * Method gluPickMatrix
-   * 
-   * @param x
-   * @param y
-   * @param deltaX
-   * @param deltaY
-   * @param viewport
-   * @param viewport_offset
-   */
-  public void gluPickMatrix(GLMatrixFunc gl,
-                            float x,
-                            float y,
-                            float deltaX,
-                            float deltaY,
-                            int[] viewport,
-                            int viewport_offset) {
-    if (deltaX <= 0 || deltaY <= 0) {
-      return;
-    }
-
-    /* Translate and scale the picked region to the entire window */
-    gl.glTranslatef((viewport[2+viewport_offset] - 2 * (x - viewport[0+viewport_offset])) / deltaX,
-                    (viewport[3+viewport_offset] - 2 * (y - viewport[1+viewport_offset])) / deltaY,
-                    0);
-    gl.glScalef(viewport[2+viewport_offset] / deltaX, viewport[3+viewport_offset] / deltaY, 1.0f);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javame_cdc_fp b/src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javame_cdc_fp
deleted file mode 100644
index f686bea..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javame_cdc_fp
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.jogamp.opengl.impl;
-
-public class SystemUtil {
-
-    /** Wrapper for System.getenv(), which doesn't work on platforms
-        earlier than JDK 5 */
-    public static String getenv(String variableName) {
-        return null;
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javase b/src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javase
deleted file mode 100644
index dbb717a..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javase
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.jogamp.opengl.impl;
-
-public class SystemUtil {
-
-    private static volatile boolean getenvSupported = true;
-    /** Wrapper for System.getenv(), which doesn't work on platforms
-        earlier than JDK 5 */
-    public static String getenv(String variableName) {
-        if (getenvSupported) {
-            try {
-                return System.getenv(variableName);
-            } catch (Error e) {
-                getenvSupported = false;
-            }
-        }
-        return null;
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/ThreadingImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/ThreadingImpl.java
deleted file mode 100644
index d434f51..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/ThreadingImpl.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.opengl.impl;
-
-import java.lang.reflect.InvocationTargetException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import com.jogamp.common.JogampRuntimeException;
-import com.jogamp.common.util.*;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
-
-/** Implementation of the {@link javax.media.opengl.Threading} class. */
-
-public class ThreadingImpl {
-    public static final int AWT    = 1;
-    public static final int WORKER = 2;
-
-    protected static final boolean DEBUG = Debug.debug("Threading");
-
-    private static boolean singleThreaded = true;
-    private static int mode;
-    private static boolean hasAWT;
-    // We need to know whether we're running on X11 platforms to change
-    // our behavior when the Java2D/JOGL bridge is active
-    private static boolean _isX11;
-
-    private static final ThreadingPlugin threadingPlugin;
-  
-    static {
-        Object threadingPluginTmp =
-            AccessController.doPrivileged(new PrivilegedAction() {
-                    public Object run() {
-                        String workaround = Debug.getProperty("jogl.1thread", true);
-                        ClassLoader cl = ThreadingImpl.class.getClassLoader();
-                        // Default to using the AWT thread on all platforms except
-                        // Windows. On OS X there is instability apparently due to
-                        // using the JAWT on non-AWT threads. On X11 platforms there
-                        // are potential deadlocks which can be caused if the AWT
-                        // EventQueue thread hands work off to the GLWorkerThread
-                        // while holding the AWT lock. The optimization of
-                        // makeCurrent / release calls isn't worth these stability
-                        // problems.
-                        hasAWT = GLProfile.isAWTAvailable();
-
-                        String osType = NativeWindowFactory.getNativeWindowType(false);
-                        _isX11 = NativeWindowFactory.TYPE_X11.equals(osType);
-
-                        int defaultMode = ( hasAWT ? AWT : WORKER );
-
-                        mode = defaultMode;
-                        if (workaround != null) {
-                            workaround = workaround.toLowerCase();
-                            if (workaround.equals("true") ||
-                                workaround.equals("auto")) {
-                                // Nothing to do; singleThreaded and mode already set up
-                            } else if (workaround.equals("worker")) {
-                                singleThreaded = true;
-                                mode = WORKER;
-                            } else if (hasAWT && workaround.equals("awt")) {
-                                singleThreaded = true;
-                                mode = AWT;
-                            } else {
-                                singleThreaded = false;
-                            }
-                        }
-                        printWorkaroundNotice();
-
-                        Object threadingPluginObj=null;
-                        if(hasAWT) {
-                            // try to fetch the AWTThreadingPlugin
-                            Exception error=null;
-                            try {
-                                threadingPluginObj = ReflectionUtil.createInstance("com.jogamp.opengl.impl.awt.AWTThreadingPlugin", cl);
-                            } catch (JogampRuntimeException jre) { error = jre; }
-                            if(AWT == mode && null==threadingPluginObj) {                                
-                                throw new GLException("Mode is AWT, but class 'com.jogamp.opengl.impl.awt.AWTThreadingPlugin' is not available", error);
-                            }
-                        }
-                        return threadingPluginObj;
-                    }
-                });
-        threadingPlugin = (ThreadingPlugin) threadingPluginTmp;
-        if(DEBUG) {
-            System.err.println("Threading: hasAWT "+hasAWT+", mode "+((mode==AWT)?"AWT":"WORKER")+", plugin "+threadingPlugin);
-        }
-    }
-
-    /** No reason to ever instantiate this class */
-    private ThreadingImpl() {}
-
-    public static boolean isX11() { return _isX11; }
-    public static int getMode() { return mode; }
-
-    /** If an implementation of the javax.media.opengl APIs offers a 
-        multithreading option but the default behavior is single-threading, 
-        this API provides a mechanism for end users to disable single-threading 
-        in this implementation.  Users are strongly discouraged from
-        calling this method unless they are aware of all of the
-        consequences and are prepared to enforce some amount of
-        threading restrictions in their applications. Disabling
-        single-threading, for example, may have unintended consequences
-        on GLAutoDrawable implementations such as GLCanvas, GLJPanel and
-        GLPbuffer. Currently there is no supported way to re-enable it
-        once disabled, partly to discourage careless use of this
-        method. This method should be called as early as possible in an
-        application. */ 
-    public static void disableSingleThreading() {
-        singleThreaded = false;
-        if (Debug.verbose()) {
-            System.err.println("Application forced disabling of single-threading of javax.media.opengl implementation");
-        }
-    }
-
-    /** Indicates whether OpenGL work is being automatically forced to a
-        single thread in this implementation. */
-    public static boolean isSingleThreaded() {
-        return singleThreaded;
-    }
-
-    /** Indicates whether the current thread is the single thread on
-        which this implementation of the javax.media.opengl APIs
-        performs all of its OpenGL-related work. This method should only
-        be called if the single-thread model is in effect. */
-    public static boolean isOpenGLThread() throws GLException {
-        if (!isSingleThreaded()) {
-            throw new GLException("Should only call this in single-threaded mode");
-        }
-
-        if(null!=threadingPlugin) {
-            return threadingPlugin.isOpenGLThread();
-        }
-
-        switch (mode) {
-            case AWT:
-                throw new InternalError();
-            case WORKER:
-                return GLWorkerThread.isWorkerThread();
-            default:
-                throw new InternalError("Illegal single-threading mode " + mode);
-        }
-    }
-
-    /** Executes the passed Runnable on the single thread used for all
-        OpenGL work in this javax.media.opengl API implementation. It is
-        not specified exactly which thread is used for this
-        purpose. This method should only be called if the single-thread
-        model is in use and if the current thread is not the OpenGL
-        thread (i.e., if <code>isOpenGLThread()</code> returns
-        false). It is up to the end user to check to see whether the
-        current thread is the OpenGL thread and either execute the
-        Runnable directly or perform the work inside it. */
-    public static void invokeOnOpenGLThread(Runnable r) throws GLException {
-        if (!isSingleThreaded()) {
-            throw new GLException ("Should only call this in single-threaded mode");
-        }
-
-        if (isOpenGLThread()) {
-            throw new GLException ("Should only call this from other threads than the OpenGL thread");
-        }    
-
-        if(null!=threadingPlugin) {
-            threadingPlugin.invokeOnOpenGLThread(r);
-            return;
-        }
-
-        switch (mode) {
-            case AWT:
-                throw new InternalError();
-
-            case WORKER:
-                if (!GLWorkerThread.isStarted()) {
-                    synchronized (GLWorkerThread.class) {
-                        if (!GLWorkerThread.isStarted()) {
-                            GLWorkerThread.start();
-                        }
-                    }
-                }
-                try {
-                    GLWorkerThread.invokeAndWait(r);
-                } catch (InvocationTargetException e) {
-                    throw new GLException(e.getTargetException());
-                } catch (InterruptedException e) {
-                    throw new GLException(e);
-                }
-                break;
-
-            default:
-                throw new InternalError("Illegal single-threading mode " + mode);
-        }
-    }
-
-    /** This is a workaround for AWT-related deadlocks which only seem
-        to show up in the context of applets */
-    public static boolean isAWTMode() {
-        return (mode == AWT);
-    }
-
-    private static void printWorkaroundNotice() {
-        if (singleThreaded && Debug.verbose()) {
-            System.err.println("Using " +
-                               (mode == AWT ? "AWT" : "OpenGL worker") +
-                               " thread for performing OpenGL work in javax.media.opengl implementation");
-        }
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/ThreadingPlugin.java b/src/jogl/classes/com/jogamp/opengl/impl/ThreadingPlugin.java
deleted file mode 100644
index 37e4aac..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/ThreadingPlugin.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl;
-
-import javax.media.opengl.*;
-
-public interface ThreadingPlugin {
-  /** Indicates whether the current thread is the single thread on
-      which this implementation of the javax.media.opengl APIs
-      performs all of its OpenGL-related work. This method should only
-      be called if the single-thread model is in effect. */
-  public boolean isOpenGLThread() throws GLException;
-
-  /** Executes the passed Runnable on the single thread used for all
-      OpenGL work in this javax.media.opengl API implementation. It is
-      not specified exactly which thread is used for this
-      purpose. This method should only be called if the single-thread
-      model is in use and if the current thread is not the OpenGL
-      thread (i.e., if <code>isOpenGLThread()</code> returns
-      false). It is up to the end user to check to see whether the
-      current thread is the OpenGL thread and either execute the
-      Runnable directly or perform the work inside it. */
-  public void invokeOnOpenGLThread(Runnable r) throws GLException;
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/awt/AWTThreadingPlugin.java b/src/jogl/classes/com/jogamp/opengl/impl/awt/AWTThreadingPlugin.java
deleted file mode 100644
index a91ab78..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/awt/AWTThreadingPlugin.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.awt;
-
-import javax.media.opengl.*;
-
-import java.awt.event.*;
-
-import java.awt.EventQueue;
-import java.lang.reflect.InvocationTargetException;
-
-import com.jogamp.opengl.impl.*;
-
-public class AWTThreadingPlugin implements ThreadingPlugin {
-
-  public AWTThreadingPlugin() {}
-
-  public boolean isOpenGLThread() throws GLException {
-    switch (ThreadingImpl.getMode()) {
-      case ThreadingImpl.AWT:
-        // FIXME: See the FIXME below in 'invokeOnOpenGLThread'
-        if (Java2D.isOGLPipelineActive() && !ThreadingImpl.isX11()) {
-          return Java2D.isQueueFlusherThread();
-        } else {
-          return EventQueue.isDispatchThread();
-        }
-      case ThreadingImpl.WORKER:
-        if (Java2D.isOGLPipelineActive()) {
-          // FIXME: ideally only the QFT would be considered to be the
-          // "OpenGL thread", but we can not currently run all of
-          // JOGL's OpenGL work on that thread. See the FIXME in
-          // invokeOnOpenGLThread.
-          return (Java2D.isQueueFlusherThread() ||
-                  (ThreadingImpl.isX11() && GLWorkerThread.isWorkerThread()));
-        } else {
-          return GLWorkerThread.isWorkerThread();
-        }
-      default:
-        throw new InternalError("Illegal single-threading mode " + ThreadingImpl.getMode());
-    }
-  }
-
-  public void invokeOnOpenGLThread(Runnable r) throws GLException {
-    switch (ThreadingImpl.getMode()) {
-      case ThreadingImpl.AWT:
-        // FIXME: ideally should run all OpenGL work on the Java2D QFT
-        // thread when it's enabled, but unfortunately there are
-        // deadlock issues on X11 platforms when making our
-        // heavyweight OpenGL contexts current on the QFT because we
-        // perform the JAWT lock inside the makeCurrent()
-        // implementation, which attempts to grab the AWT lock on the
-        // QFT which is not allowed. For now, on X11 platforms,
-        // continue to perform this work on the EDT.
-        if (Java2D.isOGLPipelineActive() && !ThreadingImpl.isX11()) {
-          Java2D.invokeWithOGLContextCurrent(null, r);
-        } else {
-          try {
-            EventQueue.invokeAndWait(r);
-          } catch (InvocationTargetException e) {
-            throw new GLException(e.getTargetException());
-          } catch (InterruptedException e) {
-            throw new GLException(e);
-          }
-        }
-        break;
-
-      case ThreadingImpl.WORKER:
-        if (!GLWorkerThread.isStarted()) {
-          synchronized (GLWorkerThread.class) {
-            if (!GLWorkerThread.isStarted()) {
-              GLWorkerThread.start();
-            }
-          }
-        }
-        try {
-          GLWorkerThread.invokeAndWait(r);
-        } catch (InvocationTargetException e) {
-          throw new GLException(e.getTargetException());
-        } catch (InterruptedException e) {
-          throw new GLException(e);
-        }
-        break;
-
-      default:
-        throw new InternalError("Illegal single-threading mode " + ThreadingImpl.getMode());
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/awt/AWTUtil.java b/src/jogl/classes/com/jogamp/opengl/impl/awt/AWTUtil.java
deleted file mode 100644
index 36c0a32..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/awt/AWTUtil.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.opengl.impl.awt;
-
-import com.jogamp.nativewindow.impl.jawt.*;
-
-import com.jogamp.opengl.impl.*;
-
-import javax.media.opengl.*;
-
-import java.lang.reflect.*;
-import java.awt.GraphicsEnvironment;
-
-public class AWTUtil {
-  // See whether we're running in headless mode
-  private static boolean headlessMode;
-  private static Class j2dClazz = null;
-  private static Method isOGLPipelineActive = null;
-  private static Method isQueueFlusherThread = null;
-  private static boolean j2dOk = false;
-
-  static {
-    lockedToolkit = false;
-    headlessMode = GraphicsEnvironment.isHeadless();
-    if(!headlessMode) {
-        try {
-            j2dClazz = Class.forName("com.jogamp.opengl.impl.awt.Java2D");
-            isOGLPipelineActive = j2dClazz.getMethod("isOGLPipelineActive", null);
-            isQueueFlusherThread = j2dClazz.getMethod("isQueueFlusherThread", null);
-            j2dOk = true;
-        } catch (Exception e) {}
-    }
-  }
-
-  private static boolean lockedToolkit;
-
-  public static synchronized void lockToolkit() throws GLException {
-    if (lockedToolkit) {
-      throw new GLException("Toolkit already locked");
-    }
-    lockedToolkit = true;
-
-    if (headlessMode) {
-      // Workaround for running (to some degree) in headless
-      // environments but still supporting rendering via pbuffers
-      // For full correctness, would need to implement a Lock class
-      return;
-    }
-
-    if(j2dOk) {
-      try {
-        if( !((Boolean)isOGLPipelineActive.invoke(null, null)).booleanValue() ||
-            !((Boolean)isQueueFlusherThread.invoke(null, null)).booleanValue() ) {
-          JAWTUtil.lockToolkit();
-        }
-      } catch (Exception e) { j2dOk=false; }
-    } 
-    if(!j2dOk) {
-      JAWTUtil.lockToolkit();
-    }
-  }
-
-  public static synchronized void unlockToolkit() {
-    if (lockedToolkit) {
-        lockedToolkit = false;
-        if (headlessMode) {
-          // Workaround for running (to some degree) in headless
-          // environments but still supporting rendering via pbuffers
-          // For full correctness, would need to implement a Lock class
-          return;
-        }
-
-        if(j2dOk) {
-          try {
-            if( !((Boolean)isOGLPipelineActive.invoke(null, null)).booleanValue() ||
-                !((Boolean)isQueueFlusherThread.invoke(null, null)).booleanValue() ) {
-              JAWTUtil.unlockToolkit();
-            }
-          } catch (Exception e) { j2dOk=false; }
-        } 
-        if(!j2dOk) {
-          JAWTUtil.unlockToolkit();
-        }
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/awt/Java2D.java b/src/jogl/classes/com/jogamp/opengl/impl/awt/Java2D.java
deleted file mode 100644
index 5566a3a..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/awt/Java2D.java
+++ /dev/null
@@ -1,569 +0,0 @@
-/*
- * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.awt;
-
-import com.jogamp.opengl.impl.*;
-
-import java.awt.*;
-import java.awt.image.*;
-import java.lang.reflect.*;
-import java.security.*;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.awt.*;
-
-/** Defines integration with the Java2D OpenGL pipeline. This
-    integration is only supported in 1.6 and is highly experimental. */
-
-public class Java2D {
-  private static boolean DEBUG = Debug.debug("Java2D");
-  private static boolean VERBOSE = Debug.verbose();
-  private static boolean isHeadless;
-  private static boolean isOGLPipelineActive;
-  private static Method invokeWithOGLContextCurrentMethod;
-  private static Method isQueueFlusherThreadMethod;
-  private static Method getOGLViewportMethod;
-  private static Method getOGLScissorBoxMethod;
-  private static Method getOGLSurfaceIdentifierMethod;
-  // This one is currently optional and is only in very recent Mustang builds
-  private static Method getOGLTextureTypeMethod;
-
-  // The following methods and fields are needed for proper support of
-  // Frame Buffer Objects in the Java2D/OpenGL pipeline
-  // (-Dsun.java2d.opengl.fbobject=true)
-  private static boolean fbObjectSupportInitialized;
-  private static Method invokeWithOGLSharedContextCurrentMethod;
-  private static Method getOGLSurfaceTypeMethod;
-
-  // Publicly-visible constants for OpenGL surface types
-  public static final int UNDEFINED       = getOGLUtilitiesIntField("UNDEFINED");
-  public static final int WINDOW          = getOGLUtilitiesIntField("WINDOW");
-  public static final int PBUFFER         = getOGLUtilitiesIntField("PBUFFER");
-  public static final int TEXTURE         = getOGLUtilitiesIntField("TEXTURE");
-  public static final int FLIP_BACKBUFFER = getOGLUtilitiesIntField("FLIP_BACKBUFFER");
-  public static final int FBOBJECT        = getOGLUtilitiesIntField("FBOBJECT");
-
-  // If FBOs are enabled in the Java2D/OpenGL pipeline, all contexts
-  // created by JOGL must share textures and display lists with the
-  // Java2D contexts in order to access the frame buffer object for
-  // potential rendering, and to simultaneously support sharing of
-  // textures and display lists with one another. Java2D has the
-  // notion of a single shared context with which all other contexts
-  // (on the same display device?) share textures and display lists;
-  // this is an approximation to that notion which will be refined
-  // later.
-  private static boolean initializedJ2DFBOShareContext;
-  private static GLContext j2dFBOShareContext;
-
-  // Accessors for new methods in sun.java2d.opengl.CGLSurfaceData
-  // class on OS X for enabling bridge
-  //  public static long    createOGLContextOnSurface(Graphics g, long ctx);
-  //  public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx);
-  //  public static void    destroyOGLContext(long ctx);
-  private static Method createOGLContextOnSurfaceMethod;
-  private static Method makeOGLContextCurrentOnSurfaceMethod;
-  private static Method destroyOGLContextMethod;
-
-  static {
-    AccessController.doPrivileged(new PrivilegedAction() {
-        public Object run() {
-          if (DEBUG && VERBOSE) {
-            System.err.println("Checking for Java2D/OpenGL support");
-          }
-          try {
-            isHeadless = true;
-            // Figure out whether the default graphics configuration is an
-            // OpenGL graphics configuration
-            GraphicsConfiguration cfg =
-              GraphicsEnvironment.getLocalGraphicsEnvironment().
-              getDefaultScreenDevice().
-              getDefaultConfiguration();
-            // If we get here, we aren't running in headless mode
-            isHeadless = false;
-            String name = cfg.getClass().getName();
-            if (DEBUG && VERBOSE) {
-              System.err.println("Java2D support: default GraphicsConfiguration = " + name);
-            }
-            isOGLPipelineActive = (name.startsWith("sun.java2d.opengl"));
-
-            if (isOGLPipelineActive) {
-              try {
-                // Try to get methods we need to integrate
-                Class utils = Class.forName("sun.java2d.opengl.OGLUtilities");
-                invokeWithOGLContextCurrentMethod = utils.getDeclaredMethod("invokeWithOGLContextCurrent",
-                                                                            new Class[] {
-                                                                              Graphics.class,
-                                                                              Runnable.class
-                                                                            });
-                invokeWithOGLContextCurrentMethod.setAccessible(true);
-
-                isQueueFlusherThreadMethod = utils.getDeclaredMethod("isQueueFlusherThread",
-                                                                     new Class[] {});
-                isQueueFlusherThreadMethod.setAccessible(true);
-
-                getOGLViewportMethod = utils.getDeclaredMethod("getOGLViewport",
-                                                               new Class[] {
-                                                                 Graphics.class,
-                                                                 Integer.TYPE,
-                                                                 Integer.TYPE
-                                                               });
-                getOGLViewportMethod.setAccessible(true);
-
-                getOGLScissorBoxMethod = utils.getDeclaredMethod("getOGLScissorBox",
-                                                                 new Class[] {
-                                                                   Graphics.class
-                                                                 });
-                getOGLScissorBoxMethod.setAccessible(true);
-
-                getOGLSurfaceIdentifierMethod = utils.getDeclaredMethod("getOGLSurfaceIdentifier",
-                                                                        new Class[] {
-                                                                          Graphics.class
-                                                                        });
-                getOGLSurfaceIdentifierMethod.setAccessible(true);
-
-                // Try to get additional methods required for proper FBO support
-                fbObjectSupportInitialized = true;
-                try {
-                  invokeWithOGLSharedContextCurrentMethod = utils.getDeclaredMethod("invokeWithOGLSharedContextCurrent",
-                                                                                    new Class[] {
-                                                                                      GraphicsConfiguration.class,
-                                                                                      Runnable.class
-                                                                                    });
-                  invokeWithOGLSharedContextCurrentMethod.setAccessible(true);
-
-                  getOGLSurfaceTypeMethod = utils.getDeclaredMethod("getOGLSurfaceType",
-                                                                    new Class[] {
-                                                                      Graphics.class
-                                                                    });
-                  getOGLSurfaceTypeMethod.setAccessible(true);
-                } catch (Exception e) {
-                  fbObjectSupportInitialized = false;
-                  if (DEBUG && VERBOSE) {
-                    e.printStackTrace();
-                    System.err.println("Info: Disabling Java2D/JOGL FBO support");
-                  }
-                }
-
-                // Try to get an additional method for FBO support in recent Mustang builds
-                try {
-                  getOGLTextureTypeMethod = utils.getDeclaredMethod("getOGLTextureType",
-                                                                    new Class[] {
-                                                                      Graphics.class
-                                                                    });
-                  getOGLTextureTypeMethod.setAccessible(true);
-                } catch (Exception e) {
-                  if (DEBUG && VERBOSE) {
-                    e.printStackTrace();
-                    System.err.println("Info: GL_ARB_texture_rectangle FBO support disabled");
-                  }
-                }
-
-                // Try to set up APIs for enabling the bridge on OS X,
-                // where it isn't possible to create generalized
-                // external GLDrawables
-                Class cglSurfaceData = null;
-                try {
-                  cglSurfaceData = Class.forName("sun.java2d.opengl.CGLSurfaceData");
-                } catch (Exception e) {
-                  if (DEBUG && VERBOSE) {
-                    e.printStackTrace();
-                    System.err.println("Info: Unable to find class sun.java2d.opengl.CGLSurfaceData for OS X");
-                  }
-                }
-                if (cglSurfaceData != null) {
-                  // FIXME: for now, assume that FBO support is not enabled on OS X
-                  fbObjectSupportInitialized = false;
-
-                  // We need to find these methods in order to make the bridge work on OS X
-                  createOGLContextOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("createOGLContextOnSurface",
-                                                                                     new Class[] {
-                                                                                       Graphics.class,
-                                                                                       Long.TYPE
-                                                                                     });
-                  createOGLContextOnSurfaceMethod.setAccessible(true);
-
-                  makeOGLContextCurrentOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("makeOGLContextCurrentOnSurface",
-                                                                                          new Class[] {
-                                                                                            Graphics.class,
-                                                                                            Long.TYPE
-                                                                                          });
-                  makeOGLContextCurrentOnSurfaceMethod.setAccessible(true);
-
-                  destroyOGLContextMethod = cglSurfaceData.getDeclaredMethod("destroyOGLContext",
-                                                                             new Class[] {
-                                                                               Long.TYPE
-                                                                             });
-                  destroyOGLContextMethod.setAccessible(true);
-                }
-              } catch (Exception e) {
-                if (DEBUG && VERBOSE) {
-                  e.printStackTrace();
-                  System.err.println("Info: Disabling Java2D/JOGL integration");
-                }
-                isOGLPipelineActive = false;
-              }
-            }
-          } catch (HeadlessException e) {
-            // The AWT is running in headless mode, so the Java 2D / JOGL bridge is clearly disabled
-          }
-
-          if (DEBUG) {
-            System.err.println("JOGL/Java2D integration " + (isOGLPipelineActive ? "enabled" : "disabled"));
-          }
-          return null;
-        }
-      });
-  }
-
-  public static boolean isOGLPipelineActive() {
-    return isOGLPipelineActive;
-  }
-
-  public static boolean isFBOEnabled() {
-    return fbObjectSupportInitialized;
-  }
-
-  public static boolean isQueueFlusherThread() {
-    checkActive();
-
-    try {
-      return ((Boolean) isQueueFlusherThreadMethod.invoke(null, null)).booleanValue();
-    } catch (InvocationTargetException e) {
-      throw new GLException(e.getTargetException());
-    } catch (Exception e) {
-      throw (InternalError) new InternalError().initCause(e);
-    }
-  }
-  
-  /** Makes current the OpenGL context associated with the passed
-      Graphics object and runs the given Runnable on the Queue
-      Flushing Thread in one atomic action. */
-  public static void invokeWithOGLContextCurrent(Graphics g, Runnable r) throws GLException {
-    checkActive();
-
-    try {
-      // FIXME: this may need adjustment
-      // This seems to be needed in many applications which don't
-      // initialize an OpenGL context before this and which would
-      // otherwise cause initFBOShareContext to be called from the
-      // Queue Flusher Thread, which isn't allowed
-      initFBOShareContext(GraphicsEnvironment.
-                          getLocalGraphicsEnvironment().
-                          getDefaultScreenDevice());
-
-      AWTUtil.lockToolkit();
-      try {
-        invokeWithOGLContextCurrentMethod.invoke(null, new Object[] {g, r});
-      } finally {
-        AWTUtil.unlockToolkit();
-      }
-    } catch (InvocationTargetException e) {
-      throw new GLException(e.getTargetException());
-    } catch (Exception e) {
-      throw (InternalError) new InternalError().initCause(e);
-    }
-  }
-
-  /** Makes current the "shared" OpenGL context associated with the
-      given GraphicsConfiguration object, allowing JOGL to share
-      server-side OpenGL objects like textures and display lists with
-      this context when necessary. This is needed when Java2D's FBO
-      support is enabled, because in order to render into that FBO,
-      JOGL must share textures and display lists with it. Returns
-      false if the passed GraphicsConfiguration was not an OpenGL
-      GraphicsConfiguration. */
-  public static boolean invokeWithOGLSharedContextCurrent(GraphicsConfiguration g, Runnable r) throws GLException {
-    checkActive();
-
-    try {
-      AWTUtil.lockToolkit();
-      try {
-        return ((Boolean) invokeWithOGLSharedContextCurrentMethod.invoke(null, new Object[] {g, r})).booleanValue();
-      } finally {
-        AWTUtil.unlockToolkit();
-      }
-    } catch (InvocationTargetException e) {
-      throw new GLException(e.getTargetException());
-    } catch (Exception e) {
-      throw (InternalError) new InternalError().initCause(e);
-    }
-  }
-
-  /** Returns the OpenGL viewport associated with the given Graphics
-      object, assuming that the Graphics object is associated with a
-      component of the specified width and height. The user should
-      call glViewport() with the returned rectangle's bounds in order
-      to get correct rendering results. Should only be called from the
-      Queue Flusher Thread. */
-  public static Rectangle getOGLViewport(Graphics g,
-                                         int componentWidth,
-                                         int componentHeight) {
-    checkActive();
-
-    try {
-      return (Rectangle) getOGLViewportMethod.invoke(null, new Object[] {g,
-                                                                         new Integer(componentWidth),
-                                                                         new Integer(componentHeight)});
-    } catch (InvocationTargetException e) {
-      throw new GLException(e.getTargetException());
-    } catch (Exception e) {
-      throw (InternalError) new InternalError().initCause(e);
-    }
-  }
-
-  /** Returns the OpenGL scissor region associated with the given
-      Graphics object, taking into account all clipping regions, etc.
-      To avoid destroying Java2D's previous rendering results, this
-      method should be called and the resulting rectangle's bounds
-      passed to a call to glScissor(). Should only be called from the
-      Queue Flusher Thread. */
-  public static Rectangle getOGLScissorBox(Graphics g) {
-    checkActive();
-
-    try {
-      return (Rectangle) getOGLScissorBoxMethod.invoke(null, new Object[] {g});
-    } catch (InvocationTargetException e) {
-      throw new GLException(e.getTargetException());
-    } catch (Exception e) {
-      throw (InternalError) new InternalError().initCause(e);
-    }
-  }
-
-  /** Returns an opaque "surface identifier" associated with the given
-      Graphics object. If this changes from invocation to invocation,
-      the underlying OpenGL drawable for the Graphics object has
-      changed and a new external GLDrawable and GLContext should be
-      created (and the old ones destroyed). Should only be called from
-      the Queue Flusher Thread.*/
-  public static Object getOGLSurfaceIdentifier(Graphics g) {
-    checkActive();
-
-    try {
-      return getOGLSurfaceIdentifierMethod.invoke(null, new Object[] {g});
-    } catch (InvocationTargetException e) {
-      throw new GLException(e.getTargetException());
-    } catch (Exception e) {
-      throw (InternalError) new InternalError().initCause(e);
-    }
-  }
-
-  /** Returns the underlying surface type for the given Graphics
-      object. This indicates, in particular, whether Java2D is
-      currently rendering into a pbuffer or FBO. */
-  public static int getOGLSurfaceType(Graphics g) {
-    checkActive();
-
-    try {
-      // FIXME: fallback path for pre-b73 (?) Mustang builds -- remove
-      // once fbobject support is in OGLUtilities
-      if (!fbObjectSupportInitialized) {
-        return 0;
-      }
-
-      return ((Integer) getOGLSurfaceTypeMethod.invoke(null, new Object[] { g })).intValue();
-    } catch (InvocationTargetException e) {
-      throw new GLException(e.getTargetException());
-    } catch (Exception e) {
-      throw (InternalError) new InternalError().initCause(e);
-    }
-  }
-
-  /** Returns the underlying texture target of the given Graphics
-      object assuming it is rendering to an FBO. Returns either
-      GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB. */
-  public static int getOGLTextureType(Graphics g) {
-    checkActive();
-
-    if (getOGLTextureTypeMethod == null) {
-      return GL.GL_TEXTURE_2D;
-    }
-
-    try {
-      return ((Integer) getOGLTextureTypeMethod.invoke(null, new Object[] { g })).intValue();
-    } catch (InvocationTargetException e) {
-      throw new GLException(e.getTargetException());
-    } catch (Exception e) {
-      throw (InternalError) new InternalError().initCause(e);
-    }
-  }
-
-  /** Returns either the given GLContext or a substitute one with
-      which clients should share textures and display lists. Needed
-      when the Java2D/OpenGL pipeline is active and FBOs are being
-      used for rendering. FIXME: may need to alter the API in the
-      future to indicate which GraphicsDevice the source context is
-      associated with. */
-  public static GLContext filterShareContext(GLContext shareContext) {
-    if (isHeadless)
-      return shareContext;
-
-    // FIXME: this may need adjustment
-    initFBOShareContext(GraphicsEnvironment.
-                        getLocalGraphicsEnvironment().
-                        getDefaultScreenDevice());
-    if (j2dFBOShareContext != null) {
-      return j2dFBOShareContext;
-    }
-    return shareContext;
-  }
-
-  /** Returns the GLContext associated with the Java2D "share
-      context", with which all contexts created by JOGL must share
-      textures and display lists when the FBO option is enabled for
-      the Java2D/OpenGL pipeline. */
-  public static GLContext getShareContext(GraphicsDevice device) {
-    initFBOShareContext(device);
-    // FIXME: for full generality probably need to have multiple of
-    // these, one per GraphicsConfiguration seen?
-    return j2dFBOShareContext;
-  }
-
-  //----------------------------------------------------------------------
-  // Mac OS X-specific methods
-  //
-
-  /** (Mac OS X-specific) Creates a new OpenGL context on the surface
-      associated with the given Graphics object, sharing textures and
-      display lists with the specified (CGLContextObj) share context. */
-  public static long createOGLContextOnSurface(Graphics g, long shareCtx) {
-    checkActive();
-
-    try {
-      return ((Long) createOGLContextOnSurfaceMethod.invoke(null, new Object[] { g, new Long(shareCtx) })).longValue();
-    } catch (InvocationTargetException e) {
-      throw new GLException(e.getTargetException());
-    } catch (Exception e) {
-      throw (InternalError) new InternalError().initCause(e);
-    }
-  }
-
-  /** (Mac OS X-specific) Makes the given OpenGL context current on
-      the surface associated with the given Graphics object. */
-  public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx) {
-    checkActive();
-
-    try {
-      return ((Boolean) makeOGLContextCurrentOnSurfaceMethod.invoke(null, new Object[] { g, new Long(ctx) })).booleanValue();
-    } catch (InvocationTargetException e) {
-      throw new GLException(e.getTargetException());
-    } catch (Exception e) {
-      throw (InternalError) new InternalError().initCause(e);
-    }
-  }
-
-  /** (Mac OS X-specific) Destroys the given OpenGL context. */
-  public static void destroyOGLContext(long ctx) {
-    checkActive();
-
-    try {
-      destroyOGLContextMethod.invoke(null, new Object[] { new Long(ctx) });
-    } catch (InvocationTargetException e) {
-      throw new GLException(e.getTargetException());
-    } catch (Exception e) {
-      throw (InternalError) new InternalError().initCause(e);
-    }
-  }
-
-  //----------------------------------------------------------------------
-  // Internals only below this point
-  //
-
-  private static void checkActive() {
-    if (!isOGLPipelineActive()) {
-      throw new GLException("Java2D OpenGL pipeline not active (or necessary support not present)");
-    }
-  }
-
-  private static int getOGLUtilitiesIntField(final String name) {
-    Integer i = (Integer) AccessController.doPrivileged(new PrivilegedAction() {
-        public Object run() {
-          try {
-            Class utils = Class.forName("sun.java2d.opengl.OGLUtilities");
-            Field f = utils.getField(name);
-            f.setAccessible(true);
-            return f.get(null);
-          } catch (Exception e) {
-            if (DEBUG && VERBOSE) {
-              e.printStackTrace();
-            }
-            return null;
-          }
-        }
-      });
-    if (i == null)
-      return 0;
-    if (DEBUG && VERBOSE) {
-      System.err.println("OGLUtilities." + name + " = " + i.intValue());
-    }
-    return i.intValue();
-  }
-
-  private static void initFBOShareContext(final GraphicsDevice device) {
-    // Note 1: this must not be done in the static initalizer due to
-    // deadlock problems.
-
-    // Note 2: the first execution of this method must not be from the
-    // Java2D Queue Flusher Thread.
-
-    if (isOGLPipelineActive() &&
-        isFBOEnabled() &&
-        !initializedJ2DFBOShareContext) {
-
-      // FIXME: this technique is probably not adequate in multi-head
-      // situations. Ideally we would keep track of a given share
-      // context on a per-GraphicsConfiguration basis or something
-      // similar rather than keeping one share context in a global
-      // variable.
-      initializedJ2DFBOShareContext = true;
-      if (DEBUG) {
-        System.err.println("Starting initialization of J2D FBO share context");
-      }
-      invokeWithOGLSharedContextCurrent(device.getDefaultConfiguration(), new Runnable() {
-          public void run() {
-            j2dFBOShareContext = GLDrawableFactory.getFactory(GLProfile.getDefault(GLProfile.getDefaultDesktopDevice())).createExternalGLContext();
-          }
-        });
-      if (DEBUG) {
-        System.err.println("Ending initialization of J2D FBO share context");
-      }
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/awt/Java2DGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/awt/Java2DGLContext.java
deleted file mode 100644
index 07bc54b..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/awt/Java2DGLContext.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.awt;
-
-import com.jogamp.opengl.impl.*;
-import java.awt.Graphics;
-
-/** Provides a construct by which the shared GLJPanel code can
- * interact with a few methods in the Mac OS X-specific Java2D/JOGL
- * bridge implementation.
- */
-
-public interface Java2DGLContext {
-  public void setGraphics(Graphics g);
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java
deleted file mode 100644
index d95a9e3..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.egl;
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.gluegen.runtime.ProcAddressTable;
-import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
-import java.nio.*;
-import java.util.*;
-
-public abstract class EGLContext extends GLContextImpl {
-    private boolean eglQueryStringInitialized;
-    private boolean eglQueryStringAvailable;
-    private EGLExt eglExt;
-    // Table that holds the addresses of the native C-language entry points for
-    // EGL extension functions.
-    private EGLExtProcAddressTable eglExtProcAddressTable;
-
-    public EGLContext(GLDrawableImpl drawable, GLDrawableImpl drawableRead,
-                      GLContext shareWith) {
-        super(drawable, drawableRead, shareWith);
-    }
-
-    public EGLContext(GLDrawableImpl drawable,
-                      GLContext shareWith) {
-        this(drawable, null, shareWith);
-    }
-
-    public Object getPlatformGLExtensions() {
-      return getEGLExt();
-    }
-
-    public EGLExt getEGLExt() {
-      if (eglExt == null) {
-        eglExt = new EGLExtImpl(this);
-      }
-      return eglExt;
-    }
-
-    public final ProcAddressTable getPlatformExtProcAddressTable() {
-        return eglExtProcAddressTable;
-    }
-
-    public final EGLExtProcAddressTable getEGLExtProcAddressTable() {
-        return eglExtProcAddressTable;
-    }
-
-    protected Map/*<String, String>*/ getFunctionNameMap() { return null; }
-
-    protected Map/*<String, String>*/ getExtensionNameMap() { return null; }
-
-    protected void makeCurrentImpl(boolean newCreated) throws GLException {
-        if(EGL.EGL_NO_DISPLAY==((EGLDrawable)drawable).getDisplay() ) {
-            throw new GLException("drawable not properly initialized, NO DISPLAY: "+drawable);
-        }
-        if (EGL.eglGetCurrentContext() != contextHandle) {
-            if (!EGL.eglMakeCurrent(((EGLDrawable)drawable).getDisplay(),
-                                    drawable.getHandle(),
-                                    drawableRead.getHandle(),
-                                    contextHandle)) {
-                throw new GLException("Error making context 0x" +
-                                      Long.toHexString(contextHandle) + " current: error code " + EGL.eglGetError());
-            }
-        }
-    }
-
-    protected void releaseImpl() throws GLException {
-      if (!EGL.eglMakeCurrent(((EGLDrawable)drawable).getDisplay(),
-                              EGL.EGL_NO_SURFACE,
-                              EGL.EGL_NO_SURFACE,
-                              EGL.EGL_NO_CONTEXT)) {
-            throw new GLException("Error freeing OpenGL context 0x" +
-                                  Long.toHexString(contextHandle) + ": error code " + EGL.eglGetError());
-      }
-    }
-
-    protected void destroyImpl() throws GLException {
-      if (!EGL.eglDestroyContext(((EGLDrawable)drawable).getDisplay(), contextHandle)) {
-          throw new GLException("Error destroying OpenGL context 0x" +
-                                Long.toHexString(contextHandle) + ": error code " + EGL.eglGetError());
-      }
-    }
-
-    protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
-        return 0; // FIXME
-    }
-
-    protected void destroyContextARBImpl(long _context) {
-        // FIXME
-    }
-
-    protected boolean createImpl() throws GLException {
-        long eglDisplay = ((EGLDrawable)drawable).getDisplay();
-        EGLGraphicsConfiguration config = ((EGLDrawable)drawable).getGraphicsConfiguration();
-        GLProfile glProfile = drawable.getGLProfile();
-        long eglConfig = config.getNativeConfig();
-        long shareWith = EGL.EGL_NO_CONTEXT;
-
-        if (eglDisplay == 0) {
-            throw new GLException("Error: attempted to create an OpenGL context without a display connection");
-        }
-        if (eglConfig == 0) {
-            throw new GLException("Error: attempted to create an OpenGL context without a graphics configuration");
-        }
-
-        try {
-            // might be unavailable on EGL < 1.2
-            if(!EGL.eglBindAPI(EGL.EGL_OPENGL_ES_API)) {
-                throw new GLException("eglBindAPI to ES failed , error 0x"+Integer.toHexString(EGL.eglGetError()));
-            }
-        } catch (GLException glex) {
-            if (DEBUG) {
-                glex.printStackTrace();
-            }
-        }
-
-        EGLContext other = (EGLContext) GLContextShareSet.getShareContext(this);
-        if (other != null) {
-            shareWith = other.getHandle();
-            if (shareWith == 0) {
-                throw new GLException("GLContextShareSet returned an invalid OpenGL context");
-            }
-        }
-
-        int[] contextAttrs = new int[] {
-                EGL.EGL_CONTEXT_CLIENT_VERSION, -1,
-                EGL.EGL_NONE
-        };
-        if (glProfile.usesNativeGLES2()) {
-            contextAttrs[1] = 2;
-        } else if (glProfile.usesNativeGLES1()) {
-            contextAttrs[1] = 1;
-        } else {
-            throw new GLException("Error creating OpenGL context - invalid GLProfile: "+glProfile);
-        }
-        contextHandle = EGL.eglCreateContext(eglDisplay, eglConfig, shareWith, contextAttrs, 0);
-        if (contextHandle == 0) {
-            throw new GLException("Error creating OpenGL context: eglDisplay 0x"+Long.toHexString(eglDisplay)+
-                                  ", "+glProfile+", error 0x"+Integer.toHexString(EGL.eglGetError()));
-        }
-        GLContextShareSet.contextCreated(this);
-        if (DEBUG) {
-            System.err.println(getThreadName() + ": !!! Created OpenGL context 0x" +
-                               Long.toHexString(contextHandle) + 
-                               ",\n\twrite surface 0x" + Long.toHexString(drawable.getHandle()) +
-                               ",\n\tread  surface 0x" + Long.toHexString(drawableRead.getHandle())+
-                               ",\n\t"+this+
-                               ",\n\tsharing with 0x" + Long.toHexString(shareWith));
-        }
-        if (!EGL.eglMakeCurrent(((EGLDrawable)drawable).getDisplay(),
-                                drawable.getHandle(),
-                                drawableRead.getHandle(),
-                                contextHandle)) {
-            throw new GLException("Error making context 0x" +
-                                  Long.toHexString(contextHandle) + " current: error code " + EGL.eglGetError());
-        }
-        setGLFunctionAvailability(true, glProfile.usesNativeGLES2()?2:1, 0, CTX_PROFILE_ES|CTX_OPTION_ANY);
-        return true;
-    }
-
-    protected final void updateGLXProcAddressTable(int major, int minor, int ctp) {
-        if (DEBUG) {
-          System.err.println(getThreadName() + ": !!! Initializing EGL extension address table");
-        }
-        eglQueryStringInitialized = false;
-        eglQueryStringAvailable = false;
-
-        EGLExtProcAddressTable table = null;
-        synchronized(mappedContextTypeObjectLock) {
-            table = (EGLExtProcAddressTable) mappedGLXProcAddress.get( contextFQN );
-        }
-        if(null != table) {
-            eglExtProcAddressTable = table;
-            if(DEBUG) {
-                System.err.println(getThreadName() + ": !!! GLContext EGL ProcAddressTable reusing key("+contextFQN+") -> "+table.hashCode());
-            }
-        } else {
-            if (eglExtProcAddressTable == null) {
-              // FIXME: cache ProcAddressTables by capability bits so we can
-              // share them among contexts with the same capabilities
-              eglExtProcAddressTable = new EGLExtProcAddressTable(new GLProcAddressResolver());
-            }
-            resetProcAddressTable(getEGLExtProcAddressTable());
-            synchronized(mappedContextTypeObjectLock) {
-                mappedGLXProcAddress.put(contextFQN, getEGLExtProcAddressTable());
-                if(DEBUG) {
-                    System.err.println(getThreadName() + ": !!! GLContext EGL ProcAddressTable mapping key("+contextFQN+") -> "+getEGLExtProcAddressTable().hashCode());
-                }
-            }
-        }
-    }
-  
-    public synchronized String getPlatformExtensionsString() {
-        if (!eglQueryStringInitialized) {
-          eglQueryStringAvailable =
-            getDrawableImpl().getGLDynamicLookupHelper().dynamicLookupFunction("eglQueryString") != 0;
-          eglQueryStringInitialized = true;
-        }
-        if (eglQueryStringAvailable) {
-            String ret = EGL.eglQueryString(((EGLDrawable)drawable).getDisplay(), 
-                                            EGL.EGL_EXTENSIONS);
-            if (DEBUG) {
-              System.err.println("!!! EGL extensions: " + ret);
-            }
-            return ret;
-        } else {
-          return "";
-        }
-    }
-
-    protected void setSwapIntervalImpl(int interval) {
-        if (EGL.eglSwapInterval(((EGLDrawable)drawable).getDisplay(), interval)) {
-            currentSwapInterval = interval ;
-        }
-    }
-
-    public abstract void bindPbufferToTexture();
-
-    public abstract void releasePbufferFromTexture();
-
-    //----------------------------------------------------------------------
-    // Currently unimplemented stuff
-    //
-
-    protected void copyImpl(GLContext source, int mask) throws GLException {
-        throw new GLException("Not yet implemented");
-    }
-
-
-    public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
-        throw new GLException("Should not call this");
-    }
-
-    public boolean offscreenImageNeedsVerticalFlip() {
-        throw new GLException("Should not call this");
-    }
-
-    public int getOffscreenContextPixelDataType() {
-        throw new GLException("Should not call this");
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawable.java
deleted file mode 100644
index 88685fa..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawable.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.egl;
-
-import com.jogamp.opengl.impl.GLDynamicLookupHelper;
-import com.jogamp.opengl.impl.GLDrawableImpl;
-
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.egl.*;
-import javax.media.opengl.*;
-
-public abstract class EGLDrawable extends GLDrawableImpl {
-    protected boolean ownEGLDisplay = false; // for destruction
-    protected boolean ownEGLSurface = false; // for destruction
-    private EGLGraphicsConfiguration eglConfig;
-    protected long eglDisplay;
-    protected long eglSurface;
-
-    protected EGLDrawable(EGLDrawableFactory factory,
-                       NativeSurface component) throws GLException {
-        super(factory, component, false);
-        eglSurface=EGL.EGL_NO_SURFACE;
-        eglDisplay=0;
-    }
-
-    public long getDisplay() {
-        return eglDisplay;
-    }
-
-    public long getHandle() {
-        return eglSurface;
-    }
-
-    public EGLGraphicsConfiguration getGraphicsConfiguration() {
-        return eglConfig;
-    }
-
-    public GLCapabilitiesImmutable getChosenGLCapabilities() {
-        return (null==eglConfig)?super.getChosenGLCapabilities():(GLCapabilitiesImmutable)eglConfig.getChosenCapabilities();
-    }
-
-    public abstract GLContext createContext(GLContext shareWith);
-
-    protected abstract long createSurface(long eglDpy, long eglNativeCfg, long surfaceHandle);
-
-    private void recreateSurface() {
-        // create a new EGLSurface ..
-        if(EGL.EGL_NO_SURFACE!=eglSurface) {
-            EGL.eglDestroySurface(eglDisplay, eglSurface);
-        }
-
-        if(DEBUG) {
-            System.err.println("createSurface using eglDisplay 0x"+Long.toHexString(eglDisplay)+", "+eglConfig);
-        }
-
-        eglSurface = createSurface(eglDisplay, eglConfig.getNativeConfig(), surface.getSurfaceHandle());
-        if (EGL.EGL_NO_SURFACE==eglSurface) {
-            throw new GLException("Creation of window surface failed: "+eglConfig+", error 0x"+Integer.toHexString(EGL.eglGetError()));
-        }
-
-        if(DEBUG) {
-            System.err.println("setSurface using component: handle 0x"+Long.toHexString(surface.getSurfaceHandle())+" -> 0x"+Long.toHexString(eglSurface));
-        }
-    }
-
-    protected void setRealizedImpl() {
-        if (realized) {
-            AbstractGraphicsConfiguration aConfig = surface.getGraphicsConfiguration().getNativeGraphicsConfiguration();
-            AbstractGraphicsDevice aDevice = aConfig.getScreen().getDevice();
-            if(aDevice instanceof EGLGraphicsDevice) {
-                if(DEBUG) {
-                    System.err.println("EGLDrawable.setRealized: using existing EGL config: "+this);
-                }
-                // just fetch the data .. trust but verify ..
-                eglDisplay = aDevice.getHandle();
-                if (eglDisplay == EGL.EGL_NO_DISPLAY) {
-                    throw new GLException("Invalid EGL display in EGLGraphicsDevice from "+aDevice);
-                }
-                if(aConfig instanceof EGLGraphicsConfiguration) {
-                    eglConfig = (EGLGraphicsConfiguration) aConfig; // done ..
-                    if (null == eglConfig) {
-                        throw new GLException("Null EGLGraphicsConfiguration from "+aConfig);
-                    }
-
-                    int[] tmp = new int[1];
-                    if ( 0 != surface.getSurfaceHandle() &&
-                         EGL.eglQuerySurface(eglDisplay, surface.getSurfaceHandle(), EGL.EGL_CONFIG_ID, tmp, 0) ) {
-                        // surface holds static EGLSurface
-                        eglSurface = surface.getSurfaceHandle();
-                        if(DEBUG) {
-                            System.err.println("setSurface re-using component's EGLSurface: handle 0x"+Long.toHexString(eglSurface));
-                        }
-                    } else {
-                        // EGLSurface is ours ..
-                        ownEGLSurface=true;
-                        
-                        eglConfig.updateGraphicsConfiguration();
-
-                        recreateSurface();
-                    }
-                } else {
-                    throw new GLException("EGLGraphicsDevice hold by non EGLGraphicsConfiguration: "+aConfig);
-                }
-            } else {
-                if(DEBUG) {
-                    System.err.println("EGLDrawable.setRealized: creating new EGL config: "+this);
-                }
-                // create a new EGL config ..
-                ownEGLDisplay=true;
-                // EGLSurface is ours ..
-                ownEGLSurface=true;
-
-                long nDisplay=0;
-                if( NativeWindowFactory.TYPE_WINDOWS.equals(NativeWindowFactory.getNativeWindowType(false)) ) {
-                    nDisplay = surface.getSurfaceHandle(); // don't even ask ..
-                } else {
-                    nDisplay = aDevice.getHandle(); // 0 == EGL.EGL_DEFAULT_DISPLAY
-                }
-                eglDisplay = EGL.eglGetDisplay(nDisplay);
-                if (eglDisplay == EGL.EGL_NO_DISPLAY) {
-                    if(DEBUG) {
-                        System.err.println("eglDisplay("+Long.toHexString(nDisplay)+" <surfaceHandle>): failed, using EGL_DEFAULT_DISPLAY");
-                    }
-                    nDisplay = EGL.EGL_DEFAULT_DISPLAY;
-                    eglDisplay = EGL.eglGetDisplay(nDisplay);
-                }
-                if (eglDisplay == EGL.EGL_NO_DISPLAY) {
-                    throw new GLException("Failed to created EGL display: nhandle 0x"+Long.toHexString(nDisplay)+", "+aDevice+", error 0x"+Integer.toHexString(EGL.eglGetError()));
-                } else if(DEBUG) {
-                    System.err.println("eglDisplay("+Long.toHexString(nDisplay)+"): 0x"+Long.toHexString(eglDisplay));
-                }
-                if (!EGL.eglInitialize(eglDisplay, null, null)) {
-                    throw new GLException("eglInitialize failed"+", error 0x"+Integer.toHexString(EGL.eglGetError()));
-                }
-                EGLGraphicsDevice e = new EGLGraphicsDevice(eglDisplay, AbstractGraphicsDevice.DEFAULT_UNIT);
-                DefaultGraphicsScreen s = new DefaultGraphicsScreen(e, aConfig.getScreen().getIndex());
-                // yes, use the already choosen/requested Capabilities (x11,win32,..)
-                GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) aConfig.getChosenCapabilities();
-                GLCapabilitiesImmutable capsRequested = (GLCapabilitiesImmutable) aConfig.getRequestedCapabilities();
-                eglConfig = (EGLGraphicsConfiguration) GraphicsConfigurationFactory.getFactory(e).chooseGraphicsConfiguration(
-                        capsChosen, capsRequested, null, s);
-                if (null == eglConfig) {
-                    throw new GLException("Couldn't create EGLGraphicsConfiguration from "+s);
-                } else if(DEBUG) {
-                    System.err.println("Chosen eglConfig: "+eglConfig);
-                }
-                recreateSurface();
-            }
-        } else if (ownEGLSurface && eglSurface != EGL.EGL_NO_SURFACE) {
-            // Destroy the window surface
-            if (!EGL.eglDestroySurface(eglDisplay, eglSurface)) {
-                throw new GLException("Error destroying window surface (eglDestroySurface)");
-            }
-            eglSurface = EGL.EGL_NO_SURFACE;
-            if (ownEGLDisplay && EGL.EGL_NO_DISPLAY!=eglDisplay) {
-                EGL.eglTerminate(eglDisplay);
-            }
-            eglDisplay=EGL.EGL_NO_DISPLAY;
-            eglConfig=null;
-        }
-    }
-
-    public int getWidth() {
-        int[] tmp = new int[1];
-        if (!EGL.eglQuerySurface(eglDisplay, eglSurface, EGL.EGL_WIDTH, tmp, 0)) {
-            throw new GLException("Error querying surface width");
-        }
-        return tmp[0];
-    }
-
-    public int getHeight() {
-        int[] tmp = new int[1];
-        if (!EGL.eglQuerySurface(eglDisplay, eglSurface, EGL.EGL_HEIGHT, tmp, 0)) {
-            throw new GLException("Error querying surface height");
-        }
-        return tmp[0];
-    }
-
-    public GLDynamicLookupHelper getGLDynamicLookupHelper() {
-        if (getGLProfile().usesNativeGLES2()) {
-            return getFactoryImpl().getGLDynamicLookupHelper(2);
-        } else if (getGLProfile().usesNativeGLES1()) {
-            return getFactoryImpl().getGLDynamicLookupHelper(1);
-        } else {
-            throw new GLException("Unsupported: "+getGLProfile());
-        }
-    }
-
-    public String toString() {
-        return getClass().getName()+"[realized "+isRealized()+
-                    ",\n\tfactory    "+getFactory()+
-                    ",\n\tsurface    "+getNativeSurface()+
-                    ",\n\teglSurface  0x"+Long.toHexString(eglSurface)+
-                    ",\n\teglConfig  "+eglConfig+
-                    ",\n\trequested  "+getRequestedGLCapabilities()+
-                    ",\n\tchosen     "+getChosenGLCapabilities()+"]";
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java
deleted file mode 100644
index 737aa55..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.egl;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.common.JogampRuntimeException;
-import com.jogamp.common.util.*;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.nativewindow.impl.ProxySurface;
-import java.util.HashMap;
-import javax.media.nativewindow.egl.EGLGraphicsDevice;
-
-public class EGLDrawableFactory extends GLDrawableFactoryImpl {
-  
-    private static final GLDynamicLookupHelper eglES1DynamicLookupHelper;
-    private static final GLDynamicLookupHelper eglES2DynamicLookupHelper;
-
-    static {
-        // Register our GraphicsConfigurationFactory implementations
-        // The act of constructing them causes them to be registered
-        new EGLGraphicsConfigurationFactory();
-
-        // Check for other underlying stuff ..
-        if(NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(true))) {
-            try {
-                ReflectionUtil.createInstance("com.jogamp.opengl.impl.x11.glx.X11GLXGraphicsConfigurationFactory", EGLDrawableFactory.class.getClassLoader());
-            } catch (JogampRuntimeException jre) { /* n/a .. */ }
-        }
-
-        // FIXME: Probably need to move EGL from a static model 
-        // to a dynamic one, where there can be 2 instances 
-        // for each ES profile with their own ProcAddressTable.
-
-        GLDynamicLookupHelper tmp=null;
-        try {
-            tmp = new GLDynamicLookupHelper(new EGLES1DynamicLibraryBundleInfo());
-        } catch (GLException gle) {
-            if(DEBUG) {
-                gle.printStackTrace();
-            }
-        }
-        eglES1DynamicLookupHelper = tmp;
-        if(null!=eglES1DynamicLookupHelper && eglES1DynamicLookupHelper.isLibComplete()) {
-            EGL.resetProcAddressTable(eglES1DynamicLookupHelper);
-        }
-
-        tmp=null;
-        try {
-            tmp = new GLDynamicLookupHelper(new EGLES2DynamicLibraryBundleInfo());
-        } catch (GLException gle) {
-            if(DEBUG) {
-                gle.printStackTrace();
-            }
-        }
-        eglES2DynamicLookupHelper = tmp;
-        if(null!=eglES2DynamicLookupHelper && eglES2DynamicLookupHelper.isLibComplete()) {
-            EGL.resetProcAddressTable(eglES2DynamicLookupHelper);
-        }
-    }
-
-    public EGLDrawableFactory() {
-        super();
-        defaultDevice = new EGLGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
-    }
-
-    static class SharedResource {
-      private EGLDrawable drawable;
-      private EGLContext context;
-
-      SharedResource(EGLDrawable draw, EGLContext ctx) {
-          drawable = draw;
-          context = ctx;
-      }
-    }
-    HashMap/*<connection, SharedResource>*/ sharedMap = new HashMap();
-    EGLGraphicsDevice defaultDevice;
-
-    public final AbstractGraphicsDevice getDefaultDevice() {
-      return defaultDevice;
-    }
-
-    public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
-      if(device instanceof EGLGraphicsDevice) {
-          return true;
-      }
-      return false;
-    }
-
-    protected final GLContext getOrCreateSharedContextImpl(AbstractGraphicsDevice device) {
-        // FIXME: not implemented .. needs a dummy EGL surface
-        return null;
-    }
-
-    public GLDynamicLookupHelper getGLDynamicLookupHelper(int esProfile) {
-        if (2==esProfile) {
-            if(null==eglES2DynamicLookupHelper) {
-                throw new GLException("GLDynamicLookupHelper for ES2 not available");
-            }
-            return eglES2DynamicLookupHelper;
-        } else if (1==esProfile) {
-            if(null==eglES1DynamicLookupHelper) {
-                throw new GLException("GLDynamicLookupHelper for ES1 not available");
-            }
-            return eglES1DynamicLookupHelper;
-        } else {
-            throw new GLException("Unsupported: ES"+esProfile);
-        }
-    }
-
-    protected final void shutdownInstance() {}
-
-    protected GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
-        if (target == null) {
-          throw new IllegalArgumentException("Null target");
-        }
-        return new EGLOnscreenDrawable(this, target);
-    }
-
-    protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
-        throw new GLException("Not yet implemented");
-    }
-
-    public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) {
-        return true;
-    }
-
-    protected GLDrawableImpl createGLPbufferDrawableImpl(NativeSurface target) {
-        return new EGLPbufferDrawable(this, target);
-    }
-
-    protected NativeSurface createOffscreenSurfaceImpl(GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, int width, int height) {
-        ProxySurface ns = new ProxySurface(EGLGraphicsConfigurationFactory.createOffscreenGraphicsConfiguration(capsChosen, capsRequested, chooser));
-        ns.setSize(width, height);
-        return ns;
-    }
-
-    protected GLContext createExternalGLContextImpl() {
-        AbstractGraphicsScreen absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_EGL);
-        return new EGLExternalContext(absScreen);
-    }
-
-    public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
-        return false;
-    }
-
-    protected GLDrawable createExternalGLDrawableImpl() {
-        throw new GLException("Not yet implemented");
-    }
-
-    public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) {
-        return false;
-    }
-
-    public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
-        throws GLException {
-        throw new GLException("Unimplemented on this platform");
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDynamicLibraryBundleInfo.java
deleted file mode 100644
index 5b4a59c..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDynamicLibraryBundleInfo.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl.egl;
-
-import com.jogamp.common.os.DynamicLookupHelper;
-import com.jogamp.common.os.NativeLibrary;
-import java.util.*;
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-import java.security.*;
-
-/**
- * Abstract implementation of the DynamicLookupHelper for EGL,
- * which decouples it's dependencies to EGLDrawable.
- *
- * Currently two implementations exist, one for ES1 and one for ES2.
- */
-public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundleInfo {
-
-    protected EGLDynamicLibraryBundleInfo() {
-        super();
-    }
-
-    /** Might be a desktop GL library, and might need to allow symbol access to subsequent libs */
-    public boolean shallLinkGlobal() { return true; }
-
-    public final List getToolGetProcAddressFuncNameList() {
-        List res = new ArrayList();
-        res.add("eglGetProcAddress");
-        return res;
-    }
-
-    public final long toolDynamicLookupFunction(long toolGetProcAddressHandle, String funcName) {
-        return EGL.eglGetProcAddress(toolGetProcAddressHandle, funcName);
-    }
-
-    protected List/*<String>*/ getEGLLibNamesList() {
-        List/*<String>*/ eglLibNames = new ArrayList();
-        // EGL
-        eglLibNames.add("EGL");
-        // for windows distributions using the 'unlike' lib prefix, 
-        // where our tool does not add it.
-        eglLibNames.add("libEGL");
-        return eglLibNames;
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES1DynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES1DynamicLibraryBundleInfo.java
deleted file mode 100644
index 1507dc8..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES1DynamicLibraryBundleInfo.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl.egl;
-
-import java.util.*;
-import com.jogamp.opengl.impl.*;
-
-public class EGLES1DynamicLibraryBundleInfo extends EGLDynamicLibraryBundleInfo {
-    static List/*<String>*/ glueLibNames;
-    static {
-        glueLibNames = new ArrayList();
-        glueLibNames.addAll(GLDynamicLibraryBundleInfo.getGlueLibNamesPreload());
-        glueLibNames.add("jogl_es1");
-    }
-
-    protected EGLES1DynamicLibraryBundleInfo() {
-        super();
-    }
-
-    public List getToolLibNames() {
-        List/*<List>*/ libNames = new ArrayList();
-
-        List/*<String>*/ glesLibNames = new ArrayList();
-        glesLibNames.add("GLES_CM");
-        glesLibNames.add("GLES_CL");
-        glesLibNames.add("GLESv1_CM");
-        // for windows distributions using the 'unlike' lib prefix, 
-        // where our tool does not add it.
-        glesLibNames.add("libGLES_CM");
-        glesLibNames.add("libGLES_CL");
-        glesLibNames.add("libGLESv1_CM");
-        // last but not least, we may even use the desktop GL library,
-        // which would be eg Mesa + Gallium EGL ..
-        glesLibNames.add("libGL.so.1");
-        glesLibNames.add("libGL.so");
-        glesLibNames.add("GL");
-
-        libNames.add(glesLibNames);
-        libNames.add(getEGLLibNamesList());
-        return libNames;
-    }
-
-    public List/*<String>*/ getGlueLibNames() {
-        return glueLibNames;
-    }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES2DynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES2DynamicLibraryBundleInfo.java
deleted file mode 100644
index 3c02aec..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES2DynamicLibraryBundleInfo.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl.egl;
-
-import java.util.*;
-import com.jogamp.opengl.impl.*;
-
-public class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundleInfo {
-    static List/*<String>*/ glueLibNames;
-    static {
-        glueLibNames = new ArrayList();
-        glueLibNames.addAll(GLDynamicLibraryBundleInfo.getGlueLibNamesPreload());
-        glueLibNames.add("jogl_es2");
-    }
-  
-    protected EGLES2DynamicLibraryBundleInfo() {
-        super();
-    }
-
-    public List getToolLibNames() {
-        List/*<List>*/ libNames = new ArrayList();
-
-        List/*<String>*/ glesLibNames = new ArrayList();
-        glesLibNames.add("GLES20");
-        glesLibNames.add("GLESv2");
-        glesLibNames.add("GLESv2_CM");
-        // for windows distributions using the 'unlike' lib prefix
-        // where our tool does not add it.
-        glesLibNames.add("libGLES20"); 
-        glesLibNames.add("libGLESv2");
-        glesLibNames.add("libGLESv2_CM");
-        // last but not least, we may even use the desktop GL library,
-        // which would be eg Mesa + Gallium EGL ..
-        glesLibNames.add("libGL.so.1");
-        glesLibNames.add("libGL.so");
-        glesLibNames.add("GL");
-
-        libNames.add(glesLibNames);
-        libNames.add(getEGLLibNamesList());
-        return libNames;
-    }
-
-    public List/*<String>*/ getGlueLibNames() {
-        return glueLibNames;
-    }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLExternalContext.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLExternalContext.java
deleted file mode 100644
index ae8b5bf..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLExternalContext.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.egl;
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-import javax.media.nativewindow.*;
-
-public class EGLExternalContext extends EGLContext {
-    private boolean firstMakeCurrent = true;
-    private GLContext lastContext;
-
-    public EGLExternalContext(AbstractGraphicsScreen screen) {
-        super(null, null);
-        GLContextShareSet.contextCreated(this);
-        setGLFunctionAvailability(false, 0, 0, CTX_IS_ARB_CREATED|CTX_PROFILE_ES|CTX_OPTION_ANY);
-        getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
-    }
-
-    public int makeCurrent() throws GLException {
-        // Save last context if necessary to allow external GLContexts to
-        // talk to other GLContexts created by this library
-        GLContext cur = getCurrent();
-        if (cur != null && cur != this) {
-            lastContext = cur;
-            setCurrent(null);
-        }
-        return super.makeCurrent();
-    }  
-
-    public void release() throws GLException {
-        super.release();
-        setCurrent(lastContext);
-        lastContext = null;
-    }
-
-    protected void makeCurrentImpl(boolean newCreated) throws GLException {
-        if (firstMakeCurrent) {
-            firstMakeCurrent = false;
-        }
-    }
-
-    protected void releaseImpl() throws GLException {
-    }
-
-    protected void destroyImpl() throws GLException {
-    }
-
-    public void bindPbufferToTexture() {
-        throw new GLException("Should not call this");
-    }
-
-    public void releasePbufferFromTexture() {
-        throw new GLException("Should not call this");
-    }
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfiguration.java
deleted file mode 100644
index dc74d36..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfiguration.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.egl;
-
-import com.jogamp.common.nio.PointerBuffer;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.egl.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-
-public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
-    protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
-
-    public long getNativeConfig() {
-        return config;
-    }
-
-    public int getNativeConfigID() {
-        return configID;
-    }
-
-    public EGLGraphicsConfiguration(AbstractGraphicsScreen absScreen, 
-                                    GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser,
-                                    long cfg, int cfgID) {
-        super(absScreen, capsChosen, capsRequested);
-        this.chooser = chooser;
-        config = cfg;
-        configID = cfgID;
-    }
-
-    public static EGLGraphicsConfiguration create(GLCapabilitiesImmutable capsRequested, AbstractGraphicsScreen absScreen, int cfgID) {
-        AbstractGraphicsDevice absDevice = absScreen.getDevice();
-        if(null==absDevice || !(absDevice instanceof EGLGraphicsDevice)) {
-            throw new GLException("GraphicsDevice must be a valid EGLGraphicsDevice");
-        }
-        long dpy = absDevice.getHandle();
-        if (dpy == EGL.EGL_NO_DISPLAY) {
-            throw new GLException("Invalid EGL display: "+absDevice);
-        }
-        GLProfile glp = capsRequested.getGLProfile();
-        long cfg = EGLConfigId2EGLConfig(glp, dpy, cfgID);
-        GLCapabilitiesImmutable caps = EGLConfig2Capabilities(glp, dpy, cfg, false, capsRequested.isOnscreen(), capsRequested.isPBuffer());
-        return new EGLGraphicsConfiguration(absScreen, caps, capsRequested, new DefaultGLCapabilitiesChooser(), cfg, cfgID);
-    }
-
-    public Object clone() {
-        return super.clone();
-    }
-
-    protected void updateGraphicsConfiguration() {
-        EGLGraphicsConfiguration newConfig = (EGLGraphicsConfiguration)
-            GraphicsConfigurationFactory.getFactory(getScreen().getDevice()).chooseGraphicsConfiguration(
-                getChosenCapabilities(), getRequestedCapabilities(), chooser, getScreen());
-        if(null!=newConfig) {
-            // FIXME: setScreen( ... );
-            setChosenCapabilities(newConfig.getChosenCapabilities());
-            config = newConfig.getNativeConfig();
-            configID = newConfig.getNativeConfigID();
-            if(DEBUG) {
-                System.err.println("!!! updateGraphicsConfiguration: "+this);
-            }
-        }
-    }
-
-    public static long EGLConfigId2EGLConfig(GLProfile glp, long display, int configID) {
-        int[] attrs = new int[] {
-                EGL.EGL_CONFIG_ID, configID,
-                EGL.EGL_NONE
-            };
-        PointerBuffer configs = PointerBuffer.allocateDirect(1);
-        int[] numConfigs = new int[1];
-        if (!EGL.eglChooseConfig(display,
-                                 attrs, 0,
-                                 configs, 1,
-                                 numConfigs, 0)) {
-            return 0;
-        }
-        if (numConfigs[0] == 0) {
-            return 0;
-        }
-        return configs.get(0);
-    }
-
-    public static boolean EGLConfigDrawableTypeVerify(int val, boolean onscreen, boolean usePBuffer) {
-        boolean res;
-
-        if ( onscreen ) {
-            res = ( 0 != (val & EGL.EGL_WINDOW_BIT) ) ;
-        } else {
-            if ( usePBuffer ) {
-                res = ( 0 != (val & EGL.EGL_PBUFFER_BIT) ) ;
-            } else {
-                res = ( 0 != (val & EGL.EGL_PIXMAP_BIT) ) ;
-            }
-        }
-
-        return res;
-    }
-
-    public static GLCapabilitiesImmutable EGLConfig2Capabilities(GLProfile glp, long display, long config,
-                                                                 boolean relaxed, boolean onscreen, boolean usePBuffer) {
-        GLCapabilities caps = new GLCapabilities(glp);
-        int[] val = new int[1];
-
-        // Read the actual configuration into the choosen caps
-        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_RED_SIZE, val, 0)) {
-            caps.setRedBits(val[0]);
-        }
-        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_GREEN_SIZE, val, 0)) {
-            caps.setGreenBits(val[0]);
-        }
-        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_BLUE_SIZE, val, 0)) {
-            caps.setBlueBits(val[0]);
-        }
-        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_ALPHA_SIZE, val, 0)) {
-            caps.setAlphaBits(val[0]);
-        }
-        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_STENCIL_SIZE, val, 0)) {
-            caps.setStencilBits(val[0]);
-        }
-        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_DEPTH_SIZE, val, 0)) {
-            caps.setDepthBits(val[0]);
-        }
-        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_SAMPLES, val, 0)) {
-            caps.setSampleBuffers(val[0]>0?true:false);
-            caps.setNumSamples(val[0]);
-        }
-        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_TYPE, val, 0)) {
-            caps.setBackgroundOpaque(val[0] != EGL.EGL_TRANSPARENT_RGB);
-        }
-        if(!caps.isBackgroundOpaque()) {
-            if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_RED_VALUE, val, 0)) {
-                caps.setTransparentRedValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
-            }
-            if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_GREEN_VALUE, val, 0)) {
-                caps.setTransparentGreenValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
-            }
-            if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_BLUE_VALUE, val, 0)) {
-                caps.setTransparentBlueValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
-            }
-            /** Not defined in EGL 
-            if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_ALPHA_VALUE, val, 0)) {
-                caps.setTransparentAlphaValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
-            } */
-        }
-        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_SURFACE_TYPE, val, 0)) {
-            if(EGLConfigDrawableTypeVerify(val[0], onscreen, usePBuffer)) {
-                caps.setDoubleBuffered(onscreen);
-                caps.setOnscreen(onscreen);
-                caps.setPBuffer(usePBuffer);
-            } else if(relaxed) {
-                caps.setDoubleBuffered( 0 != (val[0] & EGL.EGL_WINDOW_BIT) );
-                caps.setOnscreen( 0 != (val[0] & EGL.EGL_WINDOW_BIT) );
-                caps.setPBuffer ( 0 != (val[0] & EGL.EGL_PBUFFER_BIT) );
-            } else {
-                if(DEBUG) {
-                  System.err.println("EGL_SURFACE_TYPE does not match: req(onscrn "+onscreen+", pbuffer "+usePBuffer+"), got(onscreen "+( 0 != (val[0] & EGL.EGL_WINDOW_BIT) )+", pbuffer "+( 0 != (val[0] & EGL.EGL_PBUFFER_BIT) )+", pixmap "+( 0 != (val[0] & EGL.EGL_PIXMAP_BIT) )+")");
-                }
-                return null;
-            }
-        } else {
-            throw new GLException("Could not determine EGL_SURFACE_TYPE !!!");
-        }
-
-        return caps;
-    }
-
-    public static int[] GLCapabilities2AttribList(GLCapabilitiesImmutable caps) {
-        int[] attrs = new int[32];
-        int idx=0;
-
-        attrs[idx++] = EGL.EGL_SURFACE_TYPE;
-        attrs[idx++] = caps.isOnscreen() ? ( EGL.EGL_WINDOW_BIT ) : ( caps.isPBuffer() ? EGL.EGL_PBUFFER_BIT : EGL.EGL_PIXMAP_BIT ) ;
-
-        attrs[idx++] = EGL.EGL_RED_SIZE;
-        attrs[idx++] = caps.getRedBits();
-
-        attrs[idx++] = EGL.EGL_GREEN_SIZE;
-        attrs[idx++] = caps.getGreenBits();
-
-        attrs[idx++] = EGL.EGL_BLUE_SIZE;
-        attrs[idx++] = caps.getBlueBits();
-
-        attrs[idx++] = EGL.EGL_ALPHA_SIZE;
-        attrs[idx++] = caps.getAlphaBits() > 0 ? caps.getAlphaBits() : EGL.EGL_DONT_CARE;
-
-        attrs[idx++] = EGL.EGL_STENCIL_SIZE;
-        attrs[idx++] = caps.getStencilBits() > 0 ? caps.getStencilBits() : EGL.EGL_DONT_CARE;
-
-        attrs[idx++] = EGL.EGL_DEPTH_SIZE;
-        attrs[idx++] = caps.getDepthBits();
-
-        attrs[idx++] = EGL.EGL_SAMPLES;
-        attrs[idx++] = caps.getSampleBuffers() ? caps.getNumSamples() : 1;
-
-        attrs[idx++] = EGL.EGL_TRANSPARENT_TYPE;
-        attrs[idx++] = caps.isBackgroundOpaque() ? EGL.EGL_NONE : EGL.EGL_TRANSPARENT_TYPE;
-
-        // 20
-
-        if(!caps.isBackgroundOpaque()) {
-            attrs[idx++] = EGL.EGL_TRANSPARENT_RED_VALUE;
-            attrs[idx++] = caps.getTransparentRedValue()>=0?caps.getTransparentRedValue():EGL.EGL_DONT_CARE;
-
-            attrs[idx++] = EGL.EGL_TRANSPARENT_GREEN_VALUE;
-            attrs[idx++] = caps.getTransparentGreenValue()>=0?caps.getTransparentGreenValue():EGL.EGL_DONT_CARE;
-
-            attrs[idx++] = EGL.EGL_TRANSPARENT_BLUE_VALUE;
-            attrs[idx++] = caps.getTransparentBlueValue()>=0?caps.getTransparentBlueValue():EGL.EGL_DONT_CARE;
-
-            /** Not define in EGL
-            attrs[idx++] = EGL.EGL_TRANSPARENT_ALPHA_VALUE;
-            attrs[idx++] = caps.getTransparentAlphaValue()>=0?caps.getTransparentAlphaValue():EGL.EGL_DONT_CARE; */
-        }
-
-        // 26 
-
-        attrs[idx++] = EGL.EGL_RENDERABLE_TYPE;
-        if(caps.getGLProfile().usesNativeGLES1()) {
-            attrs[idx++] = EGL.EGL_OPENGL_ES_BIT;
-        }
-        else if(caps.getGLProfile().usesNativeGLES2()) {
-            attrs[idx++] = EGL.EGL_OPENGL_ES2_BIT;
-        } else {
-            attrs[idx++] = EGL.EGL_OPENGL_BIT;
-        }
-
-        // 28
-
-        attrs[idx++] = EGL.EGL_NONE;
-
-        return attrs;
-    }
-
-    public static int[] CreatePBufferSurfaceAttribList(int width, int height, int texFormat) {
-        int[] attrs = new int[16];
-        int idx=0;
-
-        attrs[idx++] = EGL.EGL_WIDTH;
-        attrs[idx++] = width;
-
-        attrs[idx++] = EGL.EGL_HEIGHT;
-        attrs[idx++] = height;
-
-        attrs[idx++] = EGL.EGL_TEXTURE_FORMAT;
-        attrs[idx++] = texFormat;
-
-        attrs[idx++] = EGL.EGL_TEXTURE_TARGET;
-        attrs[idx++] = EGL.EGL_NO_TEXTURE==texFormat ? EGL.EGL_NO_TEXTURE : EGL.EGL_TEXTURE_2D;
-
-        attrs[idx++] = EGL.EGL_NONE;
-
-        return attrs;
-    }
-
-    public String toString() {
-        return getClass().toString()+"["+getScreen()+", eglConfigID 0x"+Integer.toHexString(configID)+
-                                     ",\n\trequested " + getRequestedCapabilities()+
-                                     ",\n\tchosen    " + getChosenCapabilities()+
-                                     "]";
-
-    }
-
-    private GLCapabilitiesChooser chooser;
-    private long config;
-    private int configID;
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfigurationFactory.java
deleted file mode 100644
index 8f0f036..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfigurationFactory.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.opengl.impl.egl;
-
-import java.io.PrintStream;
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.CapabilitiesChooser;
-import javax.media.nativewindow.CapabilitiesImmutable;
-import javax.media.nativewindow.DefaultGraphicsScreen;
-import javax.media.nativewindow.GraphicsConfigurationFactory;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.egl.EGLGraphicsDevice;
-
-import javax.media.opengl.DefaultGLCapabilitiesChooser;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLCapabilitiesChooser;
-import javax.media.opengl.GLCapabilitiesImmutable;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.common.nio.PointerBuffer;
-
-
-/** Subclass of GraphicsConfigurationFactory used when non-AWT tookits
-    are used on X11 platforms. Toolkits will likely need to delegate
-    to this one to change the accepted and returned types of the
-    GraphicsDevice and GraphicsConfiguration abstractions. */
-
-public class EGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
-    protected static final boolean DEBUG = GraphicsConfigurationFactory.DEBUG || com.jogamp.opengl.impl.Debug.debug("EGL");
-
-    public EGLGraphicsConfigurationFactory() {
-        // become the selector for KD/EGL ..
-        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.egl.EGLGraphicsDevice.class, this);
-    }
-
-    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl (
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
-        if (absScreen == null) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only AbstractGraphicsDevice objects");
-        }
-
-        if (! (capsChosen instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - chosen");
-        }
-
-        if (! (capsRequested instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - requested");
-        }
-
-        if (chooser != null &&
-            !(chooser instanceof GLCapabilitiesChooser)) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
-        }
-
-        return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable) capsChosen,
-                                                 (GLCapabilitiesImmutable) capsRequested,
-                                                 (GLCapabilitiesChooser) chooser,
-                                                 absScreen);
-    }
-
-    private static EGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
-                                                                              GLCapabilitiesImmutable capsReq,
-                                                                              GLCapabilitiesChooser chooser,
-                                                                              AbstractGraphicsScreen absScreen) {
-        if (capsChosen == null) {
-            capsChosen = new GLCapabilities(null);
-        }
-        GLProfile glp = capsChosen.getGLProfile();
-
-        if(null==absScreen) {
-            throw new GLException("Null AbstractGraphicsScreen");
-        }
-        AbstractGraphicsDevice absDevice = absScreen.getDevice();
-
-        if(null==absDevice || !(absDevice instanceof EGLGraphicsDevice)) {
-            throw new GLException("GraphicsDevice must be a valid EGLGraphicsDevice");
-        }
-        long eglDisplay = absDevice.getHandle();
-
-        if (eglDisplay == EGL.EGL_NO_DISPLAY) {
-            throw new GLException("Invalid EGL display: "+absDevice);
-        }
-
-        if(!capsChosen.isOnscreen() && capsChosen.getDoubleBuffered()) {
-            // OFFSCREEN !DOUBLE_BUFFER // FIXME DBLBUFOFFSCRN
-            GLCapabilities caps2 = (GLCapabilities) capsChosen.cloneMutable();
-            caps2.setDoubleBuffered(false);
-            capsChosen = caps2;
-        }
-
-        EGLGraphicsConfiguration res = eglChooseConfig(eglDisplay, capsChosen, capsReq, chooser, absScreen);
-        if(null!=res) {
-            return res;
-        }
-        if(DEBUG) {
-            System.err.println("eglChooseConfig failed with given capabilities "+capsChosen);
-        }
-
-        if (chooser == null) {
-            chooser = new DefaultGLCapabilitiesChooser();
-        }
-
-        PointerBuffer configs = PointerBuffer.allocateDirect(10);
-        int[] numConfigs = new int[1];
-
-        if(!EGL.eglGetConfigs(eglDisplay, configs, configs.capacity(), numConfigs, 0)) {
-            throw new GLException("Graphics configuration fetch (eglGetConfigs) failed");
-        }
-        if (numConfigs[0] == 0) {
-            throw new GLException("Graphics configuration fetch (eglGetConfigs) - no EGLConfig found");
-        }
-        GLCapabilitiesImmutable[] caps = eglConfigs2GLCaps(glp, eglDisplay, configs, numConfigs[0],
-                                                           capsChosen.isOnscreen(), capsChosen.isPBuffer());
-        if(DEBUG) {
-            System.err.println("EGL Get Configs: "+numConfigs[0]+", Caps "+caps.length);
-            printCaps("eglGetConfigs", caps, System.err);
-        }
-        int chosen = -1;
-        try {
-            chosen = chooser.chooseCapabilities(capsChosen, caps, -1);
-        } catch (NativeWindowException e) { throw new GLException(e); }
-        if(chosen<0) {
-            throw new GLException("Graphics configuration chooser failed");
-        }
-        if(DEBUG) {
-            System.err.println("Chosen "+caps[chosen]);
-        }
-        res = eglChooseConfig(eglDisplay, caps[chosen], capsReq, chooser, absScreen);
-        if(null!=res) {
-            return res;
-        }
-        if(DEBUG) {
-            System.err.println("eglChooseConfig failed with eglGetConfig/choosen capabilities "+caps[chosen]);
-        }
-
-        // Last try .. add a fixed embedded profile [ATI, Nokia, Intel, ..]
-        //
-        // rgb888 - d16, s4
-        GLCapabilities fixedCaps = new GLCapabilities(glp);
-        fixedCaps.setRedBits(8);
-        fixedCaps.setGreenBits(8);
-        fixedCaps.setBlueBits(8);
-        fixedCaps.setDepthBits(16);
-        fixedCaps.setSampleBuffers(true);
-        fixedCaps.setNumSamples(4);
-        if(DEBUG) {
-            System.err.println("trying fixed caps (1): "+fixedCaps);
-        }
-        res = eglChooseConfig(eglDisplay, fixedCaps, capsReq, chooser, absScreen);
-        if(null!=res) {
-            return res;
-        }
-
-        //
-        // rgb565 - d16, s0
-        fixedCaps = new GLCapabilities(glp);
-        fixedCaps.setRedBits(5);
-        fixedCaps.setGreenBits(6);
-        fixedCaps.setBlueBits(5);
-        fixedCaps.setDepthBits(16);
-        if(DEBUG) {
-            System.err.println("trying fixed caps (2): "+fixedCaps);
-        }
-        res = eglChooseConfig(eglDisplay, fixedCaps, capsReq, chooser, absScreen);
-        if(null!=res) {
-            return res;
-        }
-
-        //
-        // rgb565 - d16, s4
-        fixedCaps = new GLCapabilities(glp);
-        fixedCaps.setRedBits(5);
-        fixedCaps.setGreenBits(6);
-        fixedCaps.setBlueBits(5);
-        fixedCaps.setDepthBits(16);
-        fixedCaps.setSampleBuffers(true);
-        fixedCaps.setNumSamples(4);
-        if(DEBUG) {
-            System.err.println("trying fixed caps (3): "+fixedCaps);
-        }
-        res = eglChooseConfig(eglDisplay, fixedCaps, capsReq, chooser, absScreen);
-        if(null!=res) {
-            return res;
-        }
-        throw new GLException("Graphics configuration failed [direct caps, eglGetConfig/chooser and fixed-caps(1-3)]");
-    }
-
-    protected static EGLGraphicsConfiguration eglChooseConfig(long eglDisplay, 
-                                                              GLCapabilitiesImmutable capsChosen0, GLCapabilitiesImmutable capsRequested,
-                                                              GLCapabilitiesChooser chooser,
-                                                              AbstractGraphicsScreen absScreen) {
-        GLProfile glp = capsChosen0.getGLProfile();
-        int[] attrs = EGLGraphicsConfiguration.GLCapabilities2AttribList(capsChosen0);
-        PointerBuffer configs = PointerBuffer.allocateDirect(1);
-        int[] numConfigs = new int[1];
-        if (!EGL.eglChooseConfig(eglDisplay,
-                                 attrs, 0,
-                                 configs, configs.capacity(),
-                                 numConfigs, 0)) {
-            throw new GLException("Graphics configuration selection (eglChooseConfig) failed for "+capsChosen0);
-        }
-        if (numConfigs[0] > 0) {
-            if(DEBUG) {
-                GLCapabilitiesImmutable[] caps = eglConfigs2GLCaps(glp, eglDisplay, configs, numConfigs[0],
-                                                                   capsChosen0.isOnscreen(), capsChosen0.isPBuffer());
-                System.err.println("EGL Choose Configs: "+numConfigs[0]+", Caps "+caps.length);
-                printCaps("eglChooseConfig", caps, System.err);
-            }
-            int[] val = new int[1];
-            // get the configID 
-            if(!EGL.eglGetConfigAttrib(eglDisplay, configs.get(0), EGL.EGL_CONFIG_ID, val, 0)) {
-                if(DEBUG) {
-                    // FIXME: this happens on a ATI PC Emulation ..
-                    System.err.println("EGL couldn't retrieve ConfigID for already chosen eglConfig "+capsChosen0+", error 0x"+Integer.toHexString(EGL.eglGetError()));
-                }
-                return null;
-            }
-            GLCapabilitiesImmutable capsChosen1 = EGLGraphicsConfiguration.EGLConfig2Capabilities(
-                                                            glp, eglDisplay, configs.get(0),
-                                                            true, capsChosen0.isOnscreen(), capsChosen0.isPBuffer());
-            if(null!=capsChosen1) {
-                if(DEBUG) {
-                    System.err.println("eglChooseConfig found: eglDisplay 0x"+Long.toHexString(eglDisplay)+
-                                                            ", eglConfig ID 0x"+Integer.toHexString(val[0])+
-                                                            ", "+capsChosen0+" -> "+capsChosen1);
-                }
-                return new EGLGraphicsConfiguration(absScreen, capsChosen1, capsRequested, chooser, configs.get(0), val[0]);
-            }
-            if(DEBUG) {
-                System.err.println("eglChooseConfig couldn't verify: eglDisplay 0x"+Long.toHexString(eglDisplay)+
-                                                                        ", eglConfig ID 0x"+Integer.toHexString(val[0])+
-                                                                        ", for "+capsChosen0);
-            }
-        } else {
-            if(DEBUG) {
-                System.err.println("EGL Choose Configs: None using eglDisplay 0x"+Long.toHexString(eglDisplay)+
-                                                                ", "+capsChosen0);
-            }
-        }
-        return null;
-    }
-
-    protected static GLCapabilitiesImmutable[] eglConfigs2GLCaps(GLProfile glp, long eglDisplay, PointerBuffer configs, int num,
-                                                                 boolean onscreen, boolean usePBuffer) {
-        GLCapabilitiesImmutable[] caps = new GLCapabilitiesImmutable[num];
-        for(int i=0; i<num; i++) {
-            caps[i] = EGLGraphicsConfiguration.EGLConfig2Capabilities(glp, eglDisplay, configs.get(i),
-                                                                      true, onscreen, usePBuffer);
-        }
-        return caps;
-    }
-
-    protected static void printCaps(String prefix, GLCapabilitiesImmutable[] caps, PrintStream out) {
-        for(int i=0; i<caps.length; i++) {
-            out.println(prefix+"["+i+"] "+caps[i]);
-        }
-    }
-
-    protected static EGLGraphicsConfiguration createOffscreenGraphicsConfiguration(GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsReq, GLCapabilitiesChooser chooser) {
-        if(capsChosen.isOnscreen()) {
-            throw new GLException("Error: Onscreen set: "+capsChosen);
-        }
-
-        if(capsChosen.getDoubleBuffered()) {
-            // OFFSCREEN !DOUBLE_BUFFER // FIXME DBLBUFOFFSCRN
-            GLCapabilities caps2 = (GLCapabilities) capsChosen.cloneMutable();
-            caps2.setDoubleBuffered(false);
-            capsChosen = caps2;
-        }
-
-        long eglDisplay = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
-        if (eglDisplay == EGL.EGL_NO_DISPLAY) {
-            throw new GLException("Failed to created EGL default display: error 0x"+Integer.toHexString(EGL.eglGetError()));
-        } else if(DEBUG) {
-            System.err.println("eglDisplay(EGL_DEFAULT_DISPLAY): 0x"+Long.toHexString(eglDisplay));
-        }
-        if (!EGL.eglInitialize(eglDisplay, null, null)) {
-            throw new GLException("eglInitialize failed"+", error 0x"+Integer.toHexString(EGL.eglGetError()));
-        }
-        EGLGraphicsDevice e = new EGLGraphicsDevice(eglDisplay, AbstractGraphicsDevice.DEFAULT_UNIT);
-        DefaultGraphicsScreen s = new DefaultGraphicsScreen(e, 0);
-        EGLGraphicsConfiguration eglConfig = chooseGraphicsConfigurationStatic(capsChosen, capsReq, chooser, s);
-        if (null == eglConfig) {
-            EGL.eglTerminate(eglDisplay);
-            throw new GLException("Couldn't create EGLGraphicsConfiguration from "+s);
-        } else if(DEBUG) {
-            System.err.println("Chosen eglConfig: "+eglConfig);
-        }
-        return eglConfig;
-    }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenContext.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenContext.java
deleted file mode 100644
index cb8b01d..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenContext.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.egl;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.gluegen.runtime.ProcAddressTable;
-import java.nio.*;
-import java.util.*;
-
-public class EGLOnscreenContext extends EGLContext {
-    public EGLOnscreenContext(EGLOnscreenDrawable drawable, GLContext shareWith) {
-        super(drawable, shareWith);
-    }
-
-    public void bindPbufferToTexture() {
-        throw new GLException("Should not call this");
-    }
-
-    public void releasePbufferFromTexture() {
-        throw new GLException("Should not call this");
-    }
-
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java
deleted file mode 100644
index 820ac04..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.egl;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-
-public class EGLOnscreenDrawable extends EGLDrawable {
-    protected EGLOnscreenDrawable(EGLDrawableFactory factory, NativeSurface component) throws GLException {
-        super(factory, component);
-    }
-
-    public GLContext createContext(GLContext shareWith) {
-        return new EGLOnscreenContext(this, shareWith);
-    }
-
-    protected long createSurface(long eglDpy, long eglNativeCfg, long surfaceHandle) {
-        return EGL.eglCreateWindowSurface(eglDpy, eglNativeCfg, surfaceHandle, null);
-    }
-
-    protected void swapBuffersImpl() {
-        EGL.eglSwapBuffers(eglDisplay, eglSurface);
-    }
-
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferContext.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferContext.java
deleted file mode 100644
index 5c634b9..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferContext.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.egl;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.gluegen.runtime.ProcAddressTable;
-import java.nio.*;
-import java.util.*;
-
-public class EGLPbufferContext extends EGLContext {
-    public EGLPbufferContext(EGLPbufferDrawable drawable, GLContext shareWith) {
-        super(drawable, shareWith);
-    }
-
-    public int getFloatingPointMode() {
-        return 0; // FIXME ??
-    }
-
-    public void bindPbufferToTexture() {
-        throw new GLException("Not yet implemented");
-    }
-
-    public void releasePbufferFromTexture() {
-        throw new GLException("Not yet implemented");
-    }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferDrawable.java
deleted file mode 100644
index 3189324..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferDrawable.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.egl;
-
-import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.SurfaceChangeable;
-import javax.media.opengl.GLCapabilitiesImmutable;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLException;
-
-public class EGLPbufferDrawable extends EGLDrawable {
-    private int texFormat;
-    protected static final boolean useTexture = false; // No yet ..
-
-    protected EGLPbufferDrawable(EGLDrawableFactory factory, NativeSurface target) {
-        super(factory, target);
-        ownEGLDisplay = true;
-
-        // get choosen ones ..
-        GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)
-                   getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
-
-        if(useTexture) {
-            this.texFormat = caps.getAlphaBits() > 0 ? EGL.EGL_TEXTURE_RGBA : EGL.EGL_TEXTURE_RGB ;
-        } else {
-            this.texFormat = EGL.EGL_NO_TEXTURE;
-        }
-
-        if (DEBUG) {
-          System.out.println("Pbuffer config: " + getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration());
-        }
-
-        setRealized(true);
-
-        if (DEBUG) {
-          System.out.println("Created pbuffer: " + this);
-        }
-
-    }
-
-    protected long createSurface(long eglDpy, long eglNativeCfg, long surfaceHandle) {
-        NativeSurface nw = getNativeSurface();
-        int[] attrs = EGLGraphicsConfiguration.CreatePBufferSurfaceAttribList(nw.getWidth(), nw.getHeight(), texFormat);
-        long surf = EGL.eglCreatePbufferSurface(eglDpy, eglNativeCfg, attrs, 0);
-        if (EGL.EGL_NO_SURFACE==surf) {
-            throw new GLException("Creation of window surface (eglCreatePbufferSurface) failed, dim "+nw.getWidth()+"x"+nw.getHeight()+", error 0x"+Integer.toHexString(EGL.eglGetError()));
-        } else if(DEBUG) {
-            System.err.println("PBuffer setSurface result: eglSurface 0x"+Long.toHexString(surf));
-        }
-        ((SurfaceChangeable)nw).setSurfaceHandle(surf);
-        return surf;
-    }
-
-    public GLContext createContext(GLContext shareWith) {
-        return new EGLPbufferContext(this, shareWith);
-    }
-
-    protected void swapBuffersImpl() { 
-        if(DEBUG) {
-            System.err.println("unhandled swapBuffersImpl() called for: "+this);
-        }
-    }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/gl2/ProjectDouble.java b/src/jogl/classes/com/jogamp/opengl/impl/gl2/ProjectDouble.java
deleted file mode 100644
index 98cc3f3..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/gl2/ProjectDouble.java
+++ /dev/null
@@ -1,1042 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-** 
-** http://oss.sgi.com/projects/FreeB
-** 
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-** 
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-** 
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2009-03-13 22:20:29 -0700 (Fri, 13 Mar 2009) $ $Revision: 1867 $
-** $Header$
-*/
-
-/* 
- * Copyright (c) 2002-2004 LWJGL Project
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are 
- * met:
- * 
- * * Redistributions of source code must retain the above copyright 
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'LWJGL' nor the names of 
- *   its contributors may be used to endorse or promote products derived 
- *   from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-package com.jogamp.opengl.impl.gl2;
-
-import java.nio.*;
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.common.nio.Buffers;
-
-/**
- * Project.java
- * <p/>
- * <p/>
- * Created 11-jan-2004
- * 
- * @author Erik Duijs
- * @author Kenneth Russell
- */
-public class ProjectDouble {
-  private static final double[] IDENTITY_MATRIX =
-    new double[] {
-      1.0, 0.0, 0.0, 0.0,
-      0.0, 1.0, 0.0, 0.0,
-      0.0, 0.0, 1.0, 0.0,
-      0.0, 0.0, 0.0, 1.0 };
-
-  // Note that we have cloned parts of the implementation in order to
-  // support incoming Buffers. The reason for this is to avoid loading
-  // non-direct buffer subclasses unnecessarily, because doing so can
-  // cause performance decreases on direct buffer operations, at least
-  // on the current HotSpot JVM. It would be nicer (and make the code
-  // simpler) to simply have the array-based entry points delegate to
-  // the versions taking Buffers by wrapping the arrays.
-
-  // Array-based implementation
-  private final double[] matrix = new double[16];
-
-  private final double[][] tempMatrix = new double[4][4];
-  private final double[] in = new double[4];
-  private final double[] out = new double[4];
-
-  private final double[] forward = new double[3];
-  private final double[] side = new double[3];
-  private final double[] up = new double[3];
-  
-  // Buffer-based implementation
-  private DoubleBuffer locbuf;
-  private final DoubleBuffer matrixBuf;
-
-  private final DoubleBuffer tempMatrixBuf;
-  private final DoubleBuffer inBuf;
-  private final DoubleBuffer outBuf;
-
-  private final DoubleBuffer forwardBuf;
-  private final DoubleBuffer sideBuf;
-  private final DoubleBuffer upBuf;
-
-  public ProjectDouble() {
-    // Use direct buffers to avoid loading indirect buffer
-    // implementations for applications trying to avoid doing so.
-    // Slice up one big buffer because some NIO implementations
-    // allocate a huge amount of memory to back even the smallest of
-    // buffers.
-    DoubleBuffer locbuf = Buffers.newDirectDoubleBuffer(128);
-    int pos = 0;
-    int sz = 16;
-    matrixBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    tempMatrixBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    sz = 4;
-    inBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    outBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    sz = 3;
-    forwardBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    sideBuf = slice(locbuf, pos, sz);
-    pos += sz;
-    upBuf = slice(locbuf, pos, sz);
-  }
-
-  public void destroy() {
-    if(locbuf!=null) {
-        locbuf.clear();
-        locbuf=null;
-    }
-  }
-
-  private static DoubleBuffer slice(DoubleBuffer buf, int pos, int len) {
-    buf.position(pos);
-    buf.limit(pos + len);
-    return buf.slice();
-  }
-
-  /**
-   * Make matrix an identity matrix
-   */
-  private void __gluMakeIdentityd(DoubleBuffer m) {
-    int oldPos = m.position();
-    m.put(IDENTITY_MATRIX);
-    m.position(oldPos);
-  }
-
-  /**
-   * Make matrix an identity matrix
-   */
-  private void __gluMakeIdentityd(double[] m) {
-    for (int i = 0; i < 16; i++) {
-      m[i] = IDENTITY_MATRIX[i];
-    }
-  }
-
-  /**
-   * Method __gluMultMatrixVecd
-   * 
-   * @param matrix
-   * @param in
-   * @param out
-   */
-  private void __gluMultMatrixVecd(double[] matrix, int matrix_offset, double[] in, double[] out) {
-    for (int i = 0; i < 4; i++) {
-      out[i] =
-        in[0] * matrix[0*4+i+matrix_offset] +
-        in[1] * matrix[1*4+i+matrix_offset] +
-        in[2] * matrix[2*4+i+matrix_offset] +
-        in[3] * matrix[3*4+i+matrix_offset];
-    }
-  }
-
-  /**
-   * Method __gluMultMatrixVecd
-   * 
-   * @param matrix
-   * @param in
-   * @param out
-   */
-  private void __gluMultMatrixVecd(DoubleBuffer matrix, DoubleBuffer in, DoubleBuffer out) {
-    int inPos = in.position();
-    int outPos = out.position();
-    int matrixPos = matrix.position();
-    for (int i = 0; i < 4; i++) {
-      out.put(i + outPos,
-              in.get(0+inPos) * matrix.get(0*4+i+matrixPos) +
-              in.get(1+inPos) * matrix.get(1*4+i+matrixPos) +
-              in.get(2+inPos) * matrix.get(2*4+i+matrixPos) +
-              in.get(3+inPos) * matrix.get(3*4+i+matrixPos));
-    }
-  }
-
-  /**
-   * @param src
-   * @param inverse
-   * 
-   * @return
-   */
-  private boolean __gluInvertMatrixd(double[] src, double[] inverse) {
-    int i, j, k, swap;
-    double t;
-    double[][] temp = tempMatrix;
-
-    for (i = 0; i < 4; i++) {
-      for (j = 0; j < 4; j++) {
-        temp[i][j] = src[i*4+j];
-      }
-    }
-    __gluMakeIdentityd(inverse);
-
-    for (i = 0; i < 4; i++) {
-      //
-      // Look for largest element in column
-      //
-      swap = i;
-      for (j = i + 1; j < 4; j++) {
-        if (Math.abs(temp[j][i]) > Math.abs(temp[i][i])) {
-          swap = j;
-        }
-      }
-
-      if (swap != i) {
-        //
-        // Swap rows.
-        //
-        for (k = 0; k < 4; k++) {
-          t = temp[i][k];
-          temp[i][k] = temp[swap][k];
-          temp[swap][k] = t;
-
-          t = inverse[i*4+k];
-          inverse[i*4+k] = inverse[swap*4+k];
-          inverse[swap*4+k] = t;
-        }
-      }
-
-      if (temp[i][i] == 0) {
-        //
-        // No non-zero pivot. The matrix is singular, which shouldn't
-        // happen. This means the user gave us a bad matrix.
-        //
-        return false;
-      }
-
-      t = temp[i][i];
-      for (k = 0; k < 4; k++) {
-        temp[i][k] /= t;
-        inverse[i*4+k] /= t;
-      }
-      for (j = 0; j < 4; j++) {
-        if (j != i) {
-          t = temp[j][i];
-          for (k = 0; k < 4; k++) {
-            temp[j][k] -= temp[i][k] * t;
-            inverse[j*4+k] -= inverse[i*4+k]*t;
-          }
-        }
-      }
-    }
-    return true;
-  }
-
-  /**
-   * @param src
-   * @param inverse
-   * 
-   * @return
-   */
-  private boolean __gluInvertMatrixd(DoubleBuffer src, DoubleBuffer inverse) {
-    int i, j, k, swap;
-    double t;
-
-    int srcPos = src.position();
-    int invPos = inverse.position();
-
-    DoubleBuffer temp = tempMatrixBuf;
-
-    for (i = 0; i < 4; i++) {
-      for (j = 0; j < 4; j++) {
-        temp.put(i*4+j, src.get(i*4+j + srcPos));
-      }
-    }
-    __gluMakeIdentityd(inverse);
-
-    for (i = 0; i < 4; i++) {
-      //
-      // Look for largest element in column
-      //
-      swap = i;
-      for (j = i + 1; j < 4; j++) {
-        if (Math.abs(temp.get(j*4+i)) > Math.abs(temp.get(i*4+i))) {
-          swap = j;
-        }
-      }
-
-      if (swap != i) {
-        //
-        // Swap rows.
-        //
-        for (k = 0; k < 4; k++) {
-          t = temp.get(i*4+k);
-          temp.put(i*4+k, temp.get(swap*4+k));
-          temp.put(swap*4+k, t);
-
-          t = inverse.get(i*4+k + invPos);
-          inverse.put(i*4+k + invPos, inverse.get(swap*4+k + invPos));
-          inverse.put(swap*4+k + invPos, t);
-        }
-      }
-
-      if (temp.get(i*4+i) == 0) {
-        //
-        // No non-zero pivot. The matrix is singular, which shouldn't
-        // happen. This means the user gave us a bad matrix.
-        //
-        return false;
-      }
-
-      t = temp.get(i*4+i);
-      for (k = 0; k < 4; k++) {
-        temp.put(i*4+k, temp.get(i*4+k) / t);
-        inverse.put(i*4+k + invPos, inverse.get(i*4+k + invPos) / t);
-      }
-      for (j = 0; j < 4; j++) {
-        if (j != i) {
-          t = temp.get(j*4+i);
-          for (k = 0; k < 4; k++) {
-            temp.put(j*4+k, temp.get(j*4+k) - temp.get(i*4+k) * t);
-            inverse.put(j*4+k + invPos, inverse.get(j*4+k + invPos) - inverse.get(i*4+k + invPos) * t);
-          }
-        }
-      }
-    }
-    return true;
-  }
-
-
-  /**
-   * @param a
-   * @param b
-   * @param r
-   */
-  private void __gluMultMatricesd(double[] a, int a_offset, double[] b, int b_offset, double[] r) {
-    for (int i = 0; i < 4; i++) {
-      for (int j = 0; j < 4; j++) {
-        r[i*4+j] =
-          a[i*4+0+a_offset]*b[0*4+j+b_offset] +
-          a[i*4+1+a_offset]*b[1*4+j+b_offset] +
-          a[i*4+2+a_offset]*b[2*4+j+b_offset] +
-          a[i*4+3+a_offset]*b[3*4+j+b_offset];
-      }
-    }
-  }
-
-
-  /**
-   * @param a
-   * @param b
-   * @param r
-   */
-  private void __gluMultMatricesd(DoubleBuffer a, DoubleBuffer b, DoubleBuffer r) {
-    int aPos = a.position();
-    int bPos = b.position();
-    int rPos = r.position();
-
-    for (int i = 0; i < 4; i++) {
-      for (int j = 0; j < 4; j++) {
-        r.put(i*4+j + rPos,
-          a.get(i*4+0+aPos)*b.get(0*4+j+bPos) +
-          a.get(i*4+1+aPos)*b.get(1*4+j+bPos) +
-          a.get(i*4+2+aPos)*b.get(2*4+j+bPos) +
-          a.get(i*4+3+aPos)*b.get(3*4+j+bPos));
-      }
-    }
-  }
-
-  /**
-   * Normalize vector
-   *
-   * @param v
-   */
-  private static void normalize(double[] v) {
-    double r;
-
-    r = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-    if ( r == 0.0 )
-      return;
-
-    r = 1.0 / r;
-
-    v[0] *= r;
-    v[1] *= r;
-    v[2] *= r;
-
-    return;
-  }
-
-  /**
-   * Normalize vector
-   *
-   * @param v
-   */
-  private static void normalize(DoubleBuffer v) {
-    double r;
-
-    int vPos = v.position();
-
-    r = Math.sqrt(v.get(0+vPos) * v.get(0+vPos) +
-                  v.get(1+vPos) * v.get(1+vPos) +
-                  v.get(2+vPos) * v.get(2+vPos));
-    if ( r == 0.0 )
-      return;
-
-    r = 1.0 / r;
-
-    v.put(0+vPos, v.get(0+vPos) * r);
-    v.put(1+vPos, v.get(1+vPos) * r);
-    v.put(2+vPos, v.get(2+vPos) * r);
-
-    return;
-  }
-
-
-  /**
-   * Calculate cross-product
-   *
-   * @param v1
-   * @param v2
-   * @param result
-   */
-  private static void cross(double[] v1, double[] v2, double[] result) {
-    result[0] = v1[1] * v2[2] - v1[2] * v2[1];
-    result[1] = v1[2] * v2[0] - v1[0] * v2[2];
-    result[2] = v1[0] * v2[1] - v1[1] * v2[0];
-  }
-
-  /**
-   * Calculate cross-product
-   *
-   * @param v1
-   * @param v2
-   * @param result
-   */
-  private static void cross(DoubleBuffer v1, DoubleBuffer v2, DoubleBuffer result) {
-    int v1Pos = v1.position();
-    int v2Pos = v2.position();
-    int rPos  = result.position();
-
-    result.put(0+rPos, v1.get(1+v1Pos) * v2.get(2+v2Pos) - v1.get(2+v1Pos) * v2.get(1+v2Pos));
-    result.put(1+rPos, v1.get(2+v1Pos) * v2.get(0+v2Pos) - v1.get(0+v1Pos) * v2.get(2+v2Pos));
-    result.put(2+rPos, v1.get(0+v1Pos) * v2.get(1+v2Pos) - v1.get(1+v1Pos) * v2.get(0+v2Pos));
-  }
-
-  /**
-   * Method gluOrtho2D.
-   * 
-   * @param left
-   * @param right
-   * @param bottom
-   * @param top
-   */
-  public void gluOrtho2D(GL2 gl, double left, double right, double bottom, double top) {
-    gl.glOrtho(left, right, bottom, top, -1, 1);
-  }
-
-  /**
-   * Method gluPerspective.
-   * 
-   * @param fovy
-   * @param aspect
-   * @param zNear
-   * @param zFar
-   */
-  public void gluPerspective(GL2 gl, double fovy, double aspect, double zNear, double zFar) {
-    double sine, cotangent, deltaZ;
-    double radians = fovy / 2 * Math.PI / 180;
-
-    deltaZ = zFar - zNear;
-    sine = Math.sin(radians);
-
-    if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) {
-      return;
-    }
-
-    cotangent = Math.cos(radians) / sine;
-
-    __gluMakeIdentityd(matrixBuf);
-
-    matrixBuf.put(0 * 4 + 0, cotangent / aspect);
-    matrixBuf.put(1 * 4 + 1, cotangent);
-    matrixBuf.put(2 * 4 + 2, - (zFar + zNear) / deltaZ);
-    matrixBuf.put(2 * 4 + 3, -1);
-    matrixBuf.put(3 * 4 + 2, -2 * zNear * zFar / deltaZ);
-    matrixBuf.put(3 * 4 + 3, 0);
-
-    gl.glMultMatrixd(matrixBuf);
-  }
-
-  /**
-   * Method gluLookAt
-   * 
-   * @param eyex
-   * @param eyey
-   * @param eyez
-   * @param centerx
-   * @param centery
-   * @param centerz
-   * @param upx
-   * @param upy
-   * @param upz
-   */
-  public void gluLookAt(GL2 gl,
-                        double eyex,
-                        double eyey,
-                        double eyez,
-                        double centerx,
-                        double centery,
-                        double centerz,
-                        double upx,
-                        double upy,
-                        double upz) {
-    DoubleBuffer forward = this.forwardBuf;
-    DoubleBuffer side = this.sideBuf;
-    DoubleBuffer up = this.upBuf;
-
-    forward.put(0, centerx - eyex);
-    forward.put(1, centery - eyey);
-    forward.put(2, centerz - eyez);
-
-    up.put(0, upx);
-    up.put(1, upy);
-    up.put(2, upz);
-
-    normalize(forward);
-
-    /* Side = forward x up */
-    cross(forward, up, side);
-    normalize(side);
-
-    /* Recompute up as: up = side x forward */
-    cross(side, forward, up);
-
-    __gluMakeIdentityd(matrixBuf);
-    matrixBuf.put(0 * 4 + 0, side.get(0));
-    matrixBuf.put(1 * 4 + 0, side.get(1));
-    matrixBuf.put(2 * 4 + 0, side.get(2));
-
-    matrixBuf.put(0 * 4 + 1, up.get(0));
-    matrixBuf.put(1 * 4 + 1, up.get(1));
-    matrixBuf.put(2 * 4 + 1, up.get(2));
-
-    matrixBuf.put(0 * 4 + 2, -forward.get(0));
-    matrixBuf.put(1 * 4 + 2, -forward.get(1));
-    matrixBuf.put(2 * 4 + 2, -forward.get(2));
-
-    gl.glMultMatrixd(matrixBuf);
-    gl.glTranslated(-eyex, -eyey, -eyez);
-  }
-
-  /**
-   * Method gluProject
-   * 
-   * @param objx
-   * @param objy
-   * @param objz
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param win_pos
-   * 
-   * @return
-   */
-  public boolean gluProject(double objx,
-                            double objy,
-                            double objz,
-                            double[] modelMatrix,
-                            int modelMatrix_offset,
-                            double[] projMatrix,
-                            int projMatrix_offset,
-                            int[] viewport,
-                            int viewport_offset,
-                            double[] win_pos,
-                            int win_pos_offset ) {
-
-    double[] in = this.in;
-    double[] out = this.out;
-
-    in[0] = objx;
-    in[1] = objy;
-    in[2] = objz;
-    in[3] = 1.0;
-
-    __gluMultMatrixVecd(modelMatrix, modelMatrix_offset, in, out);
-    __gluMultMatrixVecd(projMatrix, projMatrix_offset, out, in);
-
-    if (in[3] == 0.0)
-      return false;
-
-    in[3] = (1.0 / in[3]) * 0.5;
-
-    // Map x, y and z to range 0-1
-    in[0] = in[0] * in[3] + 0.5f;
-    in[1] = in[1] * in[3] + 0.5f;
-    in[2] = in[2] * in[3] + 0.5f;
-
-    // Map x,y to viewport
-    win_pos[0+win_pos_offset] = in[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
-    win_pos[1+win_pos_offset] = in[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
-    win_pos[2+win_pos_offset] = in[2];
-
-    return true;
-  }
-
-  /**
-   * Method gluProject
-   * 
-   * @param objx
-   * @param objy
-   * @param objz
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param win_pos
-   * 
-   * @return
-   */
-  public boolean gluProject(double objx,
-                            double objy,
-                            double objz,
-                            DoubleBuffer modelMatrix,
-                            DoubleBuffer projMatrix,
-                            IntBuffer viewport,
-                            DoubleBuffer win_pos) {
-
-    DoubleBuffer in = this.inBuf;
-    DoubleBuffer out = this.outBuf;
-
-    in.put(0, objx);
-    in.put(1, objy);
-    in.put(2, objz);
-    in.put(3, 1.0);
-
-    __gluMultMatrixVecd(modelMatrix, in, out);
-    __gluMultMatrixVecd(projMatrix, out, in);
-
-    if (in.get(3) == 0.0)
-      return false;
-
-    in.put(3, (1.0 / in.get(3)) * 0.5);
-
-    // Map x, y and z to range 0-1
-    in.put(0, in.get(0) * in.get(3) + 0.5f);
-    in.put(1, in.get(1) * in.get(3) + 0.5f);
-    in.put(2, in.get(2) * in.get(3) + 0.5f);
-
-    // Map x,y to viewport
-    int vPos = viewport.position();
-    int wPos = win_pos.position();
-    win_pos.put(0+wPos, in.get(0) * viewport.get(2+vPos) + viewport.get(0+vPos));
-    win_pos.put(1+wPos, in.get(1) * viewport.get(3+vPos) + viewport.get(1+vPos));
-    win_pos.put(2+wPos, in.get(2));
-
-    return true;
-  }
-
-
-  /**
-   * Method gluUnproject
-   * 
-   * @param winx
-   * @param winy
-   * @param winz
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param obj_pos
-   * 
-   * @return
-   */
-  public boolean gluUnProject(double winx,
-                              double winy,
-                              double winz,
-                              double[] modelMatrix,
-                              int modelMatrix_offset,
-                              double[] projMatrix,
-                              int projMatrix_offset,
-                              int[] viewport,
-                              int viewport_offset,
-                              double[] obj_pos,
-                              int obj_pos_offset) {
-    double[] in = this.in;
-    double[] out = this.out;
-
-    __gluMultMatricesd(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
-
-    if (!__gluInvertMatrixd(matrix, matrix))
-      return false;
-
-    in[0] = winx;
-    in[1] = winy;
-    in[2] = winz;
-    in[3] = 1.0;
-
-    // Map x and y from window coordinates
-    in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
-    in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
-
-    // Map to range -1 to 1
-    in[0] = in[0] * 2 - 1;
-    in[1] = in[1] * 2 - 1;
-    in[2] = in[2] * 2 - 1;
-
-    __gluMultMatrixVecd(matrix, 0, in, out);
-
-    if (out[3] == 0.0)
-      return false;
-
-    out[3] = 1.0 / out[3];
-
-    obj_pos[0+obj_pos_offset] = out[0] * out[3];
-    obj_pos[1+obj_pos_offset] = out[1] * out[3];
-    obj_pos[2+obj_pos_offset] = out[2] * out[3];
-
-    return true;
-  }
-
-
-  /**
-   * Method gluUnproject
-   * 
-   * @param winx
-   * @param winy
-   * @param winz
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param obj_pos
-   * 
-   * @return
-   */
-  public boolean gluUnProject(double winx,
-                              double winy,
-                              double winz,
-                              DoubleBuffer modelMatrix,
-                              DoubleBuffer projMatrix,
-                              IntBuffer viewport,
-                              DoubleBuffer obj_pos) {
-    DoubleBuffer in = this.inBuf;
-    DoubleBuffer out = this.outBuf;
-
-    __gluMultMatricesd(modelMatrix, projMatrix, matrixBuf);
-
-    if (!__gluInvertMatrixd(matrixBuf, matrixBuf))
-      return false;
-
-    in.put(0, winx);
-    in.put(1, winy);
-    in.put(2, winz);
-    in.put(3, 1.0);
-
-    // Map x and y from window coordinates
-    int vPos = viewport.position();
-    int oPos = obj_pos.position();
-    in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
-    in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
-
-    // Map to range -1 to 1
-    in.put(0, in.get(0) * 2 - 1);
-    in.put(1, in.get(1) * 2 - 1);
-    in.put(2, in.get(2) * 2 - 1);
-
-    __gluMultMatrixVecd(matrixBuf, in, out);
-
-    if (out.get(3) == 0.0)
-      return false;
-
-    out.put(3, 1.0 / out.get(3));
-
-    obj_pos.put(0+oPos, out.get(0) * out.get(3));
-    obj_pos.put(1+oPos, out.get(1) * out.get(3));
-    obj_pos.put(2+oPos, out.get(2) * out.get(3));
-
-    return true;
-  }
-
-
-  /**
-   * Method gluUnproject4
-   * 
-   * @param winx
-   * @param winy
-   * @param winz
-   * @param clipw
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param near
-   * @param far
-   * @param obj_pos
-   * 
-   * @return
-   */
-  public boolean gluUnProject4(double winx,
-                               double winy,
-                               double winz,
-                               double clipw,
-                               double[] modelMatrix,
-                               int modelMatrix_offset,
-                               double[] projMatrix,
-                               int projMatrix_offset,
-                               int[] viewport,
-                               int viewport_offset,
-                               double near,
-                               double far,
-                               double[] obj_pos,
-                               int obj_pos_offset ) {
-    double[] in = this.in;
-    double[] out = this.out;
-
-    __gluMultMatricesd(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
-
-    if (!__gluInvertMatrixd(matrix, matrix))
-      return false;
-
-    in[0] = winx;
-    in[1] = winy;
-    in[2] = winz;
-    in[3] = clipw;
-
-    // Map x and y from window coordinates
-    in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
-    in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
-    in[2] = (in[2] - near) / (far - near);
-
-    // Map to range -1 to 1
-    in[0] = in[0] * 2 - 1;
-    in[1] = in[1] * 2 - 1;
-    in[2] = in[2] * 2 - 1;
-
-    __gluMultMatrixVecd(matrix, 0, in, out);
-
-    if (out[3] == 0.0)
-      return false;
-
-    obj_pos[0+obj_pos_offset] = out[0];
-    obj_pos[1+obj_pos_offset] = out[1];
-    obj_pos[2+obj_pos_offset] = out[2];
-    obj_pos[3+obj_pos_offset] = out[3];
-    return true;
-  }
-
-  /**
-   * Method gluUnproject4
-   * 
-   * @param winx
-   * @param winy
-   * @param winz
-   * @param clipw
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param near
-   * @param far
-   * @param obj_pos
-   * 
-   * @return
-   */
-  public boolean gluUnProject4(double winx,
-                               double winy,
-                               double winz,
-                               double clipw,
-                               DoubleBuffer modelMatrix,
-                               DoubleBuffer projMatrix,
-                               IntBuffer viewport,
-                               double near,
-                               double far,
-                               DoubleBuffer obj_pos) {
-    DoubleBuffer in = this.inBuf;
-    DoubleBuffer out = this.outBuf;
-
-    __gluMultMatricesd(modelMatrix, projMatrix, matrixBuf);
-
-    if (!__gluInvertMatrixd(matrixBuf, matrixBuf))
-      return false;
-
-    in.put(0, winx);
-    in.put(1, winy);
-    in.put(2, winz);
-    in.put(3, clipw);
-
-    // Map x and y from window coordinates
-    int vPos = viewport.position();
-    in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
-    in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
-    in.put(2, (in.get(2) - near) / (far - near));
-
-    // Map to range -1 to 1
-    in.put(0, in.get(0) * 2 - 1);
-    in.put(1, in.get(1) * 2 - 1);
-    in.put(2, in.get(2) * 2 - 1);
-
-    __gluMultMatrixVecd(matrixBuf, in, out);
-
-    if (out.get(3) == 0.0)
-      return false;
-
-    int oPos = obj_pos.position();
-    obj_pos.put(0+oPos, out.get(0));
-    obj_pos.put(1+oPos, out.get(1));
-    obj_pos.put(2+oPos, out.get(2));
-    obj_pos.put(3+oPos, out.get(3));
-    return true;
-  }
-
-
-  /**
-   * Method gluPickMatrix
-   * 
-   * @param x
-   * @param y
-   * @param deltaX
-   * @param deltaY
-   * @param viewport
-   */
-  public void gluPickMatrix(GL2 gl,
-                            double x,
-                            double y,
-                            double deltaX,
-                            double deltaY,
-                            IntBuffer viewport) {
-    if (deltaX <= 0 || deltaY <= 0) {
-      return;
-    }
-
-    /* Translate and scale the picked region to the entire window */
-    int vPos = viewport.position();
-    gl.glTranslated((viewport.get(2+vPos) - 2 * (x - viewport.get(0+vPos))) / deltaX,
-                    (viewport.get(3+vPos) - 2 * (y - viewport.get(1+vPos))) / deltaY,
-                    0);
-    gl.glScaled(viewport.get(2) / deltaX, viewport.get(3) / deltaY, 1.0);
-  }
-
-  /**
-   * Method gluPickMatrix
-   * 
-   * @param x
-   * @param y
-   * @param deltaX
-   * @param deltaY
-   * @param viewport
-   * @param viewport_offset
-   */
-  public void gluPickMatrix(GL2 gl,
-                            double x,
-                            double y,
-                            double deltaX,
-                            double deltaY,
-                            int[] viewport,
-                            int viewport_offset) {
-    if (deltaX <= 0 || deltaY <= 0) {
-      return;
-    }
-
-    /* Translate and scale the picked region to the entire window */
-    gl.glTranslated((viewport[2+viewport_offset] - 2 * (x - viewport[0+viewport_offset])) / deltaX,
-                    (viewport[3+viewport_offset] - 2 * (y - viewport[1+viewport_offset])) / deltaY,
-                    0);
-    gl.glScaled(viewport[2+viewport_offset] / deltaX, viewport[3+viewport_offset] / deltaY, 1.0);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/gl2/Util.java b/src/jogl/classes/com/jogamp/opengl/impl/gl2/Util.java
deleted file mode 100644
index a542dcf..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/gl2/Util.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/* 
- * Copyright (c) 2002-2004 LWJGL Project
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are 
- * met:
- * 
- * * Redistributions of source code must retain the above copyright 
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'LWJGL' nor the names of 
- *   its contributors may be used to endorse or promote products derived 
- *   from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.opengl.impl.gl2;
-
-import com.jogamp.opengl.impl.*;
-
-import java.nio.IntBuffer;
-import javax.media.opengl.*;
-
-/**
- * Util.java
- * <p/>
- * <p/>
- * Created 7-jan-2004
- *
- * @author Erik Duijs
- */
-class Util {
-
-  /**
-   * temp int[] of one for getting an int from some GL functions
-   */
-  private int[] scratch = new int[1];
-
-  /**
-   * Return ceiling of integer division
-   *
-   * @param a
-   * @param b
-   *
-   * @return int
-   */
-  protected static int ceil(int a, int b) {
-    return (a % b == 0 ? a / b : a / b + 1);
-  }
-
-  /**
-   * Method compPerPix.
-   *
-   * @param format
-   *
-   * @return int
-   */
-  protected static int compPerPix(int format) {
-    /* Determine number of components per pixel */
-    switch ( format ) {
-    case GL2.GL_COLOR_INDEX:
-    case GL2.GL_STENCIL_INDEX:
-    case GL2.GL_DEPTH_COMPONENT:
-    case GL2.GL_RED:
-    case GL2.GL_GREEN:
-    case GL2.GL_BLUE:
-    case GL2.GL_ALPHA:
-    case GL2.GL_LUMINANCE:
-      return 1;
-    case GL2.GL_LUMINANCE_ALPHA:
-      return 2;
-    case GL2.GL_RGB:
-    case GL2.GL_BGR:
-      return 3;
-    case GL2.GL_RGBA:
-    case GL2.GL_BGRA:
-      return 4;
-    default :
-      return -1;
-    }
-  }
-
-  /**
-   * Method nearestPower.
-   * <p/>
-   * Compute the nearest power of 2 number.  This algorithm is a little strange, but it works quite well.
-   *
-   * @param value
-   *
-   * @return int
-   */
-  protected static int nearestPower(int value) {
-    int i;
-
-    i = 1;
-
-    /* Error! */
-    if ( value == 0 )
-      return -1;
-
-    for ( ; ; ) {
-      if ( value == 1 ) {
-        return i;
-      } else if ( value == 3 ) {
-        return i << 2;
-      }
-      value >>= 1;
-      i <<= 1;
-    }
-  }
-
-  /**
-   * Method bytesPerPixel.
-   *
-   * @param format
-   * @param type
-   *
-   * @return int
-   */
-  protected static int bytesPerPixel(int format, int type) {
-    int n, m;
-
-    switch ( format ) {
-    case GL2.GL_COLOR_INDEX:
-    case GL2.GL_STENCIL_INDEX:
-    case GL2.GL_DEPTH_COMPONENT:
-    case GL2.GL_RED:
-    case GL2.GL_GREEN:
-    case GL2.GL_BLUE:
-    case GL2.GL_ALPHA:
-    case GL2.GL_LUMINANCE:
-      n = 1;
-      break;
-    case GL2.GL_LUMINANCE_ALPHA:
-      n = 2;
-      break;
-    case GL2.GL_RGB:
-    case GL2.GL_BGR:
-      n = 3;
-      break;
-    case GL2.GL_RGBA:
-    case GL2.GL_BGRA:
-      n = 4;
-      break;
-    default :
-      n = 0;
-    }
-
-    switch ( type ) {
-    case GL2.GL_UNSIGNED_BYTE:
-      m = 1;
-      break;
-    case GL2.GL_BYTE:
-      m = 1;
-      break;
-    case GL2.GL_BITMAP:
-      m = 1;
-      break;
-    case GL2.GL_UNSIGNED_SHORT:
-      m = 2;
-      break;
-    case GL2.GL_SHORT:
-      m = 2;
-      break;
-    case GL2.GL_UNSIGNED_INT:
-      m = 4;
-      break;
-    case GL2.GL_INT:
-      m = 4;
-      break;
-    case GL2.GL_FLOAT:
-      m = 4;
-      break;
-    default :
-      m = 0;
-    }
-
-    return n * m;
-  }
-
-  /**
-   * Convenience method for returning an int, rather than getting it out of a buffer yourself.
-   *
-   * @param what
-   *
-   * @return int
-   */
-  protected int glGetIntegerv(GL gl, int what) {
-    gl.glGetIntegerv(what, scratch, 0);
-    return scratch[0];
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/gl2/fixme/GLObjectTracker.java b/src/jogl/classes/com/jogamp/opengl/impl/gl2/fixme/GLObjectTracker.java
deleted file mode 100644
index 6ee29b8..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/gl2/fixme/GLObjectTracker.java
+++ /dev/null
@@ -1,835 +0,0 @@
-/*
- * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.gl2;
-
-import com.jogamp.opengl.impl.*;
-
-import java.nio.*;
-import javax.media.opengl.*;
-
-/** 
- * Tracks the creation of server-side OpenGL objects which can be
- * shared between contexts. Ordinarily, when an OpenGL context is
- * deleted and no other contexts are sharing server-side objects with
- * it, all of the server-side objects are automatically deleted by the
- * OpenGL implementation. It is not necessary for the end user to
- * explicitly delete these objects. However, when the Java2D/OpenGL
- * pipeline is active and frame buffer objects are being used for
- * rendering, it is necessary for all OpenGL contexts created by JOGL
- * to share server-side objects with the Java2D OpenGL context. This
- * means that these objects "leak" into the namespace used by Java2D.
- * In order to prevent memory leaks and to present the same
- * programming model to the end user, it is necessary to track the
- * creation and destruction of all of these server-side OpenGL objects
- * and to explicitly release them when all of the JOGL-created
- * contexts which can see them have been released. <P>
- *
- * The {@link #ref ref} and {@link #unref unref} methods should be
- * used during the creation and destruction of OpenGL contexts by JOGL
- * in order to update the liveness of the objects being tracked. The
- * various other methods should be called by the OpenGL binding in the
- * various named methods.
- */
-
-public class GLObjectTracker {
-  private static final boolean DEBUG = Debug.debug("GLStatusTracker");
-
-  //----------------------------------------------------------------------
-  // Adders
-  //
-
-  // glGenBuffers
-  public synchronized void addBuffers(int n, IntBuffer ids) {
-    add(getList(BUFFERS), n, ids);
-  }
-
-  // glGenBuffers
-  public synchronized void addBuffers(int n, int[] ids, int ids_offset) {
-    add(getList(BUFFERS), n, ids, ids_offset);
-  }
-
-  // glGenBuffersARB
-  public synchronized void addBuffersARB(int n, IntBuffer ids) {
-    add(getList(BUFFERS_ARB), n, ids);
-  }
-
-  // glGenBuffersARB
-  public synchronized void addBuffersARB(int n, int[] ids, int ids_offset) {
-    add(getList(BUFFERS_ARB), n, ids, ids_offset);
-  }
-
-  // glGenFencesAPPLE
-  public synchronized void addFencesAPPLE(int n, IntBuffer ids) {
-    add(getList(FENCES_APPLE), n, ids);
-  }
-
-  // glGenFencesAPPLE
-  public synchronized void addFencesAPPLE(int n, int[] ids, int ids_offset) {
-    add(getList(FENCES_APPLE), n, ids, ids_offset);
-  }
-
-  // glGenFencesNV
-  public synchronized void addFencesNV(int n, IntBuffer ids) {
-    add(getList(FENCES_NV), n, ids);
-  }
-
-  // glGenFencesNV
-  public synchronized void addFencesNV(int n, int[] ids, int ids_offset) {
-    add(getList(FENCES_NV), n, ids, ids_offset);
-  }
-
-  // glGenFragmentShadersATI
-  public synchronized void addFragmentShadersATI(int start, int n) {
-    add(getList(FRAGMENT_SHADERS_ATI), start, n);
-  }
-
-  // glGenFramebuffersEXT
-  public synchronized void addFramebuffersEXT(int n, IntBuffer ids) {
-    add(getList(FRAMEBUFFERS_EXT), n, ids);
-  }
-
-  // glGenFramebuffersEXT
-  public synchronized void addFramebuffersEXT(int n, int[] ids, int ids_offset) {
-    add(getList(FRAMEBUFFERS_EXT), n, ids, ids_offset);
-  }
-  
-  // glGenLists
-  public synchronized void addLists(int start, int n) {
-    add(getList(LISTS), start, n);
-  }
-
-  // glGenOcclusionQueriesNV
-  public synchronized void addOcclusionQueriesNV(int n, IntBuffer ids) {
-    add(getList(OCCLUSION_QUERIES_NV), n, ids);
-  }
-
-  // glGenOcclusionQueriesNV
-  public synchronized void addOcclusionQueriesNV(int n, int[] ids, int ids_offset) {
-    add(getList(OCCLUSION_QUERIES_NV), n, ids, ids_offset);
-  }
-
-  // glCreateProgram
-  public synchronized void addProgramObject(int obj) {
-    add(getList(PROGRAM_OBJECTS), obj, 1);
-  }
-
-  // glCreateProgramObjectARB
-  public synchronized void addProgramObjectARB(int obj) {
-    add(getList(PROGRAM_AND_SHADER_OBJECTS_ARB), obj, 1);
-  }
-
-  // glGenProgramsARB
-  public synchronized void addProgramsARB(int n, IntBuffer ids) {
-    add(getList(PROGRAMS_ARB), n, ids);
-  }
-
-  // glGenProgramsARB
-  public synchronized void addProgramsARB(int n, int[] ids, int ids_offset) {
-    add(getList(PROGRAMS_ARB), n, ids, ids_offset);
-  }
-
-  // glGenProgramsNV
-  public synchronized void addProgramsNV(int n, IntBuffer ids) {
-    add(getList(PROGRAMS_NV), n, ids);
-  }
-
-  // glGenProgramsNV
-  public synchronized void addProgramsNV(int n, int[] ids, int ids_offset) {
-    add(getList(PROGRAMS_NV), n, ids, ids_offset);
-  }
-
-  // glGenQueries
-  public synchronized void addQueries(int n, IntBuffer ids) {
-    add(getList(QUERIES), n, ids);
-  }
-
-  // glGenQueries
-  public synchronized void addQueries(int n, int[] ids, int ids_offset) {
-    add(getList(QUERIES), n, ids, ids_offset);
-  }
-
-  // glGenQueriesARB
-  public synchronized void addQueriesARB(int n, IntBuffer ids) {
-    add(getList(QUERIES_ARB), n, ids);
-  }
-
-  // glGenQueriesARB
-  public synchronized void addQueriesARB(int n, int[] ids, int ids_offset) {
-    add(getList(QUERIES_ARB), n, ids, ids_offset);
-  }
-
-  // glGenRenderbuffersEXT
-  public synchronized void addRenderbuffersEXT(int n, IntBuffer ids) {
-    add(getList(RENDERBUFFERS_EXT), n, ids);
-  }
-
-  // glGenRenderbuffersEXT
-  public synchronized void addRenderbuffersEXT(int n, int[] ids, int ids_offset) {
-    add(getList(RENDERBUFFERS_EXT), n, ids, ids_offset);
-  }
-
-  // glCreateShader
-  public synchronized void addShaderObject(int obj) {
-    add(getList(SHADER_OBJECTS), obj, 1);
-  }
-
-  // glCreateShaderObjectARB
-  public synchronized void addShaderObjectARB(int obj) {
-    add(getList(PROGRAM_AND_SHADER_OBJECTS_ARB), obj, 1);
-  }
-
-  // glGenTextures
-  public synchronized void addTextures(int n, IntBuffer ids) {
-    add(getList(TEXTURES), n, ids);
-  }
-
-  // glGenTextures
-  public synchronized void addTextures(int n, int[] ids, int ids_offset) {
-    add(getList(TEXTURES), n, ids, ids_offset);
-  }
-
-  // glGenVertexArraysAPPLE
-  public synchronized void addVertexArraysAPPLE(int n, IntBuffer ids) {
-    add(getList(VERTEX_ARRAYS_APPLE), n, ids);
-  }
-
-  // glGenVertexArraysAPPLE
-  public synchronized void addVertexArraysAPPLE(int n, int[] ids, int ids_offset) {
-    add(getList(VERTEX_ARRAYS_APPLE), n, ids, ids_offset);
-  }
-
-  // glGenVertexShadersEXT
-  public synchronized void addVertexShadersEXT(int start, int n) {
-    add(getList(VERTEX_SHADERS_EXT), start, n);
-  }
-
-  //----------------------------------------------------------------------
-  // Removers
-  //
-
-  // glDeleteBuffers
-  public synchronized void removeBuffers(int n, IntBuffer ids) {
-    remove(getList(BUFFERS), n, ids);
-  }
-
-  // glDeleteBuffers
-  public synchronized void removeBuffers(int n, int[] ids, int ids_offset) {
-    remove(getList(BUFFERS), n, ids, ids_offset);
-  }
-
-  // glDeleteBuffersARB
-  public synchronized void removeBuffersARB(int n, IntBuffer ids) {
-    remove(getList(BUFFERS_ARB), n, ids);
-  }
-
-  // glDeleteBuffersARB
-  public synchronized void removeBuffersARB(int n, int[] ids, int ids_offset) {
-    remove(getList(BUFFERS_ARB), n, ids, ids_offset);
-  }
-
-  // glDeleteFencesAPPLE
-  public synchronized void removeFencesAPPLE(int n, IntBuffer ids) {
-    remove(getList(FENCES_APPLE), n, ids);
-  }
-
-  // glDeleteFencesAPPLE
-  public synchronized void removeFencesAPPLE(int n, int[] ids, int ids_offset) {
-    remove(getList(FENCES_APPLE), n, ids, ids_offset);
-  }
-
-  // glDeleteFencesNV
-  public synchronized void removeFencesNV(int n, IntBuffer ids) {
-    remove(getList(FENCES_NV), n, ids);
-  }
-
-  // glDeleteFencesNV
-  public synchronized void removeFencesNV(int n, int[] ids, int ids_offset) {
-    remove(getList(FENCES_NV), n, ids, ids_offset);
-  }
-
-  // glDeleteFragmentShaderATI
-  public synchronized void removeFragmentShaderATI(int obj) {
-    remove(getList(FRAGMENT_SHADERS_ATI), obj, 1);
-  }
-
-  // glDeleteFramebuffersEXT
-  public synchronized void removeFramebuffersEXT(int n, IntBuffer ids) {
-    remove(getList(FRAMEBUFFERS_EXT), n, ids);
-  }
-
-  // glDeleteFramebuffersEXT
-  public synchronized void removeFramebuffersEXT(int n, int[] ids, int ids_offset) {
-    remove(getList(FRAMEBUFFERS_EXT), n, ids, ids_offset);
-  }
-  
-  // glDeleteLists
-  public synchronized void removeLists(int start, int n) {
-    remove(getList(LISTS), start, n);
-  }
-
-  // glDeleteOcclusionQueriesNV
-  public synchronized void removeOcclusionQueriesNV(int n, IntBuffer ids) {
-    remove(getList(OCCLUSION_QUERIES_NV), n, ids);
-  }
-
-  // glDeleteOcclusionQueriesNV
-  public synchronized void removeOcclusionQueriesNV(int n, int[] ids, int ids_offset) {
-    remove(getList(OCCLUSION_QUERIES_NV), n, ids, ids_offset);
-  }
-
-  // glDeleteProgram
-  public synchronized void removeProgramObject(int obj) {
-    remove(getList(PROGRAM_OBJECTS), obj, 1);
-  }
-
-  // glDeleteObjectARB
-  public synchronized void removeProgramOrShaderObjectARB(int obj) {
-    remove(getList(PROGRAM_AND_SHADER_OBJECTS_ARB), obj, 1);
-  }
-
-  // glDeleteProgramsARB
-  public synchronized void removeProgramsARB(int n, IntBuffer ids) {
-    remove(getList(PROGRAMS_ARB), n, ids);
-  }
-
-  // glDeleteProgramsARB
-  public synchronized void removeProgramsARB(int n, int[] ids, int ids_offset) {
-    remove(getList(PROGRAMS_ARB), n, ids, ids_offset);
-  }
-
-  // glDeleteProgramsNV
-  public synchronized void removeProgramsNV(int n, IntBuffer ids) {
-    remove(getList(PROGRAMS_NV), n, ids);
-  }
-
-  // glDeleteProgramsNV
-  public synchronized void removeProgramsNV(int n, int[] ids, int ids_offset) {
-    remove(getList(PROGRAMS_NV), n, ids, ids_offset);
-  }
-
-  // glDeleteQueries
-  public synchronized void removeQueries(int n, IntBuffer ids) {
-    remove(getList(QUERIES), n, ids);
-  }
-
-  // glDeleteQueries
-  public synchronized void removeQueries(int n, int[] ids, int ids_offset) {
-    remove(getList(QUERIES), n, ids, ids_offset);
-  }
-
-  // glDeleteQueriesARB
-  public synchronized void removeQueriesARB(int n, IntBuffer ids) {
-    remove(getList(QUERIES_ARB), n, ids);
-  }
-
-  // glDeleteQueriesARB
-  public synchronized void removeQueriesARB(int n, int[] ids, int ids_offset) {
-    remove(getList(QUERIES_ARB), n, ids, ids_offset);
-  }
-
-  // glDeleteRenderbuffersEXT
-  public synchronized void removeRenderbuffersEXT(int n, IntBuffer ids) {
-    remove(getList(RENDERBUFFERS_EXT), n, ids);
-  }
-
-  // glDeleteRenderbuffersEXT
-  public synchronized void removeRenderbuffersEXT(int n, int[] ids, int ids_offset) {
-    remove(getList(RENDERBUFFERS_EXT), n, ids, ids_offset);
-  }
-
-  // glDeleteShader
-  public synchronized void removeShaderObject(int obj) {
-    remove(getList(SHADER_OBJECTS), obj, 1);
-  }
-
-  // glDeleteTextures
-  public synchronized void removeTextures(int n, IntBuffer ids) {
-    remove(getList(TEXTURES), n, ids);
-  }
-
-  // glDeleteTextures
-  public synchronized void removeTextures(int n, int[] ids, int ids_offset) {
-    remove(getList(TEXTURES), n, ids, ids_offset);
-  }
-
-  // glDeleteVertexArraysAPPLE
-  public synchronized void removeVertexArraysAPPLE(int n, IntBuffer ids) {
-    remove(getList(VERTEX_ARRAYS_APPLE), n, ids);
-  }
-
-  // glDeleteVertexArraysAPPLE
-  public synchronized void removeVertexArraysAPPLE(int n, int[] ids, int ids_offset) {
-    remove(getList(VERTEX_ARRAYS_APPLE), n, ids, ids_offset);
-  }
-
-  // glDeleteVertexShaderEXT
-  public synchronized void removeVertexShaderEXT(int obj) {
-    remove(getList(VERTEX_SHADERS_EXT), obj, 1);
-  }
-
-  //----------------------------------------------------------------------
-  // Reference count maintenance and manual deletion
-  //
-
-  public synchronized void transferAll(GLObjectTracker other) {
-    for (int i = 0; i < lists.length; i++) {
-      getList(i).addAll(other.lists[i]);
-      if (other.lists[i] != null) {
-        other.lists[i].clear();
-      }
-    }
-    dirty = true;
-  }
-
-  public synchronized void ref() {
-    ++refCount;
-  }
-
-  public void unref(GLObjectTracker deletedObjectPool) {
-    boolean tryDelete = false;
-    synchronized (this) {
-      if (--refCount == 0) {
-        tryDelete = true;
-      }
-    }
-    if (tryDelete) {
-      // See whether we should try to do the work now or whether we
-      // have to postpone
-      GLContext cur = GLContext.getCurrent();
-      if ((cur != null) &&
-          (cur instanceof GLContextImpl)) {
-        GLContextImpl curImpl = (GLContextImpl) cur;
-        if (deletedObjectPool != null &&
-            deletedObjectPool == curImpl.getDeletedObjectTracker()) {
-          // Should be safe to delete these objects now
-          try {
-            delete((GL2)curImpl.getGL());
-            return;
-          } catch (GLException e) {
-            // Shouldn't happen, but if it does, transfer all objects
-            // to the deleted object pool hoping we can later clean
-            // them up
-            deletedObjectPool.transferAll(this);
-            throw(e);
-          }
-        }
-      }
-      // If we get here, we couldn't attempt to delete the objects
-      // right now; instead try to transfer them to the
-      // deletedObjectPool for later cleanup (FIXME: should consider
-      // throwing an exception if deletedObjectPool is null, since
-      // that shouldn't happen)
-      if (DEBUG) {
-        String s = null;
-        if (cur == null) {
-          s = "current context was null";
-        } else if (!(cur instanceof GLContextImpl)) {
-          s = "current context was not a GLContextImpl";
-        } else if (deletedObjectPool == null) {
-          s = "no current deletedObjectPool";
-        } else if (deletedObjectPool != ((GLContextImpl) cur).getDeletedObjectTracker()) {
-          s = "deletedObjectTracker didn't match";
-          if (((GLContextImpl) cur).getDeletedObjectTracker() == null) {
-            s += " (other was null)";
-          }
-        } else {
-          s = "unknown reason";
-        }
-        System.err.println("Deferred destruction of server-side OpenGL objects into " + deletedObjectPool + ": " + s);
-      }
-
-      if (deletedObjectPool != null) {
-        deletedObjectPool.transferAll(this);
-      }
-    }
-  }
-
-  public void clean(GL2 gl) {
-    if (dirty) {
-      try {
-        delete(gl);
-        dirty = false;
-      } catch (GLException e) {
-        // FIXME: not sure what to do here; probably a bad idea to be
-        // throwing exceptions during an otherwise-successful makeCurrent
-      }
-    }
-  }
-
-
-  //----------------------------------------------------------------------
-  // Internals only below this point
-  //
-
-  // Kinds of sharable server-side OpenGL objects this class tracks
-  private static final int BUFFERS                        = 0;
-  private static final int BUFFERS_ARB                    = 1;
-  private static final int FENCES_APPLE                   = 2;
-  private static final int FENCES_NV                      = 3;
-  private static final int FRAGMENT_SHADERS_ATI           = 4;
-  private static final int FRAMEBUFFERS_EXT               = 5;
-  private static final int LISTS                          = 6;
-  private static final int OCCLUSION_QUERIES_NV           = 7;
-  private static final int PROGRAM_AND_SHADER_OBJECTS_ARB = 8;
-  private static final int PROGRAM_OBJECTS                = 9;
-  private static final int PROGRAMS_ARB                   = 10;
-  private static final int PROGRAMS_NV                    = 11;
-  private static final int QUERIES                        = 12;
-  private static final int QUERIES_ARB                    = 13;
-  private static final int RENDERBUFFERS_EXT              = 14;
-  private static final int SHADER_OBJECTS                 = 15;
-  private static final int TEXTURES                       = 16;
-  private static final int VERTEX_ARRAYS_APPLE            = 17;
-  private static final int VERTEX_SHADERS_EXT             = 18;
-  private static final int NUM_OBJECT_TYPES               = 19;
-
-  static abstract class Deleter {
-    public abstract void delete(GL2 gl, int obj);
-  }
-
-  static class ObjectList {
-    private static final int MIN_CAPACITY = 4;
-
-    private int size;
-    private int capacity;
-    private int[] data;
-    private Deleter deleter;
-    private String name;
-
-    public ObjectList(Deleter deleter) {
-      this.deleter = deleter;
-      clear();
-    }
-
-    public void add(int obj) {
-      if (size == capacity) {
-        int newCapacity = 2 * capacity;
-        int[] newData = new int[newCapacity];
-        System.arraycopy(data, 0, newData, 0, size);
-        data = newData;
-        capacity = newCapacity;
-      }
-
-      data[size++] = obj;
-    }
-
-    public void addAll(ObjectList other) {
-      if (other == null) {
-        return;
-      }
-      for (int i = 0; i < other.size; i++) {
-        add(other.data[i]);
-      }
-    }
-
-    public boolean remove(int value) {
-      for (int i = 0; i < size; i++) {
-        if (data[i] == value) {
-          if (i < size - 1) {
-            System.arraycopy(data, i+1, data, i, size - i - 1);
-          }
-          --size;
-          if ((size < capacity / 4) &&
-              (capacity > MIN_CAPACITY)) {
-            int newCapacity = capacity / 4;
-            if (newCapacity < MIN_CAPACITY) {
-              newCapacity = MIN_CAPACITY;
-            }
-            int[] newData = new int[newCapacity];
-            System.arraycopy(data, 0, newData, 0, size);
-            data = newData;
-            capacity = newCapacity;
-          }
-          return true;
-        }
-      }
-      return false;
-    }
-
-    public void setName(String name) {
-      if (DEBUG) {
-        this.name = name;
-      }
-    }
-
-    public void delete(GL2 gl) {
-      // Just in case we start throwing exceptions during deletion,
-      // make sure we make progress rather than going into an infinite
-      // loop
-      while (size > 0) {
-        int obj = data[size - 1];
-        --size;
-        if (DEBUG) {
-          System.err.println("Deleting server-side OpenGL object " + obj +
-                             ((name != null) ? (" (" + name + ")") : ""));
-        }
-        deleter.delete(gl, obj);
-      }
-    }
-
-    public void clear() {
-      size = 0;
-      capacity = MIN_CAPACITY;
-      data = new int[capacity];
-    }
-  }
-
-  private ObjectList[] lists = new ObjectList[NUM_OBJECT_TYPES];
-  private int refCount;
-  private boolean dirty;
-
-  private void add(ObjectList list, int n, IntBuffer ids) {
-    int pos = ids.position();
-    for (int i = 0; i < n; i++) {
-      list.add(ids.get(pos + i));
-    }
-  }
-
-  private void add(ObjectList list, int n, int[] ids, int ids_offset) {
-    for (int i = 0; i < n; i++) {
-      list.add(ids[i + ids_offset]);
-    }
-  }
-
-  private void add(ObjectList list, int start, int n) {
-    for (int i = 0; i < n; i++) {
-      list.add(start + i);
-    }
-  }
-
-  private void remove(ObjectList list, int n, IntBuffer ids) {
-    int pos = ids.position();
-    for (int i = 0; i < n; i++) {
-      list.remove(ids.get(pos + i));
-    }
-  }
-
-  private void remove(ObjectList list, int n, int[] ids, int ids_offset) {
-    for (int i = 0; i < n; i++) {
-      list.remove(ids[i + ids_offset]);
-    }
-  }
-
-  private void remove(ObjectList list, int start, int n) {
-    for (int i = 0; i < n; i++) {
-      list.remove(start + i);
-    }
-  }
-
-  private ObjectList getList(int which) {
-    ObjectList list = lists[which];
-    if (list == null) {
-      Deleter deleter = null;
-      String name = null;
-      // Figure out which deleter we need
-      switch (which) {
-        case BUFFERS:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteBuffers(1, new int[] { obj }, 0);
-              }
-            };
-          name = "buffer";
-          break;
-        case BUFFERS_ARB:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteBuffersARB(1, new int[] { obj }, 0);
-              }
-            };
-          name = "ARB buffer";
-          break;
-        case FENCES_APPLE:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteFencesAPPLE(1, new int[] { obj }, 0);
-              }
-            };
-          name = "APPLE fence";
-          break;
-        case FENCES_NV:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteFencesNV(1, new int[] { obj }, 0);
-              }
-            };
-          name = "NV fence";
-          break;
-        case FRAGMENT_SHADERS_ATI:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteFragmentShaderATI(obj);
-              }
-            };
-          name = "ATI fragment shader";
-          break;
-        case FRAMEBUFFERS_EXT:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteFramebuffersEXT(1, new int[] { obj }, 0);
-              }
-            };
-          name = "EXT framebuffer";
-          break;
-        case LISTS:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteLists(obj, 1);
-              }
-            };
-          name = "display list";
-          break;
-        case OCCLUSION_QUERIES_NV:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteOcclusionQueriesNV(1, new int[] { obj }, 0);
-              }
-            };
-          name = "NV occlusion query";
-          break;
-        case PROGRAM_AND_SHADER_OBJECTS_ARB:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteObjectARB(obj);
-              }
-            };
-          name = "ARB program or shader object";
-          break;
-        case PROGRAM_OBJECTS:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteProgram(obj);
-              }
-            };
-          name = "program object";
-          break;
-        case PROGRAMS_ARB:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteProgramsARB(1, new int[] { obj }, 0);
-              }
-            };
-          name = "ARB program object";
-          break;
-        case PROGRAMS_NV:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteProgramsNV(1, new int[] { obj }, 0);
-              }
-            };
-          name = "NV program";
-          break;
-        case QUERIES:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteQueries(1, new int[] { obj }, 0);
-              }
-            };
-          name = "query";
-          break;
-        case QUERIES_ARB:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteQueriesARB(1, new int[] { obj }, 0);
-              }
-            };
-          name = "ARB query";
-          break;
-        case RENDERBUFFERS_EXT:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteRenderbuffersEXT(1, new int[] { obj }, 0);
-              }
-            };
-          name = "EXT renderbuffer";
-          break;
-        case SHADER_OBJECTS:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteShader(obj);
-              }
-            };
-          name = "shader object";
-          break;
-        case TEXTURES:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteTextures(1, new int[] { obj }, 0);
-              }
-            };
-          name = "texture";
-          break;
-        case VERTEX_ARRAYS_APPLE:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteVertexArraysAPPLE(1, new int[] { obj }, 0);
-              }
-            };
-          name = "APPLE vertex array";
-          break;
-        case VERTEX_SHADERS_EXT:
-          deleter = new Deleter() {
-              public void delete(GL2 gl, int obj) {
-                gl.glDeleteVertexShaderEXT(obj);
-              }
-            };
-          name = "EXT vertex shader";
-          break;
-        default:
-          throw new InternalError("Unexpected OpenGL object type " + which);
-      }
-
-      list = new ObjectList(deleter);
-      list.setName(name);
-      lists[which] = list;
-    }
-    return list;
-  }
-
-  private void delete(GL2 gl) {
-    for (int i = 0; i < lists.length; i++) {
-      ObjectList list = lists[i];
-      if (list != null) {
-        list.delete(gl);
-        lists[i] = null;
-      }
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/GLUquadricImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/GLUquadricImpl.java
deleted file mode 100644
index d7e6a23..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/GLUquadricImpl.java
+++ /dev/null
@@ -1,1212 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-** 
-** http://oss.sgi.com/projects/FreeB
-** 
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-** 
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-** 
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** $Date: 2009-03-04 17:23:34 -0800 (Wed, 04 Mar 2009) $ $Revision: 1856 $
-** $Header$
-*/
-
-/* 
- * Copyright (c) 2002-2004 LWJGL Project
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are 
- * met:
- * 
- * * Redistributions of source code must retain the above copyright 
- *   notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of 'LWJGL' nor the names of 
- *   its contributors may be used to endorse or promote products derived 
- *   from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.opengl.impl.glu;
-
-import javax.media.opengl.*;
-import javax.media.opengl.glu.*;
-import com.jogamp.opengl.util.ImmModeSink;
-import java.nio.*;
-
-/**
- * GLUquadricImpl.java
- * 
- * 
- * Created 22-dec-2003 (originally Quadric.java)
- * @author Erik Duijs
- * @author Kenneth Russell, Sven Gothel
- */
-
-public class GLUquadricImpl implements GLUquadric {
-  private boolean useGLSL;
-  private int drawStyle;
-  private int orientation;
-  private boolean textureFlag;
-  private int normals;
-  private boolean immModeSinkEnabled;
-  private boolean immModeSinkImmediate;
-  public int normalType;
-  public GL gl;
-
-  public static final boolean USE_NORM = true;
-  public static final boolean USE_TEXT = false;
-
-  private ImmModeSink immModeSink=null;
-
-  public GLUquadricImpl(GL gl, boolean useGLSL) {
-    this.gl=gl;
-    this.useGLSL = useGLSL;
-    drawStyle = GLU.GLU_FILL;
-    orientation = GLU.GLU_OUTSIDE;
-    textureFlag = false;
-    normals = GLU.GLU_SMOOTH;
-    normalType = gl.isGLES1()?GL.GL_BYTE:GL.GL_FLOAT;
-    immModeSinkImmediate=true;
-    immModeSinkEnabled=!gl.isGL2();
-    replaceImmModeSink();
-  }
-
-  public void enableImmModeSink(boolean val) {
-    if(gl.isGL2()) {
-        immModeSinkEnabled=val;
-    } else {
-        immModeSinkEnabled=true;
-    }
-    if(null==immModeSink && immModeSinkEnabled) {
-      replaceImmModeSink();
-    }
-  }
-
-  public boolean isImmModeSinkEnabled() {
-    return immModeSinkEnabled;
-  }
-
-  public void setImmMode(boolean val) {
-    if(immModeSinkEnabled) {
-        immModeSinkImmediate=val;
-    } else {
-        immModeSinkImmediate=true;
-    }
-  }
-
-  public boolean getImmMode() {
-    return immModeSinkImmediate;
-  }
-
-  public ImmModeSink replaceImmModeSink() {
-    if(!immModeSinkEnabled) return null;
-
-    ImmModeSink res = immModeSink;
-    if(useGLSL) {
-        immModeSink = ImmModeSink.createGLSL (gl, GL.GL_STATIC_DRAW, 32, 
-                                              3, GL.GL_FLOAT,  // vertex
-                                              0, GL.GL_FLOAT,  // color
-                                              USE_NORM?3:0, normalType,// normal
-                                              USE_TEXT?2:0, GL.GL_FLOAT); // texture
-    } else {
-        immModeSink = ImmModeSink.createFixed(gl, GL.GL_STATIC_DRAW, 32, 
-                                              3, GL.GL_FLOAT,  // vertex
-                                              0, GL.GL_FLOAT,  // color
-                                              USE_NORM?3:0, normalType,// normal
-                                              USE_TEXT?2:0, GL.GL_FLOAT); // texture
-    }
-    return res;
-  }
-
-  public void resetImmModeSink(GL gl) {
-    if(immModeSinkEnabled) {
-        immModeSink.reset(gl);
-    }
-  }
-
-  /**
-   * specifies the draw style for quadrics.  
-   *
-   * The legal values are as follows:
-   *
-   * GLU.FILL:       Quadrics are rendered with polygon primitives. The polygons
-   *                 are drawn in a counterclockwise fashion with respect to
-   *                 their normals (as defined with glu.quadricOrientation).
-   *
-   * GLU.LINE:       Quadrics are rendered as a set of lines.
-   *
-   * GLU.SILHOUETTE: Quadrics are rendered as a set of lines, except that edges
-   * 		   separating coplanar faces will not be drawn.
-   *
-   * GLU.POINT:       Quadrics are rendered as a set of points.
-   * 
-   * @param drawStyle The drawStyle to set
-   */
-  public void setDrawStyle(int drawStyle) {
-    this.drawStyle = drawStyle;
-  }
-
-  /**
-   * specifies what kind	of normals are desired for quadrics.
-   * The legal values	are as follows:
-   *
-   * GLU.NONE:     No normals are generated.
-   *
-   * GLU.FLAT:     One normal is generated for every facet of a quadric.
-   *
-   * GLU.SMOOTH:   One normal is generated for every vertex of a quadric.  This
-   *               is the default.
-   * 
-   * @param normals The normals to set
-   */
-  public void setNormals(int normals) {
-    this.normals = normals;
-  }
-
-  /**
-   * specifies what kind of orientation is desired for.
-   * The orientation	values are as follows:
-   *
-   * GLU.OUTSIDE:  Quadrics are drawn with normals pointing outward.
-   *
-   * GLU.INSIDE:   Normals point inward. The default is GLU.OUTSIDE.
-   *
-   * Note that the interpretation of outward and inward depends on the quadric
-   * being drawn.
-   * 
-   * @param orientation The orientation to set
-   */
-  public void setOrientation(int orientation) {
-    this.orientation = orientation;
-  }
-
-  /**
-   * specifies if texture coordinates should be generated for
-   * quadrics rendered with qobj. If the value of textureCoords is true,
-   * then texture coordinates are generated, and if textureCoords is false,
-   * they are not.. The default is false.
-   *
-   * The manner in which texture coordinates are generated depends upon the
-   * specific quadric rendered.
-   * 
-   * @param textureFlag The textureFlag to set
-   */
-  public void setTextureFlag(boolean textureFlag) {
-    this.textureFlag = textureFlag;
-  }
-
-  /**
-   * Returns the drawStyle.
-   * @return int
-   */
-  public int getDrawStyle() {
-    return drawStyle;
-  }
-
-  /**
-   * Returns the normals.
-   * @return int
-   */
-  public int getNormals() {
-    return normals;
-  }
-
-  /**
-   * Returns the orientation.
-   * @return int
-   */
-  public int getOrientation() {
-    return orientation;
-  }
-
-  /**
-   * Returns the textureFlag.
-   * @return boolean
-   */
-  public boolean getTextureFlag() {
-    return textureFlag;
-  }
-
-
-  /**
-   * draws a cylinder oriented along the z axis. The base of the
-   * cylinder is placed at z = 0, and the top at z=height. Like a sphere, a
-   * cylinder is subdivided around the z axis into slices, and along the z axis
-   * into stacks.
-   *
-   * Note that if topRadius is set to zero, then this routine will generate a
-   * cone.
-   *
-   * If the orientation is set to GLU.OUTSIDE (with glu.quadricOrientation), then
-   * any generated normals point away from the z axis. Otherwise, they point
-   * toward the z axis.
-   *
-   * If texturing is turned on (with glu.quadricTexture), then texture
-   * coordinates are generated so that t ranges linearly from 0.0 at z = 0 to
-   * 1.0 at z = height, and s ranges from 0.0 at the +y axis, to 0.25 at the +x
-   * axis, to 0.5 at the -y axis, to 0.75 at the -x axis, and back to 1.0 at the
-   * +y axis.
-   *
-   * @param baseRadius  Specifies the radius of the cylinder at z = 0.
-   * @param topRadius   Specifies the radius of the cylinder at z = height.
-   * @param height      Specifies the height of the cylinder.
-   * @param slices      Specifies the number of subdivisions around the z axis.
-   * @param stacks      Specifies the number of subdivisions along the z axis.
-   */
-  public void drawCylinder(GL gl, float baseRadius, float topRadius, float height, int slices, int stacks) {
-
-    float da, r, dr, dz;
-    float x, y, z, nz, nsign;
-    int i, j;
-
-    if (orientation == GLU.GLU_INSIDE) {
-      nsign = -1.0f;
-    } else {
-      nsign = 1.0f;
-    }
-
-    da = 2.0f * PI / slices;
-    dr = (topRadius - baseRadius) / stacks;
-    dz = height / stacks;
-    nz = (baseRadius - topRadius) / height;
-    // Z component of normal vectors
-
-    if (drawStyle == GLU.GLU_POINT) {
-      glBegin(gl, GL.GL_POINTS);
-      for (i = 0; i < slices; i++) {
-        x = cos((i * da));
-        y = sin((i * da));
-        normal3f(gl, x * nsign, y * nsign, nz * nsign);
-
-        z = 0.0f;
-        r = baseRadius;
-        for (j = 0; j <= stacks; j++) {
-          glVertex3f(gl, (x * r), (y * r), z);
-          z += dz;
-          r += dr;
-        }
-      }
-      glEnd(gl);
-    } else if (drawStyle == GLU.GLU_LINE || drawStyle == GLU.GLU_SILHOUETTE) {
-      // Draw rings
-      if (drawStyle == GLU.GLU_LINE) {
-        z = 0.0f;
-        r = baseRadius;
-        for (j = 0; j <= stacks; j++) {
-          glBegin(gl, GL.GL_LINE_LOOP);
-          for (i = 0; i < slices; i++) {
-            x = cos((i * da));
-            y = sin((i * da));
-            normal3f(gl, x * nsign, y * nsign, nz * nsign);
-            glVertex3f(gl, (x * r), (y * r), z);
-          }
-          glEnd(gl);
-          z += dz;
-          r += dr;
-        }
-      } else {
-        // draw one ring at each end
-        if (baseRadius != 0.0) {
-          glBegin(gl, GL.GL_LINE_LOOP);
-          for (i = 0; i < slices; i++) {
-            x = cos((i * da));
-            y = sin((i * da));
-            normal3f(gl, x * nsign, y * nsign, nz * nsign);
-            glVertex3f(gl, (x * baseRadius), (y * baseRadius), 0.0f);
-          }
-          glEnd(gl);
-          glBegin(gl, GL.GL_LINE_LOOP);
-          for (i = 0; i < slices; i++) {
-            x = cos((i * da));
-            y = sin((i * da));
-            normal3f(gl, x * nsign, y * nsign, nz * nsign);
-            glVertex3f(gl, (x * topRadius), (y * topRadius), height);
-          }
-          glEnd(gl);
-        }
-      }
-      // draw length lines
-      glBegin(gl, GL.GL_LINES);
-      for (i = 0; i < slices; i++) {
-        x = cos((i * da));
-        y = sin((i * da));
-        normal3f(gl, x * nsign, y * nsign, nz * nsign);
-        glVertex3f(gl, (x * baseRadius), (y * baseRadius), 0.0f);
-        glVertex3f(gl, (x * topRadius), (y * topRadius), (height));
-      }
-      glEnd(gl);
-    } else if (drawStyle == GLU.GLU_FILL) {
-      float ds = 1.0f / slices;
-      float dt = 1.0f / stacks;
-      float t = 0.0f;
-      z = 0.0f;
-      r = baseRadius;
-      for (j = 0; j < stacks; j++) {
-        float s = 0.0f;
-        glBegin(gl, immModeSink.GL_QUAD_STRIP);
-        for (i = 0; i <= slices; i++) {
-          if (i == slices) {
-            x = sin(0.0f);
-            y = cos(0.0f);
-          } else {
-            x = sin((i * da));
-            y = cos((i * da));
-          }
-          if (nsign == 1.0f) {
-            normal3f(gl, (x * nsign), (y * nsign), (nz * nsign));
-            TXTR_COORD(gl, s, t);
-            glVertex3f(gl, (x * r), (y * r), z);
-            normal3f(gl, (x * nsign), (y * nsign), (nz * nsign));
-            TXTR_COORD(gl, s, t + dt);
-            glVertex3f(gl, (x * (r + dr)), (y * (r + dr)), (z + dz));
-          } else {
-            normal3f(gl, x * nsign, y * nsign, nz * nsign);
-            TXTR_COORD(gl, s, t);
-            glVertex3f(gl, (x * r), (y * r), z);
-            normal3f(gl, x * nsign, y * nsign, nz * nsign);
-            TXTR_COORD(gl, s, t + dt);
-            glVertex3f(gl, (x * (r + dr)), (y * (r + dr)), (z + dz));
-          }
-          s += ds;
-        } // for slices
-        glEnd(gl);
-        r += dr;
-        t += dt;
-        z += dz;
-      } // for stacks
-    }
-  }
-
-  /**
-   * renders a disk on the z = 0  plane.  The disk has a radius of
-   * outerRadius, and contains a concentric circular hole with a radius of
-   * innerRadius. If innerRadius is 0, then no hole is generated. The disk is
-   * subdivided around the z axis into slices (like pizza slices), and also
-   * about the z axis into rings (as specified by slices and loops,
-   * respectively).
-   *
-   * With respect to orientation, the +z side of the disk is considered to be
-   * "outside" (see glu.quadricOrientation).  This means that if the orientation
-   * is set to GLU.OUTSIDE, then any normals generated point along the +z axis.
-   * Otherwise, they point along the -z axis.
-   *
-   * If texturing is turned on (with glu.quadricTexture), texture coordinates are
-   * generated linearly such that where r=outerRadius, the value at (r, 0, 0) is
-   * (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5), and at
-   * (0, -r, 0) it is (0.5, 0).
-   */
-  public void drawDisk(GL gl, float innerRadius, float outerRadius, int slices, int loops)
-  {
-    float da, dr;
-
-    /* Normal vectors */
-    if (normals != GLU.GLU_NONE) {
-      if (orientation == GLU.GLU_OUTSIDE) {
-        glNormal3f(gl, 0.0f, 0.0f, +1.0f);
-      }
-      else {
-        glNormal3f(gl, 0.0f, 0.0f, -1.0f);
-      }
-    }
-	
-    da = 2.0f * PI / slices;
-    dr = (outerRadius - innerRadius) /  loops;
-	
-    switch (drawStyle) {
-    case GLU.GLU_FILL:
-      {
-        /* texture of a gluDisk is a cut out of the texture unit square
-         * x, y in [-outerRadius, +outerRadius]; s, t in [0, 1]
-         * (linear mapping)
-         */
-        float dtc = 2.0f * outerRadius;
-        float sa, ca;
-        float r1 = innerRadius;
-        int l;
-        for (l = 0; l < loops; l++) {
-          float r2 = r1 + dr;
-          if (orientation == GLU.GLU_OUTSIDE) {
-            int s;
-            glBegin(gl, immModeSink.GL_QUAD_STRIP);
-            for (s = 0; s <= slices; s++) {
-              float a;
-              if (s == slices)
-                a = 0.0f;
-              else
-                a = s * da;
-              sa = sin(a);
-              ca = cos(a);
-              TXTR_COORD(gl, 0.5f + sa * r2 / dtc, 0.5f + ca * r2 / dtc);
-              glVertex2f(gl, r2 * sa, r2 * ca);
-              TXTR_COORD(gl, 0.5f + sa * r1 / dtc, 0.5f + ca * r1 / dtc);
-              glVertex2f(gl, r1 * sa, r1 * ca);
-            }
-            glEnd(gl);
-          }
-          else {
-            int s;
-            glBegin(gl, immModeSink.GL_QUAD_STRIP);
-            for (s = slices; s >= 0; s--) {
-              float a;
-              if (s == slices)
-                a = 0.0f;
-              else
-                a = s * da;
-              sa = sin(a);
-              ca = cos(a);
-              TXTR_COORD(gl, 0.5f - sa * r2 / dtc, 0.5f + ca * r2 / dtc);
-              glVertex2f(gl, r2 * sa, r2 * ca);
-              TXTR_COORD(gl, 0.5f - sa * r1 / dtc, 0.5f + ca * r1 / dtc);
-              glVertex2f(gl, r1 * sa, r1 * ca);
-            }
-            glEnd(gl);
-          }
-          r1 = r2;
-        }
-        break;
-      }
-    case GLU.GLU_LINE:
-      {
-        int l, s;
-        /* draw loops */
-        for (l = 0; l <= loops; l++) {
-          float r = innerRadius + l * dr;
-          glBegin(gl, GL.GL_LINE_LOOP);
-          for (s = 0; s < slices; s++) {
-            float a = s * da;
-            glVertex2f(gl, r * sin(a), r * cos(a));
-          }
-          glEnd(gl);
-        }
-        /* draw spokes */
-        for (s = 0; s < slices; s++) {
-          float a = s * da;
-          float x = sin(a);
-          float y = cos(a);
-          glBegin(gl, GL.GL_LINE_STRIP);
-          for (l = 0; l <= loops; l++) {
-            float r = innerRadius + l * dr;
-            glVertex2f(gl, r * x, r * y);
-          }
-          glEnd(gl);
-        }
-        break;
-      }
-    case GLU.GLU_POINT:
-      {
-        int s;
-        glBegin(gl, GL.GL_POINTS);
-        for (s = 0; s < slices; s++) {
-          float a = s * da;
-          float x = sin(a);
-          float y = cos(a);
-          int l;
-          for (l = 0; l <= loops; l++) {
-            float r = innerRadius * l * dr;
-            glVertex2f(gl, r * x, r * y);
-          }
-        }
-        glEnd(gl);
-        break;
-      }
-    case GLU.GLU_SILHOUETTE:
-      {
-        if (innerRadius != 0.0) {
-          float a;
-          glBegin(gl, GL.GL_LINE_LOOP);
-          for (a = 0.0f; a < 2.0 * PI; a += da) {
-            float x = innerRadius * sin(a);
-            float y = innerRadius * cos(a);
-            glVertex2f(gl, x, y);
-          }
-          glEnd(gl);
-        }
-        {
-          float a;
-          glBegin(gl, GL.GL_LINE_LOOP);
-          for (a = 0; a < 2.0f * PI; a += da) {
-            float x = outerRadius * sin(a);
-            float y = outerRadius * cos(a);
-            glVertex2f(gl, x, y);
-          }
-          glEnd(gl);
-        }
-        break;
-      }
-    default:
-      return;
-    }
-  }
-
-  /**
-   * renders a partial disk on the z=0 plane. A partial disk is similar to a
-   * full disk, except that only the subset of the disk from startAngle
-   * through startAngle + sweepAngle is included (where 0 degrees is along
-   * the +y axis, 90 degrees along the +x axis, 180 along the -y axis, and
-   * 270 along the -x axis).
-   * 
-   * The partial disk has a radius of outerRadius, and contains a concentric
-   * circular hole with a radius of innerRadius. If innerRadius is zero, then
-   * no hole is generated. The partial disk is subdivided around the z axis
-   * into slices (like pizza slices), and also about the z axis into rings
-   * (as specified by slices and loops, respectively).
-   * 
-   * With respect to orientation, the +z side of the partial disk is
-   * considered to be outside (see gluQuadricOrientation). This means that if
-   * the orientation is set to GLU.GLU_OUTSIDE, then any normals generated point
-   * along the +z axis. Otherwise, they point along the -z axis.
-   * 
-   * If texturing is turned on (with gluQuadricTexture), texture coordinates
-   * are generated linearly such that where r=outerRadius, the value at (r, 0, 0)
-   * is (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5),
-   * and at (0, -r, 0) it is (0.5, 0).
-   */
-  public void drawPartialDisk(GL gl,
-                              float innerRadius,
-                              float outerRadius,
-                              int slices,
-                              int loops,
-                              float startAngle,
-                              float sweepAngle) {
-    int i, j, max;
-    float[] sinCache = new float[CACHE_SIZE];
-    float[] cosCache = new float[CACHE_SIZE];
-    float angle;
-    float x, y;
-    float sintemp, costemp;
-    float deltaRadius;
-    float radiusLow, radiusHigh;
-    float texLow = 0, texHigh = 0;
-    float angleOffset;
-    int slices2;
-    int finish;
-
-    if (slices >= CACHE_SIZE)
-      slices = CACHE_SIZE - 1;
-    if (slices < 2
-        || loops < 1
-        || outerRadius <= 0.0f
-        || innerRadius < 0.0f
-        || innerRadius > outerRadius) {
-      //gluQuadricError(qobj, GLU.GLU_INVALID_VALUE);
-      System.err.println("PartialDisk: GLU_INVALID_VALUE");
-      return;
-    }
-
-    if (sweepAngle < -360.0f)
-      sweepAngle = 360.0f;
-    if (sweepAngle > 360.0f)
-      sweepAngle = 360.0f;
-    if (sweepAngle < 0) {
-      startAngle += sweepAngle;
-      sweepAngle = -sweepAngle;
-    }
-
-    if (sweepAngle == 360.0f) {
-      slices2 = slices;
-    } else {
-      slices2 = slices + 1;
-    }
-
-    /* Compute length (needed for normal calculations) */
-    deltaRadius = outerRadius - innerRadius;
-
-    /* Cache is the vertex locations cache */
-
-    angleOffset = startAngle / 180.0f * PI;
-    for (i = 0; i <= slices; i++) {
-      angle = angleOffset + ((PI * sweepAngle) / 180.0f) * i / slices;
-      sinCache[i] = sin(angle);
-      cosCache[i] = cos(angle);
-    }
-
-    if (sweepAngle == 360.0f) {
-      sinCache[slices] = sinCache[0];
-      cosCache[slices] = cosCache[0];
-    }
-
-    switch (normals) {
-    case GLU.GLU_FLAT :
-    case GLU.GLU_SMOOTH :
-      if (orientation == GLU.GLU_OUTSIDE) {
-        glNormal3f(gl, 0.0f, 0.0f, 1.0f);
-      } else {
-        glNormal3f(gl, 0.0f, 0.0f, -1.0f);
-      }
-      break;
-    default :
-    case GLU.GLU_NONE :
-      break;
-    }
-
-    switch (drawStyle) {
-    case GLU.GLU_FILL :
-      if (innerRadius == .0f) {
-        finish = loops - 1;
-        /* Triangle strip for inner polygons */
-        glBegin(gl, GL.GL_TRIANGLE_FAN);
-        if (textureFlag) {
-          glTexCoord2f(gl, 0.5f, 0.5f);
-        }
-        glVertex3f(gl, 0.0f, 0.0f, 0.0f);
-        radiusLow = outerRadius - deltaRadius * ((float) (loops - 1) / loops);
-        if (textureFlag) {
-          texLow = radiusLow / outerRadius / 2;
-        }
-
-        if (orientation == GLU.GLU_OUTSIDE) {
-          for (i = slices; i >= 0; i--) {
-            if (textureFlag) {
-              glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
-                              texLow * cosCache[i] + 0.5f);
-            }
-            glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
-          }
-        } else {
-          for (i = 0; i <= slices; i++) {
-            if (textureFlag) {
-              glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
-                              texLow * cosCache[i] + 0.5f);
-            }
-            glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
-          }
-        }
-        glEnd(gl);
-      } else {
-        finish = loops;
-      }
-      for (j = 0; j < finish; j++) {
-        radiusLow = outerRadius - deltaRadius * ((float) j / loops);
-        radiusHigh = outerRadius - deltaRadius * ((float) (j + 1) / loops);
-        if (textureFlag) {
-          texLow = radiusLow / outerRadius / 2;
-          texHigh = radiusHigh / outerRadius / 2;
-        }
-
-        glBegin(gl, immModeSink.GL_QUAD_STRIP);
-        for (i = 0; i <= slices; i++) {
-          if (orientation == GLU.GLU_OUTSIDE) {
-            if (textureFlag) {
-              glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
-                              texLow * cosCache[i] + 0.5f);
-            }
-            glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
-
-            if (textureFlag) {
-              glTexCoord2f(gl, texHigh * sinCache[i] + 0.5f,
-                              texHigh * cosCache[i] + 0.5f);
-            }
-            glVertex3f(gl, radiusHigh * sinCache[i],
-                          radiusHigh * cosCache[i],
-                          0.0f);
-          } else {
-            if (textureFlag) {
-              glTexCoord2f(gl, texHigh * sinCache[i] + 0.5f,
-                              texHigh * cosCache[i] + 0.5f);
-            }
-            glVertex3f(gl, radiusHigh * sinCache[i],
-                          radiusHigh * cosCache[i],
-                          0.0f);
-
-            if (textureFlag) {
-              glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
-                              texLow * cosCache[i] + 0.5f);
-            }
-            glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
-          }
-        }
-        glEnd(gl);
-      }
-      break;
-    case GLU.GLU_POINT :
-      glBegin(gl, GL.GL_POINTS);
-      for (i = 0; i < slices2; i++) {
-        sintemp = sinCache[i];
-        costemp = cosCache[i];
-        for (j = 0; j <= loops; j++) {
-          radiusLow = outerRadius - deltaRadius * ((float) j / loops);
-
-          if (textureFlag) {
-            texLow = radiusLow / outerRadius / 2;
-
-            glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
-                            texLow * cosCache[i] + 0.5f);
-          }
-          glVertex3f(gl, radiusLow * sintemp, radiusLow * costemp, 0.0f);
-        }
-      }
-      glEnd(gl);
-      break;
-    case GLU.GLU_LINE :
-      if (innerRadius == outerRadius) {
-        glBegin(gl, GL.GL_LINE_STRIP);
-
-        for (i = 0; i <= slices; i++) {
-          if (textureFlag) {
-            glTexCoord2f(gl, sinCache[i] / 2 + 0.5f, cosCache[i] / 2 + 0.5f);
-          }
-          glVertex3f(gl, innerRadius * sinCache[i], innerRadius * cosCache[i], 0.0f);
-        }
-        glEnd(gl);
-        break;
-      }
-      for (j = 0; j <= loops; j++) {
-        radiusLow = outerRadius - deltaRadius * ((float) j / loops);
-        if (textureFlag) {
-          texLow = radiusLow / outerRadius / 2;
-        }
-
-        glBegin(gl, GL.GL_LINE_STRIP);
-        for (i = 0; i <= slices; i++) {
-          if (textureFlag) {
-            glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
-                            texLow * cosCache[i] + 0.5f);
-          }
-          glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
-        }
-        glEnd(gl);
-      }
-      for (i = 0; i < slices2; i++) {
-        sintemp = sinCache[i];
-        costemp = cosCache[i];
-        glBegin(gl, GL.GL_LINE_STRIP);
-        for (j = 0; j <= loops; j++) {
-          radiusLow = outerRadius - deltaRadius * ((float) j / loops);
-          if (textureFlag) {
-            texLow = radiusLow / outerRadius / 2;
-          }
-
-          if (textureFlag) {
-            glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
-                            texLow * cosCache[i] + 0.5f);
-          }
-          glVertex3f(gl, radiusLow * sintemp, radiusLow * costemp, 0.0f);
-        }
-        glEnd(gl);
-      }
-      break;
-    case GLU.GLU_SILHOUETTE :
-      if (sweepAngle < 360.0f) {
-        for (i = 0; i <= slices; i += slices) {
-          sintemp = sinCache[i];
-          costemp = cosCache[i];
-          glBegin(gl, GL.GL_LINE_STRIP);
-          for (j = 0; j <= loops; j++) {
-            radiusLow = outerRadius - deltaRadius * ((float) j / loops);
-
-            if (textureFlag) {
-              texLow = radiusLow / outerRadius / 2;
-              glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
-                              texLow * cosCache[i] + 0.5f);
-            }
-            glVertex3f(gl, radiusLow * sintemp, radiusLow * costemp, 0.0f);
-          }
-          glEnd(gl);
-        }
-      }
-      for (j = 0; j <= loops; j += loops) {
-        radiusLow = outerRadius - deltaRadius * ((float) j / loops);
-        if (textureFlag) {
-          texLow = radiusLow / outerRadius / 2;
-        }
-
-        glBegin(gl, GL.GL_LINE_STRIP);
-        for (i = 0; i <= slices; i++) {
-          if (textureFlag) {
-            glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
-                            texLow * cosCache[i] + 0.5f);
-          }
-          glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
-        }
-        glEnd(gl);
-        if (innerRadius == outerRadius)
-          break;
-      }
-      break;
-    default :
-      break;
-    }
-  }
-
-  /**
-   * draws a sphere of the given	radius centered	around the origin.
-   * The sphere is subdivided around the z axis into slices and along the z axis
-   * into stacks (similar to lines of longitude and latitude).
-   *
-   * If the orientation is set to GLU.OUTSIDE (with glu.quadricOrientation), then
-   * any normals generated point away from the center of the sphere. Otherwise,
-   * they point toward the center of the sphere.
-
-   * If texturing is turned on (with glu.quadricTexture), then texture
-   * coordinates are generated so that t ranges from 0.0 at z=-radius to 1.0 at
-   * z=radius (t increases linearly along longitudinal lines), and s ranges from
-   * 0.0 at the +y axis, to 0.25 at the +x axis, to 0.5 at the -y axis, to 0.75
-   * at the -x axis, and back to 1.0 at the +y axis.
-   */
-  public void drawSphere(GL gl, float radius, int slices, int stacks) {
-    // TODO
-
-    float rho, drho, theta, dtheta;
-    float x, y, z;
-    float s, t, ds, dt;
-    int i, j, imin, imax;
-    boolean normals;
-    float nsign;
-
-    normals = (this.normals != GLU.GLU_NONE);
-
-    if (orientation == GLU.GLU_INSIDE) {
-      nsign = -1.0f;
-    } else {
-      nsign = 1.0f;
-    }
-
-    drho = PI / stacks;
-    dtheta = 2.0f * PI / slices;
-
-    if (drawStyle == GLU.GLU_FILL) {
-      if (!textureFlag) {
-        // draw +Z end as a triangle fan
-        glBegin(gl, GL.GL_TRIANGLE_FAN);
-        glNormal3f(gl, 0.0f, 0.0f, 1.0f);
-        glVertex3f(gl, 0.0f, 0.0f, nsign * radius);
-        for (j = 0; j <= slices; j++) {
-          theta = (j == slices) ? 0.0f : j * dtheta;
-          x = -sin(theta) * sin(drho);
-          y = cos(theta) * sin(drho);
-          z = nsign * cos(drho);
-          if (normals) {
-            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
-          }
-          glVertex3f(gl, x * radius, y * radius, z * radius);
-        }
-        glEnd(gl);
-      }
-
-      ds = 1.0f / slices;
-      dt = 1.0f / stacks;
-      t = 1.0f; // because loop now runs from 0
-      if (textureFlag) {
-        imin = 0;
-        imax = stacks;
-      } else {
-        imin = 1;
-        imax = stacks - 1;
-      }
-
-      // draw intermediate stacks as quad strips
-      for (i = imin; i < imax; i++) {
-        rho = i * drho;
-        glBegin(gl, immModeSink.GL_QUAD_STRIP);
-        s = 0.0f;
-        for (j = 0; j <= slices; j++) {
-          theta = (j == slices) ? 0.0f : j * dtheta;
-          x = -sin(theta) * sin(rho);
-          y = cos(theta) * sin(rho);
-          z = nsign * cos(rho);
-          if (normals) {
-            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
-          }
-          TXTR_COORD(gl, s, t);
-          glVertex3f(gl, x * radius, y * radius, z * radius);
-          x = -sin(theta) * sin(rho + drho);
-          y = cos(theta) * sin(rho + drho);
-          z = nsign * cos(rho + drho);
-          if (normals) {
-            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
-          }
-          TXTR_COORD(gl, s, t - dt);
-          s += ds;
-          glVertex3f(gl, x * radius, y * radius, z * radius);
-        }
-        glEnd(gl);
-        t -= dt;
-      }
-
-      if (!textureFlag) {
-        // draw -Z end as a triangle fan
-        glBegin(gl, GL.GL_TRIANGLE_FAN);
-        glNormal3f(gl, 0.0f, 0.0f, -1.0f);
-        glVertex3f(gl, 0.0f, 0.0f, -radius * nsign);
-        rho = PI - drho;
-        s = 1.0f;
-        for (j = slices; j >= 0; j--) {
-          theta = (j == slices) ? 0.0f : j * dtheta;
-          x = -sin(theta) * sin(rho);
-          y = cos(theta) * sin(rho);
-          z = nsign * cos(rho);
-          if (normals)
-            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
-          s -= ds;
-          glVertex3f(gl, x * radius, y * radius, z * radius);
-        }
-        glEnd(gl);
-      }
-    } else if (
-               drawStyle == GLU.GLU_LINE
-               || drawStyle == GLU.GLU_SILHOUETTE) {
-      // draw stack lines
-      for (i = 1;
-           i < stacks;
-           i++) { // stack line at i==stacks-1 was missing here
-        rho = i * drho;
-        glBegin(gl, GL.GL_LINE_LOOP);
-        for (j = 0; j < slices; j++) {
-          theta = j * dtheta;
-          x = cos(theta) * sin(rho);
-          y = sin(theta) * sin(rho);
-          z = cos(rho);
-          if (normals)
-            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
-          glVertex3f(gl, x * radius, y * radius, z * radius);
-        }
-        glEnd(gl);
-      }
-      // draw slice lines
-      for (j = 0; j < slices; j++) {
-        theta = j * dtheta;
-        glBegin(gl, GL.GL_LINE_STRIP);
-        for (i = 0; i <= stacks; i++) {
-          rho = i * drho;
-          x = cos(theta) * sin(rho);
-          y = sin(theta) * sin(rho);
-          z = cos(rho);
-          if (normals)
-            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
-          glVertex3f(gl, x * radius, y * radius, z * radius);
-        }
-        glEnd(gl);
-      }
-    } else if (drawStyle == GLU.GLU_POINT) {
-      // top and bottom-most points
-      glBegin(gl, GL.GL_POINTS);
-      if (normals)
-        glNormal3f(gl, 0.0f, 0.0f, nsign);
-      glVertex3f(gl, 0.0f, 0.0f, radius);
-      if (normals)
-        glNormal3f(gl, 0.0f, 0.0f, -nsign);
-      glVertex3f(gl, 0.0f, 0.0f, -radius);
-
-      // loop over stacks
-      for (i = 1; i < stacks - 1; i++) {
-        rho = i * drho;
-        for (j = 0; j < slices; j++) {
-          theta = j * dtheta;
-          x = cos(theta) * sin(rho);
-          y = sin(theta) * sin(rho);
-          z = cos(rho);
-          if (normals)
-            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
-          glVertex3f(gl, x * radius, y * radius, z * radius);
-        }
-      }
-      glEnd(gl);
-    }
-  }
-
-
-  //----------------------------------------------------------------------
-  // Internals only below this point
-  //
-
-  private static final float PI = (float)Math.PI;
-  private static final int CACHE_SIZE = 240;
-
-  private final void glBegin(GL gl, int mode) {
-      if(immModeSinkEnabled) {
-          immModeSink.glBegin(mode);
-      } else {
-          gl.getGL2().glBegin(mode);
-      }
-  }
-
-  private final void glEnd(GL gl) {
-      if(immModeSinkEnabled) {
-          immModeSink.glEnd(gl, immModeSinkImmediate);
-      } else {
-          gl.getGL2().glEnd();
-      }
-  }
-
-  private final void glVertex2f(GL gl, float x, float y) {
-      if(immModeSinkEnabled) {
-          immModeSink.glVertex2f(x, y);
-      } else {
-          gl.getGL2().glVertex2f(x, y);
-      }
-  }
-
-  private final void glVertex3f(GL gl, float x, float y, float z) {
-      if(immModeSinkEnabled) {
-          immModeSink.glVertex3f(x, y, z);
-      } else {
-          gl.getGL2().glVertex3f(x, y, z);
-      }
-  }
-
-  private final void glNormal3f_s(GL gl, float x, float y, float z) {
-      short a=(short)(x*0xFFFF);
-      short b=(short)(y*0xFFFF);
-      short c=(short)(z*0xFFFF);
-      if(immModeSinkEnabled) {
-          immModeSink.glNormal3s(a, b, c);
-      } else {
-          gl.getGL2().glNormal3s(a, b, c);
-      }
-  }
-
-  private final void glNormal3f_b(GL gl, float x, float y, float z) {
-      byte a=(byte)(x*0xFF);
-      byte b=(byte)(y*0xFF);
-      byte c=(byte)(z*0xFF);
-      if(immModeSinkEnabled) {
-          immModeSink.glNormal3b(a, b, c);
-      } else {
-          gl.getGL2().glNormal3b(a, b, c);
-      }
-  }
-
-  private final void glNormal3f(GL gl, float x, float y, float z) {
-    switch(normalType) {
-        case GL.GL_FLOAT:
-            if(immModeSinkEnabled) {
-                immModeSink.glNormal3f(x,y,z);
-            } else {
-                gl.getGL2().glNormal3f(x,y,z);
-            }
-            break;
-        case GL.GL_SHORT:
-            glNormal3f_s(gl, x, y, z);
-            break;
-        case GL.GL_BYTE:
-            glNormal3f_b(gl, x, y, z);
-            break;
-    }
-  }
-
-  private final void glTexCoord2f(GL gl, float x, float y) {
-      if(immModeSinkEnabled) {
-          immModeSink.glTexCoord2f(x, y);
-      } else {
-          gl.getGL2().glTexCoord2f(x, y);
-      }
-  }
-
-  /**
-   * Call glNormal3f after scaling normal to unit length.
-   *
-   * @param x
-   * @param y
-   * @param z
-   */
-  private void normal3f(GL gl, float x, float y, float z) {
-    float mag;
-	
-    mag = (float)Math.sqrt(x * x + y * y + z * z);
-    if (mag > 0.00001F) {
-      x /= mag;
-      y /= mag;
-      z /= mag;
-    }
-    glNormal3f(gl, x, y, z);
-  }
-
-  private final void TXTR_COORD(GL gl, float x, float y) {
-    if (textureFlag) glTexCoord2f(gl, x,y);
-  }
-
-  private float sin(float r) {
-    return (float)Math.sin(r);
-  }
-
-  private float cos(float r) {
-    return (float)Math.cos(r);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/Glue.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/Glue.java
deleted file mode 100644
index 7c360c5..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/Glue.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu;
-
-/**
- *
- * @author  Administrator
- */
-public class Glue {
-  private static String[] __gluNurbsErrors = {
-    " ",
-    "spline order un-supported",
-    "too few knots",
-    "valid knot range is empty",
-    "decreasing knot sequence knot",
-    "knot multiplicity greater than order of spline",
-    "gluEndCurve() must follow gluBeginCurve()",
-    "gluBeginCurve() must precede gluEndCurve()",
-    "missing or extra geometric data",
-    "can't draw piecewise linear trimming curves",
-    "missing or extra domain data",
-    "missing or extra domain data",
-    "gluEndTrim() must precede gluEndSurface()",
-    "gluBeginSurface() must precede gluEndSurface()",
-    "curve of improper type passed as trim curve",
-    "gluBeginSurface() must precede gluBeginTrim()",
-    "gluEndTrim() must follow gluBeginTrim()",
-    "gluBeginTrim() must follow gluEndTrim()",
-    "invalid or missing trim curve",
-    "gluBeginTrim() must precede gluPwlCurve()",
-    "piecewise linear trimming curve referenced twice",
-    "piecewise linear trimming curve and nurbs curve mixed",
-    "improper usage of trim data type",
-    "nurbs curve referenced twice",
-    "nurbs curve and piecewise linear trimming curve mixed",
-    "nurbs surface referenced twice",
-    "invalid property",
-    "gluEndSurface() must follow gluBeginSurface()",
-    "intersecting or misoriented trim curve",
-    "intersecting trim curves",
-    "UNUSED",
-    "inconnected trim curves",
-    "unknown knot error",
-    "negative vertex count encountered",
-    "negative byte-stride encountered",
-    "unknown type descriptor",
-    "null control point reference",
-    "duplicate point on piecewise linear trimming curve"
-  } ;
-  
-  /** Creates a new instance of Glue */
-  public Glue() {
-  }
-  
-  public static String __gluNURBSErrorString( int errno ) {
-    return( __gluNurbsErrors[ errno ] );
-  }
-  
-  private static String[] __gluTessErrors = {
-    " ",
-    "gluTessBeginPolygon() must precede a gluTessEndPolygon",
-    "gluTessBeginContour() must precede a gluTessEndContour()",
-    "gluTessEndPolygon() must follow a gluTessBeginPolygon()",
-    "gluTessEndContour() must follow a gluTessBeginContour()",
-    "a coordinate is too large",
-    "need combine callback"
-  };
-  
-  public static String __gluTessErrorString( int errno ) {
-    return( __gluTessErrors[ errno ] );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/error/Error.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/error/Error.java
deleted file mode 100644
index 7c7e6b0..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/error/Error.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- * 
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.error;
-
-import javax.media.opengl.GL;
-import javax.media.opengl.glu.GLU;
-import com.jogamp.opengl.impl.glu.Glue;
-
-/**
- *
- * @author  Administrator
- */
-public class Error {
-  
-  private static String[] glErrorStrings = {
-    "invalid enumerant",
-    "invalid value",
-    "invalid operation",
-    "stack overflow",
-    "stack underflow",
-    "out of memory",
-    "invalid framebuffer operation"
-  };
-  
-  private static String[] gluErrorStrings = {
-    "invalid enumerant",
-    "invalid value",
-    "out of memory",
-    "",
-    "invalid operation"
-  };
-  
-  /** Creates a new instance of Error */
-  public Error() {
-  }
-  
-  public static String gluErrorString( int errorCode ) {
-    if( errorCode == 0 ) {
-      return( "no error" );
-    }
-    if( (errorCode >= GL.GL_INVALID_ENUM) && (errorCode <= GL.GL_INVALID_FRAMEBUFFER_OPERATION) ) {
-      return( glErrorStrings[ errorCode - GL.GL_INVALID_ENUM ] );
-    }
-    if( errorCode == 0x8031 /* GL.GL_TABLE_TOO_LARGE */ ) {
-      return( "table too large" );
-    }
-    if( (errorCode >= GLU.GLU_INVALID_ENUM) && (errorCode <= GLU.GLU_INVALID_OPERATION) ) {
-      return( gluErrorStrings[ errorCode - GLU.GLU_INVALID_ENUM ] );
-    }
-//    if( (errorCode >= GLU.GLU_NURBS_ERROR1) && (errorCode <= GLU.GLU_NURBS_ERROR37) ) {
-//      return( gluErrorStrings[ errorCode - (GLU.GLU_NURBS_ERROR1 - 1) ] );
-//    }
-    if( (errorCode >= GLU.GLU_TESS_ERROR1) && (errorCode <= GLU.GLU_TESS_ERROR8) ) {
-        return( Glue.__gluTessErrorString(errorCode - (GLU.GLU_TESS_ERROR1 - 1)) );
-    }
-    return( "error ("+errorCode+")" );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2Backend.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2Backend.java
deleted file mode 100644
index 42ddeea..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2Backend.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package com.jogamp.opengl.impl.glu.gl2.nurbs;
-import com.jogamp.opengl.impl.glu.nurbs.*;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class responsible for rendering
- * @author Tomas Hrasky
- *
- */
-public class GL2Backend extends Backend {
-  public GL2Backend() {
-    super();
-    curveEvaluator = new GL2CurveEvaluator();
-    surfaceEvaluator = new GL2SurfaceEvaluator();
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java
deleted file mode 100644
index adb8c51..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java
+++ /dev/null
@@ -1,205 +0,0 @@
-package com.jogamp.opengl.impl.glu.gl2.nurbs;
-import com.jogamp.opengl.impl.glu.nurbs.*;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import javax.media.opengl.glu.GLU;
-import javax.media.opengl.glu.gl2.GLUgl2;
-
-/**
- * Class rendering curves with OpenGL
- * @author Tomáš Hráský
- *
- */
-class GL2CurveEvaluator implements CurveEvaluator {
-
-  /**
-   * Output triangles (for callback) or render curve 
-   */
-  private boolean output_triangles;
-
-  /**
-   * OpenGL object
-   */
-  private GL2 gl;
-
-  /**
-   * Not used
-   */
-  private int vertex_flag;
-
-  /**
-   * Not used
-   */
-  private int normal_flag;
-
-  /**
-   * Not used
-   */
-  private int color_flag;
-
-  /**
-   * Not used
-   */
-  private int texcoord_flag;
-
-  /**
-   * Number of bezier arc - used for color distinguishing of arcs forming NURBS curve
-   */
-  private int poradi;
-
-  /**
-   * Makes new Evaluator
-   */
-  public GL2CurveEvaluator() {
-    gl = GLUgl2.getCurrentGL2();
-  }
-
-  /**
-   * Pushes eval bit
-   */
-  public void bgnmap1f() {
-    // DONE
-    if (output_triangles) {
-      vertex_flag = 0;
-      normal_flag = 0;
-      color_flag = 0;
-      texcoord_flag = 0;
-    } else {
-      gl.glPushAttrib(GL2.GL_EVAL_BIT);
-    }
-
-  }
-
-  /**
-   * Pops all OpenGL attributes
-   */
-  public void endmap1f() {
-    // DONE
-    if (output_triangles) {
-
-    } else {
-      gl.glPopAttrib();
-    }
-
-  }
-
-  /**
-   * Initializes opengl evaluator
-   * @param type curve type
-   * @param ulo lowest u
-   * @param uhi highest u
-   * @param stride control point coords
-   * @param order curve order
-   * @param ps control points
-   */
-  public void map1f(int type, float ulo, float uhi, int stride, int order,
-                    CArrayOfFloats ps) {
-    if (output_triangles) {
-      // TODO code for callback (output_triangles probably indicates callback)
-      //				System.out.println("TODO curveevaluator.map1f-output_triangles");
-    } else {
-      gl.glMap1f(type, ulo, uhi, stride, order, ps.getArray(), ps
-                 .getPointer());
-
-      // DEBUG - drawing bézier control points
-      // gl.glColor3d(.5,.5,.5);
-      // gl.glPointSize(5);
-      // gl.glBegin(GL2.GL_POINTS);
-      // float[] ctrlpoints=ps.getArray();
-      // for(int i=ps.getPointer();i<ps.getPointer()+order;i++){
-      // gl.glVertex3d(ctrlpoints[i * 4], ctrlpoints[i * 4 + 1],0);
-      // }
-      // gl.glEnd();
-    }
-
-  }
-
-  /**
-   * Calls opengl enable
-   * @param type what to enable
-   */
-  public void enable(int type) {
-    // DONE
-    gl.glEnable(type);
-  }
-
-  /**
-   * Calls glMapGrid1f
-   * @param nu steps
-   * @param u1 low u
-   * @param u2 high u
-   */
-  public void mapgrid1f(int nu, float u1, float u2) {
-    if (output_triangles) {
-      //				System.out.println("TODO curveevaluator.mapgrid1f");
-    } else
-      gl.glMapGrid1f(nu, u1, u2);
-    //			// System.out.println("upravit NU");
-    // gl.glMapGrid1f(50,u1,u2);
-  }
-
-  /**
-   * Evaluates a curve using glEvalMesh1f
-   * @param style Backend.N_MESHFILL/N_MESHLINE/N_MESHPOINT
-   * @param from lowest param
-   * @param to highest param
-   */
-  public void mapmesh1f(int style, int from, int to) {
-    /* //DEBUG drawing control points
-       this.poradi++;
-       if (poradi % 2 == 0)
-       gl.glColor3f(1, 0, 0);
-       else
-       gl.glColor3f(0, 1, 0);
-    */
-    if (output_triangles) {
-      // TODO code for callback
-      //			System.out.println("TODO openglcurveevaluator.mapmesh1f output_triangles");
-    } else {
-      switch (style) {
-      case Backend.N_MESHFILL:
-      case Backend.N_MESHLINE:
-        gl.glEvalMesh1(GL2.GL_LINE, from, to);
-        break;
-      case Backend.N_MESHPOINT:
-        gl.glEvalMesh1(GL2.GL_POINT, from, to);
-        break;
-      }
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
deleted file mode 100644
index 393601f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
+++ /dev/null
@@ -1,217 +0,0 @@
-package com.jogamp.opengl.impl.glu.gl2.nurbs;
-import com.jogamp.opengl.impl.glu.nurbs.*;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import javax.media.opengl.glu.GLU;
-import javax.media.opengl.glu.gl2.GLUgl2;
-
-/**
- * Class rendering surfaces with OpenGL
- * @author Tomas Hrasky
- *
- */
-class GL2SurfaceEvaluator implements SurfaceEvaluator {
-
-  /**
-   * JOGL OpenGL object
-   */
-  private GL2 gl;
-
-  /**
-   * Output triangles (callback)
-   */
-  private boolean output_triangles;
-
-  /**
-   * Number of patch - used for distinguishing bezier plates forming NURBS surface with different colors
-   */
-  private int poradi;
-
-  /**
-   * Creates new evaluator
-   */
-  public GL2SurfaceEvaluator() {
-    gl = GLUgl2.getCurrentGL2();
-  }
-
-  /**
-   * Pushes eval bit
-   */
-  public void bgnmap2f() {
-
-    if (output_triangles) {
-      // TODO outp triangles surfaceevaluator bgnmap2f
-      //			System.out.println("TODO surfaceevaluator.bgnmap2f output triangles");
-    } else {
-      gl.glPushAttrib(GL2.GL_EVAL_BIT);
-      //				System.out.println("TODO surfaceevaluator.bgnmap2f glgetintegerv");
-    }
-
-  }
-
-  /**
-   * Sets  glPolygonMode
-   * @param style polygon mode (N_MESHFILL/N_MESHLINE/N_MESHPOINT)
-   */
-  public void polymode(int style) {
-    if (!output_triangles) {
-      switch (style) {
-      default:
-      case NurbsConsts.N_MESHFILL:
-        gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
-        break;
-      case NurbsConsts.N_MESHLINE:
-        gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
-        break;
-      case NurbsConsts.N_MESHPOINT:
-        gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_POINT);
-        break;
-      }
-    }
-
-  }
-
-  /**
-   * Pops all attributes
-   */
-  public void endmap2f() {
-    // TODO Auto-generated method stub
-    if (output_triangles) {
-      //			System.out.println("TODO surfaceevaluator.endmap2f output triangles");
-    } else {
-      gl.glPopAttrib();
-      // TODO use LOD
-    }
-  }
-
-  /**
-   * Empty method
-   * @param ulo
-   * @param uhi
-   * @param vlo
-   * @param vhi
-   */
-  public void domain2f(float ulo, float uhi, float vlo, float vhi) {
-    // DONE
-  }
-
-  /**
-   * Defines 2D mesh
-   * @param nu number of steps in u direction
-   * @param u0 lowest u
-   * @param u1 highest u
-   * @param nv number of steps in v direction
-   * @param v0 lowest v
-   * @param v1 highest v
-   */
-  public void mapgrid2f(int nu, float u0, float u1, int nv, float v0, float v1) {
-
-    if (output_triangles) {
-      //			System.out.println("TODO openglsurfaceavaluator.mapgrid2f output_triangles");
-    } else {
-      gl.glMapGrid2d(nu, u0, u1, nv, v0, v1);
-    }
-
-  }
-
-  /**
-   * Evaluates surface
-   * @param style surface style
-   * @param umin minimum U
-   * @param umax maximum U
-   * @param vmin minimum V
-   * @param vmax maximum V
-   */
-  public void mapmesh2f(int style, int umin, int umax, int vmin, int vmax) {
-    if (output_triangles) {
-      //			System.out.println("TODO openglsurfaceavaluator.mapmesh2f output_triangles");
-    } else {
-      /* //DEBUG - draw control points
-         this.poradi++;
-         if (poradi % 2 == 0)
-         gl.glColor3f(1, 0, 0);
-         else if (poradi % 2 == 1)
-         gl.glColor3f(0, 1, 0);
-      */
-      switch (style) {
-      case NurbsConsts.N_MESHFILL:
-        gl.glEvalMesh2(GL2.GL_FILL, umin, umax, vmin, vmax);
-        break;
-      case NurbsConsts.N_MESHLINE:
-        gl.glEvalMesh2(GL2.GL_LINE, umin, umax, vmin, vmax);
-        break;
-      case NurbsConsts.N_MESHPOINT:
-        gl.glEvalMesh2(GL2.GL_POINT, umin, umax, vmin, vmax);
-        break;
-      }
-    }
-  }
-
-  /**
-   * Initializes evaluator
-   * @param type surface type
-   * @param ulo lowest u
-   * @param uhi highest u
-   * @param ustride number of objects between control points in u direction
-   * @param uorder surface order in u direction
-   * @param vlo lowest v
-   * @param vhi highest v
-   * @param vstride number of control points' coords
-   * @param vorder surface order in v direction
-   * @param pts control points
-   */
-  public void map2f(int type, float ulo, float uhi, int ustride, int uorder,
-                    float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) {
-    // TODO Auto-generated method stub
-    if (output_triangles) {
-      //			System.out.println("TODO openglsurfaceevaluator.map2f output_triangles");
-    } else {
-      gl.glMap2f(type, ulo, uhi, ustride, uorder, vlo, vhi, vstride,
-                 vorder, pts.getArray(), pts.getPointer());
-    }
-  }
-
-  /**
-   * Calls opengl enable
-   * @param type what to enable
-   */
-  public void enable(int type) {
-    //DONE
-    gl.glEnable(type);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
deleted file mode 100644
index 13b6813..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
+++ /dev/null
@@ -1,862 +0,0 @@
-package com.jogamp.opengl.impl.glu.gl2.nurbs;
-import com.jogamp.opengl.impl.glu.nurbs.*;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-import java.lang.reflect.Method;
-
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import javax.media.opengl.glu.GLUnurbs;
-
-/**
- * Base object for working with NURBS curves and surfaces
- * 
- * @author Tomas Hrasky
- * 
- */
-public class GLUgl2nurbsImpl implements GLUnurbs {
-
-  /**
-   * Curve type - no type
-   */
-  public static final int CT_NONE = 0;
-
-  /**
-   * Curve type - NURBS curve
-   */
-  public static final int CT_NURBSCURVE = 1;
-
-  /**
-   * Curve type - picewise linear curve
-   */
-  public static final int CT_NPWLCURVE = 2;
-
-  /**
-   * Matrixes autoloading
-   */
-  private boolean autoloadmode;
-
-  /**
-   * Using callback
-   */
-  private int callBackFlag;
-
-  /**
-   * Object for error call backs
-   */
-  private Object errorCallback;
-
-  /**
-   * List of map definitions
-   */
-  Maplist maplist;
-
-  /**
-   * Indicates validity of data
-   */
-  private int isDataValid;
-
-  /**
-   * Are we in the middle of curve processing
-   */
-  private int inCurve;
-
-  /**
-   * Current curve
-   */
-  private O_curve currentCurve;
-
-  /**
-   * Are we in trim
-   */
-  private boolean inTrim;
-
-  /**
-   * Are we playbacking curve/surface rendering
-   */
-  private boolean playBack;
-
-  /**
-   * Next curve in linked list
-   */
-  private O_curve nextCurve;
-
-  /**
-   * Is curve modified
-   */
-  private int isCurveModified;
-
-  /**
-   * Object holding rendering settings
-   */
-  private Renderhints renderhints;
-
-  /**
-   * Display list
-   */
-  private DisplayList dl;
-
-  /**
-   * Object for subdividing curves and surfaces
-   */
-  private Subdivider subdivider;
-
-  /**
-   * Object responsible for rendering
-   */
-  private Backend backend;
-
-  /**
-   * Next picewise linear curve in linked list
-   */
-  private O_pwlcurve nextPwlcurve;
-
-  /**
-   * Next trimming NURBS curve in linked list
-   */
-  private O_nurbscurve nextNurbscurve;
-
-  /**
-   * Are we in the middle of surface processing
-   */
-  private int inSurface;
-
-  /**
-   * Are there any changes in trimming
-   */
-  private boolean isTrimModified;
-
-  /**
-   * Are there any changes in surface data
-   */
-  private boolean isDataSurfaceModified;
-
-  /**
-   * Nurber of trmims of processed surface
-   */
-  private int numTrims;
-
-  /**
-   * Current processed surface
-   */
-  private O_surface currentSurface;
-
-  /**
-   * Next trimming curve
-   */
-  private O_trim nextTrim;
-
-  /**
-   * Nextr surface in linked list
-   */
-  private O_nurbssurface nextNurbssurface;
-
-  /**
-   * Are there any changes in surface
-   */
-  private boolean isSurfaceModified;
-
-  /**
-   * Initializes default GLUgl2nurbs object
-   */
-  public GLUgl2nurbsImpl() {
-    // DONE
-    maplist = new Maplist(backend);
-    renderhints = new Renderhints();
-    subdivider = new Subdivider();
-    // original code
-
-    redefineMaps();
-
-    defineMap(GL2.GL_MAP2_NORMAL, 0, 3);
-    defineMap(GL2.GL_MAP1_NORMAL, 0, 3);
-    defineMap(GL2.GL_MAP2_TEXTURE_COORD_1, 0, 1);
-    defineMap(GL2.GL_MAP1_TEXTURE_COORD_1, 0, 1);
-    defineMap(GL2.GL_MAP2_TEXTURE_COORD_2, 0, 2);
-    defineMap(GL2.GL_MAP1_TEXTURE_COORD_2, 0, 2);
-    defineMap(GL2.GL_MAP2_TEXTURE_COORD_3, 0, 3);
-    defineMap(GL2.GL_MAP1_TEXTURE_COORD_3, 0, 3);
-    defineMap(GL2.GL_MAP2_TEXTURE_COORD_4, 1, 4);
-    defineMap(GL2.GL_MAP1_TEXTURE_COORD_4, 1, 4);
-    defineMap(GL2.GL_MAP2_VERTEX_4, 1, 4);
-    defineMap(GL2.GL_MAP1_VERTEX_4, 1, 4);
-    defineMap(GL2.GL_MAP2_VERTEX_3, 0, 3);
-    defineMap(GL2.GL_MAP1_VERTEX_3, 0, 3);
-    defineMap(GL2.GL_MAP2_COLOR_4, 0, 4);
-    defineMap(GL2.GL_MAP1_COLOR_4, 0, 4);
-    defineMap(GL2.GL_MAP2_INDEX, 0, 1);
-    defineMap(GL2.GL_MAP1_INDEX, 0, 1);
-
-    setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
-                     (float) NurbsConsts.N_PATHLENGTH);
-    setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_SAMPLINGMETHOD,
-                     (float) NurbsConsts.N_PATHLENGTH);
-    setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
-                     (float) NurbsConsts.N_PATHLENGTH);
-    setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_SAMPLINGMETHOD,
-                     (float) NurbsConsts.N_PATHLENGTH);
-
-    setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_PIXEL_TOLERANCE,
-                     (float) 50.0);
-    setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_PIXEL_TOLERANCE,
-                     (float) 50.0);
-    setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_PIXEL_TOLERANCE,
-                     (float) 50.0);
-    setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_PIXEL_TOLERANCE,
-                     (float) 50.0);
-
-    setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_ERROR_TOLERANCE,
-                     (float) 0.50);
-    setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_ERROR_TOLERANCE,
-                     (float) 0.50);
-    setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_ERROR_TOLERANCE,
-                     (float) 0.50);
-    setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_ERROR_TOLERANCE,
-                     (float) 0.50);
-
-    setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_S_STEPS,
-                     (float) 100.0);
-    setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_S_STEPS,
-                     (float) 100.0);
-    setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_S_STEPS,
-                     (float) 100.0);
-    setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_S_STEPS,
-                     (float) 100.0);
-
-    setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
-                     NurbsConsts.N_PATHLENGTH);
-
-    set_domain_distance_u_rate(100.0);
-    set_domain_distance_v_rate(100.0);
-    set_is_domain_distance_sampling(0);
-
-    this.autoloadmode = true;
-
-    this.callBackFlag = 0;
-
-    this.errorCallback = null;
-  }
-
-  /**
-   * Sets domain distance for dom.dist. sampling in u direction
-   * 
-   * @param d
-   *            distance
-   */
-  private void set_domain_distance_u_rate(double d) {
-    // DONE
-    subdivider.set_domain_distance_u_rate(d);
-  }
-
-  /**
-   * Sets domain distance for dom.dist. sampling in v direction
-   * 
-   * @param d
-   *            distance
-   */
-  private void set_domain_distance_v_rate(double d) {
-    // DONE
-    subdivider.set_domain_distance_v_rate(d);
-  }
-
-  /**
-   * Begins new NURBS curve
-   */
-  public void bgncurve() {
-    // DONE
-    O_curve o_curve = new O_curve();
-    thread("do_bgncurve", o_curve);
-  }
-
-  /**
-   * Calls a method with given name and passes argumet
-   * 
-   * @param name
-   *            name of a method to be called
-   * @param arg
-   *            parameter to be passed to called method
-   */
-  private void thread(String name, Object arg) {
-    // DONE
-    Class partype[] = new Class[1];
-    partype[0] = arg.getClass();
-    Method m;
-    try {
-      m = this.getClass().getMethod(name, partype);
-      if (dl != null) {
-        dl.append(this, m, arg);
-      } else {
-        m.invoke(this, new Object[] { arg });
-      }
-    } catch (Throwable e) {
-      e.printStackTrace();
-    }
-
-  }
-
-  /**
-   * Calls a method with given name
-   * 
-   * @param name
-   *            name of a method to be called
-   */
-  private void thread2(String name) {
-    // DONE
-    try {
-      Method m = this.getClass().getMethod(name, (Class[]) null);
-      if (dl != null) {
-        dl.append(this, m, null);
-      } else {
-        m.invoke(this, (Object[]) null);
-      }
-    } catch (Throwable e) {
-      e.printStackTrace();
-    }
-  }
-
-  /**
-   * Begins a NURBS curve
-   * 
-   * @param o_curve
-   *            curve object
-   */
-  public void do_bgncurve(O_curve o_curve) {
-    if (inCurve > 0) {
-      do_nurbserror(6);
-      endcurve();
-    }
-    inCurve = 1;
-    currentCurve = o_curve;
-
-    currentCurve.curvetype = CT_NONE;
-
-    if (inTrim) {
-      if (!nextCurve.equals(o_curve)) {
-        isCurveModified = 1;
-        nextCurve = o_curve;
-      }
-    } else {
-      if (!playBack)
-        bgnrender();
-      isDataValid = 1;
-    }
-    nextCurve = o_curve.next;
-    // kind of solution of union
-    nextPwlcurve = o_curve.o_pwlcurve;
-    nextNurbscurve = o_curve.o_nurbscurve;
-  }
-
-  /**
-   * Begins new surface
-   * 
-   * @param o_surface
-   *            surface object
-   */
-  public void do_bgnsurface(O_surface o_surface) {
-    // DONE
-    if (inSurface > 0) {
-      do_nurbserror(27);
-      endsurface();
-    }
-    inSurface = 1;
-    if (!playBack)
-      bgnrender();
-
-    isTrimModified = false;
-    isDataSurfaceModified = false;
-    isDataValid = 1;
-    numTrims = 0;
-    currentSurface = o_surface;
-    nextTrim = o_surface.o_trim;
-    nextNurbssurface = o_surface.o_nurbssurface;
-  }
-
-  /**
-   * End a curve
-   */
-  public void endcurve() {
-    // DONE
-    thread2("do_endcurve");
-  }
-
-  /**
-   * Ends surface
-   */
-  public void do_endsurface() {
-    // DONE
-    if (inTrim) {
-      do_nurbserror(12);
-      endtrim();
-    }
-
-    if (inSurface <= 0) {
-      do_nurbserror(13);
-      return;
-    }
-
-    inSurface = 0;
-
-    nextNurbssurface = null;
-
-    if (isDataValid <= 0) {
-      return;
-    }
-
-    if (nextTrim != null) {
-      isTrimModified = true;
-      nextTrim = null;
-    }
-
-    // TODO errval ??
-    if (numTrims > 0) {
-      //				System.out.println("TODO glunurbs.do_endsurface - numtrims > 0");
-    }
-
-    subdivider.beginQuilts(new GL2Backend());
-    for (O_nurbssurface n = currentSurface.o_nurbssurface; n != null; n = n.next) {
-      subdivider.addQuilt(n.bezier_patches);
-    }
-    subdivider.endQuilts();
-    subdivider.drawSurfaces();
-    if (!playBack)
-      endrender();
-
-  }
-
-  /**
-   * Ends a curve
-   */
-  public void do_endcurve() {
-    // DONE
-    //			// System.out.println("do_endcurve");
-    if (inCurve <= 0) {
-      do_nurbserror(7);
-      return;
-    }
-    inCurve = 0;
-
-    nextCurve = null;
-
-    if (currentCurve.curvetype == CT_NURBSCURVE) {
-      // nextNurbscurve = null;
-      // currentCurve.o_nurbscurve=null;
-    } else {
-      // nextPwlcurve = null;
-      // currentCurve.o_pwlcurve=null;
-    }
-    if (!inTrim) {
-      if (isDataValid <= 0) {
-        return;
-      }
-      // TODO errval?
-      if (currentCurve.curvetype == CT_NURBSCURVE) {
-        subdivider.beginQuilts(new GL2Backend());
-
-        for (O_nurbscurve n = currentCurve.o_nurbscurve; n != null; n = n.next)
-          subdivider.addQuilt(n.bezier_curves);
-
-        subdivider.endQuilts();
-        subdivider.drawCurves();
-        if (!playBack)
-          endrender();
-      } else {
-        if (!playBack)
-          endrender();
-        do_nurbserror(9);
-      }
-    }
-
-  }
-
-  /**
-   * Method for handling error codes
-   * 
-   * @param i
-   *            error code
-   */
-  private void do_nurbserror(int i) {
-    // TODO nurberror
-    //			System.out.println("TODO nurbserror " + i);
-  }
-
-  /**
-   * Begin rendering
-   */
-  private void bgnrender() {
-    // DONE
-    if (autoloadmode) {
-      loadGLMatrices();
-    }
-  }
-
-  /**
-   * Load matrices from OpenGL state machine
-   */
-  private void loadGLMatrices() {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO glunurbs.loadGLMatrices");
-  }
-
-  /**
-   * End rendering
-   */
-  private void endrender() {
-    // DONE
-  }
-
-  /**
-   * Make a NURBS curve
-   * 
-   * @param nknots
-   *            number of knots in knot vector
-   * @param knot
-   *            knot vector
-   * @param stride
-   *            number of control points coordinates
-   * @param ctlarray
-   *            control points
-   * @param order
-   *            order of the curve
-   * @param realType
-   *            type of the curve
-   */
-  public void nurbscurve(int nknots, float[] knot, int stride,
-                         float[] ctlarray, int order, int realType) {
-    // DONE
-    Mapdesc mapdesc = maplist.locate(realType);
-    if (mapdesc == null) {
-      do_nurbserror(35);
-      isDataValid = 0;
-      return;
-    }
-    if (ctlarray == null) {
-      do_nurbserror(36);
-      isDataValid = 0;
-      return;
-    }
-    if (stride < 0) {
-      do_nurbserror(34);
-      isDataValid = 0;
-      return;
-    }
-    Knotvector knots = new Knotvector(nknots, stride, order, knot);
-
-    if (!do_check_knots(knots, "curve"))
-      return;
-
-    O_nurbscurve o_nurbscurve = new O_nurbscurve(realType);
-    o_nurbscurve.bezier_curves = new Quilt(mapdesc);
-    CArrayOfFloats ctrlcarr = new CArrayOfFloats(ctlarray);
-    o_nurbscurve.bezier_curves.toBezier(knots, ctrlcarr, mapdesc
-                                        .getNCoords());
-    thread("do_nurbscurve", o_nurbscurve);
-  }
-
-  /**
-   * Check knot vector specification
-   * 
-   * @param knots
-   *            knot vector
-   * @param msg
-   *            error message
-   * @return knot vector is / is not valid
-   */
-  public boolean do_check_knots(Knotvector knots, String msg) {
-    // DONE
-    int status = knots.validate();
-    if (status > 0) {
-      do_nurbserror(status);
-      if (renderhints.errorchecking != NurbsConsts.N_NOMSG)
-        knots.show(msg);
-    }
-    return (status > 0) ? false : true;
-  }
-
-  /**
-   * Draw a curve
-   * 
-   * @param o_nurbscurve
-   *            NURBS curve object
-   */
-  public void do_nurbscurve(O_nurbscurve o_nurbscurve) {
-    // DONE
-
-    if (inCurve <= 0) {
-      bgncurve();
-      inCurve = 2;
-    }
-
-    if (o_nurbscurve.used) {
-      do_nurbserror(23);
-      isDataValid = 0;
-      return;
-    } else
-      o_nurbscurve.used = true;
-
-    if (currentCurve.curvetype == CT_NONE) {
-      currentCurve.curvetype = CT_NURBSCURVE;
-    } else if (currentCurve.curvetype != CT_NURBSCURVE) {
-      do_nurbserror(24);
-      isDataValid = 0;
-      return;
-    }
-
-    // it was necessary to overcome problem with pointer to pointer here
-
-    // if(!o_nurbscurve.equals(nextNurbscurve)){
-    if (!o_nurbscurve.equals(currentCurve.o_nurbscurve)) {
-      isCurveModified = 1;
-      currentCurve.o_nurbscurve = o_nurbscurve;
-      // nextNurbscurve=o_nurbscurve;
-
-    }
-
-    nextNurbscurve = o_nurbscurve.next;
-
-    if (!currentCurve.equals(o_nurbscurve.owner)) {
-      isCurveModified = 1;
-      o_nurbscurve.owner = currentCurve;
-    }
-
-    if (o_nurbscurve.owner == null)
-      isCurveModified = 1;
-
-    if (inCurve == 2)
-      endcurve();
-  }
-
-  /**
-   * Draw NURBS surface
-   * 
-   * @param o_nurbssurface
-   *            NURBS surface object
-   */
-  public void do_nurbssurface(O_nurbssurface o_nurbssurface) {
-    // DONE
-    if (inSurface <= 0) {
-      bgnsurface();
-      inSurface = 2;
-    }
-    if (o_nurbssurface.used) {
-      do_nurbserror(25);
-      isDataValid = 0;
-      return;
-    } else
-      o_nurbssurface.used = true;
-
-    if (!o_nurbssurface.equals(nextNurbscurve)) {
-      isSurfaceModified = true;
-      // nextNurbssurface=o_nurbssurface;
-      currentSurface.o_nurbssurface = o_nurbssurface;
-    }
-
-    if (!currentSurface.equals(o_nurbssurface.owner)) {
-      isSurfaceModified = true;
-      o_nurbssurface.owner = currentSurface;
-    }
-
-    nextNurbssurface = o_nurbssurface.next;
-
-    if (inSurface == 2)
-      endsurface();
-  }
-
-  /**
-   * (Re)Inicialize maps
-   */
-  public void redefineMaps() {
-    // DONE
-    maplist.initialize();
-  }
-
-  /**
-   * Define a map of given properties
-   * 
-   * @param type
-   *            map type
-   * @param rational
-   *            is rational
-   * @param ncoords
-   *            number of control point coordinates
-   */
-  public void defineMap(int type, int rational, int ncoords) {
-    // DONE
-    maplist.define(type, rational, ncoords);
-  }
-
-  /**
-   * Set NURBS property
-   * 
-   * @param type
-   *            property type
-   * @param tag
-   *            property tag
-   * @param value
-   *            property value
-   */
-  public void setnurbsproperty(int type, int tag, float value) {
-    // DONE
-    Mapdesc mapdesc = maplist.locate(type);
-    if (mapdesc == null) {
-      do_nurbserror(35);
-      return;
-    }
-    if (!mapdesc.isProperty(tag)) {
-      do_nurbserror(26);
-      return;
-    }
-    Property prop = new Property(type, tag, value);
-    thread("do_setnurbsproperty2", prop);
-  }
-
-  /**
-   * Set parameters of existing property
-   * 
-   * @param prop
-   *            property
-   */
-  public void do_setnurbsproperty2(Property prop) {
-    Mapdesc mapdesc = maplist.find(prop.type);
-    mapdesc.setProperty(prop.tag, prop.value);
-  }
-
-  /**
-   * Set given property to rendering hints
-   * 
-   * @param prop
-   *            property to be set
-   */
-  public void do_setnurbsproperty(Property prop) {
-    // DONE
-    renderhints.setProperty(prop);
-    // TODO freeproperty?
-  }
-
-  /**
-   * Sets wheteher we use domain distance sampling
-   * 
-   * @param i
-   *            domain distance sampling flag
-   */
-  public void set_is_domain_distance_sampling(int i) {
-    // DONE
-    subdivider.set_is_domain_distance_sampling(i);
-  }
-
-  /**
-   * Begin new surface
-   */
-  public void bgnsurface() {
-    // DONE
-    O_surface o_surface = new O_surface();
-    // TODO nuid
-    //			System.out.println("TODO glunurbs.bgnsurface nuid");
-    thread("do_bgnsurface", o_surface);
-  }
-
-  /**
-   * End current surface
-   */
-  public void endsurface() {
-    // DONE
-    thread2("do_endsurface");
-  }
-
-  /**
-   * End surface trimming
-   */
-  private void endtrim() {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO glunurbs.endtrim");
-  }
-
-  /**
-   * Make NURBS surface
-   * 
-   * @param sknot_count
-   *            number of knots in s direction
-   * @param sknot
-   *            knot vector in s direction
-   * @param tknot_count
-   *            number of knots in t direction
-   * @param tknot
-   *            knot vector in t direction
-   * @param s_stride
-   *            number of coords of control points in s direction
-   * @param t_stride
-   *            number of coords of control points in t direction
-   * @param ctlarray
-   *            control points
-   * @param sorder
-   *            order of curve in s direction
-   * @param torder
-   *            order of curve in t direction
-   * @param type
-   *            NURBS surface type (rational,...)
-   */
-  public void nurbssurface(int sknot_count, float[] sknot, int tknot_count,
-                           float[] tknot, int s_stride, int t_stride, float[] ctlarray,
-                           int sorder, int torder, int type) {
-    // DONE
-    Mapdesc mapdesc = maplist.locate(type);
-    if (mapdesc == null) {
-      do_nurbserror(35);
-      isDataValid = 0;
-      return;
-    }
-    if (s_stride < 0 || t_stride < 0) {
-      do_nurbserror(34);
-      isDataValid = 0;
-      return;
-    }
-    Knotvector sknotvector = new Knotvector(sknot_count, s_stride, sorder,
-                                            sknot);
-    if (!do_check_knots(sknotvector, "surface"))
-      return;
-    Knotvector tknotvector = new Knotvector(tknot_count, t_stride, torder,
-                                            tknot);
-    if (!do_check_knots(tknotvector, "surface"))
-      return;
-
-    O_nurbssurface o_nurbssurface = new O_nurbssurface(type);
-    o_nurbssurface.bezier_patches = new Quilt(mapdesc);
-
-    CArrayOfFloats ctrlarr = new CArrayOfFloats(ctlarray);
-    o_nurbssurface.bezier_patches.toBezier(sknotvector, tknotvector,
-                                           ctrlarr, mapdesc.getNCoords());
-    thread("do_nurbssurface", o_nurbssurface);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/BuildMipmap.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/BuildMipmap.java
deleted file mode 100644
index 42f55f9..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/BuildMipmap.java
+++ /dev/null
@@ -1,1597 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import javax.media.opengl.glu.GLU;
-import com.jogamp.opengl.impl.Debug;
-import com.jogamp.common.nio.Buffers;
-import java.nio.*;
-import java.io.*;
-
-/**
- *
- * @author  Administrator
- */
-public class BuildMipmap {
-
-  private static final boolean DEBUG = Debug.debug("BuildMipmap");
-  private static final boolean VERBOSE = Debug.verbose();
-
-  /** Creates a new instance of BuildMipmap */
-  public BuildMipmap() {
-  }
-  
-  public static int gluBuild1DMipmapLevelsCore( GL gl, int target, int internalFormat,
-                  int width, int widthPowerOf2, int format, int type, int userLevel,
-                  int baseLevel, int maxLevel, ByteBuffer data ) {
-    int newwidth;
-    int level, levels;
-    ShortBuffer newImage = null;
-    int newImage_width;
-    ShortBuffer otherImage = null;
-    ShortBuffer imageTemp = null;
-    int memReq;
-    int maxsize;
-    int cmpts;
-    PixelStorageModes psm = new PixelStorageModes();
-    
-    assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
-    assert( width >= 1 );
-    
-    newwidth = widthPowerOf2;
-    levels = Mipmap.computeLog( newwidth );
-    
-    levels += userLevel;
-    
-    Mipmap.retrieveStoreModes( gl, psm );
-    try {
-      newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, 1, format, 
-            GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
-    } catch( OutOfMemoryError ome ) {
-      return( GLU.GLU_OUT_OF_MEMORY );
-    }
-    newImage_width = width;
-    
-    Image.fill_image( psm, width, 1, format, type, Mipmap.is_index( format ), data, newImage );
-    cmpts = Mipmap.elements_per_group( format, type );
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-    
-    // if swap_bytes was set, swapping occurred in fill_image
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-    
-    for( level = userLevel; level <= levels; level++ ) {
-      if( newImage_width == newwidth ) {
-        // user newimage for this level
-        if( baseLevel <= level && level <= maxLevel ) {
-          gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0, format,
-                        GL2.GL_UNSIGNED_SHORT, newImage );
-        }
-      } else {
-        if( otherImage == null ) {
-          memReq = Mipmap.image_size( newwidth, 1, format, GL2.GL_UNSIGNED_SHORT );
-          try {
-            otherImage = Buffers.newDirectByteBuffer( memReq ).asShortBuffer();
-          } catch( OutOfMemoryError ome ) {
-            gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-            gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-            return( GLU.GLU_OUT_OF_MEMORY );
-          }
-        }
-        ScaleInternal.scale_internal( cmpts, newImage_width, 1, newImage, newwidth, 1, otherImage );
-        // swap newImage and otherImage
-        imageTemp = otherImage;
-        otherImage = newImage;
-        newImage = imageTemp;
-        
-        newImage_width = newwidth;
-        if( baseLevel <= level && level <= maxLevel ) {
-          gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0, 
-                            format, GL2.GL_UNSIGNED_SHORT, newImage );
-        }
-      }
-      if( newwidth > 1 ) {
-        newwidth /= 2;
-      }
-    }
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-    
-    return( 0 );
-  }
-  
-  public static int bitmapBuild2DMipmaps( GL gl, int target, int internalFormat,
-            int width, int height, int format, int type, ByteBuffer data ) {
-    int newwidth[] = new int[1];
-    int newheight[] = new int[1];
-    int level, levels;
-    ShortBuffer newImage = null;
-    int newImage_width;
-    int newImage_height;
-    ShortBuffer otherImage = null;
-    ShortBuffer tempImage = null;
-    int memReq;
-    int maxsize;
-    int cmpts;
-    PixelStorageModes psm = new PixelStorageModes();
-    
-    Mipmap.retrieveStoreModes( gl, psm );
-    
-    Mipmap.closestFit( gl, target, width, height, internalFormat, format, type, newwidth, newheight );
-    
-    levels = Mipmap.computeLog( newwidth[0] );
-    level = Mipmap.computeLog( newheight[0] );
-    if( level > levels ) {
-      levels = level;
-    }
-    
-    try {
-      newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, height, 
-            format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
-    } catch( OutOfMemoryError ome ) {
-      return( GLU.GLU_OUT_OF_MEMORY );
-    }
-    newImage_width = width;
-    newImage_height = height;
-    
-    Image.fill_image( psm, width, height, format, type, Mipmap.is_index( format ), data, newImage );
-    
-    cmpts = Mipmap.elements_per_group( format, type );
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-    
-    // if swap_bytes is set, swapping occurred in fill_image
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-    
-    for( level = 0; level < levels; level++ ) {
-      if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
-        newImage.rewind();
-        gl.glTexImage2D( target, level, internalFormat, newImage_width,
-            newImage_height, 0, format, GL2.GL_UNSIGNED_SHORT, newImage );
-      } else {
-        if( otherImage == null ) {
-          memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_SHORT );
-          try {
-            otherImage = Buffers.newDirectByteBuffer( memReq ).asShortBuffer();
-          } catch( OutOfMemoryError ome ) {
-            gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-            gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-            return( GLU.GLU_OUT_OF_MEMORY );
-          }
-        }
-        ScaleInternal.scale_internal( cmpts, newImage_width, newImage_height, 
-                              newImage, newwidth[0], newheight[0], otherImage );
-        // swap newImage and otherImage
-        tempImage = otherImage;
-        otherImage = newImage;
-        newImage = tempImage;
-        
-        newImage_width = newwidth[0];
-        newImage_height = newheight[0];
-        newImage.rewind();
-        gl.glTexImage2D( target, level, internalFormat, newImage_width, newImage_height,
-                                    0, format, GL2.GL_UNSIGNED_SHORT, newImage );
-      }
-      if( newheight[0] > 1 ) {
-        newwidth[0] /= 2;
-      }
-      if( newheight[0] > 1 ) {
-        newheight[0] /= 2;
-      }
-    }
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-    
-    return( 0 );
-  }
-  
-  public static int gluBuild2DMipmapLevelsCore( GL gl, int target, int internalFormat,
-                int width, int height, int widthPowerOf2, int heightPowerOf2,
-                int format, int type, int userLevel, int baseLevel, int maxLevel,
-                ByteBuffer data ) { // PointerWrapper data
-    int newwidth;
-    int newheight;
-    int level, levels;
-    int usersImage;
-    ByteBuffer srcImage = null;
-    ByteBuffer dstImage = null;
-    ByteBuffer tempImage = null;
-    int newImage_width;
-    int newImage_height;
-    short[] SWAP_IMAGE = null;
-    int memReq;
-    int maxsize;
-    int cmpts;
-    int mark=-1;
-    
-    boolean myswap_bytes;
-    int groups_per_line, element_size, group_size;
-    int rowsize, padding;
-    PixelStorageModes psm = new PixelStorageModes();
-    
-    assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
-    assert( width >= 1 && height >= 1 );
-    
-    if( type == GL2.GL_BITMAP ) {
-      return( bitmapBuild2DMipmaps( gl, target, internalFormat, width, height, format, type, data ) );
-    }
-    
-    newwidth = widthPowerOf2;
-    newheight = heightPowerOf2;
-    levels = Mipmap.computeLog( newwidth );
-    level = Mipmap.computeLog( newheight );
-    if( level > levels ) {
-      levels = level;
-    }
-    
-    levels += userLevel;
-    
-    Mipmap.retrieveStoreModes( gl, psm );
-    myswap_bytes = psm.getUnpackSwapBytes();
-    cmpts = Mipmap.elements_per_group( format, type );
-    if( psm.getUnpackRowLength() > 0 ) {
-      groups_per_line = psm.getUnpackRowLength();
-    } else {
-      groups_per_line = width;
-    }
-    
-    element_size = Mipmap.bytes_per_element( type );
-    group_size = element_size * cmpts;
-    if( element_size == 1 ) {
-      myswap_bytes = false;
-    }
-    
-    rowsize = groups_per_line * group_size;
-    padding = ( rowsize % psm.getUnpackAlignment() );
-    if( padding != 0 ) {
-      rowsize += psm.getUnpackAlignment() - padding;
-    }
-    
-    mark = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
-    data.position( mark );
-    
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-    
-    level = userLevel;
-    
-    // already power of two square
-    if( width == newwidth && height == newheight ) {
-      // use usersImage for level userLevel
-      if( baseLevel <= level && level <= maxLevel ) {
-        data.rewind();
-        gl.glTexImage2D( target, level, internalFormat, width, height, 0, format, type, data );
-      }
-      if( levels == 0 ) { /* we're done. clean up and return */
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-        return( 0 );
-      }
-      int nextWidth = newwidth / 2;
-      int nextHeight = newheight / 2;
-      
-      // clamp to 1
-      if( nextWidth < 1 ) {
-        nextWidth = 1;
-      }
-      if( nextHeight < 1 ) {
-        nextHeight = 1;
-      }
-      memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
-      
-      try {
-        switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-            dstImage = Buffers.newDirectByteBuffer( memReq );
-            break;
-          default:
-            return( GLU.GLU_INVALID_ENUM );
-        }
-      } catch( OutOfMemoryError ome ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-        return( GLU.GLU_OUT_OF_MEMORY );
-      }
-      if( dstImage != null ) {
-        switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-            HalveImage.halveImage_ubyte( cmpts, width, height, data, dstImage, element_size, rowsize, group_size );
-            break;
-          case( GL2.GL_BYTE ):
-            HalveImage.halveImage_byte( cmpts, width, height, data, dstImage, element_size, rowsize, group_size );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT ):
-            HalveImage.halveImage_ushort( cmpts, width, height, data, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
-            break;
-          case( GL2.GL_SHORT ):
-            HalveImage.halveImage_short( cmpts, width, height, data, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_INT ):
-            HalveImage.halveImage_uint( cmpts, width, height, data, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
-            break;
-          case( GL2.GL_INT ):
-            HalveImage.halveImage_int( cmpts, width, height, data, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
-            break;
-          case( GL2.GL_FLOAT ):
-            HalveImage.halveImage_float( cmpts, width, height, data, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-            assert( format == GL2.GL_RGB );
-            HalveImage.halveImagePackedPixel( 3, new Extract332(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-            assert( format == GL2.GL_RGB );
-            HalveImage.halveImagePackedPixel( 3, new Extract233rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-            HalveImage.halveImagePackedPixel( 3, new Extract565(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-            HalveImage.halveImagePackedPixel( 3, new Extract565rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-            HalveImage.halveImagePackedPixel( 4, new Extract4444(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-            HalveImage.halveImagePackedPixel( 4, new Extract4444rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-            HalveImage.halveImagePackedPixel( 4, new Extract5551(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-            HalveImage.halveImagePackedPixel( 4, new Extract1555rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-            HalveImage.halveImagePackedPixel( 4, new Extract8888(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-            HalveImage.halveImagePackedPixel( 4, new Extract8888rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-            HalveImage.halveImagePackedPixel( 4, new Extract1010102(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-            HalveImage.halveImagePackedPixel( 4, new Extract2101010rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-          default:
-            assert( false );
-            break;
-        }
-      }
-      newwidth = width / 2;
-      newheight = height / 2;
-      // clamp to 1
-      if( newwidth < 1 ) {
-        newwidth = 1;
-      }
-      if( newheight < 1 ) {
-        newheight = 1;
-      }
-      
-      myswap_bytes = false;
-      rowsize = newwidth * group_size;
-      memReq = Mipmap.image_size( newwidth, newheight, format, type );
-      // swap srcImage and dstImage
-      tempImage = srcImage;
-      srcImage = dstImage;
-      dstImage = tempImage;
-      try {
-        switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-            dstImage = Buffers.newDirectByteBuffer( memReq );
-            break;
-          default:
-            return( GLU.GLU_INVALID_ENUM );
-        }
-      } catch( OutOfMemoryError ome ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-        return( GLU.GLU_OUT_OF_MEMORY );
-      }
-      // level userLevel+1 is in srcImage; level userLevel already saved
-      level = userLevel + 1;
-    } else { // user's image is not nice powerof2 size square
-      memReq = Mipmap.image_size( newwidth, newheight, format, type );
-      try { 
-        switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-            dstImage = Buffers.newDirectByteBuffer( memReq );
-            break;
-          default:
-            return( GLU.GLU_INVALID_ENUM );
-        }
-      } catch( OutOfMemoryError ome ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-        return( GLU.GLU_OUT_OF_MEMORY );
-      }
-      data.position( mark );
-      switch( type ) {
-        case( GL2.GL_UNSIGNED_BYTE ):
-          ScaleInternal.scale_internal_ubyte( cmpts, width, height, data, 
-                newwidth, newheight, dstImage, element_size, rowsize, group_size );
-          break;
-        case( GL2.GL_BYTE ):
-          ScaleInternal.scale_internal_byte( cmpts, width, height, data, newwidth, 
-                  newheight, dstImage, element_size, rowsize, group_size );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT ):
-          ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth, 
-                  newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
-          break;
-        case( GL2.GL_SHORT ):
-          ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
-                  newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_INT ):
-          ScaleInternal.scale_internal_uint( cmpts, width, height, data, newwidth,
-                  newheight, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
-          break;
-        case( GL2.GL_INT ):
-          ScaleInternal.scale_internal_int( cmpts, width, height, data, newwidth,
-                  newheight, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
-          break;
-        case( GL2.GL_FLOAT ):
-          ScaleInternal.scale_internal_float( cmpts, width, height, data, newwidth,
-                  newheight, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          ScaleInternal.scaleInternalPackedPixel( 3, new Extract332(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          ScaleInternal.scaleInternalPackedPixel( 3, new Extract233rev(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          ScaleInternal.scaleInternalPackedPixel( 3, new Extract565(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          ScaleInternal.scaleInternalPackedPixel( 3, new Extract565rev(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          ScaleInternal.scaleInternalPackedPixel( 4, new Extract4444(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          ScaleInternal.scaleInternalPackedPixel( 4, new Extract4444rev(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          ScaleInternal.scaleInternalPackedPixel( 4, new Extract5551(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          ScaleInternal.scaleInternalPackedPixel( 4, new Extract1555rev(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          ScaleInternal.scaleInternalPackedPixel( 4, new Extract8888(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          ScaleInternal.scaleInternalPackedPixel( 4, new Extract8888rev(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          ScaleInternal.scaleInternalPackedPixel( 4, new Extract1010102(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-          ScaleInternal.scaleInternalPackedPixel( 4, new Extract2101010rev(), width, height, data, newwidth,
-              newheight, dstImage, element_size, rowsize, myswap_bytes );
-          break;
-        default:
-          assert( false );
-          break;
-      }
-      myswap_bytes = false;
-      rowsize = newwidth * group_size;
-      // swap dstImage and srcImage
-      tempImage = srcImage;
-      srcImage = dstImage;
-      dstImage = tempImage;
-      
-      if( levels != 0 ) { // use as little memory as possible
-        int nextWidth = newwidth / 2;
-        int nextHeight = newheight / 2;
-        if( nextWidth < 1 ) {
-          nextWidth = 1;
-        }
-        if( nextHeight < 1 ) {
-          nextHeight = 1;
-        }
-        
-        memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
-        try {
-          switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE ):
-            case( GL2.GL_BYTE ):
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_INT ):
-            case( GL2.GL_FLOAT ):
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-              dstImage = Buffers.newDirectByteBuffer( memReq );
-              break;
-            default:
-              return( GLU.GLU_INVALID_ENUM );
-          }
-        } catch( OutOfMemoryError ome ) {
-          gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-          gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-          return( GLU.GLU_OUT_OF_MEMORY );
-        }
-      }
-      // level userLevel is in srcImage; nothing saved yet
-      level = userLevel;
-    }
-    
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-    if( baseLevel <= level && level <= maxLevel ) {
-      srcImage.rewind();
-      gl.glTexImage2D( target, level, internalFormat, newwidth, newheight, 0, format, type, srcImage );
-      if (DEBUG) {
-        System.err.println("GL Error(" + level + "): " + gl.glGetError() );
-        if (VERBOSE) {
-          srcImage.limit( Mipmap.image_size( newwidth, newheight, format, type ) );
-          writeTargaFile("glu2DMipmapJ" + level + ".tga",
-                         srcImage, newwidth, newheight);
-          srcImage.clear();
-        }
-      }
-    }
-    
-    level++;  // update current level for the loop
-    for( ; level <= levels; level++ ) {
-      srcImage.rewind();
-      dstImage.rewind();
-      switch( type ) {
-        case( GL2.GL_UNSIGNED_BYTE ):
-          HalveImage.halveImage_ubyte( cmpts, newwidth, newheight, srcImage, dstImage, element_size, rowsize, group_size );
-          break;
-        case( GL2.GL_BYTE ):
-          HalveImage.halveImage_byte( cmpts, newwidth, newheight, srcImage, dstImage, element_size, rowsize, group_size );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT ):
-          HalveImage.halveImage_ushort( cmpts, newwidth, newheight, srcImage, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
-          break;
-        case( GL2.GL_SHORT ):
-          HalveImage.halveImage_short( cmpts, newwidth, newheight, srcImage, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_INT ):
-          HalveImage.halveImage_uint( cmpts, newwidth, newheight, srcImage, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
-          break;
-        case( GL2.GL_INT ):
-          HalveImage.halveImage_int( cmpts, newwidth, newheight, srcImage, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
-          break;
-        case( GL2.GL_FLOAT ):
-          HalveImage.halveImage_float( cmpts, newwidth, newheight, srcImage, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
-          break;
-        case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          assert( format == GL2.GL_RGB );
-          HalveImage.halveImagePackedPixel( 3, new Extract332(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          assert( format == GL2.GL_RGB );
-          HalveImage.halveImagePackedPixel( 3, new Extract233rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          HalveImage.halveImagePackedPixel( 3, new Extract565(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          HalveImage.halveImagePackedPixel( 3, new Extract565rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          HalveImage.halveImagePackedPixel( 4, new Extract4444(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          HalveImage.halveImagePackedPixel( 4, new Extract4444rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          HalveImage.halveImagePackedPixel( 4, new Extract5551(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          HalveImage.halveImagePackedPixel( 4, new Extract1555rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          HalveImage.halveImagePackedPixel( 4, new Extract8888(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          HalveImage.halveImagePackedPixel( 4, new Extract8888rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          HalveImage.halveImagePackedPixel( 4, new Extract1010102(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-          HalveImage.halveImagePackedPixel( 4, new Extract2101010rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
-            break;
-        default:
-          assert( false );
-          break;
-      }
-      
-      // swap dstImage and srcImage
-      tempImage = srcImage;
-      srcImage = dstImage;
-      dstImage = tempImage;
-      
-      if( newwidth > 1 ) {
-        newwidth /= 2;
-        rowsize /= 2;
-      }
-      if( newheight > 1 ) {
-        newheight /= 2;
-      }
-      // compute amount to pad per row if any
-      int rowPad = rowsize % psm.getUnpackAlignment();
-      
-      // should row be padded
-      if( rowPad == 0 ) {
-        // call teximage with srcImage untouched since its not padded
-        if( baseLevel <= level && level <= maxLevel ) {
-          srcImage.rewind();
-          gl.glTexImage2D( target, level, internalFormat, newwidth, newheight, 0, format, type, srcImage );
-          if (DEBUG) {
-            System.err.println("GL Error(" + level + "): " + gl.glGetError() );
-            if (VERBOSE) {
-              srcImage.limit( Mipmap.image_size( newwidth, newheight, format, type ) );
-              writeTargaFile("glu2DMipmapJ" + level + ".tga",
-                             srcImage, newwidth, newheight);
-              srcImage.clear();
-            }
-          }
-        }
-      } else {
-        // compute length of new row in bytes, including padding
-        int newRowLength = rowsize + psm.getUnpackAlignment() - rowPad;
-        int ii, jj;
-        int dstTrav;
-        int srcTrav;
-        
-        // allocate new image for mipmap of size newRowLength x newheight
-        ByteBuffer newMipmapImage = null;
-        try {
-          newMipmapImage = ByteBuffer.allocateDirect( newRowLength * newheight );
-        } catch( OutOfMemoryError ome ) {
-          gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-          gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-          return( GLU.GLU_OUT_OF_MEMORY );
-        }
-        srcImage.rewind();
-        // copy image from srcImage into newMipmapImage by rows
-        for( ii = 0; ii < newheight; ii++ ) {
-          newMipmapImage.position(newRowLength * ii);
-          for( jj = 0; jj < rowsize; jj++ ) {
-            newMipmapImage.put( srcImage.get() );
-          }
-        }
-        
-        // and use this new image for mipmapping instead
-        if( baseLevel <= level && level <= maxLevel ) {
-          newMipmapImage.rewind();
-          gl.glTexImage2D( target, level, internalFormat, newwidth, newheight, 0, format, type, newMipmapImage );
-          if (DEBUG) {
-            System.err.println("GL Error(" + level + " padded): " + gl.glGetError() );
-            if (VERBOSE) {
-              writeTargaFile("glu2DMipmapJ" + level + ".tga",
-                             newMipmapImage, newwidth, newheight);
-            }
-          }
-        }
-      }
-    }
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-    
-    return( 0 );
-  }
-  
-  public static int fastBuild2DMipmaps( GL gl, PixelStorageModes psm, int target,
-          int components, int width, int height, int format, int type, ByteBuffer data ) {
-    int[] newwidth = new int[1];
-    int[] newheight = new int[1];
-    int level, levels;
-    ByteBuffer newImage;
-    int newImage_width;
-    int newImage_height;
-    ByteBuffer otherImage;
-    ByteBuffer imageTemp;
-    int memReq;
-    int maxsize;
-    int cmpts;
-    
-    Mipmap.closestFit( gl, target, width, height, components, format, type, newwidth, 
-            newheight );
-    
-    levels = Mipmap.computeLog( newwidth[0] );
-    level = Mipmap.computeLog( newheight[0] );
-    if( level > levels ) {
-      levels = level;
-    }
-    
-    cmpts = Mipmap.elements_per_group( format, type );
-    
-    otherImage = null;
-    //  No need to copy the user data if its packed correctly.
-    //  Make sure that later routines don't change that data.
-    
-    if( psm.getUnpackSkipRows() == 0 && psm.getUnpackSkipPixels() == 0 ) {
-      newImage = data;
-      newImage_width = width;
-      newImage_height = height;
-    } else {
-      int rowsize;
-      int group_per_line;
-      int elements_per_line;
-      int start;
-      int iter;
-      int iter2;
-      int i, j;
-      
-      try {
-        newImage = Buffers.newDirectByteBuffer( Mipmap.image_size(width, height, format, GL2.GL_UNSIGNED_BYTE ) );
-      } catch( OutOfMemoryError err ) {
-        return( GLU.GLU_OUT_OF_MEMORY );
-      }
-      newImage_width = width;
-      newImage_height = height;
-
-      // Abbreviated version of fill_image for the restricted case.
-      if( psm.getUnpackRowLength() > 0 ) {
-        group_per_line = psm.getUnpackRowLength();
-      } else {
-        group_per_line = width;
-      }
-      rowsize = group_per_line * cmpts;
-      elements_per_line = width * cmpts;
-      start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * cmpts;
-      
-      for( i = 0; i < height; i++ ) {
-        iter = start;
-        data.position( iter );
-        for( j = 0; j < elements_per_line; j++ ) {
-          newImage.put( data.get() );
-        }
-        start += rowsize;
-      }
-    }
-    
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 1 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-    
-    for( level = 0; level <= levels; level++ ) {
-      if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
-        // use newImage for this level
-        newImage.rewind();
-        gl.glTexImage2D( target, level, components, newImage_width, newImage_height,
-                0, format, GL2.GL_UNSIGNED_BYTE, newImage );
-      } else {
-        if( otherImage == null ) {
-          memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_BYTE );
-          try {
-            otherImage = Buffers.newDirectByteBuffer( memReq );
-          } catch( OutOfMemoryError err ) {
-            gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-            gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
-            return( GLU.GLU_OUT_OF_MEMORY );
-          }
-        }
-        // swap newImage and otherImage
-        imageTemp = otherImage;
-        otherImage = newImage;
-        newImage = imageTemp;
-        
-        newImage_width = newwidth[0];
-        newImage_height = newheight[0];
-        newImage.rewind();
-        gl.glTexImage2D( target, level, components, newImage_width, newImage_height,
-                0, format, GL2.GL_UNSIGNED_BYTE, newImage );
-      }
-      if( newwidth[0] > 1 ) {
-        newwidth[0] /= 2;
-      }
-      if( newheight[0] > 1 ) {
-        newheight[0] /= 2;
-      }
-    }
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
-    
-    return( 0 );
-  }
-  
-  public static int gluBuild3DMipmapLevelsCore( GL gl, int target, int internalFormat,
-          int width, int height, int depth, int widthPowerOf2, int heightPowerOf2,
-          int depthPowerOf2, int format, int type, int userLevel, int baseLevel,
-          int maxLevel, ByteBuffer data ) {
-    int newWidth;
-    int newHeight;
-    int newDepth;
-    int level, levels;
-    ByteBuffer usersImage;
-    ByteBuffer srcImage, dstImage, tempImage;
-    int newImageWidth;
-    int newImageHeight;
-    int newImageDepth;
-    int memReq;
-    int maxSize;
-    int cmpts;
-    int mark=-1;
-    
-    boolean myswapBytes;
-    int groupsPerLine, elementSize, groupSize;
-    int rowsPerImage, imageSize;
-    int rowSize, padding;
-    PixelStorageModes psm = new PixelStorageModes();
-    
-    assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
-    assert( width >= 1 && height >= 1 && depth >= 1 );
-    assert( type != GL2.GL_BITMAP );
-    
-    srcImage = dstImage = null;
-    
-    newWidth = widthPowerOf2;
-    newHeight = heightPowerOf2;
-    newDepth = depthPowerOf2;
-    levels = Mipmap.computeLog( newWidth );
-    level = Mipmap.computeLog( newHeight );
-    if( level > levels ) {
-      levels = level;
-    }
-    level = Mipmap.computeLog( newDepth );
-    if( level > levels ) {
-      levels = level;
-    }
-    
-    levels += userLevel;
-    
-    Mipmap.retrieveStoreModes3D( gl, psm );
-    myswapBytes = psm.getUnpackSwapBytes();
-    cmpts = Mipmap.elements_per_group( format, type );
-    if( psm.getUnpackRowLength() > 0 ) {
-      groupsPerLine = psm.getUnpackRowLength();
-    } else {
-      groupsPerLine = width;
-    }
-    
-    elementSize = Mipmap.bytes_per_element( type );
-    groupSize = elementSize * cmpts;
-    if( elementSize == 1 ) {
-      myswapBytes = false;
-    }
-    
-    // 3dstuff
-    if( psm.getUnpackImageHeight() > 0 ) {
-      rowsPerImage = psm.getUnpackImageHeight();
-    } else {
-      rowsPerImage = height;
-    }
-    
-    rowSize = groupsPerLine * groupSize;
-    padding = ( rowSize % psm.getUnpackAlignment() );
-    if( padding != 0 ) {
-      rowSize += psm.getUnpackAlignment() - padding;
-    }
-    
-    imageSize = rowsPerImage * rowSize;
-    
-    usersImage = ByteBuffer.wrap(data.array());
-    mark = psm.getUnpackSkipRows() * rowSize +
-           psm.getUnpackSkipPixels() * groupSize +
-           psm.getUnpackSkipImages() * imageSize;
-    usersImage.position( mark );
-    
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, 0 );
-    
-    level = userLevel;
-    
-    if( width == newWidth && height == newHeight && depth == newDepth ) {
-      // use usersImage for level userlevel
-      if( baseLevel <= level && level <= maxLevel ) {
-        gl.getGL2().glTexImage3D( target, level, internalFormat, width, height, depth,
-                0, format, type, usersImage );
-      }
-      if( levels == 0 ) { /* we're done. clean up and return */
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
-        return( 0 );
-      }
-      int nextWidth = newWidth / 2;
-      int nextHeight = newHeight / 2;
-      int nextDepth = newDepth / 2;
-      
-      // clamp to one
-      if( nextWidth < 1 ) {
-        nextWidth = 1;
-      }
-      if( nextHeight < 1 ) {
-        nextHeight = 1;
-      }
-      if( nextDepth < 1 ) {
-        nextDepth = 1;
-      }
-      memReq = Mipmap.imageSize3D( nextWidth, nextHeight, nextDepth, format, type );
-      try {
-        switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-            dstImage = Buffers.newDirectByteBuffer( memReq );
-            break;
-          default:
-            return( GLU.GLU_INVALID_ENUM );
-        }
-      } catch( OutOfMemoryError err ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
-        return( GLU.GLU_OUT_OF_MEMORY );
-      }
-      
-      if( dstImage != null ) {
-        switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-            if( depth > 1 ) {
-              HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
-                      usersImage, dstImage, elementSize, 
-                      groupSize, rowSize, imageSize, myswapBytes );
-            } else {
-              HalveImage.halveImage_ubyte( cmpts, width, height, usersImage,
-                      dstImage, elementSize, rowSize, groupSize );
-            }
-            break;
-          case( GL2.GL_BYTE ):
-            if( depth > 1 ) {
-              HalveImage.halveImage3D( cmpts, new ExtractSByte(), width, height, depth,
-                      usersImage, dstImage, elementSize, groupSize, rowSize,
-                      imageSize, myswapBytes );
-            } else {
-              HalveImage.halveImage_byte( cmpts, width, height, usersImage,
-                      dstImage, elementSize, rowSize, groupSize );
-            }
-            break;
-          case( GL2.GL_UNSIGNED_SHORT ):
-            if( depth > 1 ) {
-              HalveImage.halveImage3D( cmpts, new ExtractUShort(), width, height, depth,
-                      usersImage, dstImage, elementSize, groupSize, rowSize,
-                      imageSize, myswapBytes );
-            } else {
-              HalveImage.halveImage_ushort( cmpts, width, height, usersImage, 
-                      dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
-            }
-            break;
-          case( GL2.GL_SHORT ):
-            if( depth > 1 ) {
-              HalveImage.halveImage3D( cmpts, new ExtractSShort(), width, height, depth,
-                      usersImage, dstImage, elementSize, groupSize, rowSize,
-                      imageSize, myswapBytes );
-            } else {
-              HalveImage.halveImage_short( cmpts, width, height, usersImage,
-                      dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
-            }
-            break;
-          case( GL2.GL_UNSIGNED_INT ):
-            if( depth > 1 ) {
-              HalveImage.halveImage3D( cmpts, new ExtractUInt(), width, height, depth,
-                      usersImage, dstImage, elementSize, groupSize, rowSize,
-                      imageSize, myswapBytes );
-            } else {
-              HalveImage.halveImage_uint( cmpts, width, height, usersImage,
-                      dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
-            }
-            break;
-          case( GL2.GL_INT ):
-            if( depth > 1 ) {
-              HalveImage.halveImage3D( cmpts, new ExtractSInt(), width, height, depth,
-                      usersImage, dstImage, elementSize, groupSize, rowSize,
-                      imageSize, myswapBytes );
-            } else {
-              HalveImage.halveImage_int( cmpts, width, height, usersImage,
-                      dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
-            }
-            break;
-          case( GL2.GL_FLOAT ):
-            if( depth > 1 ) {
-              HalveImage.halveImage3D( cmpts, new ExtractFloat(), width, height, depth,
-                      usersImage, dstImage, elementSize, groupSize, rowSize,
-                      imageSize, myswapBytes );
-            } else {
-              HalveImage.halveImage_float( cmpts, width, height, usersImage,
-                      dstImage.asFloatBuffer(), elementSize, rowSize, groupSize, myswapBytes );
-            }
-            break;
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-            assert( format == GL2.GL_RGB );
-            HalveImage.halveImagePackedPixel3D( 3, new Extract332(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-            assert( format == GL2.GL_RGB );
-            HalveImage.halveImagePackedPixel3D( 3, new Extract233rev(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-            HalveImage.halveImagePackedPixel3D( 3, new Extract565(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-            HalveImage.halveImagePackedPixel3D( 3, new Extract565rev(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-            HalveImage.halveImagePackedPixel3D( 4, new Extract4444(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-            HalveImage.halveImagePackedPixel3D( 4, new Extract4444rev(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-            HalveImage.halveImagePackedPixel3D( 4, new Extract5551(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-            HalveImage.halveImagePackedPixel3D( 4, new Extract1555rev(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-            HalveImage.halveImagePackedPixel3D( 4, new Extract8888(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-            HalveImage.halveImagePackedPixel3D( 4, new Extract8888rev(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-            HalveImage.halveImagePackedPixel3D( 4, new Extract1010102(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-            HalveImage.halveImagePackedPixel3D( 4, new Extract2101010rev(), width, height, depth, usersImage,
-                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
-            break;
-          default:
-            assert( false );
-            break;
-        }
-      }
-      newWidth = width / 2;
-      newHeight = height / 2;
-      newDepth = depth / 2;
-      // clamp to 1
-      if( newWidth < 1 ) {
-        newWidth = 1;
-      }
-      if( newHeight < 1 ) {
-        newHeight = 1;
-      }
-      if( newDepth < 1 ) {
-        newDepth = 1;
-      }
-      
-      myswapBytes = false;
-      rowSize = newWidth * groupSize;
-      imageSize = rowSize * newHeight;
-      memReq = Mipmap.imageSize3D( newWidth, newHeight, newDepth, format, type );
-      // swap srcImage and dstImage
-      tempImage = srcImage;
-      srcImage = dstImage;
-      dstImage = tempImage;
-      try {
-        switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-            dstImage = Buffers.newDirectByteBuffer( memReq );
-            break;
-          default:
-            return( GLU.GLU_INVALID_ENUM );
-        }
-      } catch( OutOfMemoryError err ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
-        return( GLU.GLU_OUT_OF_MEMORY );
-      }
-      
-      // level userLevel + 1 is in srcImage; level userLevel already saved
-      level = userLevel + 1;
-    } else {
-      memReq = Mipmap.imageSize3D( newWidth, newHeight, newDepth, format, type );
-      try {
-        switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-            dstImage = Buffers.newDirectByteBuffer( memReq );
-            break;
-          default:
-            return( GLU.GLU_INVALID_ENUM );
-        }
-      } catch( OutOfMemoryError err ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
-        return( GLU.GLU_OUT_OF_MEMORY );
-      }
-      
-      ScaleInternal.gluScaleImage3D( gl, format, width, height, depth, type,
-              usersImage, newWidth, newHeight, newDepth, type, dstImage );
-      
-      myswapBytes = false;
-      rowSize = newWidth * groupSize;
-      imageSize = rowSize * newHeight;
-      // swap dstImage and srcImage
-      tempImage = srcImage;
-      srcImage = dstImage;
-      dstImage = tempImage;
-      
-      if( levels != 0 ) {
-        int nextWidth = newWidth / 2;
-        int nextHeight = newHeight / 2;
-        int nextDepth = newDepth / 2;
-        if( nextWidth < 1 ) {
-          nextWidth = 1;
-        }
-        if( nextHeight < 1 ) {
-          nextHeight = 1;
-        }
-        if( nextDepth < 1 ) {
-          nextDepth = 1;
-        }
-        memReq = Mipmap.imageSize3D( nextWidth, nextHeight, nextDepth, format, type );
-        try {
-          switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE ):
-            case( GL2.GL_BYTE ):
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_INT ):
-            case( GL2.GL_FLOAT ):
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-              dstImage = Buffers.newDirectByteBuffer( memReq );
-              break;
-            default:
-              return( GLU.GLU_INVALID_ENUM );
-          }
-        } catch( OutOfMemoryError err ) {
-          gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-          gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-          gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
-          return( GLU.GLU_OUT_OF_MEMORY );
-        }
-      }
-      // level userLevel is in srcImage; nothing saved yet
-      level = userLevel;
-    }
-    
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-    if( baseLevel <= level && level <= maxLevel ) {
-      usersImage.position( mark );
-      gl.getGL2().glTexImage3D( target, level, internalFormat, width, height, depth,
-              0, format, type, usersImage );
-    }
-    level++;
-    for( ; level <= levels; level++ ) {
-      switch( type ) {
-        case( GL2.GL_UNSIGNED_BYTE ):
-          if( depth > 1 ) {
-            HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
-                    usersImage, dstImage, elementSize, groupSize, rowSize,
-                    imageSize, myswapBytes );
-          } else {
-            HalveImage.halveImage_ubyte( cmpts, width, height, usersImage,
-                    dstImage, elementSize, rowSize, groupSize );
-          }
-          break;
-        case( GL2.GL_BYTE ):
-          if( depth > 1 ) {
-            HalveImage.halveImage3D( cmpts, new ExtractSByte(), width, height, depth,
-                    usersImage, dstImage, elementSize, groupSize, rowSize,
-                    imageSize, myswapBytes );
-          } else {
-            HalveImage.halveImage_byte( cmpts, width, height, usersImage,
-                    dstImage, elementSize, rowSize, groupSize );
-          }
-          break;
-        case( GL2.GL_UNSIGNED_SHORT ):
-          if( depth > 1 ) {
-            HalveImage.halveImage3D( cmpts, new ExtractUShort(), width, height, depth,
-                    usersImage, dstImage, elementSize, groupSize, rowSize,
-                    imageSize, myswapBytes );
-          } else {
-            HalveImage.halveImage_ushort( cmpts, width, height, usersImage,
-                    dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
-          }
-          break;
-        case( GL2.GL_SHORT ):
-          if( depth > 1 ) {
-            HalveImage.halveImage3D( cmpts, new ExtractSShort(), width, height, depth,
-                    usersImage, dstImage, elementSize, groupSize, rowSize,
-                    imageSize, myswapBytes );
-          } else {
-            HalveImage.halveImage_short( cmpts, width, height, usersImage,
-                    dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
-          }
-          break;
-        case( GL2.GL_UNSIGNED_INT ):
-          if( depth > 1 ) {
-            HalveImage.halveImage3D( cmpts, new ExtractUInt(), width, height, depth,
-                    usersImage, dstImage, elementSize, groupSize, rowSize,
-                    imageSize, myswapBytes );
-          } else {
-            HalveImage.halveImage_uint( cmpts, width, height, usersImage,
-                    dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
-          }
-          break;
-        case( GL2.GL_INT ):
-          if( depth > 1 ) {
-            HalveImage.halveImage3D( cmpts, new ExtractSInt(), width, height, depth,
-                    usersImage, dstImage, elementSize, groupSize, rowSize,
-                    imageSize, myswapBytes );
-          } else {
-            HalveImage.halveImage_int( cmpts, width, height, usersImage,
-                    dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
-          }
-          break;
-        case( GL2.GL_FLOAT ):
-          if( depth > 1 ) {
-            HalveImage.halveImage3D( cmpts, new ExtractFloat(), width, height, depth,
-                    usersImage, dstImage, elementSize, groupSize, rowSize,
-                    imageSize, myswapBytes );
-          } else {
-            HalveImage.halveImage_float( cmpts, width, height, usersImage,
-                    dstImage.asFloatBuffer(), elementSize, rowSize, groupSize, myswapBytes );
-          }
-          break;
-        case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          HalveImage.halveImagePackedPixel3D( 3, new Extract332(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          HalveImage.halveImagePackedPixel3D( 3, new Extract233rev(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          HalveImage.halveImagePackedPixel3D( 3, new Extract565(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          HalveImage.halveImagePackedPixel3D( 3, new Extract565rev(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          HalveImage.halveImagePackedPixel3D( 4, new Extract4444(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          HalveImage.halveImagePackedPixel3D( 4, new Extract4444rev(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          HalveImage.halveImagePackedPixel3D( 4, new Extract5551(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          HalveImage.halveImagePackedPixel3D( 4, new Extract1555rev(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          HalveImage.halveImagePackedPixel3D( 4, new Extract8888(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          HalveImage.halveImagePackedPixel3D( 4, new Extract8888rev(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          HalveImage.halveImagePackedPixel3D( 4, new Extract1010102(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-          HalveImage.halveImagePackedPixel3D( 4, new Extract2101010rev(), width, height, depth, usersImage,
-                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
-          break;
-        default:
-          assert( false );
-          break;
-      }
-      
-      tempImage = srcImage;
-      srcImage = dstImage;
-      dstImage = tempImage;
-      
-      if( newWidth > 1 ) {
-        newWidth /= 2;
-        rowSize /= 2;
-      }
-      if( newHeight > 1 ) {
-        newHeight /= 2;
-        imageSize = rowSize * newHeight;
-      }
-      if( newDepth > 1 ) {
-        newDepth /= 2;
-      }
-      if( baseLevel <= level && level <= maxLevel ) {
-        usersImage.position( mark );
-        gl.getGL2().glTexImage3D( target, level, internalFormat, width, height, depth,
-                0, format, type, usersImage );
-      }
-    }
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-    gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
-    return( 0 );
-  }
-
-  private static final int TARGA_HEADER_SIZE = 18;
-  private static void writeTargaFile(String filename, ByteBuffer data,
-                                     int width, int height) {
-    try {
-      FileOutputStream fos = new FileOutputStream(new File(filename));
-      ByteBuffer header = ByteBuffer.allocateDirect(TARGA_HEADER_SIZE);
-      header.put(0, (byte) 0).put(1, (byte) 0);
-      header.put(2, (byte) 2); // uncompressed type
-      header.put(12, (byte) (width & 0xFF)); // width
-      header.put(13, (byte) (width >> 8)); // width
-      header.put(14, (byte) (height & 0xFF)); // height
-      header.put(15, (byte) (height >> 8)); // height
-      header.put(16, (byte) 24); // pixel size
-      fos.write(header.array());
-      fos.write(data.array());
-      data.clear();
-      fos.close();
-    } catch (IOException e) {
-      e.printStackTrace();
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract.java
deleted file mode 100644
index be86585..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.ByteBuffer;
-
-/**
- *
- * @author Administrator
- */
-public interface Extract {
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents );
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel );
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1010102.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1010102.java
deleted file mode 100644
index 7e172b1..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1010102.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.ByteBuffer;
-
-/**
- *
- * @author Administrator
- */
-public class Extract1010102 implements Extract {
-  
-  /** Creates a new instance of Extract1010102 */
-  public Extract1010102() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    long uint = 0;
-    
-    if( isSwap ) {
-      uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
-    } else {
-      uint = 0x00000000FFFFFFFF & packedPixel.getInt();
-    }
-    
-    // 11111111,11000000,00000000,00000000 == 0xFFC00000
-    // 00000000,00111111,11110000,00000000 == 0x003F0000
-    // 00000000,00000000,00001111,11111100 == 0x00000FFC
-    // 00000000,00000000,00000000,00000011 == 0x00000003
-    
-    extractComponents[0] = (float)( ( uint & 0xFFC00000 ) >> 22 ) / 1023.0f;
-    extractComponents[1] = (float)( ( uint & 0x003FF000 ) >> 12 ) / 1023.0f;
-    extractComponents[2] = (float)( ( uint & 0x00000FFC ) >>  2 ) / 1023.0f;
-    extractComponents[3] = (float)( ( uint & 0x00000003 )       ) / 3.0f;
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 11110000,00000000 == 0xF000
-    // 00001111,00000000 == 0x0F00
-    // 00000000,11110000 == 0x00F0
-    // 00000000,00001111 == 0x000F
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    long uint = (((int)((shoveComponents[0] * 1023) + 0.5f) << 22) & 0xFFC00000 );
-    uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) <<   12) & 0x003FF000 );
-    uint |= (((int)((shoveComponents[2] * 1023) + 0.5f) <<    2) & 0x00000FFC );
-    uint |= (((int)((shoveComponents[3] *    3) + 0.5f)        ) & 0x00000003 );
-    packedPixel.asIntBuffer().put( index, (int)uint );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1555rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1555rev.java
deleted file mode 100644
index 3789509..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1555rev.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.ByteBuffer;
-
-/**
- *
- * @author Administrator
- */
-public class Extract1555rev implements Extract {
-  
-  /** Creates a new instance of Extract1555rev */
-  public Extract1555rev() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    int ushort = 0;
-    
-    if( isSwap ) {
-      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
-    } else {
-      ushort = 0x0000FFFF & packedPixel.getShort();
-    }
-    
-    // 00000000,00011111 == 0x001F
-    // 00000011,11100000 == 0x03E0
-    // 01111100,00000000 == 0x7C00
-    // 10000000,00000000 == 0x8000
-    
-    extractComponents[0] = (float)( ( ushort & 0x001F )       ) / 31.0f;
-    extractComponents[1] = (float)( ( ushort & 0x003E ) >>  5 ) / 31.0f;
-    extractComponents[2] = (float)( ( ushort & 0x7C00 ) >>  10) / 31.0f;
-    extractComponents[3] = (float)( ( ushort & 0x8000 ) >>  15);
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 00000000,00011111 == 0x001F
-    // 00000011,11100000 == 0x03E0
-    // 01111100,00000000 == 0x7C00
-    // 10000000,00000000 == 0x8000
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    int ushort = (((int)((shoveComponents[0] * 31) + 0.5f)   ) & 0x0000001F );
-    ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) <<  5) & 0x000003E0 );
-    ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) << 10) & 0x00007C00 );
-    ushort |= (((int)((shoveComponents[3]) + 0.5f)      << 15) & 0x00008000 );
-    packedPixel.asShortBuffer().put( index, (short)ushort );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract2101010rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract2101010rev.java
deleted file mode 100644
index 077f303..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract2101010rev.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.ByteBuffer;
-
-/**
- *
- * @author Administrator
- */
-public class Extract2101010rev implements Extract {
-  
-  /** Creates a new instance of Extract2101010 */
-  public Extract2101010rev() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    long uint = 0;
-    
-    if( isSwap ) {
-      uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
-    } else {
-      uint = 0x00000000FFFFFFFF & packedPixel.getInt();
-    }
-    
-    // 11111111,11000000,00000000,00000000 == 0xFFC00000
-    // 00000000,00111111,11110000,00000000 == 0x003F0000
-    // 00000000,00000000,00001111,11111100 == 0x00000FFC
-    // 00000000,00000000,00000000,00000011 == 0x00000003
-    
-    extractComponents[0] = (float)( ( uint & 0x000003FF )       ) / 1023.0f;
-    extractComponents[1] = (float)( ( uint & 0x000FFC00 ) >> 10 ) / 1023.0f;
-    extractComponents[2] = (float)( ( uint & 0x3FF00000 ) >> 20 ) / 1023.0f;
-    extractComponents[3] = (float)( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 11110000,00000000 == 0xF000
-    // 00001111,00000000 == 0x0F00
-    // 00000000,11110000 == 0x00F0
-    // 00000000,00001111 == 0x000F
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    long uint = (((int)((shoveComponents[0] * 1023) + 0.5f)    ) & 0x000003FF );
-    uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) <<   10) & 0x000FFC00 );
-    uint |= (((int)((shoveComponents[2] * 1023) + 0.5f) <<   20) & 0x3FF00000 );
-    uint |= (((int)((shoveComponents[3] *    3) + 0.5f) <<   30) & 0xC0000000 );
-    packedPixel.asIntBuffer().put( index, (int)uint );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract233rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract233rev.java
deleted file mode 100644
index fa35c6f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract233rev.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.ByteBuffer;
-
-/**
- *
- * @author Administrator
- */
-public class Extract233rev implements Extract {
-  
-  /** Creates a new instance of Extract223rev */
-  public Extract233rev() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    // 11100000 == 0xe0
-    // 00011100 == 0x1c
-    // 00000011 == 0x03
-    byte ubyte = packedPixel.get();
-    extractComponents[0] = (float)((ubyte & 0x07) ) / 7.0f;
-    extractComponents[1] = (float)((ubyte & 0x38) >> 3) / 7.0f;
-    extractComponents[2] = (float)((ubyte & 0xC0) >> 6) / 3.0f;
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 11100000 == 0xE0
-    // 00011100 == 0x1C
-    // 00000011 == 0x03
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) ) & 0x07 );
-    b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 3 ) & 0x38 );
-    b |= (byte)( ( (int)( ( shoveComponents[2] * 3 ) + 0.5f ) << 6 ) & 0xC0 );
-    packedPixel.position( index );
-    packedPixel.put( b );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract332.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract332.java
deleted file mode 100644
index 3593646..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract332.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.ByteBuffer;
-
-/**
- *
- * @author Administrator
- */
-public class Extract332 implements Extract {
-  
-  /** Creates a new instance of Extract332 */
-  public Extract332() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    // 11100000 == 0xe0
-    // 00011100 == 0x1c
-    // 00000011 == 0x03
-    byte ubyte = packedPixel.get();
-    extractComponents[0] = (float)((ubyte & 0xe0) >> 5) / 7.0f;
-    extractComponents[1] = (float)((ubyte & 0x1c) >> 2) / 7.0f;
-    extractComponents[2] = (float)((ubyte & 0x03)) / 3.0f;
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 11100000 == 0xE0
-    // 00011100 == 0x1C
-    // 00000011 == 0x03
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) << 5 ) & 0xE0 );
-    b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 2 ) & 0x1C );
-    b |= (byte)( ( (int)( ( shoveComponents[2] * 3 ) + 0.5f ) ) & 0x03 );
-    packedPixel.put( index, b );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444.java
deleted file mode 100644
index bac4f57..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class Extract4444 implements Extract {
-  
-  /** Creates a new instance of Extract4444 */
-  public Extract4444() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    int ushort = 0;
-    
-    if( isSwap ) {
-      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
-    } else {
-      ushort = 0x0000FFFF & packedPixel.getShort();
-    }
-    
-    // 11110000,00000000 == 0xF000
-    // 00001111,00000000 == 0x0F00
-    // 00000000,11110000 == 0x00F0
-    // 00000000,00001111 == 0x000F
-    
-    extractComponents[0] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
-    extractComponents[1] = (float)( ( ushort & 0x0F00 ) >> 8  ) / 15.0f;
-    extractComponents[2] = (float)( ( ushort & 0x00F0 ) >> 4  ) / 15.0f;
-    extractComponents[3] = (float)( ( ushort & 0x000F )       ) / 15.0f;
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 11110000,00000000 == 0xF000
-    // 00001111,00000000 == 0x0F00
-    // 00000000,11110000 == 0x00F0
-    // 00000000,00001111 == 0x000F
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    int ushort = (((int)((shoveComponents[0] * 15) + 0.5f) << 12) & 0x0000F000 );
-    ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) << 8) & 0x00000F00 );
-    ushort |= (((int)((shoveComponents[2] * 15) + 0.5f) << 4) & 0x000000F0 );
-    ushort |= (((int)((shoveComponents[3] * 15) + 0.5f)     ) & 0x0000000F );
-    packedPixel.asShortBuffer().put( index, (short)ushort );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444rev.java
deleted file mode 100644
index b1bea75..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444rev.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class Extract4444rev implements Extract {
-  
-  /** Creates a new instance of Extract4444rev */
-  public Extract4444rev() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    int ushort = 0;
-    
-    if( isSwap ) {
-      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
-    } else {
-      ushort = 0x0000FFFF & packedPixel.getShort();
-    }
-    
-    // 00000000,00001111 == 0x000F
-    // 00000000,11110000 == 0x00F0
-    // 00001111,00000000 == 0x0F00
-    // 11110000,00000000 == 0xF000
-    
-    extractComponents[0] = (float)( ( ushort & 0x000F )       ) / 15.0f;
-    extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 4  ) / 15.0f;
-    extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 8  ) / 15.0f;
-    extractComponents[3] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 11110000,00000000 == 0xF000
-    // 00001111,00000000 == 0x0F00
-    // 00000000,11110000 == 0x00F0
-    // 00000000,00001111 == 0x000F
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    int ushort = (((int)((shoveComponents[0] * 15) + 0.5f)   ) & 0x0000000F );
-    ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) <<  4) & 0x000000F0 );
-    ushort |= (((int)((shoveComponents[2] * 15) + 0.5f) <<  8) & 0x00000F00 );
-    ushort |= (((int)((shoveComponents[3] * 15) + 0.5f) << 12) & 0x0000F000 );
-    packedPixel.asShortBuffer().put( index, (short)ushort );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract5551.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract5551.java
deleted file mode 100644
index a624784..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract5551.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class Extract5551 implements Extract {
-  
-  /** Creates a new instance of Extract5551 */
-  public Extract5551() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    int ushort = 0;
-    
-    if( isSwap ) {
-      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
-    } else {
-      ushort = 0x0000FFFF & packedPixel.getShort();
-    }
-    
-    // 11111000,00000000 == 0xF800
-    // 00000111,11000000 == 0x07C0
-    // 00000000,00111110 == 0x003E
-    // 00000000,00000001 == 0x0001
-    
-    extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
-    extractComponents[1] = (float)( ( ushort & 0x00F0 ) >>  6 ) / 31.0f;
-    extractComponents[2] = (float)( ( ushort & 0x0F00 ) >>  1 ) / 31.0f;
-    extractComponents[3] = (float)( ( ushort & 0xF000 )       );
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 11110000,00000000 == 0xF000
-    // 00001111,00000000 == 0x0F00
-    // 00000000,11110000 == 0x00F0
-    // 00000000,00001111 == 0x000F
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
-    ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) <<  6) & 0x000007C0 );
-    ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) <<  1) & 0x0000003E );
-    ushort |= (((int)((shoveComponents[3]) + 0.5f)) & 0x00000001 );
-    packedPixel.asShortBuffer().put( index, (short)ushort );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565.java
deleted file mode 100644
index 624a4f3..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class Extract565 implements Extract {
-  
-  /** Creates a new instance of Extract565 */
-  public Extract565() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    int ushort = 0;
-    
-    if( isSwap ) {
-      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
-    } else {
-      ushort = 0x0000FFFF & packedPixel.getShort();
-    }
-    
-    // 11111000,00000000 == 0xF800
-    // 00000111,11100000 == 0x07E0
-    // 00000000,00111111 == 0x001F
-    
-    extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
-    extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
-    extractComponents[2] = (float)( ( ushort & 0x001F ) ) / 31.0f;
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 11111000,00000000 == 0xF800
-    // 00000111,11100000 == 0x07E0
-    // 00000000,00111111 == 0x001F
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
-    ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
-    ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) ) & 0x0000001F );
-    packedPixel.asShortBuffer().put( index, (short)ushort );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565rev.java
deleted file mode 100644
index 4ab6d7e..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565rev.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class Extract565rev implements Extract {
-  
-  /** Creates a new instance of Extract565rev */
-  public Extract565rev() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    int ushort = 0;
-    
-    if( isSwap ) {
-      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
-    } else {
-      ushort = 0x0000FFFF & packedPixel.getShort();
-    }
-    
-    // 00000000,00011111 == 0x001F
-    // 00000111,11100000 == 0x07E0
-    // 11111000,00000000 == 0xF800
-    
-    extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
-    extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
-    extractComponents[2] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 00000000,00111111 == 0x001F
-    // 00000111,11100000 == 0x07E0
-    // 11111000,00000000 == 0xF800
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) ) & 0x0000001F );
-    ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
-    ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) << 11) & 0x0000F800 );
-    packedPixel.asShortBuffer().put( index, (short)ushort );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888.java
deleted file mode 100644
index 90d7e57..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class Extract8888 implements Extract {
-  
-  /** Creates a new instance of Extract8888 */
-  public Extract8888() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    long uint = 0;
-    
-    if( isSwap ) {
-      uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
-    } else {
-      uint = 0x00000000FFFFFFFF & packedPixel.getInt();
-    }
-    
-    // 11111000,00000000 == 0xF800
-    // 00000111,11000000 == 0x07C0
-    // 00000000,00111110 == 0x003E
-    // 00000000,00000001 == 0x0001
-    
-    extractComponents[0] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
-    extractComponents[1] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
-    extractComponents[2] = (float)( ( uint & 0x0000FF00 ) >>  8 ) / 255.0f;
-    extractComponents[3] = (float)( ( uint & 0x000000FF )       ) / 255.0f;
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 11110000,00000000 == 0xF000
-    // 00001111,00000000 == 0x0F00
-    // 00000000,11110000 == 0x00F0
-    // 00000000,00001111 == 0x000F
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    long uint = (((int)((shoveComponents[0] * 255) + 0.5f) << 24) & 0xFF000000 );
-    uint |= (((int)((shoveComponents[1] * 255) + 0.5f) <<   16) & 0x00FF0000 );
-    uint |= (((int)((shoveComponents[2] * 255) + 0.5f) <<    8) & 0x0000FF00 );
-    uint |= (((int)((shoveComponents[3] * 255) + 0.5f)        ) & 0x000000FF );
-    packedPixel.asIntBuffer().put( index, (int)uint );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888rev.java
deleted file mode 100644
index 1097057..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888rev.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class Extract8888rev implements Extract {
-  
-  /** Creates a new instance of Extract8888rev */
-  public Extract8888rev() {
-  }
-  
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
-    long uint = 0;
-    
-    if( isSwap ) {
-      uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
-    } else {
-      uint = 0x00000000FFFFFFFF & packedPixel.getInt();
-    }
-    
-    // 11111000,00000000 == 0xF800
-    // 00000111,11000000 == 0x07C0
-    // 00000000,00111110 == 0x003E
-    // 00000000,00000001 == 0x0001
-    
-    extractComponents[0] = (float)( ( uint & 0x000000FF )       ) / 255.0f;
-    extractComponents[1] = (float)( ( uint & 0x0000FF00 ) >>  8 ) / 255.0f;
-    extractComponents[2] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
-    extractComponents[3] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
-  }
-  
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
-    // 11110000,00000000 == 0xF000
-    // 00001111,00000000 == 0x0F00
-    // 00000000,11110000 == 0x00F0
-    // 00000000,00001111 == 0x000F
-    
-    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
-    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
-    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-    
-    // due to limited precision, need to round before shoving
-    long uint = (((int)((shoveComponents[0] * 255) + 0.5f)    ) & 0x000000FF );
-    uint |= (((int)((shoveComponents[1] * 255) + 0.5f) <<    8) & 0x0000FF00 );
-    uint |= (((int)((shoveComponents[2] * 255) + 0.5f) <<   16) & 0x00FF0000 );
-    uint |= (((int)((shoveComponents[3] * 255) + 0.5f) <<   24) & 0xFF000000 );
-    packedPixel.asIntBuffer().put( index, (int)uint );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractFloat.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractFloat.java
deleted file mode 100644
index c427994..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractFloat.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class ExtractFloat implements ExtractPrimitive {
-  
-  /** Creates a new instance of ExtractFloat */
-  public ExtractFloat() {
-  }
-  
-  public double extract( boolean isSwap, ByteBuffer data ) {
-    float f = 0;
-    if( isSwap ) {
-      f = Mipmap.GLU_SWAP_4_BYTES( data.getInt() );
-    } else {
-      f = data.getInt();
-    }
-    assert( f <= 1.0f );
-    return( f );
-  }
-  
-  public void shove( double value, int index, ByteBuffer data ) {
-    assert(0.0 <= value && value < 1.0);
-    data.asFloatBuffer().put( index, (float)value );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractPrimitive.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractPrimitive.java
deleted file mode 100644
index 8b986d6..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractPrimitive.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.ByteBuffer;
-
-/**
- *
- * @author Administrator
- */
-public interface ExtractPrimitive {
-  public double extract( boolean isSwap, ByteBuffer pointer );
-  public void shove( double value, int index, ByteBuffer pointer );
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSByte.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSByte.java
deleted file mode 100644
index 4f61015..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSByte.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.ByteBuffer;
-
-/**
- *
- * @author Administrator
- */
-public class ExtractSByte implements ExtractPrimitive {
-  
-  /** Creates a new instance of ExtractUByte */
-  public ExtractSByte() {
-  }
-  
-  public double extract( boolean isSwap, ByteBuffer sbyte ) {
-    byte b = sbyte.get();
-    assert( b <= 127 );
-    return( b );
-  }
-  
-  public void shove( double value, int index, ByteBuffer data ) {
-    data.position( index );
-    data.put( (byte)value );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSInt.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSInt.java
deleted file mode 100644
index 2d5ac53..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSInt.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class ExtractSInt implements ExtractPrimitive {
-  
-  /** Creates a new instance of ExtractSInt */
-  public ExtractSInt() {
-  }
-  
-  public double extract( boolean isSwap, ByteBuffer uint ) {
-    int i = 0;
-    if( isSwap ) {
-      i = Mipmap.GLU_SWAP_4_BYTES( uint.getInt() );
-    } else {
-      i = uint.getInt();
-    }
-    assert( i <= 0x7FFFFFFF );
-    return( i );
-  }
-  
-  public void shove( double value, int index, ByteBuffer data ) {
-    assert(0.0 <= value && value < Integer.MAX_VALUE);
-    IntBuffer ib = data.asIntBuffer();
-    ib.position( index );
-    ib.put( (int)value );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSShort.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSShort.java
deleted file mode 100644
index 8b8d50c..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSShort.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class ExtractSShort implements ExtractPrimitive {
-  
-  /** Creates a new instance of ExtractSShort */
-  public ExtractSShort() {
-  }
-  
-  public double extract( boolean isSwap, ByteBuffer ushort ) {
-    short s = 0;
-    if( isSwap ) {
-      s = Mipmap.GLU_SWAP_2_BYTES( ushort.getShort() );
-    } else {
-      s = ushort.getShort();
-    }
-    assert( s <= 32767 );
-    return( s );
-  }
-  
-  public void shove( double value, int index, ByteBuffer data ) {
-    assert(0.0 <= value && value < 32768.0);
-    ShortBuffer sb = data.asShortBuffer();
-    sb.position( index );
-    sb.put( (short)value );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUByte.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUByte.java
deleted file mode 100644
index d33213f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUByte.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.ByteBuffer;
-
-/**
- *
- * @author Administrator
- */
-public class ExtractUByte implements ExtractPrimitive {
-  
-  /** Creates a new instance of ExtractUByte */
-  public ExtractUByte() {
-  }
-  
-  public double extract( boolean isSwap, ByteBuffer ubyte ) {
-    int i = 0x000000FF & ubyte.get();
-    assert( i <= 255 );
-    return( i );
-  }
-  
-  public void shove( double value, int index, ByteBuffer data ) {
-    assert(0.0 <= value && value < 256.0);
-    data.position( index );
-    data.put( (byte)value );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUInt.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUInt.java
deleted file mode 100644
index 873668a..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUInt.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class ExtractUInt implements ExtractPrimitive {
-  
-  /** Creates a new instance of ExtractUInt */
-  public ExtractUInt() {
-  }
-  
-  public double extract( boolean isSwap, ByteBuffer uint ) {
-    long i = 0;
-    if( isSwap ) {
-      i = 0xFFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( uint.getInt() );
-    } else {
-      i = 0xFFFFFFFF & uint.getInt();
-    }
-    assert( i <= 0xFFFFFFFF );
-    return( i );
-  }
-  
-  public void shove( double value, int index, ByteBuffer data ) {
-    assert(0.0 <= value && value < 0xFFFFFFFF);
-    IntBuffer ib = data.asIntBuffer();
-    ib.position( index );
-    ib.put( (int)value );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUShort.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUShort.java
deleted file mode 100644
index 86bbb95..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUShort.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author Administrator
- */
-public class ExtractUShort implements ExtractPrimitive {
-  
-  /** Creates a new instance of ExtracUShort */
-  public ExtractUShort() {
-  }
-  
-  public double extract( boolean isSwap, ByteBuffer ushort ) {
-    int i = 0;
-    if( isSwap ) {
-      i = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( ushort.getShort() );
-    } else {
-      i = 0x0000FFFF & ushort.getShort();
-    }
-    assert( i <= 65535 );
-    return( i );
-  }
-  
-  public void shove( double value, int index, ByteBuffer data ) {
-    assert(0.0 <= value && value < 65536.0);
-    ShortBuffer sb = data.asShortBuffer();
-    sb.position( index );
-    sb.put( (short)value );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/HalveImage.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/HalveImage.java
deleted file mode 100644
index 893d33c..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/HalveImage.java
+++ /dev/null
@@ -1,1533 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import javax.media.opengl.GL;
-import java.nio.*;
-
-/**
- *
- * @author  Administrator
- */
-public class HalveImage {
-  
-  private static final int BOX2 = 2;
-  private static final int BOX4 = 4;
-  private static final int BOX8 = 8;
-  
-  public static void halveImage( int components, int width, int height,
-          ShortBuffer datain, ShortBuffer dataout ) {
-    int i, j, k;
-    int newwidth, newheight;
-    int delta;
-    int t = 0;
-    short temp = 0;
-    
-    newwidth = width / 2;
-    newheight = height /2;
-    delta = width * components;
-    
-    // Piece of cake
-    for( i = 0; i < newheight; i++ ) {
-      for( j = 0; j < newwidth; j++ ) {
-        for( k = 0; k < components; k++ ) {
-          datain.position( t );
-          temp = datain.get();
-          datain.position( t + components );
-          temp += datain.get();
-          datain.position( t + delta );
-          temp += datain.get();
-          datain.position( t + delta + components );
-          temp +=datain.get();
-          temp += 2;
-          temp /= 4;
-          dataout.put( temp );
-          t++;
-        }
-        t += components;
-      }
-      t += delta;
-    }
-  }
-  
-  public static void halveImage_ubyte( int components, int width, int height,
-                                      ByteBuffer datain, ByteBuffer dataout,
-                                      int element_size, int ysize, int group_size ) {
-    int i, j, k;
-    int newwidth, newheight;
-    int s;
-    int t;
-    
-    // Handle case where there is only 1 column/row
-    if( width == 1 || height == 1 ) {
-      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
-      halve1Dimage_ubyte( components, width, height, datain, dataout, element_size, ysize, group_size );
-      return;
-    }
-    
-    newwidth = width / 2;
-    newheight = height / 2;
-    s = 0;
-    t = 0;
-    
-    int temp = 0;
-    // piece of cake
-    for( i = 0; i < newheight; i++ ) {
-      for( j = 0; j < newwidth; j++ ) {
-        for( k = 0; k < components; k++ ) {
-          datain.position( t );
-          temp = ( 0x000000FF & datain.get() );
-          datain.position( t + group_size );
-          temp += ( 0x000000FF & datain.get() );
-          datain.position( t + ysize );
-          temp += ( 0x000000FF & datain.get() );
-          datain.position( t + ysize + group_size );
-          temp += ( 0x000000FF & datain.get() ) + 2;
-          dataout.put( (byte)(temp / 4) );
-          t += element_size;
-        }
-        t += group_size;
-      }
-      t += ysize;
-    }
-  }
-  
-  public static void halve1Dimage_ubyte( int components, int width, int height,
-                      ByteBuffer datain, ByteBuffer dataout, 
-                      int element_size, int ysize, int group_size ) {
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int src = 0;
-    int dest = 0;
-    int jj;
-    int temp = 0;
-    
-    assert( width == 1 || height == 1 ); // Must be 1D
-    assert( width != height ); // can't be square
-    
-    if( height == 1 ) { // 1 row
-      assert( width != 1 ); // widthxheight can't be 1x1
-      halfHeight = 1;
-      
-      for( jj = 0; jj < halfWidth; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          datain.position( src );
-          temp = ( 0x000000FF & datain.get() );
-          datain.position( src + group_size );
-          temp += ( 0x000000FF & datain.get() );
-          temp /= 2;
-          dataout.put( (byte)temp );
-          /*
-          dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) + 
-                    (0x000000FF & datain.setIndexInBytes( src + group_size ).getByte())) / 2 ) );
-           */
-          src += element_size;
-          //dataout.plusPlus();
-          dest++;
-        }
-        src += group_size; // skip to next 2
-      }
-      int padBytes = ysize - ( width * group_size );
-      src += padBytes; // for assertion only
-    } else if( width == 1 ) { // 1 column
-      int padBytes = ysize - ( width * group_size );
-      assert( height != 1 );
-      halfWidth = 1;
-      // one vertical column with possible pad bytes per row
-      // average two at a time
-      for( jj = 0; jj < halfHeight; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          datain.position( src );
-          temp = ( 0x000000FF & datain.get() );
-          datain.position( src + ysize );
-          temp += ( 0x000000FF & datain.get() );
-          temp /= 2;
-          dataout.put( (byte)temp );
-          /*
-          dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) + 
-                    (0x000000FF & datain.setIndexInBytes(src + ysize).getByte()) ) / 2 ) );
-           */
-          src += element_size;
-          //dataout.plusPlus();
-          dest++;
-        }
-        src += padBytes; // add pad bytes, if any, to get to end of row
-        src += ysize;
-      }
-    }
-    assert( src == ysize * height );
-    assert( dest == components * element_size * halfWidth * halfHeight );
-  }
-  
-  public static void halveImage_byte( int components, int width, int height,
-                    ByteBuffer datain, ByteBuffer dataout, int element_size,
-                    int ysize, int group_size ) {
-    int i, j, k;
-    int newwidth, newheight;
-    int s = 0;
-    int t = 0;
-    byte temp = (byte)0;
-    
-    // handle case where there is only 1 column
-    if( width == 1 || height == 1 ) {
-      assert( !( width == 1 && height == 1 ) );
-      halve1Dimage_byte( components, width, height, datain, dataout, element_size,
-                                                            ysize, group_size );
-      return;
-    }
-    
-    newwidth = width / 2;
-    newheight = height / 2;
-    
-    for( i = 0; i < newheight; i++ ) {
-      for( j = 0; j < newwidth; j++ ) {
-        for( k = 0; k < components; k++ ) {
-          datain.position( t );
-          temp = datain.get();
-          datain.position( t + group_size );
-          temp += datain.get();
-          datain.position( t + ysize );
-          temp += datain.get();
-          datain.position( t + ysize + group_size );
-          temp += datain.get();
-          temp += 2;
-          temp /= 4;
-          dataout.put( temp );
-          t += element_size;
-        }
-        t += group_size;
-      }
-      t += ysize;
-    }
-  }
-  
-  public static void halve1Dimage_byte( int components, int width, int height,
-                      ByteBuffer datain, ByteBuffer dataout,
-                      int element_size, int ysize, int group_size ) {
-    int halfWidth = width / 2;
-    int halfHeight = width / 2;
-    int src = 0;
-    int dest = 0;
-    int jj;
-    byte temp = (byte)0;
-    
-    assert( width == 1 || height == 1 ); // must be 1D
-    assert( width != height ); // can't be square
-    
-    if( height == 1 ) { // 1 row
-      assert( width != 1 ); // widthxheight can't be 1
-      halfHeight = 1;
-      
-      for( jj = 0; jj < halfWidth; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          datain.position( src );
-          temp = datain.get();
-          datain.position( src + group_size );
-          temp += datain.get();
-          temp /= 2;
-          dataout.put( temp );
-          src += element_size;
-          dest++;
-        }
-        src += group_size; // skip to next 2
-      }
-      int padBytes = ysize - ( width * group_size );
-      src += padBytes; // for assert only
-    } else if( width == 1 ) { // 1 column
-      int padBytes = ysize - ( width * group_size );
-      assert( height != 1 ); // widthxheight can't be 1
-      halfWidth = 1;
-      // one vertical column with possible pad bytes per row
-      // average two at a time
-      
-      for( jj = 0; jj < halfHeight; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          datain.position( src );
-          temp = datain.get();
-          datain.position( src + ysize );
-          temp += datain.get();
-          temp /= 2;
-          src += element_size;
-          dest++;
-        }
-        src += padBytes; // add pad bytes, if any, to get to end of row
-        src += ysize;
-      }
-      assert( src == ysize * height );
-    }
-    assert( dest == components * element_size * halfWidth * halfHeight );
-  }
-  
-  public static void halveImage_ushort( int components, int width, int height,
-                          ByteBuffer datain, ShortBuffer dataout, int element_size,
-                          int ysize, int group_size, boolean myswap_bytes ) {
-    int i, j, k, l;
-    int newwidth, newheight;
-    int s = 0;
-    int t = 0;
-    int temp = 0;
-    // handle case where there is only 1 column/row
-    if( width == 1 || height == 1 ) {
-      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
-      halve1Dimage_ushort( components, width, height, datain, dataout, element_size,
-                                ysize, group_size, myswap_bytes );
-      return;
-    }
-    
-    newwidth = width / 2;
-    newheight = height / 2;
-    
-    // Piece of cake
-    if( !myswap_bytes ) {
-      for( i = 0; i < newheight; i++ ) {
-        for( j = 0; j < newwidth; j++ ) {
-          for( k = 0; k < components; k++ ) {
-            datain.position( t );
-            temp = ( 0x0000FFFF & datain.getShort() );
-            datain.position( t + group_size );
-            temp += ( 0x0000FFFF & datain.getShort() );
-            datain.position( t + ysize );
-            temp += ( 0x0000FFFF & datain.getShort() );
-            datain.position( t + ysize + group_size );
-            temp += ( 0x0000FFFF & datain.getShort() );
-            dataout.put( (short)( ( temp + 2 ) / 4 ) );
-            t += element_size;
-          }
-          t += group_size;
-        }
-        t += ysize;
-      }
-    } else {
-      for( i = 0; i < newheight; i++ ) {
-        for( j = 0; j < newwidth; j++ ) {
-          for( k = 0; k < components; k++ ) {
-            datain.position( t );
-            temp = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
-            datain.position( t + group_size );
-            temp += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
-            datain.position( t + ysize );
-            temp += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
-            datain.position( t + ysize + group_size );
-            temp += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
-            dataout.put( (short)( ( temp + 2 ) / 4 ) );
-            t += element_size;
-          }
-          t += group_size;
-        }
-        t += ysize;
-      }
-    }
-  }
-  
-  public static void halve1Dimage_ushort( int components, int width, int height,
-                      ByteBuffer datain, ShortBuffer dataout, int element_size,
-                      int ysize, int group_size, boolean myswap_bytes ) {
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int src = 0;
-    int dest = 0;
-    int jj;
-    
-    assert( width == 1 || height == 1 ); // must be 1D
-    assert( width != height ); // can't be square
-    
-    if( height == 1 ) { // 1 row
-      assert( width != 1 ); // widthxheight can't be 1
-      halfHeight = 1;
-      
-      for( jj = 0; jj < halfWidth; jj++ ) {
-        int kk;
-        for( kk = 0; kk < halfHeight; kk++ ) {
-          int[] ushort = new int[BOX2];
-          if( myswap_bytes ) {
-            datain.position( src );
-            ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
-            datain.position( src + group_size );
-            ushort[1] = (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
-          } else {
-            datain.position( src );
-            ushort[0] = (0x0000FFFF & datain.getShort() );
-            datain.position( src + group_size );
-            ushort[1] = (0x0000FFFF & datain.getShort() );
-          }
-          dataout.put( (short)( (ushort[0] + ushort[1]) / 2 ) );
-          src += element_size;
-          dest += 2;
-        }
-        src += group_size; // skip to next 2
-      }
-      int padBytes = ysize - ( width * group_size );
-      src += padBytes; // for assertion only
-    } else if( width == 1 ) { // 1 column
-      int padBytes = ysize - ( width * group_size );
-      assert( height != 1 ); // widthxheight can't be 1
-      halfWidth = 1;
-      // one vertical column with possible pad bytes per row
-      // average two at a time
-      
-      for( jj = 0; jj < halfHeight; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          int[] ushort = new int[BOX2];
-          if( myswap_bytes ) {
-            datain.position( src );
-            ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
-            datain.position( src + ysize );
-            ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
-          } else {
-            datain.position( src );
-            ushort[0] = ( 0x0000FFFF & datain.getShort() );
-            datain.position( src + ysize );
-            ushort[1] = ( 0x0000FFFF & datain.getShort() );
-          }
-          dataout.put( (short)((ushort[0] + ushort[1]) / 2) );
-          src += element_size;
-          dest += 2;
-        }
-        src += padBytes; // add pad bytes, if any, to get to end of row
-        src += ysize;
-      }
-      assert( src == ysize * height );
-    }
-    assert( dest == components * element_size * halfWidth * halfHeight );
-  }
-  
-  public static void halveImage_short( int components, int width, int height,
-                        ByteBuffer datain, ShortBuffer dataout, int element_size,
-                        int ysize, int group_size, boolean myswap_bytes ) {
-    int i, j, k, l;
-    int newwidth, newheight;
-    int s = 0;
-    int t = 0;
-    short temp = (short)0;
-    // handle case where there is only 1 column/row
-    if( width == 1 || height == 1 ) {
-      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
-      halve1Dimage_short( components, width, height, datain, dataout, element_size,
-                            ysize, group_size, myswap_bytes );
-      return;
-    }
-    
-    newwidth = width / 2;
-    newheight = height / 2;
-    
-    // Piece of cake
-    if( !myswap_bytes ) {
-      for( i = 0; i < newheight; i++ ) {
-        for( j = 0; j < newwidth; j++ ) {
-          for( k = 0; k < components; k++ ) {
-            datain.position( t );
-            temp = datain.getShort();
-            datain.position( t + group_size );
-            temp += datain.getShort();
-            datain.position( t + ysize );
-            temp += datain.getShort();
-            datain.position( t + ysize + group_size );
-            temp += datain.getShort();
-            temp += 2;
-            temp /= 4;
-            dataout.put( (short)temp );
-            t += element_size;
-          }
-          t += group_size;
-        }
-        t += ysize;
-      }
-    } else {
-      for( i = 0; i < newheight; i++ ) {
-        for( j = 0; j < newwidth; j++ ) {
-          for( k = 0; k < components; k++ ) {
-            short b;
-            int buf;
-            datain.position( t );
-            temp = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-            datain.position( t + group_size );
-            temp += Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-            datain.position( t + ysize );
-            temp += Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-            datain.position( t + ysize + group_size );
-            temp += Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-            temp += 2;
-            temp /= 4;
-            dataout.put( temp );
-            t += element_size;
-          }
-          t += group_size;
-        }
-        t += ysize;
-      }
-    }
-  }
-  
-  public static void halve1Dimage_short( int components, int width, int height,
-              ByteBuffer datain, ShortBuffer dataout, int element_size, int ysize,
-              int group_size, boolean myswap_bytes ) {
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int src = 0;
-    int dest = 0;
-    int jj;
-    
-    assert( width == 1 || height == 1 ); // must be 1D
-    assert( width != height ); // can't be square
-    
-    if( height == 1 ) { // 1 row
-      assert( width != 1 ); // can't be 1x1
-      halfHeight = 1;
-      
-      for( jj = 0; jj < halfWidth; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          short[] sshort = new short[BOX2];
-          if( myswap_bytes ) {
-            datain.position( src );
-            sshort[0] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-            datain.position( src + group_size );
-            sshort[1] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-          } else {
-            datain.position( src );
-            sshort[0] = datain.getShort();
-            datain.position( src + group_size );
-            sshort[1] = datain.getShort();
-          }
-          dataout.put( (short)(( sshort[0] + sshort[1] ) / 2) );
-          src += element_size;
-          dest += 2;
-        }
-        src += group_size; // skip to next 2
-      }
-      int padBytes = ysize - ( width * group_size );
-      src += padBytes; // for assertion only
-    } else if( width == 1 ) {
-      int padBytes = ysize - ( width * group_size );
-      assert( height != 1 );
-      halfWidth = 1;
-      // one vertical column with possible pad bytes per row
-      // average two at a time
-      
-      for( jj = 0; jj < halfHeight; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          short[] sshort = new short[BOX2];
-          if( myswap_bytes ) {
-            datain.position( src );
-            sshort[0] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-            datain.position( src + ysize );
-            sshort[1] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-          } else {
-            datain.position( src );
-            sshort[0] = datain.getShort();
-            datain.position( src + ysize );
-            sshort[1] = datain.getShort();
-          }
-          dataout.put( (short)(( sshort[0] + sshort[1] ) / 2) );
-          src += element_size;
-          dest += 2;
-        }
-        src += padBytes; // add pad bytes, if any, to get to end of row
-        src += ysize;
-      }
-      assert( src == ysize * height );
-    }
-    assert( dest == ( components * element_size * halfWidth * halfHeight ) );
-  }
-  
-  public static void halveImage_uint( int components, int width, int height,
-                          ByteBuffer datain, IntBuffer dataout, int element_size,
-                          int ysize, int group_size, boolean myswap_bytes ) {
-    int i, j, k, l;
-    int newwidth, newheight;
-    int s = 0;
-    int t = 0;
-    double temp = 0;
-    
-    // handle case where there is only 1 column/row
-    if( width == 1 || height == 1 ) {
-      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
-      halve1Dimage_uint( components, width, height, datain, dataout, element_size,
-                                ysize, group_size, myswap_bytes );
-      return;
-    }
-    
-    newwidth = width / 2;
-    newheight = height / 2;
-    
-    // Piece of cake
-    if( !myswap_bytes ) {
-      for( i = 0; i < newheight; i++ ) {
-        for( j = 0; j < newwidth; j++ ) {
-          for( k = 0; k < components; k++ ) {
-            datain.position( t );
-            temp = (0x000000007FFFFFFFL & datain.getInt() );
-            datain.position( t + group_size );
-            temp += (0x000000007FFFFFFFL & datain.getInt() );
-            datain.position( t + ysize );
-            temp += (0x000000007FFFFFFFL & datain.getInt() );
-            datain.position( t + ysize + group_size );
-            temp += (0x000000007FFFFFFFL & datain.getInt() );
-            dataout.put( (int)( ( temp / 4 ) + 0.5 ) );
-            t += element_size;
-          }
-          t += group_size;
-        }
-        t += ysize;
-      }
-    } else {
-      for( i = 0; i < newheight; i++ ) {
-        for( j = 0; j < newwidth; j++ ) {
-          for( k = 0; k < components; k++ ) {
-            // need to cast to double to hold large unsigned ints
-            double buf;
-            datain.position( t );
-            buf = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            datain.position( t + group_size );
-            buf += ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            datain.position( t + ysize );
-            buf += ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            datain.position( t + ysize + group_size );
-            buf += ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            temp /= 4;
-            temp += 0.5;
-            dataout.put( (int)temp );
-            t += element_size;
-          }
-          t += group_size;
-        }
-        t += ysize;
-      }
-    }
-  }
-  
-  public static void halve1Dimage_uint( int components, int width, int height,
-                      ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
-                      int group_size, boolean myswap_bytes ) {
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int src = 0;
-    int dest = 0;
-    int jj;
-    
-    assert( width == 1 || height == 1 ); // must be 1D
-    assert( width != height ); // can't be square
-    
-    if( height == 1 ) { // 1 row
-      assert( width != 1 ); // widthxheight can't be 1
-      halfHeight = 1;
-      
-      for( jj = 0; jj < halfWidth; jj++ ) {
-        int kk;
-        for( kk = 0; kk < halfHeight; kk++ ) {
-          long[] uint = new long[BOX2];
-          if( myswap_bytes ) {
-            datain.position( src );
-            uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            datain.position( src + group_size );
-            uint[1] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-          } else {
-            datain.position( src );
-            uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
-            datain.position( src + group_size );
-            uint[1] = (0x00000000FFFFFFFF & datain.getInt() );
-          }
-          dataout.put( (int)( ( uint[0] + uint[1] ) / 2.0 ) );
-          src += element_size;
-          dest += 4;
-        }
-        src += group_size; // skip to next 2
-      }
-      int padBytes = ysize - ( width * group_size );
-      src += padBytes; // for assertion only
-    } else if( width == 1 ) { // 1 column
-      int padBytes = ysize - ( width * group_size );
-      assert( height != 1 ); // widthxheight can't be 1
-      halfWidth = 1;
-      // one vertical column with possible pad bytes per row
-      // average two at a time
-      
-      for( jj = 0; jj < halfHeight; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          long[] uint = new long[BOX2];
-          if( myswap_bytes ) {
-            datain.position( src );
-            uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            datain.position( src + group_size );
-            uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-          } else {
-            datain.position( src );
-            uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
-            datain.position( src + ysize );
-            uint[1] = ( 0x00000000FFFFFFFF & datain.getInt() );
-          }
-          dataout.put( (int)( ( uint[0] + uint[1] ) / 2.0 ) );
-          src += element_size;
-          dest += 4;
-        }
-        src += padBytes; // add pad bytes, if any, to get to end of row
-        src += ysize;
-      }
-      assert( src == ysize * height );
-    }
-    assert( dest == components * element_size * halfWidth * halfHeight );
-  }
-  
-  public static void halveImage_int( int components, int width, int height,
-                        ByteBuffer datain, IntBuffer dataout, int element_size,
-                        int ysize, int group_size, boolean myswap_bytes ) {
-    int i, j, k, l;
-    int newwidth, newheight;
-    int s = 0;
-    int t = 0;
-    int temp = 0;
-    
-    // handle case where there is only 1 column/row
-    if( width == 1 || height == 1 ) {
-      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
-      halve1Dimage_int( components, width, height, datain, dataout, element_size,
-                            ysize, group_size, myswap_bytes );
-      return;
-    }
-    
-    newwidth = width / 2;
-    newheight = height / 2;
-    
-    // Piece of cake
-    if( !myswap_bytes ) {
-      for( i = 0; i < newheight; i++ ) {
-        for( j = 0; j < newwidth; j++ ) {
-          for( k = 0; k < components; k++ ) {
-            datain.position( t );
-            temp = datain.getInt();
-            datain.position( t + group_size );
-            temp += datain.getInt();
-            datain.position( t + ysize );
-            temp += datain.getInt();
-            datain.position( t + ysize + group_size );
-            temp += datain.getInt();
-            temp = (int)( ( temp / 4.0f ) + 0.5f );
-            dataout.put( temp );
-            t += element_size;
-          }
-          t += group_size;
-        }
-        t += ysize;
-      }
-    } else {
-      for( i = 0; i < newheight; i++ ) {
-        for( j = 0; j < newwidth; j++ ) {
-          for( k = 0; k < components; k++ ) {
-            long b;
-            float buf;
-            datain.position( t );
-            b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            buf = b;
-            datain.position( t + group_size );
-            b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            buf += b;
-            datain.position( t + ysize );
-            b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            buf += b;
-            datain.position( t + ysize + group_size );
-            b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            buf += b;
-            dataout.put( (int)( ( buf / 4.0f ) + 0.5f ) );
-            t += element_size;
-          }
-          t += group_size;
-        }
-        t += ysize;
-      }
-    }
-  }
-  
-  public static void halve1Dimage_int( int components, int width, int height,
-              ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
-              int group_size, boolean myswap_bytes ) {
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int src = 0;
-    int dest = 0;
-    int jj;
-    
-    assert( width == 1 || height == 1 ); // must be 1D
-    assert( width != height ); // can't be square
-    
-    if( height == 1 ) { // 1 row
-      assert( width != 1 ); // can't be 1x1
-      halfHeight = 1;
-      
-      for( jj = 0; jj < halfWidth; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          long[] uint = new long[BOX2];
-          if( myswap_bytes ) {
-            datain.position( src );
-            uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            datain.position( src + group_size );
-            uint[1] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-          } else {
-            datain.position( src );
-            uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
-            datain.position( src + group_size );
-            uint[1] = ( 0x00000000FFFFFFFF & datain.getInt() );
-          }
-          dataout.put( (int)( ( (float)uint[0] + (float)uint[1] ) / 2.0f) );
-          src += element_size;
-          dest += 4;
-        }
-        src += group_size; // skip to next 2
-      }
-      int padBytes = ysize - ( width * group_size );
-      src += padBytes; // for assertion only
-    } else if( width == 1 ) {
-      int padBytes = ysize - ( width * group_size );
-      assert( height != 1 );
-      halfWidth = 1;
-      // one vertical column with possible pad bytes per row
-      // average two at a time
-      
-      for( jj = 0; jj < halfHeight; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          long[] uint = new long[BOX2];
-          if( myswap_bytes ) {
-            datain.position( src );
-            uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-            datain.position( src + ysize );
-            uint[1] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
-          } else {
-            datain.position( src );
-            uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
-            datain.position( src + ysize );
-            uint[1] = ( 0x00000000FFFFFFFF & datain.getInt() );
-          }
-          dataout.put( (int)(( (float)uint[0] + (float)uint[1] ) / 2.0f) );
-          src += element_size;
-          dest += 4;
-        }
-        src += padBytes; // add pad bytes, if any, to get to end of row
-        src += ysize;
-      }
-      assert( src == ysize * height );
-    }
-    assert( dest == ( components * element_size * halfWidth * halfHeight ) );
-  }
-  
-  public static void halveImage_float( int components, int width, int height,
-                    ByteBuffer datain, FloatBuffer dataout, int element_size,
-                    int ysize, int group_size, boolean myswap_bytes ) {
-    int i, j, k, l;
-    int newwidth, newheight;
-    int s = 0;
-    int t = 0;
-    float temp = 0.0f;
-    // handle case where there is only 1 column/row
-    if( width == 1 || height == 1 ) {
-      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
-      halve1Dimage_float( components, width, height, datain, dataout, element_size,
-                                              ysize, group_size, myswap_bytes );
-      return;
-    }
-    
-    newwidth = width / 2;
-    newheight = height / 2;
-    
-    // Piece of cake
-    if( !myswap_bytes ) {
-      for( i = 0; i < newheight; i++ ) {
-        for( j = 0; j < newwidth; j++ ) {
-          for( k = 0; k < components; k++ ) {
-            datain.position( t );
-            temp = datain.getFloat();
-            datain.position( t + group_size );
-            temp += datain.getFloat();
-            datain.position( t + ysize );
-            temp += datain.getFloat();
-            datain.position( t + ysize + group_size );
-            temp /= 4.0f;
-            dataout.put( temp );
-            t += element_size;
-          }
-          t += group_size;
-        }
-        t += ysize;
-      }
-    } else {
-      for( i = 0; i < newheight; i++ ) {
-        for( j = 0; j < newwidth; j++ ) {
-          for( k = 0; k < components; k++ ) {
-            float buf;
-            datain.position( t );
-            buf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-            datain.position( t + group_size );
-            buf += Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-            datain.position( t + ysize );
-            buf += Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-            datain.position( t + ysize + group_size );
-            buf += Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-            dataout.put( buf / 4.0f );
-            t += element_size;
-          }
-          t += group_size;
-        }
-        t += ysize;
-      }
-    }
-  }
-  
-  public static void halve1Dimage_float( int components, int width, int height,
-              ByteBuffer datain, FloatBuffer dataout, int element_size, int ysize,
-              int group_size, boolean myswap_bytes ) {
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int src = 0;
-    int dest = 0;
-    int jj;
-    
-    assert( width == 1 || height == 1 ); // must be 1D
-    assert( width != height ); // can't be square
-    
-    if( height == 1 ) { // 1 row
-      assert( width != 1 ); // can't be 1x1
-      halfHeight = 1;
-      
-      for( jj = 0; jj < halfWidth; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          float[] sfloat = new float[BOX2];
-          if( myswap_bytes ) {
-            datain.position( src );
-            sfloat[0] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-            datain.position( src + group_size );
-            sfloat[1] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-          } else {
-            datain.position( src );
-            sfloat[0] = datain.getFloat();
-            datain.position( src + group_size );
-            sfloat[1] = datain.getFloat();
-          }
-          dataout.put( (sfloat[0] + sfloat[1]) / 2.0f );
-          src += element_size;
-          dest += 4;
-        }
-        src += group_size; // skip to next 2
-      }
-      int padBytes = ysize - ( width * group_size );
-      src += padBytes; // for assertion only
-    } else if( width == 1 ) {
-      int padBytes = ysize - ( width * group_size );
-      assert( height != 1 );
-      halfWidth = 1;
-      // one vertical column with possible pad bytes per row
-      // average two at a time
-      
-      for( jj = 0; jj < halfHeight; jj++ ) {
-        int kk;
-        for( kk = 0; kk < components; kk++ ) {
-          float[] sfloat = new float[BOX2];
-          if( myswap_bytes ) {
-            datain.position( src );
-            sfloat[0] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-            datain.position( src + ysize );
-            sfloat[1] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-          } else {
-            datain.position( src );
-            sfloat[0] = datain.getFloat();
-            datain.position( src + ysize );
-            sfloat[1] = datain.getFloat();
-          }
-          dataout.put( ( sfloat[0] + sfloat[1] ) / 2.0f );
-          src += element_size;
-          dest += 4;
-        }
-        src += padBytes; // add pad bytes, if any, to get to end of row
-        src += ysize;
-      }
-      assert( src == ysize * height );
-    }
-    assert( dest == ( components * element_size * halfWidth * halfHeight ) );
-  }
-  
-  public static void halveImagePackedPixel( int components, Extract extract, int width, 
-          int height, ByteBuffer datain, ByteBuffer dataout, 
-          int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
-    if( width == 1 || height == 1 ) {
-      assert( !( width == 1 && height == 1 ) );
-      halve1DimagePackedPixel( components, extract, width, height, datain, dataout,
-                          pixelSizeInBytes, rowSizeInBytes, isSwap );
-      return;
-    }
-    int ii, jj;
-    
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int src = 0;
-    int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
-    int outIndex = 0;
-    
-    for( ii = 0; ii < halfHeight; ii++ ) {
-      for( jj = 0; jj < halfWidth; jj++ ) {
-        float totals[] = new float[4];
-        float extractTotals[][] = new float[BOX4][4];
-        int cc;
-        
-        datain.position( src );
-        extract.extract( isSwap, datain, extractTotals[0] );
-        datain.position( src + pixelSizeInBytes );
-        extract.extract( isSwap, datain, extractTotals[1] );
-        datain.position( src + rowSizeInBytes );
-        extract.extract( isSwap, datain, extractTotals[2] );
-        datain.position( src + rowSizeInBytes + pixelSizeInBytes );
-        extract.extract( isSwap, datain, extractTotals[3] );
-        for( cc = 0; cc < components; cc++ ) {
-          int kk = 0;
-          // grab 4 pixels to average
-          totals[cc] = 0.0f;
-          for( kk = 0; kk < BOX4; kk++ ) {
-            totals[cc] += extractTotals[kk][cc];
-          }
-          totals[cc] /= BOX4;
-        }
-        extract.shove( totals, outIndex, dataout );
-        outIndex++;
-        src += pixelSizeInBytes + pixelSizeInBytes;
-      }
-      // skip past pad bytes, if any, to get to next row
-      src += padBytes;
-      src += rowSizeInBytes;
-    }
-    assert( src == rowSizeInBytes * height );
-    assert( outIndex == halfWidth * halfHeight );
-  }
-  
-  public static void halve1DimagePackedPixel( int components, Extract extract, int width,
-              int height, ByteBuffer datain, ByteBuffer dataout,
-              int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int src = 0;
-    int jj;
-    
-    assert( width == 1 || height == 1 );
-    assert( width != height );
-    
-    if( height == 1 ) {
-      int outIndex = 0;
-      
-      assert( width != 1 );
-      halfHeight = 1;
-      
-      // one horizontal row with possible pad bytes
-      
-      for( jj = 0; jj < halfWidth; jj++ ) {
-        float[] totals = new float[4];
-        float[][] extractTotals = new float[BOX2][4];
-        int cc;
-        
-        datain.position( src );
-        extract.extract( isSwap, datain, extractTotals[0] );
-        datain.position( src + pixelSizeInBytes );
-        extract.extract( isSwap, datain, extractTotals[1] );
-        for( cc = 0; cc < components; cc++ ) {
-          int kk = 0;
-          // grab 4 pixels to average
-          totals[cc] = 0.0f;
-          for( kk = 0; kk < BOX2; kk++ ) {
-            totals[cc] += extractTotals[kk][cc];
-          }
-          totals[cc] /= BOX2;
-        }
-        extract.shove( totals, outIndex, dataout );
-        outIndex++;
-        // skip over to next group of 2
-        src += pixelSizeInBytes + pixelSizeInBytes;
-      }
-      int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
-      src += padBytes;
-      
-      assert( src == rowSizeInBytes );
-      assert( outIndex == halfWidth * halfHeight );
-    } else if( width == 1 ) {
-      int outIndex = 0;
-      
-      assert( height != 1 );
-      halfWidth = 1;
-      // one vertical volumn with possible pad bytes per row
-      // average two at a time
-      
-      for( jj = 0; jj < halfHeight; jj++ ) {
-        float[] totals = new float[4];
-        float[][] extractTotals = new float[BOX2][4];
-        int cc;
-        // average two at a time, instead of four
-        datain.position( src );
-        extract.extract( isSwap, datain, extractTotals[0] );
-        datain.position( src + rowSizeInBytes );
-        extract.extract( isSwap, datain, extractTotals[1] );
-        for( cc = 0; cc < components; cc++ ) {
-          int kk = 0;
-          // grab 4 pixels to average
-          totals[cc] = 0.0f;
-          for( kk = 0; kk < BOX2; kk++ ) {
-            totals[cc] += extractTotals[kk][cc];
-          }
-          totals[cc] /= BOX2;
-        }
-        extract.shove( totals, outIndex, dataout );
-        outIndex++;
-        // skip over to next group of 2
-        src += rowSizeInBytes + rowSizeInBytes;
-      }
-      assert( src == rowSizeInBytes );
-      assert( outIndex == halfWidth * halfHeight );
-    }
-  }
-  
-  public static void halveImagePackedPixelSlice( int components, Extract extract,
-          int width, int height, int depth, ByteBuffer dataIn,
-          ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
-          int imageSizeInBytes, boolean isSwap ) {
-    int ii, jj;
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int halfDepth = depth / 2;
-    int src = 0;
-    int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
-    int outIndex = 0;
-    
-    assert( (width == 1 || height == 1) && depth >= 2 );
-    
-    if( width == height ) {
-      assert( width == 1 && height == 1 );
-      assert( depth >= 2 );
-      
-      for( ii = 0; ii < halfDepth; ii++ ) {
-        float totals[] = new float[4];
-        float extractTotals[][] = new float[BOX2][4];
-        int cc;
-        
-        dataIn.position( src );
-        extract.extract( isSwap, dataIn, extractTotals[0] );
-        dataIn.position( src + imageSizeInBytes );
-        extract.extract( isSwap, dataIn, extractTotals[1] );
-        
-        for( cc = 0; cc < components; cc++ ) {
-          int kk;
-          
-          // average only 2 pixels since a column
-          totals[cc]= 0.0f;
-          for( kk = 0; kk < BOX2; kk++ ) {
-            totals[cc] += extractTotals[kk][cc];
-          }
-          totals[cc] /= BOX2;
-        } // for cc
-        
-        extract.shove( totals, outIndex, dataOut );
-        outIndex++;
-        // skip over to next group of 2
-        src += imageSizeInBytes + imageSizeInBytes;
-      } // for ii
-    } else if( height == 1 ) {
-      assert( width != 1 );
-      
-      for( ii = 0; ii < halfDepth; ii++ ) {
-        for( jj = 0; jj < halfWidth; jj++ ) {
-          float totals[] = new float[4];
-          float extractTotals[][] = new float[BOX4][4];
-          int cc;
-          
-          dataIn.position( src );
-          extract.extract( isSwap, dataIn, extractTotals[0] );
-          dataIn.position( src + pixelSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[1] );
-          dataIn.position( src + imageSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[2] );
-          dataIn.position( src + pixelSizeInBytes + imageSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[3] );
-          
-          for( cc = 0; cc < components; cc++ ) {
-            int kk;
-            
-            // grab 4 pixels to average
-            totals[cc] = 0.0f;
-            for( kk = 0; kk < BOX4; kk++ ) {
-              totals[cc]+= extractTotals[kk][cc];
-            }
-            totals[cc]/= (float)BOX4;
-          }
-          extract.shove( totals, outIndex, dataOut );
-          outIndex++;
-          // skip over to next horizontal square of 4
-          src += imageSizeInBytes + imageSizeInBytes;
-        }
-      }
-    } else if( width == 1 ) {
-      assert( height != 1 );
-      
-      for( ii = 0; ii < halfDepth; ii++ ) {
-        for( jj = 0; jj < halfWidth; jj++ ) {
-          float totals[] = new float[4];
-          float extractTotals[][] = new float[BOX4][4];
-          int cc;
-          
-          dataIn.position( src );
-          extract.extract( isSwap, dataIn, extractTotals[0] );
-          dataIn.position( src + rowSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[1] );
-          dataIn.position( src + imageSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[2] );
-          dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[3] );
-          
-          for( cc = 0; cc < components; cc++ ) {
-            int kk;
-            
-            // grab 4 pixels to average
-            totals[cc] = 0.0f;
-            for( kk = 0; kk < BOX4; kk++ ) {
-              totals[cc]+= extractTotals[kk][cc];
-            }
-            totals[cc]/= (float)BOX4;
-          }
-          extract.shove( totals, outIndex, dataOut );
-          outIndex++;
-          // skip over to next horizontal square of 4
-          src += imageSizeInBytes + imageSizeInBytes;
-        }
-      }
-    }
-  }
-  
-  public static void halveImageSlice( int components, ExtractPrimitive extract, int width,
-          int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
-          int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
-          int imageSizeInBytes, boolean isSwap ) {
-    int ii, jj;
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int halfDepth = depth / 2;
-    int src = 0;
-    int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
-    int outIndex = 0;
-    
-    assert( (width == 1 || height == 1) && depth >= 2 );
-    
-    if( width == height ) {
-      assert( width == 1 && height == 1 );
-      assert( depth >= 2 );
-      
-      for( ii = 0; ii < halfDepth; ii++ ) {
-        int cc;
-        for( cc = 0; cc < components; cc++ ) {
-          double[] totals = new double[4];
-          double[][] extractTotals = new double[BOX2][4];
-          int kk;
-          
-          dataIn.position( src );
-          extractTotals[0][cc] = extract.extract( isSwap, dataIn );
-          dataIn.position( src + imageSizeInBytes );
-          extractTotals[1][cc] = extract.extract( isSwap, dataIn );
-          
-          // average 2 pixels since only a column
-          totals[cc] = 0.0f;
-          // totals[red] = extractTotals[0][red] + extractTotals[1][red];
-          // totals[red] = red / 2;
-          for( kk = 0; kk < BOX2; kk++ ) {
-            totals[cc] += extractTotals[kk][cc];
-          }
-          totals[cc] /= (double)BOX2;
-          
-          extract.shove( totals[cc], outIndex, dataOut );
-          outIndex++;
-          src += elementSizeInBytes;
-        } // for cc
-        // skip over next group of 2
-        src += rowSizeInBytes;
-      } // for ii
-      
-      assert( src == rowSizeInBytes * height * depth );
-      assert( outIndex == halfDepth * components );
-    } else if( height == 1 ) {
-      assert( width != 1 );
-      
-      for( ii = 0; ii < halfDepth; ii++ ) {
-        for( jj = 0; jj < halfWidth; jj++ ) {
-          int cc;
-          for( cc = 0; cc < components; cc++ ) {
-            int kk;
-            double totals[] = new double[4];
-            double extractTotals[][] = new double[BOX4][4];
-            
-            dataIn.position( src );
-            extractTotals[0][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + groupSizeInBytes );
-            extractTotals[1][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + imageSizeInBytes );
-            extractTotals[2][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
-            extractTotals[3][cc] = extract.extract( isSwap, dataIn );
-            
-            // grab 4 pixels to average
-            totals[cc] = 0.0f;
-            // totals[red] = extractTotals[0][red] + extractTotals[1][red] +
-            //               extractTotals[2][red] + extractTotals[3][red];
-            // totals[red] /= (double)BOX4;
-            for( kk = 0; kk < BOX4; kk++ ) {
-              totals[cc] += extractTotals[kk][cc];
-            }
-            totals[cc] /= (double)BOX4;
-            
-            extract.shove( totals[cc], outIndex, dataOut );
-            outIndex++;
-            src += elementSizeInBytes;
-          } // for cc
-          // skip over to next horizontal square of 4
-          src += elementSizeInBytes;
-        } // for jj
-        src += padBytes;
-        src += rowSizeInBytes;
-      } // for ii
-      assert( src == rowSizeInBytes * height * depth );
-      assert( outIndex == halfWidth * halfDepth * components );
-    } else if( width == 1 ) {
-      assert( height != 1 );
-      
-      for( ii = 0; ii < halfDepth; ii++ ) {
-        for( jj = 0; jj < halfHeight; jj++ ) {
-          int cc;
-          for( cc = 0; cc < components; cc++ ) {
-            int kk;
-            double totals[] = new double[4];
-            double extractTotals[][] = new double[BOX4][4];
-            
-            dataIn.position( src );
-            extractTotals[0][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + rowSizeInBytes );
-            extractTotals[1][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + imageSizeInBytes );
-            extractTotals[2][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
-            extractTotals[3][cc] = extract.extract( isSwap, dataIn );
-            
-            
-            // grab 4 pixels to average
-            totals[cc] = 0.0f;
-            // totals[red] = extractTotals[0][red] + extractTotals[1][red] +
-            //               extractTotals[2][red] + extractTotals[3][red];
-            // totals[red] /= (double)BOX4;
-            for( kk = 0; kk < BOX4; kk++ ) {
-              totals[cc] += extractTotals[kk][cc];
-            }
-            totals[cc] /= (double)BOX4;
-            
-            extract.shove( totals[cc], outIndex, dataOut );
-            outIndex++;
-            src += elementSizeInBytes;
-          } // for cc
-          // skip over to next horizontal square of 4
-          src += padBytes;
-          src += rowSizeInBytes;
-        } // for jj
-        src += imageSizeInBytes;
-      } // for ii
-      assert( src == rowSizeInBytes * height * depth );
-      assert( outIndex == halfWidth * halfDepth * components );
-    }
-  }
-  
-  public static void halveImage3D( int components, ExtractPrimitive extract,
-          int width, int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
-          int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
-          int imageSizeInBytes, boolean isSwap ) {
-    assert( depth > 1 );
-    
-    // horizontal/vertical/onecolumn slice viewed from top
-    if( width == 1 || height == 1 ) {
-      assert( 1 <= depth );
-      
-      halveImageSlice( components, extract, width, height, depth, dataIn, dataOut,
-              elementSizeInBytes, groupSizeInBytes, rowSizeInBytes, imageSizeInBytes,
-              isSwap );
-      return;
-    }
-    
-    int ii, jj, dd;
-    
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int halfDepth = depth / 2;
-    int src = 0;
-    int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
-    int outIndex = 0;
-    
-    for( dd = 0; dd < halfDepth; dd++ ) {
-      for( ii = 0; ii < halfHeight; ii++ ) {
-        for( jj = 0; jj < halfWidth; jj++ ) {
-          int cc;
-          for( cc = 0; cc < components; cc++ ) {
-            int kk;
-            double totals[] = new double[4];
-            double extractTotals[][] = new double[BOX8][4];
-            
-            dataIn.position( src );
-            extractTotals[0][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + groupSizeInBytes );
-            extractTotals[1][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + rowSizeInBytes );
-            extractTotals[2][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + rowSizeInBytes + groupSizeInBytes );
-            extractTotals[3][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + imageSizeInBytes );
-            extractTotals[4][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + groupSizeInBytes + imageSizeInBytes );
-            extractTotals[5][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
-            extractTotals[6][cc] = extract.extract( isSwap, dataIn );
-            dataIn.position( src + rowSizeInBytes + imageSizeInBytes + groupSizeInBytes );
-            extractTotals[7][cc] = extract.extract( isSwap, dataIn );
-            
-            totals[cc] = 0.0f;
-            
-            for( kk = 0; kk < BOX8; kk++ ) {
-              totals[cc] += extractTotals[kk][cc];
-            }
-            totals[cc] /= (double)BOX8;
-            
-            extract.shove( totals[cc], outIndex, dataOut );
-            outIndex++;
-            
-            src += elementSizeInBytes;
-          } // for cc
-          // skip over to next square of 4
-          src += groupSizeInBytes;
-        } // for jj
-        // skip past pad bytes, if any, to get to next row
-        src += padBytes;
-        src += rowSizeInBytes;
-      } // for ii
-      src += imageSizeInBytes;
-    } // for dd
-    assert( src == rowSizeInBytes * height * depth );
-    assert( outIndex == halfWidth * halfHeight * halfDepth * components );
-  }
-  
-  public static void halveImagePackedPixel3D( int components, Extract extract,
-          int width, int height, int depth, ByteBuffer dataIn, 
-          ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
-          int imageSizeInBytes, boolean isSwap ) {
-    if( depth == 1 ) {
-      assert( 1 <= width && 1 <= height );
-      
-      halveImagePackedPixel( components, extract, width, height, dataIn, dataOut,
-              pixelSizeInBytes, rowSizeInBytes, isSwap );
-      return;
-    } else if( width == 1 || height == 1 ) { // a horizontal or vertical slice viewed from top
-      assert( 1 <= depth );
-      
-      halveImagePackedPixelSlice( components, extract, width, height, depth, dataIn,
-              dataOut, pixelSizeInBytes, rowSizeInBytes, imageSizeInBytes, isSwap );
-      return;
-    }
-    int ii, jj, dd;
-    
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int halfDepth = depth / 2;
-    int src = 0;
-    int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
-    int outIndex = 0;
-    
-    for( dd = 0; dd < halfDepth; dd++ ) {
-      for( ii = 0; ii < halfHeight; ii++ ) {
-        for( jj = 0; jj < halfWidth; jj++ ) {
-          float totals[] = new float[4]; // 4 is max components
-          float extractTotals[][] = new float[BOX8][4];
-          int cc;
-          
-          dataIn.position( src );
-          extract.extract( isSwap, dataIn, extractTotals[0] );
-          dataIn.position( src + pixelSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[1] );
-          dataIn.position( src + rowSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[2] );
-          dataIn.position( src + rowSizeInBytes + pixelSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[3] );
-          dataIn.position( src + imageSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[4] );
-          dataIn.position( src + pixelSizeInBytes + imageSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[5] );
-          dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[6] );
-          dataIn.position( src + rowSizeInBytes + pixelSizeInBytes + imageSizeInBytes );
-          extract.extract( isSwap, dataIn, extractTotals[7] );
-          
-          for( cc = 0; cc < components; cc++ ) {
-            int kk;
-            // grab 8 pixels to average
-            totals[cc] = 0.0f;
-            for( kk = 0; kk < BOX8; kk++ ) {
-              totals[cc] += extractTotals[kk][cc];
-            }
-            totals[cc] /= (float)BOX8;
-          }
-          extract.shove( totals, outIndex, dataOut );
-          outIndex++;
-          // skip over to next square of 4
-          src += pixelSizeInBytes + pixelSizeInBytes;
-        }
-        // skip past pad bytes, if any, to get to next row
-        src += padBytes;
-        src += rowSizeInBytes;
-      }
-      src += imageSizeInBytes;
-    }
-    assert( src == rowSizeInBytes * height * depth );
-    assert( outIndex == halfWidth * halfHeight * halfDepth );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Image.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Image.java
deleted file mode 100644
index b2aaad2..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Image.java
+++ /dev/null
@@ -1,1413 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import java.nio.*;
-
-/**
- *
- * @author  Administrator
- */
-public class Image {
-  
-  /** Creates a new instance of Image */
-  public Image() {
-  }
-  
-  public static short getShortFromByteArray( byte[] array, int index ) {
-    short s;
-    s = (short)(array[index] << 8 );
-    s |= (short)(0x00FF & array[index+1]);
-    return( s );
-  }
-  
-  public static int getIntFromByteArray( byte[] array, int index ) {
-    int i;
-    i = ( array[index] << 24 ) & 0xFF000000;
-    i |= ( array[index+1] << 16 ) & 0x00FF0000;
-    i |= ( array[index+2] << 8 ) & 0x0000FF00;
-    i |= ( array[index+3] ) & 0x000000FF;
-    return( i );
-  }
-  
-  public static float getFloatFromByteArray( byte[] array, int index ) {
-    int i = getIntFromByteArray( array, index );
-    return( Float.intBitsToFloat(i) );
-  }
-  
-  /*
-   *  Extract array from user's data applying all pixel store modes.
-   *  The internal format used is an array of unsigned shorts.
-   */
-  public static void fill_image( PixelStorageModes psm, int width, int height,
-                  int format, int type, boolean index_format, ByteBuffer userdata,
-                  ShortBuffer newimage ) {
-    int components;
-    int element_size;
-    int rowsize;
-    int padding;
-    int groups_per_line;
-    int group_size;
-    int elements_per_line;
-    int start;
-    int iter = 0;
-    int iter2;
-    int i, j, k;
-    boolean myswap_bytes;
-    
-    // Create a Extract interface object
-    Extract extract = null;
-    switch( type ) {
-      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-        extract = new Extract332();
-        break;
-      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-        extract = new Extract233rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-        extract = new Extract565();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-        extract = new Extract565rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-        extract = new Extract4444();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-        extract = new Extract4444rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-        extract = new Extract5551();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-        extract = new Extract1555rev();
-        break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-        extract = new Extract8888();
-        break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-        extract = new Extract8888rev();
-        break;
-      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-        extract = new Extract1010102();
-        break;
-      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-        extract = new Extract2101010rev();
-        break;
-    }
-    
-    myswap_bytes = psm.getUnpackSwapBytes();
-    components = Mipmap.elements_per_group( format, type );
-    if( psm.getUnpackRowLength() > 0 ) {
-      groups_per_line = psm.getUnpackRowLength();
-    } else {
-      groups_per_line = width;
-    }
-    
-    // All formats except GL_BITMAP fall out trivially
-    if( type == GL2.GL_BITMAP ) {
-      int bit_offset;
-      int current_bit;
-      
-      rowsize = ( groups_per_line * components + 7 ) / 8;
-      padding = ( rowsize % psm.getUnpackAlignment() );
-      if( padding != 0 ) {
-        rowsize += psm.getUnpackAlignment() - padding;
-      }
-      start = psm.getUnpackSkipRows() * rowsize + ( psm.getUnpackSkipPixels() * components / 8 );
-      elements_per_line = width * components;
-      iter2 = 0;
-      for( i = 0; i < height; i++ ) {
-        iter = start;
-        userdata.position( iter ); // ****************************************
-        bit_offset = (psm.getUnpackSkipPixels() * components) % 8;
-        for( j = 0; j < elements_per_line; j++ ) {
-          // retrieve bit
-          if( psm.getUnpackLsbFirst() ) {
-            userdata.position( iter );
-            current_bit = ( userdata.get() & 0x000000FF ) & ( 1 << bit_offset );//userdata[iter] & ( 1 << bit_offset );
-          } else {
-            current_bit = ( userdata.get() & 0x000000FF ) & ( 1 << ( 7 - bit_offset ) );
-          }
-          if( current_bit != 0 ) {
-            if( index_format ) {
-              newimage.position( iter2 );
-              newimage.put( (short)1 );
-            } else {
-              newimage.position( iter2 );
-              newimage.put( (short)65535 );
-            }
-          } else {
-            newimage.position( iter2 );
-            newimage.put( (short)0 );
-          }
-          bit_offset++;
-          if( bit_offset == 8 ) {
-            bit_offset = 0;
-            iter++;
-          }
-          iter2++;
-        }
-        start += rowsize;
-      }
-    } else {
-      element_size = Mipmap.bytes_per_element( type );
-      group_size = element_size * components;
-      if( element_size == 1 ) {
-        myswap_bytes = false;
-      }
-      
-      rowsize = groups_per_line * group_size;
-      padding = ( rowsize % psm.getUnpackAlignment() );
-      if( padding != 0 ) {
-        rowsize += psm.getUnpackAlignment() - padding;
-      }
-      start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
-      elements_per_line = width * components;
-      
-      iter2 = 0;
-      for( i = 0; i < height; i++ ) {
-        iter = start;
-        userdata.position( iter ); //***************************************
-        for( j = 0; j < elements_per_line; j++ ) {
-          Type_Widget widget = new Type_Widget();
-          float[] extractComponents = new float[4];
-          userdata.position( iter );
-          switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-              extract.extract( false, userdata /*userdata[iter]*/, extractComponents );
-              for( k = 0; k < 3; k++ ) {
-                newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-              extract.extract( false, userdata /*userdata[iter]*/, extractComponents );
-              for( k = 0; k < 3; k++ ) {
-                newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_BYTE ):
-              if( index_format ) {
-                newimage.put( iter2++, (short)( 0x000000FF & userdata.get() ) );//userdata[iter];
-              } else {
-                newimage.put( iter2++, (short)( 0x000000FF & userdata.get()/*userdata[iter]*/ * 257 ) );
-              }
-              break;
-            case( GL2.GL_BYTE ):
-              if( index_format ) {
-                newimage.put( iter2++, userdata.get() ); //userdata[iter];
-              } else {
-                newimage.put( iter2++, (short)(userdata.get()/*userdata[iter]*/ * 516 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-              extract.extract( myswap_bytes, userdata/*userdata[iter]*/, extractComponents );
-              for( k = 0; k < 3; k++ ) {
-                newimage.put( iter2++, (short)(extractComponents[k] * 65535) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-              extract.extract( myswap_bytes, userdata, extractComponents );
-              for( k = 0; k < 3; k++ ) {
-                newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-              extract.extract( myswap_bytes, userdata, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-              extract.extract( myswap_bytes, userdata, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-              extract.extract( myswap_bytes, userdata, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-              extract.extract( myswap_bytes, userdata, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
-              if( myswap_bytes ) {
-                widget.setUB1( userdata.get() );
-                widget.setUB0( userdata.get() );
-              } else {
-                widget.setUB0( userdata.get() );
-                widget.setUB1( userdata.get() );
-              }
-              if( type == GL2.GL_SHORT ) {
-                if( index_format ) {
-                  newimage.put( iter2++, widget.getS0() );
-                } else {
-                  newimage.put( iter2++, (short)(widget.getS0() * 2) );
-                }
-              } else {
-                newimage.put( iter2++, widget.getUS0() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-              extract.extract( myswap_bytes, userdata, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-              extract.extract( myswap_bytes, userdata, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-              extract.extract( myswap_bytes, userdata, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-              extract.extract( myswap_bytes, userdata, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_INT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_FLOAT ):
-              if( myswap_bytes ) {
-                widget.setUB3( userdata.get() );
-                widget.setUB2( userdata.get() );
-                widget.setUB1( userdata.get() );
-                widget.setUB0( userdata.get() );
-              } else {
-                widget.setUB0( userdata.get() );
-                widget.setUB1( userdata.get() );
-                widget.setUB2( userdata.get() );
-                widget.setUB3( userdata.get() );
-              }
-              if( type == GL2.GL_FLOAT ) {
-                if( index_format ) {
-                  newimage.put( iter2++, (short)widget.getF() );
-                } else {
-                  newimage.put( iter2++, (short)(widget.getF() * 65535 ) );
-                }
-              } else if( type == GL2.GL_UNSIGNED_INT ) {
-                if( index_format ) {
-                  newimage.put( iter2++, (short)( widget.getUI() ) );
-                } else {
-                  newimage.put( iter2++, (short)( widget.getUI() >> 16 ) );
-                }
-              } else {
-                if( index_format ) {
-                  newimage.put( iter2++, (short)( widget.getI() ) );
-                } else {
-                  newimage.put( iter2++, (short)( widget.getI() >> 15 ) );
-                }
-              }
-              break;
-          }
-          iter += element_size;
-        }  // for j
-        start += rowsize;
-        // want iter pointing at start, not within, row for assertion purposes
-        iter = start;
-      } // for i
-      
-      // iterators should be one byte past end
-      if( !Mipmap.isTypePackedPixel( type ) ) {
-        assert( iter2 == ( width * height * components ) );
-      } else {
-        assert( iter2 == ( width * height * Mipmap.elements_per_group( format, 0 ) ) );
-      }
-      assert( iter == ( rowsize * height + psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size ) );
-    }
-  }
-  
-  /*
-   *  Insert array into user's data applying all pixel store modes.
-   *  Theinternal format is an array of unsigned shorts.
-   *  empty_image() because it is the opposet of fill_image().
-   */
-  public static void empty_image( PixelStorageModes psm, int width, int height, 
-                                  int format, int type, boolean index_format, 
-                                  ShortBuffer oldimage, ByteBuffer userdata ) {
-    
-    int components;
-    int element_size;
-    int rowsize;
-    int padding;
-    int groups_per_line;
-    int group_size;
-    int elements_per_line;
-    int start;
-    int iter = 0;
-    int iter2;
-    int i, j, k;
-    boolean myswap_bytes;
-    
-    // Create a Extract interface object
-    Extract extract = null;
-    switch( type ) {
-      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-        extract = new Extract332();
-        break;
-      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-        extract = new Extract233rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-        extract = new Extract565();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-        extract = new Extract565rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-        extract = new Extract4444();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-        extract = new Extract4444rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-        extract = new Extract5551();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-        extract = new Extract1555rev();
-        break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-        extract = new Extract8888();
-        break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-        extract = new Extract8888rev();
-        break;
-      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-        extract = new Extract1010102();
-        break;
-      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-        extract = new Extract2101010rev();
-        break;
-    }
-    
-    myswap_bytes = psm.getPackSwapBytes();
-    components = Mipmap.elements_per_group( format, type );
-    if( psm.getPackRowLength() > 0 ) {
-      groups_per_line = psm.getPackRowLength();
-    } else {
-      groups_per_line = width;
-    }
-    
-    // all formats except GL_BITMAP fall out trivially
-    if( type == GL2.GL_BITMAP ) {
-      int bit_offset;
-      int current_bit;
-      
-      rowsize = ( groups_per_line * components + 7 ) / 8;
-      padding = ( rowsize % psm.getPackAlignment() );
-      if( padding != 0 ) {
-        rowsize += psm.getPackAlignment() - padding;
-      }
-      start = psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * components / 8;
-      elements_per_line = width * components;
-      iter2 = 0;
-      for( i = 0; i < height; i++ ) {
-        iter = start;
-        bit_offset = ( psm.getPackSkipPixels() * components ) % 8;
-        for( j = 0; j < elements_per_line; j++ ) {
-          if( index_format ) {
-            current_bit = oldimage.get( iter2 ) & 1;
-          } else {
-            if( oldimage.get( iter2 ) < 0 ) { // must check for negative rather than 32767
-              current_bit = 1;
-            } else {
-              current_bit = 0;
-            }
-          }
-          
-          if( current_bit != 0 ) {
-            if( psm.getPackLsbFirst() ) {
-              userdata.put( iter, (byte)( ( userdata.get( iter ) | ( 1 << bit_offset ) ) ) );
-            } else {
-              userdata.put( iter, (byte)( ( userdata.get( iter ) | ( 7 - bit_offset ) ) ) );
-            }
-          } else {
-            if( psm.getPackLsbFirst() ) {
-              //userdata[iter] &= ~( 1 << bit_offset );
-              userdata.put( iter, (byte)( ( userdata.get( iter ) & ~( 1 << bit_offset ) ) ) );
-            } else {
-              //userdata[iter] &= ~( 1 << ( 7 - bit_offset ) );
-              userdata.put( iter, (byte)( ( userdata.get( iter ) & ~( 7 - bit_offset ) ) ) );
-            }
-          }
-          
-          bit_offset++;
-          if( bit_offset == 8 ) {
-            bit_offset = 0;
-            iter++;
-          }
-          iter2++;
-        }
-        start += rowsize;
-      }
-    } else {
-      float shoveComponents[] = new float[4];
-      
-      element_size = Mipmap.bytes_per_element( type );
-      group_size = element_size * components;
-      if( element_size == 1 ) {
-        myswap_bytes = false;
-      }
-      
-      rowsize = groups_per_line * group_size;
-      padding = ( rowsize % psm.getPackAlignment() );
-      if( padding != 0 ) {
-        rowsize += psm.getPackAlignment() - padding;
-      }
-      start = psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size;
-      elements_per_line = width * components;
-      
-      iter2 = 0;
-      for( i = 0; i < height; i++ ) {
-        iter = start;
-        for( j = 0; j < elements_per_line; j++ ) {
-          Type_Widget widget = new Type_Widget();
-          
-          switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-              for( k = 0; k < 3; k++ ) {
-                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, userdata );
-              break;
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-              for( k = 0; k < 3; k++ ) {
-                shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, userdata );
-              break;
-            case( GL2.GL_UNSIGNED_BYTE ):
-              if( index_format ) {
-                //userdata[iter] = (byte)oldimage[iter2++];
-                userdata.put( iter, (byte)oldimage.get(iter2++) );
-              } else {
-                //userdata[iter] = (byte)( oldimage[iter2++] >> 8 );
-                userdata.put( iter, (byte)( oldimage.get(iter2++) ) );
-              }
-              break;
-            case( GL2.GL_BYTE ):
-              if( index_format ) {
-                //userdata[iter] = (byte)oldimage[iter2++];
-                userdata.put( iter, (byte)oldimage.get(iter2++) );
-              } else {
-                //userdata[iter] = (byte)( oldimage[iter2++] >> 9 );
-                userdata.put( iter, (byte)( oldimage.get(iter2++) ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-              for( k = 0; k < 3; k++ ) {
-                shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswap_bytes ) {
-                //userdata[iter] = widget.getUB1();
-                //userdata[iter+1] = widget.getUB0();
-                userdata.put( iter, widget.getUB1() );
-                userdata.put( iter + 1,widget.getUB0() );
-              } else {
-                //userdata[iter] = widget.getUB0();
-                //userdata[iter+1] = widget.getUB1();
-                userdata.put( iter, widget.getUB0() );
-                userdata.put( iter + 1, widget.getUB1() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-              for( k = 0; k < 3; k++ ) {
-                shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswap_bytes ) {
-                //userdata[iter] = widget.getUB1();
-                //userdata[iter+1] = widget.getUB0();
-                userdata.put( iter, widget.getUB1() );
-                userdata.put( iter + 1, widget.getUB0() );
-              } else {
-                //userdata[iter] = widget.getUB0();
-                //userdata[iter+1] = widget.getUB1();
-                userdata.put( iter, widget.getUB0() );
-                userdata.put( iter, widget.getUB1() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswap_bytes ) {
-                //userdata[iter] = widget.getUB1();
-                //userdata[iter+1] = widget.getUB0();
-                userdata.put( iter, widget.getUB1() );
-                userdata.put( iter + 1, widget.getUB0() );
-              } else {
-                //userdata[iter] = widget.getUB0();
-                //userdata[iter+1] = widget.getUB1();
-                userdata.put( iter, widget.getUB0() );
-                userdata.put( iter + 1, widget.getUB1() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswap_bytes ) {
-                //userdata[iter] = widget.getUB1();
-                //userdata[iter+1] = widget.getUB0();
-                userdata.put( iter, widget.getUB1() );
-                userdata.put( iter + 1, widget.getUB0() );
-              } else {
-                //userdata[iter] = widget.getUB0();
-                //userdata[iter+1] = widget.getUB1();
-                userdata.put( iter, widget.getUB0() );
-                userdata.put( iter + 1, widget.getUB1() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswap_bytes ) {
-                //userdata[iter] = widget.getUB1();
-                //userdata[iter+1] = widget.getUB0();
-                userdata.put( iter, widget.getUB1() );
-                userdata.put( iter + 1, widget.getUB0() );
-              } else {
-                //userdata[iter] = widget.getUB0();
-                //userdata[iter+1] = widget.getUB1();
-                userdata.put( iter, widget.getUB0() );
-                userdata.put( iter + 1, widget.getUB1() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswap_bytes ) {
-                //userdata[iter] = widget.getUB1();
-                //userdata[iter+1] = widget.getUB0();
-                userdata.put( iter, widget.getUB1() );
-                userdata.put( iter + 1, widget.getUB0() );
-              } else {
-                //userdata[iter] = widget.getUB0();
-                //userdata[iter+1] = widget.getUB1();
-                userdata.put( iter, widget.getUB0() );
-                userdata.put( iter + 1, widget.getUB1() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
-              if( type == GL2.GL_SHORT ) {
-                if( index_format ) {
-                  widget.setS0( oldimage.get( iter2++ ) );
-                } else {
-                  widget.setS0( (short)(oldimage.get( iter2++ ) >> 1) );
-                }
-              } else {
-                widget.setUS0( oldimage.get( iter2++ ) );
-              }
-              if( myswap_bytes ) {
-                //userdata[iter] = widget.getUB1();
-                //userdata[iter+1] = widget.getUB0();
-                userdata.put( iter, widget.getUB1() );
-                userdata.put( iter + 1, widget.getUB0() );
-              } else {
-                //userdata[iter] = widget.getUB0();
-                //userdata[iter] = widget.getUB1();
-                userdata.put( iter, widget.getUB0() );
-                userdata.put( iter + 1, widget.getUB1() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswap_bytes ) {
-                //userdata[iter+3] = widget.getUB0();
-                //userdata[iter+2] = widget.getUB1();
-                //userdata[iter+1] = widget.getUB2();
-                //userdata[iter  ] = widget.getUB3();
-                userdata.put( iter + 3, widget.getUB0() );
-                userdata.put( iter + 2, widget.getUB1() );
-                userdata.put( iter + 1, widget.getUB2() );
-                userdata.put( iter    , widget.getUB3() );
-              } else {
-                userdata.putInt( iter, widget.getUI() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswap_bytes ) {
-                //userdata[iter+3] = widget.getUB0();
-                //userdata[iter+2] = widget.getUB1();
-                //userdata[iter+1] = widget.getUB2();
-                //userdata[iter  ] = widget.getUB3();
-                userdata.put( iter + 3, widget.getUB0() );
-                userdata.put( iter + 2, widget.getUB1() );
-                userdata.put( iter + 2, widget.getUB2() );
-                userdata.put( iter    , widget.getUB3() );
-              } else {
-                userdata.putInt( iter, widget.getUI() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswap_bytes ) {
-                //userdata[iter+3] = widget.getUB0();
-                //userdata[iter+2] = widget.getUB1();
-                //userdata[iter+1] = widget.getUB2();
-                //userdata[iter  ] = widget.getUB3();
-                userdata.put( iter + 3, widget.getUB0() );
-                userdata.put( iter + 2, widget.getUB1() );
-                userdata.put( iter + 1, widget.getUB2() );
-                userdata.put( iter    , widget.getUB3() );
-              } else {
-                userdata.putInt( iter, widget.getUI() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswap_bytes ) {
-                //userdata[iter+3] = widget.getUB0();
-                //userdata[iter+2] = widget.getUB1();
-                //userdata[iter+1] = widget.getUB2();
-                //userdata[iter  ] = widget.getUB3();
-                userdata.put( iter + 3, widget.getUB0() );
-                userdata.put( iter + 2, widget.getUB1() );
-                userdata.put( iter + 1, widget.getUB2() );
-                userdata.put( iter    , widget.getUB3() );
-              } else {
-                userdata.putInt( iter, widget.getUI() );
-              }
-              break;
-            case( GL2.GL_INT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_FLOAT ):
-              if( type == GL2.GL_FLOAT ) {
-                if( index_format ) {
-                  widget.setF( oldimage.get( iter2++ ) );
-                } else {
-                  widget.setF( oldimage.get( iter2++ ) / 65535.0f );
-                }
-              } else if( type == GL2.GL_UNSIGNED_INT ) {
-                if( index_format ) {
-                  widget.setUI( oldimage.get( iter2++ ) );
-                } else {
-                  widget.setUI( oldimage.get( iter2++ ) * 65537 );
-                }
-              } else {
-                if( index_format ) {
-                  widget.setI( oldimage.get( iter2++ ) );
-                } else {
-                  widget.setI( (oldimage.get( iter2++ ) * 65537) / 2 );
-                }
-              }
-              if( myswap_bytes ) {
-                userdata.put( iter + 3, widget.getUB0() );
-                userdata.put( iter + 2, widget.getUB1() );
-                userdata.put( iter + 1, widget.getUB2() );
-                userdata.put( iter    , widget.getUB3() );
-              } else {
-                userdata.put( iter    , widget.getUB0() );
-                userdata.put( iter + 1, widget.getUB1() );
-                userdata.put( iter + 2, widget.getUB2() );
-                userdata.put( iter + 3, widget.getUB3() );
-              }
-              break;
-          }
-          iter += element_size;
-        } // for j
-        start += rowsize;
-        // want iter pointing at start, not within, row for assertion purposes
-        iter = start;
-      } // for i
-      // iterators should be one byte past end
-      if( !Mipmap.isTypePackedPixel( type ) ) {
-        assert( iter2 == width * height * components );
-      } else {
-        assert( iter2 == width * height * Mipmap.elements_per_group( format, 0 ) );
-      }
-      assert( iter == rowsize * height + psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size );
-    }
-  }
-  
-  public static void fillImage3D( PixelStorageModes psm, int width, int height,
-          int depth, int format, int type, boolean indexFormat, ByteBuffer userImage,
-          ShortBuffer newImage ) {
-    boolean myswapBytes;
-    int components;
-    int groupsPerLine;
-    int elementSize;
-    int groupSize;
-    int rowSize;
-    int padding;
-    int elementsPerLine;
-    int rowsPerImage;
-    int imageSize;
-    int start, rowStart;
-    int iter = 0;
-    int iter2 = 0;
-    int ww, hh, dd, k;
-    Type_Widget widget = new Type_Widget();
-    float extractComponents[] = new float[4];
-    
-    // Create a Extract interface object
-    Extract extract = null;
-    switch( type ) {
-      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-        extract = new Extract332();
-        break;
-      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-        extract = new Extract233rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-        extract = new Extract565();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-        extract = new Extract565rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-        extract = new Extract4444();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-        extract = new Extract4444rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-        extract = new Extract5551();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-        extract = new Extract1555rev();
-        break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-        extract = new Extract8888();
-        break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-        extract = new Extract8888rev();
-        break;
-      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-        extract = new Extract1010102();
-        break;
-      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-        extract = new Extract2101010rev();
-        break;
-    }
-    
-    myswapBytes = psm.getUnpackSwapBytes();
-    components = Mipmap.elements_per_group( format, type );
-    if( psm.getUnpackRowLength() > 0 ) {
-      groupsPerLine = psm.getUnpackRowLength();
-    } else {
-      groupsPerLine = width;
-    }
-    elementSize = Mipmap.bytes_per_element( type );
-    groupSize = elementSize * components;
-    if( elementSize == 1 ) {
-      myswapBytes = false;
-    }
-    
-    // 3dstuff begin
-    if( psm.getUnpackImageHeight() > 0 ) {
-      rowsPerImage = psm.getUnpackImageHeight();
-    } else {
-      rowsPerImage = height;
-    }
-    // 3dstuff end
-    
-    rowSize = groupsPerLine * groupSize;
-    padding = rowSize % psm.getUnpackAlignment();
-    if( padding != 0 ) {
-      rowSize += psm.getUnpackAlignment() - padding;
-    }
-    
-    imageSize = rowsPerImage * rowSize; // 3dstuff
-    
-    start = psm.getUnpackSkipRows() * rowSize + 
-            psm.getUnpackSkipPixels() * groupSize + 
-            psm.getUnpackSkipImages() * imageSize;
-    elementsPerLine = width * components;
-    
-    iter2 = 0;
-    for( dd = 0; dd < depth; dd++ ) {
-      rowStart = start;
-      for( hh = 0; hh < height; hh++ ) {
-        iter = rowStart;
-        for( ww = 0; ww < elementsPerLine; ww++ ) {
-          
-          switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE ):
-              if( indexFormat ) {
-                newImage.put( iter2++, (short)(0x000000FF & userImage.get( iter ) ) );
-              } else {
-                newImage.put( iter2++, (short)((0x000000FF & userImage.get( iter ) ) * 257 ) );
-              }
-              break;
-            case( GL2.GL_BYTE ):
-              if( indexFormat ) {
-                newImage.put( iter2++, userImage.get( iter ) );
-              } else {
-                newImage.put( iter2++, (short)(userImage.get( iter ) * 516 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-              userImage.position( iter );
-              extract.extract( false, userImage, extractComponents );
-              for( k = 0; k < 3; k++ ) {
-                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-              userImage.position( iter );
-              extract.extract( false, userImage, extractComponents );
-              for( k = 0; k < 3; k++ ) {
-                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-              userImage.position( iter );
-              extract.extract( myswapBytes, userImage, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-              userImage.position( iter );
-              extract.extract( myswapBytes, userImage, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-              userImage.position( iter );
-              extract.extract( myswapBytes, userImage, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-              userImage.position( iter );
-              extract.extract( myswapBytes, userImage, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-              userImage.position( iter );
-              extract.extract( myswapBytes, userImage, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-              userImage.position( iter );
-              extract.extract( myswapBytes, userImage, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
-              if( myswapBytes ) {
-                widget.setUB0( userImage.get( iter + 1 ) );
-                widget.setUB1( userImage.get( iter ) );
-              } else {
-                widget.setUB0( userImage.get( iter ) );
-                widget.setUB1( userImage.get( iter + 1 ) );
-              }
-              if( type == GL2.GL_SHORT ) {
-                if( indexFormat ) {
-                  newImage.put( iter2++, widget.getUS0() );
-                } else {
-                  newImage.put( iter2++, (short)(widget.getUS0() * 2) );
-                }
-              } else {
-                newImage.put( iter2++, widget.getUS0() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-              userImage.position( iter );
-              extract.extract( myswapBytes, userImage, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-              userImage.position( iter );
-              extract.extract( myswapBytes, userImage, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-              userImage.position( iter );
-              extract.extract( myswapBytes, userImage, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-              extract.extract( myswapBytes, userImage, extractComponents );
-              for( k = 0; k < 4; k++ ) {
-                newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
-              }
-              break;
-            case( GL2.GL_INT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_FLOAT ):
-              if( myswapBytes ) {
-                widget.setUB0( userImage.get( iter + 3 ) );
-                widget.setUB1( userImage.get( iter + 2 ) );
-                widget.setUB2( userImage.get( iter + 1 ) );
-                widget.setUB3( userImage.get( iter     ) );
-              } else {
-                widget.setUB0( userImage.get( iter     ) );
-                widget.setUB1( userImage.get( iter + 1 ) );
-                widget.setUB2( userImage.get( iter + 2 ) );
-                widget.setUB3( userImage.get( iter + 3 ) );
-              }
-              if( type == GL2.GL_FLOAT ) {
-                if( indexFormat ) {
-                  newImage.put( iter2++, (short)widget.getF() );
-                } else {
-                  newImage.put( iter2++, (short)( widget.getF() * 65535.0f ) );
-                }
-              } else if( type == GL2.GL_UNSIGNED_INT ) {
-                if( indexFormat ) {
-                  newImage.put( iter2++, (short)widget.getUI() );
-                } else {
-                  newImage.put( iter2++, (short)(widget.getUI() >> 16) );
-                }
-              } else {
-                if( indexFormat ) {
-                  newImage.put( iter2++, (short)widget.getI() );
-                } else {
-                  newImage.put( iter2++, (short)(widget.getI() >> 15) );
-                }
-              }
-              break;
-            default:
-              assert( false );
-          }
-          iter += elementSize;
-        } // for ww
-        rowStart += rowSize;
-        iter = rowStart; // for assert
-      } // for hh
-      start += imageSize;
-    }// for dd
-    
-    // iterators should be one byte past end
-    if( !Mipmap.isTypePackedPixel( type ) ) {
-      assert( iter2 == width * height * depth * components );
-    } else {
-      assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
-    }
-    assert( iter == rowSize * height * depth + psm.getUnpackSkipRows() * rowSize + 
-            psm.getUnpackSkipPixels() * groupSize +
-            psm.getUnpackSkipImages() * imageSize );
-  }
-  
-  public static void emptyImage3D( PixelStorageModes psm, int width, int height, int depth,
-          int format, int type, boolean indexFormat, ShortBuffer oldImage, ByteBuffer userImage ) {
-    boolean myswapBytes;
-    int components;
-    int groupsPerLine;
-    int elementSize;
-    int groupSize;
-    int rowSize;
-    int padding;
-    int start, rowStart, iter;
-    int elementsPerLine;
-    int iter2;
-    int ii, jj, dd, k;
-    int rowsPerImage;
-    int imageSize;
-    Type_Widget widget = new Type_Widget();
-    float[] shoveComponents = new float[4];
-    
-    // Create a Extract interface object
-    Extract extract = null;
-    switch( type ) {
-      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-        extract = new Extract332();
-        break;
-      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-        extract = new Extract233rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-        extract = new Extract565();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-        extract = new Extract565rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-        extract = new Extract4444();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-        extract = new Extract4444rev();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-        extract = new Extract5551();
-        break;
-      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-        extract = new Extract1555rev();
-        break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-        extract = new Extract8888();
-        break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-        extract = new Extract8888rev();
-        break;
-      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-        extract = new Extract1010102();
-        break;
-      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-        extract = new Extract2101010rev();
-        break;
-    }
-    
-    iter = 0;
-    
-    myswapBytes = psm.getPackSwapBytes();
-    components = Mipmap.elements_per_group( format, type );
-    if( psm.getPackRowLength() > 0 ) {
-      groupsPerLine = psm.getPackRowLength();
-    } else {
-      groupsPerLine = width;
-    }
-    
-    elementSize = Mipmap.bytes_per_element( type );
-    groupSize = elementSize * components;
-    if( elementSize == 1 ) {
-      myswapBytes = false;
-    }
-    
-    // 3dstuff begin
-    if( psm.getPackImageHeight() > 0 ) {
-      rowsPerImage = psm.getPackImageHeight();
-    } else {
-      rowsPerImage = height;
-    }
-    
-    // 3dstuff end
-    
-    rowSize = groupsPerLine * groupSize;
-    padding = rowSize % psm.getPackAlignment();
-    if( padding != 0 ) {
-      rowSize += psm.getPackAlignment() - padding;
-    }
-    
-    imageSize = rowsPerImage * rowSize;
-    
-    start = psm.getPackSkipRows() * rowSize +
-            psm.getPackSkipPixels() * groupSize +
-            psm.getPackSkipImages() * imageSize;
-    elementsPerLine = width * components;
-    
-    iter2 = 0;
-    for( dd = 0; dd < depth; dd++ ) {
-      rowStart = start;
-      
-      for( ii = 0; ii < height; ii++ ) {
-        iter = rowStart;
-        
-        for( jj = 0; jj < elementsPerLine; jj++ ) {
-          
-          switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE ):
-              if( indexFormat ) {
-                userImage.put( iter, (byte)(oldImage.get( iter2++ ) ) );
-              } else {
-                userImage.put( iter, (byte)(oldImage.get( iter2++ ) >> 8 ) );
-              }
-              break;
-            case( GL2.GL_BYTE ):
-              if( indexFormat ) {
-                userImage.put( iter, (byte)(oldImage.get(iter2++) ) );
-              } else {
-                userImage.put( iter, (byte)(oldImage.get(iter2++) >> 9) );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-              for( k = 0; k < 3; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, userImage );
-              break;
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-              for( k = 0; k < 3; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, userImage );
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswapBytes ) {
-                userImage.putShort( iter, widget.getUB1() );
-                userImage.putShort( iter + 1, widget.getUB0() );
-              } else {
-                userImage.putShort( iter, widget.getUS0() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswapBytes ) {
-                userImage.put( iter, widget.getUB1() );
-                userImage.put( iter + 1, widget.getUB0() );
-              } else {
-                userImage.putShort( iter, widget.getUS0() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswapBytes ) {
-                userImage.put( iter, widget.getUB1() );
-                userImage.put( iter + 1, widget.getUB0() );
-              } else {
-                userImage.putShort( iter, widget.getUS0() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswapBytes ) {
-                userImage.put( iter, widget.getUB1() );
-                userImage.put( iter + 1, widget.getUB0() );
-              } else {
-                userImage.putShort( iter, widget.getUS0() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswapBytes ) {
-                userImage.put( iter, widget.getUB1() );
-                userImage.put( iter + 1, widget.getUB0() );
-              } else {
-                userImage.putShort( iter, widget.getUS0() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswapBytes ) {
-                userImage.put( iter, widget.getUB1() );
-                userImage.put( iter + 1, widget.getUB0() );
-              } else {
-                userImage.putShort( iter, widget.getUS0() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
-              if( type == GL2.GL_SHORT ) {
-                if( indexFormat ) {
-                  widget.setS0( (short)oldImage.get( iter2++ ) );
-                } else {
-                  widget.setS0( (short)(oldImage.get( iter2++ ) >> 1) );
-                }
-              } else {
-                widget.setUS0( (short)oldImage.get( iter2++ ) );
-              }
-              if( myswapBytes ) {
-                userImage.put( iter, widget.getUB1() );
-                userImage.put( iter + 1, widget.getUB0() );
-              } else {
-                userImage.put( iter, widget.getUB0() );
-                userImage.put( iter + 1, widget.getUB1() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswapBytes ) {
-                userImage.put( iter + 3, widget.getUB0() );
-                userImage.put( iter + 2, widget.getUB1() );
-                userImage.put( iter + 1, widget.getUB2() );
-                userImage.put( iter    , widget.getUB3() );
-              } else {
-                userImage.putInt( iter, widget.getUI() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswapBytes ) {
-                userImage.put( iter + 3, widget.getUB0() );
-                userImage.put( iter + 2, widget.getUB1() );
-                userImage.put( iter + 1, widget.getUB2() );
-                userImage.put( iter    , widget.getUB3() );
-              } else {
-                userImage.putInt( iter, widget.getUI() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswapBytes ) {
-                userImage.put( iter + 3, widget.getUB0() );
-                userImage.put( iter + 2, widget.getUB1() );
-                userImage.put( iter + 1, widget.getUB2() );
-                userImage.put( iter    ,widget.getUB3() );
-              } else {
-                userImage.putInt( iter, widget.getUI() );
-              }
-              break;
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
-              for( k = 0; k < 4; k++ ) {
-                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
-              }
-              extract.shove( shoveComponents, 0, widget.getBuffer() );
-              if( myswapBytes ) {
-                userImage.put( iter + 3, widget.getUB0() );
-                userImage.put( iter + 2, widget.getUB2() );
-                userImage.put( iter + 1, widget.getUB1() );
-                userImage.put( iter    , widget.getUB0() );
-              } else {
-                userImage.putInt( iter, widget.getUI() );
-              }
-              break;
-            case( GL2.GL_INT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_FLOAT ):
-              if( type == GL2.GL_FLOAT ) {
-                if( indexFormat ) {
-                  widget.setF( oldImage.get( iter2++ ) );
-                } else {
-                  widget.setF( oldImage.get( iter2++ ) / 65535.0f );
-                }
-              } else if( type == GL2.GL_UNSIGNED_INT ) {
-                if( indexFormat ) {
-                  widget.setUI( oldImage.get( iter2++ ) );
-                } else {
-                  widget.setUI( oldImage.get( iter2++ ) * 65537 );
-                }
-              } else {
-                if( indexFormat ) {
-                  widget.setI( oldImage.get( iter2++ ) );
-                } else {
-                  widget.setI( ( oldImage.get( iter2++ ) * 65535 ) / 2 );
-                }
-              }
-              if( myswapBytes ) {
-                userImage.put( iter + 3, widget.getUB0() );
-                userImage.put( iter + 2, widget.getUB1() );
-                userImage.put( iter + 1, widget.getUB2() );
-                userImage.put( iter    , widget.getUB3() );
-              } else {
-                userImage.put( iter    , widget.getUB0() );
-                userImage.put( iter + 1, widget.getUB1() );
-                userImage.put( iter + 2, widget.getUB2() );
-                userImage.put( iter + 3, widget.getUB3() );
-              }
-              break;
-            default:
-              assert( false );
-          }
-          
-          iter += elementSize;
-        } // for jj
-        rowStart += rowSize;
-      } // for ii
-      start += imageSize;
-    } // for dd
-    
-    if( !Mipmap.isTypePackedPixel( type ) ) {
-      assert( iter2 == width * height * depth * components );
-    } else {
-      assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
-    }
-    assert( iter == rowSize * height * depth + 
-                    psm.getUnpackSkipRows() * rowSize +
-                    psm.getUnpackSkipPixels() * groupSize +
-                    psm.getUnpackSkipImages() * imageSize );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Mipmap.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Mipmap.java
deleted file mode 100644
index 4e3f6c2..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Mipmap.java
+++ /dev/null
@@ -1,868 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import javax.media.opengl.GL2GL3;
-import javax.media.opengl.glu.GLU;
-import javax.media.opengl.GLException;
-import java.nio.*;
-import com.jogamp.common.nio.Buffers;
-
-/**
- *
- * @author  Administrator
- */
-public class Mipmap {
-  
-  /** Creates a new instance of Mipmap */
-  public Mipmap() {
-  }
-  
-  public static int computeLog( int value ) {
-    int i = 0;
-    // Error
-    if( value == 0 ) {
-      return( -1 );
-    }
-    for( ;; ) {
-      if( (value & 1) >= 1 ) {
-        if( value != 1 ) {
-          return( -1 );
-        }
-        return( i );
-      }
-      value = value >> 1;
-      i++;
-    }
-  }
-  
-  /* Compute the nearest power of 2 number.  This algorithm is a little strange
-   * but it works quite well.
-   */
-  public static int nearestPower( int value ) {
-    int i = 1;
-    // Error!
-    if( value == 0 ) {
-      return( -1 );
-    }
-    for( ;; ) {
-      if( value == 1 ) {
-        return( i );
-      } else if( value == 3 ) {
-        return( i * 4 );
-      }
-      value = value >> 1;
-      i *= 2;
-    }
-  }
-  
-  public static short GLU_SWAP_2_BYTES( short s ) {
-    byte b = 0;
-    b = (byte)( s >>> 8 );
-    s = (short)( s << 8 );
-    s = (short)( s | (0x00FF & b) );
-    return( s );
-  }
-  
-  public static int GLU_SWAP_4_BYTES( int i ) {
-    int t = i << 24;
-    t |= 0x00FF0000 & ( i << 8 );
-    t |= 0x0000FF00 & ( i >>> 8 );
-    t |= 0x000000FF & ( i >>> 24 );
-    return( t );
-  }
-  
-  public static float GLU_SWAP_4_BYTES( float f ) {
-    int i = Float.floatToRawIntBits( f );
-    float temp = Float.intBitsToFloat( i );
-    return( temp );
-  }
-  
-  public static int checkMipmapArgs( int internalFormat, int format, int type ) {
-    if( !legalFormat( format ) || !legalType( type ) ) {
-      return( GLU.GLU_INVALID_ENUM );
-    }
-    if( format == GL2GL3.GL_STENCIL_INDEX ) {
-      return( GLU.GLU_INVALID_ENUM );
-    }
-    if( !isLegalFormatForPackedPixelType( format, type ) ) {
-      return( GLU.GLU_INVALID_OPERATION );
-    }
-    return( 0 );
-  }
-  
-  public static boolean legalFormat( int format ) {
-    switch( format ) {
-      case( GL2.GL_COLOR_INDEX ):
-      case( GL2GL3.GL_STENCIL_INDEX ):
-      case( GL2GL3.GL_DEPTH_COMPONENT ):
-      case( GL2GL3.GL_RED ):
-      case( GL2GL3.GL_GREEN ):
-      case( GL2GL3.GL_BLUE ):
-      case( GL2GL3.GL_ALPHA ):
-      case( GL2GL3.GL_RGB ):
-      case( GL2GL3.GL_RGBA ):
-      case( GL2GL3.GL_LUMINANCE ):
-      case( GL2GL3.GL_LUMINANCE_ALPHA ):
-      case( GL2GL3.GL_BGR ):
-      case( GL2GL3.GL_BGRA ):
-        return( true );
-      default:
-        return( false );
-    }
-  }
-  
-  public static boolean legalType( int type ) {
-    switch( type ) {
-      case( GL2.GL_BITMAP ):
-      case( GL2GL3.GL_BYTE ):
-      case( GL2GL3.GL_UNSIGNED_BYTE ):
-      case( GL2GL3.GL_SHORT ):
-      case( GL2GL3.GL_UNSIGNED_SHORT ):
-      case( GL2GL3.GL_INT ):
-      case( GL2GL3.GL_UNSIGNED_INT ):
-      case( GL2GL3.GL_FLOAT ):
-      case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
-      case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
-      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
-      case( GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ):
-      case( GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ):
-        return( true );
-      default:
-        return( false );
-    }
-  }
-  
-  public static boolean isTypePackedPixel( int type ) {
-    assert( legalType( type ) );
-    
-    if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
-        type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
-        type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
-        type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
-        type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
-        type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) {
-          return( true );
-    }
-    return( false );
-  }
-  
-  public static boolean isLegalFormatForPackedPixelType( int format, int type ) {
-    // if not a packed pixel type then return true
-    if( isTypePackedPixel( type ) ) {
-      return( true );
-    }
-    
-    // 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB
-    if( (type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 || type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 || type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV )
-        & format != GL2GL3.GL_RGB ) {
-          return( false );
-    }
-    
-    // 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV &
-    // 10_10_10_2/2_10_10_10_REV are only campatible with RGBA, BGRA & ARGB_EXT
-    if( ( type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
-          type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
-          type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
-          type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
-          type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
-          type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
-          type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
-          type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) &&
-          (format != GL2GL3.GL_RGBA && format != GL2GL3.GL_BGRA) ) {
-            return( false );
-    }
-    return( true );
-  }
-  
-  public static boolean isLegalLevels( int userLevel, int baseLevel, int maxLevel,
-                                            int totalLevels ) {
-    if( (baseLevel < 0) || (baseLevel < userLevel) || (maxLevel < baseLevel) ||
-                                                  (totalLevels < maxLevel) ) {
-      return( false );
-    }
-    return( true );
-  }
-  
-  /* Given user requested textures size, determine if it fits. If it doesn't then
-   * halve both sides and make the determination again until it does fit ( for
-   * IR only ).
-   * Note that proxy textures are not implemented in RE* even though they
-   * advertise the texture extension.
-   * Note that proxy textures are implemented but not according to spec in IMPACT*
-   */
-  public static void closestFit( GL gl, int target, int width, int height, int internalFormat,
-                                int format, int type, int[] newWidth, int[] newHeight ) {
-    // Use proxy textures if OpenGL version >= 1.1
-    if( Double.parseDouble( gl.glGetString( GL.GL_VERSION ).trim().substring( 0, 3 ) ) >= 1.1 ) {
-      int widthPowerOf2 = nearestPower( width );
-      int heightPowerOf2 = nearestPower( height );
-      int[] proxyWidth = new int[1];
-      boolean noProxyTextures = false;
-      
-      // Some drivers (in particular, ATI's) seem to set a GL error
-      // when proxy textures are used even though this is in violation
-      // of the spec. Guard against this and interactions with the
-      // DebugGL by watching for GLException.
-      try {
-        do {
-          // compute level 1 width & height, clamping each at 1
-          int widthAtLevelOne = ( ( width > 1 ) ? (widthPowerOf2 >> 1) : widthPowerOf2 );
-          int heightAtLevelOne = ( ( height > 1 ) ? (heightPowerOf2 >> 1) : heightPowerOf2 );
-          int proxyTarget;
-        
-          assert( widthAtLevelOne > 0 );
-          assert( heightAtLevelOne > 0 );
-        
-          // does width x height at level 1 & all their mipmaps fit?
-          if( target == GL2GL3.GL_TEXTURE_2D || target == GL2GL3.GL_PROXY_TEXTURE_2D ) {
-            proxyTarget = GL2GL3.GL_PROXY_TEXTURE_2D;
-            gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
-                             heightAtLevelOne, 0, format, type, null );
-          } else if( (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_X) || 
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) || 
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) || 
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) || 
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) || 
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) ) {
-            proxyTarget = GL2GL3.GL_PROXY_TEXTURE_CUBE_MAP;
-            gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
-                             heightAtLevelOne, 0, format, type, null );
-          } else {
-            assert( target == GL2GL3.GL_TEXTURE_1D || target == GL2GL3.GL_PROXY_TEXTURE_1D );
-            proxyTarget = GL2GL3.GL_PROXY_TEXTURE_1D;
-            gl.getGL2GL3().glTexImage1D( proxyTarget, 1, internalFormat, widthAtLevelOne, 
-                             0, format, type, null );
-          }
-          if(gl.isGL2GL3()) {
-            gl.getGL2GL3().glGetTexLevelParameteriv( proxyTarget, 1, GL2GL3.GL_TEXTURE_WIDTH, proxyWidth, 0 );
-          } else {
-            proxyWidth[0] = 0;
-          }
-          // does it fit?
-          if( proxyWidth[0] == 0 ) { // nope, so try again with theses sizes
-            if( widthPowerOf2 == 1 && heightPowerOf2 == 1 ) {
-              /* A 1x1 texture couldn't fit for some reason so break out.  This
-               * should never happen.  But things happen.  The disadvantage with
-               * this if-statement is that we will never be aware of when this
-               * happens since it will silently branch out.
-               */
-              noProxyTextures = true;
-              break;
-            }
-            widthPowerOf2 = widthAtLevelOne;
-            heightPowerOf2 = heightAtLevelOne;
-          }
-          // else it does fit
-        } while( proxyWidth[0] == 0 );
-      } catch (GLException e) {
-        noProxyTextures = true;
-      }
-      // loop must terminate
-      // return the width & height at level 0 that fits
-      if( !noProxyTextures ) {
-        newWidth[0] = widthPowerOf2;
-        newHeight[0] = heightPowerOf2;
-        return;
-      }
-    }
-    int[] maxsize = new int[1];
-    gl.glGetIntegerv( GL2GL3.GL_MAX_TEXTURE_SIZE, maxsize , 0);
-    // clamp user's texture sizes to maximum sizes, if necessary
-    newWidth[0] = nearestPower( width );
-    if( newWidth[0] > maxsize[0] ) {
-      newWidth[0] = maxsize[0];
-    }
-    newHeight[0] = nearestPower( height );
-    if( newHeight[0] > maxsize[0] ) {
-      newHeight[0] = maxsize[0];
-    }
-  }
-  
-  public static void closestFit3D( GL gl, int target, int width, int height, int depth, 
-          int internalFormat, int format, int type, int[] newWidth, int[] newHeight,
-          int[] newDepth ) {
-    int widthPowerOf2 = nearestPower( width );
-    int heightPowerOf2 = nearestPower( height );
-    int depthPowerOf2 = nearestPower( depth );
-    int[] proxyWidth = new int[1];
-    
-    do {
-      // compute level 1 width & height & depth, clamping each at 1
-      int widthAtLevelOne = (widthPowerOf2 > 1) ? widthPowerOf2 >> 1 : widthPowerOf2;
-      int heightAtLevelOne = (heightPowerOf2 > 1) ? heightPowerOf2 >> 1 : heightPowerOf2;
-      int depthAtLevelOne = (depthPowerOf2 > 1) ? depthPowerOf2 >> 1 : depthPowerOf2;
-      int proxyTarget = 0;
-      assert( widthAtLevelOne > 0 );
-      assert( heightAtLevelOne > 0 );
-      assert( depthAtLevelOne > 0 );
-      
-      // does width x height x depth at level 1 & all their mipmaps fit?
-      if( target == GL2GL3.GL_TEXTURE_3D || target == GL2GL3.GL_PROXY_TEXTURE_3D ) {
-        proxyTarget = GL2GL3.GL_PROXY_TEXTURE_3D;
-        gl.getGL2GL3().glTexImage3D( proxyTarget, 1, internalFormat, widthAtLevelOne,
-                heightAtLevelOne, depthAtLevelOne, 0, format, type, null );
-      }
-      if(gl.isGL2GL3()) {
-        gl.getGL2GL3().glGetTexLevelParameteriv( proxyTarget, 1, GL2GL3.GL_TEXTURE_WIDTH, proxyWidth, 0 );
-      } else {
-        proxyWidth[0] = 0;
-      }
-      // does it fit
-      if( proxyWidth[0] == 0 ) {
-        if( widthPowerOf2 == 1 && heightPowerOf2 == 1 && depthPowerOf2 == 1 ) {
-          newWidth[0] = newHeight[0] = newDepth[0] = 1;
-          return;
-        }
-        widthPowerOf2 = widthAtLevelOne;
-        heightPowerOf2 = heightAtLevelOne;
-        depthPowerOf2 = depthAtLevelOne;
-      }
-    } while( proxyWidth[0] == 0 );
-    // loop must terminate
-    
-    // return the width & height at level 0 that fits
-    newWidth[0] = widthPowerOf2;
-    newHeight[0] = heightPowerOf2;
-    newDepth[0] = depthPowerOf2;
-  }
-  
-  public static int elements_per_group( int format, int type ) {
-    // Return the number of elements per grtoup of a specified gromat
-    
-    // If the type is packedpixels then answer is 1
-    if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
-        type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
-        type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
-        type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
-        type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
-        type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) {
-          return( 1 );
-    }
-    
-    // Types are not packed pixels so get elements per group
-    switch( format ) {
-      case( GL2GL3.GL_RGB ):
-      case( GL2GL3.GL_BGR ):
-        return( 3 );
-      case( GL2GL3.GL_LUMINANCE_ALPHA ):
-        return( 2 );
-      case( GL2GL3.GL_RGBA ):
-      case( GL2GL3.GL_BGRA ):
-        return( 4 );
-      default:
-        return( 1 );
-    }
-  }
-  
-  public static int bytes_per_element( int type ) {
-    // return the number of bytes per element, based on the element type
-    
-    switch( type ) {
-      case( GL2.GL_BITMAP ):
-      case( GL2GL3.GL_BYTE ):
-      case( GL2GL3.GL_UNSIGNED_BYTE ):
-      case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
-      case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
-        return( 1 );
-      case( GL2GL3.GL_SHORT ):
-      case( GL2GL3.GL_UNSIGNED_SHORT ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-        return( 2 );
-      case( GL2GL3.GL_INT ):
-      case( GL2GL3.GL_UNSIGNED_INT ):
-      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
-      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
-      case( GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ):
-      case( GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ):
-      case( GL2GL3.GL_FLOAT ):
-        return( 4 );
-      default:
-        return( 4 );
-    }
-  }
-  
-  public static boolean is_index( int format ) {
-    return( format == GL2.GL_COLOR_INDEX || format == GL2GL3.GL_STENCIL_INDEX );
-  }
-  
-  /* Compute memory required for internal packed array of data of given type and format. */
-  
-  public static int image_size( int width, int height, int format, int type ) {
-    int bytes_per_row;
-    int components;
-    
-    assert( width > 0 );
-    assert( height > 0 );
-    components = elements_per_group( format, type );
-    if( type == GL2.GL_BITMAP ) {
-      bytes_per_row = (width + 7) / 8;
-    } else {
-      bytes_per_row = bytes_per_element( type ) * width;
-    }
-    return( bytes_per_row * height * components );
-  }
-  
-  public static int imageSize3D( int width, int height, int depth, int format, int type ) {
-    int components = elements_per_group( format, type );
-    int bytes_per_row = bytes_per_element( type ) * width;
-    
-    assert( width > 0 && height > 0 && depth > 0 );
-    assert( type != GL2.GL_BITMAP );
-    
-    return( bytes_per_row * height * depth * components );
-  }
-  
-  public static void retrieveStoreModes( GL gl, PixelStorageModes psm ) {
-    int[] a = new int[1];
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
-    psm.setUnpackAlignment( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ROW_LENGTH, a, 0);
-    psm.setUnpackRowLength( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_ROWS, a, 0);
-    psm.setUnpackSkipRows( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_PIXELS, a, 0);
-    psm.setUnpackSkipPixels( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_LSB_FIRST, a, 0);
-    psm.setUnpackLsbFirst( ( a[0] == 1 ) );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0);
-    psm.setUnpackSwapBytes( ( a[0] == 1 ) );
-    
-    gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
-    psm.setPackAlignment( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
-    psm.setPackRowLength( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_ROWS, a, 0);
-    psm.setPackSkipRows( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_PIXELS, a, 0);
-    psm.setPackSkipPixels( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_LSB_FIRST, a, 0);
-    psm.setPackLsbFirst( ( a[0] == 1 ) );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_SWAP_BYTES, a, 0);
-    psm.setPackSwapBytes( ( a[0] == 1 ) );
-  }
-  
-  public static void retrieveStoreModes3D( GL gl, PixelStorageModes psm ) {
-    int[] a = new int[1];
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
-    psm.setUnpackAlignment( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ROW_LENGTH, a, 0);
-    psm.setUnpackRowLength( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_ROWS, a, 0);
-    psm.setUnpackSkipRows( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_PIXELS, a, 0);
-    psm.setUnpackSkipPixels( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_LSB_FIRST, a, 0);
-    psm.setUnpackLsbFirst( ( a[0] == 1 ) );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0);
-    psm.setUnpackSwapBytes( ( a[0] == 1 ) );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_IMAGES, a, 0);
-    psm.setUnpackSkipImages( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_IMAGE_HEIGHT, a, 0);
-    psm.setUnpackImageHeight( a[0] );
-    
-    gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
-    psm.setPackAlignment( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
-    psm.setPackRowLength( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_ROWS, a, 0);
-    psm.setPackSkipRows( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_PIXELS, a, 0 );
-    psm.setPackSkipPixels( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_LSB_FIRST, a, 0 );
-    psm.setPackLsbFirst( ( a[0] == 1 ) );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_SWAP_BYTES, a, 0 );
-    psm.setPackSwapBytes( ( a[0] == 1 ) );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_IMAGES, a, 0 );
-    psm.setPackSkipImages( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_IMAGE_HEIGHT, a, 0 );
-    psm.setPackImageHeight( a[0] );
-  }
-  
-  public static int gluScaleImage( GL gl, int format, int widthin, int heightin, 
-          int typein, ByteBuffer datain, int widthout, int heightout, 
-          int typeout, ByteBuffer dataout ) {
-    int datainPos = datain.position();
-    int dataoutPos = dataout.position();
-    try {
-
-      int components;
-      ByteBuffer beforeimage;
-      ByteBuffer afterimage;
-      PixelStorageModes psm = new PixelStorageModes();
-    
-      if( (widthin == 0)  || (heightin == 0) || (widthout == 0) || (heightout == 0) ) {
-        return( 0 );
-      }
-      if( (widthin < 0) || (heightin < 0) || (widthout < 0) || (heightout < 0) ) {
-        return( GLU.GLU_INVALID_VALUE );
-      }
-      if( !legalFormat( format ) || !legalType( typein ) || !legalType( typeout ) ) {
-        return( GLU.GLU_INVALID_ENUM );
-      }
-      if( !isLegalFormatForPackedPixelType( format, typein ) ) {
-        return( GLU.GLU_INVALID_OPERATION );
-      }
-      if( !isLegalFormatForPackedPixelType( format, typeout ) ) {
-        return( GLU.GLU_INVALID_OPERATION );
-      }
-      beforeimage = Buffers.newDirectByteBuffer( image_size( widthin, heightin, format, GL2GL3.GL_UNSIGNED_SHORT ) );
-      afterimage = Buffers.newDirectByteBuffer( image_size( widthout, heightout, format, GL2GL3.GL_UNSIGNED_SHORT ) );
-      if( beforeimage == null || afterimage == null ) {
-        return( GLU.GLU_OUT_OF_MEMORY );
-      }
-    
-      retrieveStoreModes( gl, psm );
-      Image.fill_image( psm, widthin, heightin, format, typein, is_index( format ), datain, beforeimage.asShortBuffer() );
-      components = elements_per_group( format, 0 );
-      ScaleInternal.scale_internal( components, widthin, heightin, beforeimage.asShortBuffer(), widthout, heightout, afterimage.asShortBuffer() );
-      Image.empty_image( psm, widthout, heightout, format, typeout, is_index( format ), afterimage.asShortBuffer(), dataout );
-    
-      return( 0 );
-    } finally {
-      datain.position(datainPos);
-      dataout.position(dataoutPos);
-    }
-  }
-  
-  public static int gluBuild1DMipmapLevels( GL gl, int target, int internalFormat,
-                          int width, int format, int type, int userLevel, int baseLevel,
-                          int maxLevel, ByteBuffer data ) {
-    int dataPos = data.position();
-    try {
-
-      int levels;
-    
-      int rc = checkMipmapArgs( internalFormat, format, type );
-      if( rc != 0 ) {
-        return( rc );
-      }
-    
-      if( width < 1 ) {
-        return( GLU.GLU_INVALID_VALUE );
-      }
-    
-      levels = computeLog( width );
-    
-      levels += userLevel;
-      if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
-        return( GLU.GLU_INVALID_VALUE );
-      }
-    
-      return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat, width,
-              width, format, type, userLevel, baseLevel, maxLevel, data ) );
-    } finally {
-      data.position(dataPos);
-    }
-  }
-  
-  public static int gluBuild1DMipmaps( GL gl, int target, int internalFormat, int width,
-              int format, int type, ByteBuffer data ) {
-    int dataPos = data.position();
-
-    try {
-      int[] widthPowerOf2 = new int[1];
-      int levels;
-      int[] dummy = new int[1];
-    
-      int rc = checkMipmapArgs( internalFormat, format, type );
-      if( rc != 0 ) {
-        return( rc );
-      }
-    
-      if( width < 1 ) {
-        return( GLU.GLU_INVALID_VALUE );
-      }
-    
-      closestFit( gl, target, width, 1, internalFormat, format, type, widthPowerOf2, dummy );
-      levels = computeLog( widthPowerOf2[0] );
-    
-      return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat, 
-                    width, widthPowerOf2[0], format, type, 0, 0, levels, data ) );
-    } finally {
-      data.position(dataPos);
-    }
-  }
-
- 
-  public static int gluBuild2DMipmapLevels( GL gl, int target, int internalFormat,
-          int width, int height, int format, int type, int userLevel,
-          int baseLevel, int maxLevel, Object data ) {
-    int dataPos = 0;
-
-    int level, levels;
-    
-    int rc = checkMipmapArgs( internalFormat, format, type );
-    if( rc != 0 ) {
-      return( rc );
-    }
-    
-    if( width < 1 || height < 1 ) {
-      return( GLU.GLU_INVALID_VALUE );
-    }
-    
-    levels = computeLog( width );
-    level = computeLog( height );
-    if( level > levels ) {
-      levels = level;
-    }
-    
-    levels += userLevel;
-    if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
-      return( GLU.GLU_INVALID_VALUE );
-    }
-    
-    //PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
-    ByteBuffer buffer = null;
-    if( data instanceof ByteBuffer ) {
-        buffer = (ByteBuffer)data;
-        dataPos = buffer.position();
-    } else if( data instanceof byte[] ) {
-      byte[] array = (byte[])data;
-      buffer = ByteBuffer.allocateDirect(array.length);
-      buffer.put(array);
-    } else if( data instanceof short[] ) {
-        short[] array = (short[])data;
-        buffer = ByteBuffer.allocateDirect( array.length * 2 );
-        ShortBuffer sb = buffer.asShortBuffer();
-        sb.put( array );
-    } else if( data instanceof int[] ) {
-        int[] array = (int[])data;
-        buffer = ByteBuffer.allocateDirect( array.length * 4 );
-        IntBuffer ib = buffer.asIntBuffer();
-        ib.put( array );
-    } else if( data instanceof float[] ) {
-        float[] array = (float[])data;
-        buffer = ByteBuffer.allocateDirect( array.length * 4 );
-        FloatBuffer fb = buffer.asFloatBuffer();
-        fb.put( array );
-    }
-    
-    try {
-      return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
-              width, height, width, height, format, type, userLevel, baseLevel,
-              maxLevel, buffer ) );
-    } finally {
-      buffer.position(dataPos);
-    }
-  }
-
- 
-  public static int gluBuild2DMipmaps( GL gl, int target, int internalFormat,
-          int width, int height, int format, int type, Object data ) {
-    int dataPos = 0;
-
-    int[] widthPowerOf2 = new int[1];
-    int[] heightPowerOf2 = new int[1];
-    int level, levels;
-    
-    int rc = checkMipmapArgs( internalFormat, format, type );
-    if( rc != 0 ) {
-      return( rc );
-    }
-    
-    if( width < 1 || height < 1 ) {
-      return( GLU.GLU_INVALID_VALUE );
-    }
-    
-    closestFit( gl, target, width, height, internalFormat, format, type, 
-            widthPowerOf2, heightPowerOf2 );
-    
-    levels = computeLog( widthPowerOf2[0] );
-    level = computeLog( heightPowerOf2[0] );
-    if( level > levels ) {
-      levels = level;
-    }
-    
-    //PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
-    ByteBuffer buffer = null;
-    if( data instanceof ByteBuffer ) {
-        buffer = (ByteBuffer)data;
-        dataPos = buffer.position();
-    } else if( data instanceof byte[] ) {
-      byte[] array = (byte[])data;
-      buffer = ByteBuffer.allocateDirect(array.length);
-      buffer.put(array);
-    } else if( data instanceof short[] ) {
-        short[] array = (short[])data;
-        buffer = ByteBuffer.allocateDirect( array.length * 2 );
-        ShortBuffer sb = buffer.asShortBuffer();
-        sb.put( array );
-    } else if( data instanceof int[] ) {
-        int[] array = (int[])data;
-        buffer = ByteBuffer.allocateDirect( array.length * 4 );
-        IntBuffer ib = buffer.asIntBuffer();
-        ib.put( array );
-    } else if( data instanceof float[] ) {
-        float[] array = (float[])data;
-        buffer = ByteBuffer.allocateDirect( array.length * 4 );
-        FloatBuffer fb = buffer.asFloatBuffer();
-        fb.put( array );
-    }
-    
-    try {
-      return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat, 
-              width, height, widthPowerOf2[0], heightPowerOf2[0], format, type, 0, 
-              0, levels, buffer ) );
-    } finally {
-      buffer.position(dataPos);
-    }
-  }
- 
- 
-  public static int gluBuild3DMipmaps( GL gl, int target, int internalFormat,
-          int width, int height, int depth, int format, int type, ByteBuffer data ) {
-    int dataPos = data.position();
-    try {
-
-      int[] widthPowerOf2 = new int[1];
-      int[] heightPowerOf2 = new int[1];
-      int[] depthPowerOf2 = new int[1];
-      int level, levels;
-    
-      int rc = checkMipmapArgs( internalFormat, format, type );
-      if( rc != 0 ) {
-        return( rc );
-      }
-    
-      if( width < 1 || height < 1 || depth < 1 ) {
-        return( GLU.GLU_INVALID_VALUE );
-      }
-    
-      if( type == GL2.GL_BITMAP ) {
-        return( GLU.GLU_INVALID_ENUM );
-      }
-    
-      closestFit3D( gl, target, width, height, depth, internalFormat, format,
-                    type, widthPowerOf2, heightPowerOf2, depthPowerOf2 );
-    
-      levels = computeLog( widthPowerOf2[0] );
-      level = computeLog( heightPowerOf2[0] );
-      if( level > levels ) {
-        levels = level;
-      }
-      level = computeLog( depthPowerOf2[0] );
-      if( level > levels ) {
-        levels = level;
-      }
-    
-      return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
-              height, depth, widthPowerOf2[0], heightPowerOf2[0], depthPowerOf2[0],
-              format, type, 0, 0, levels, data ) );
-    } finally {
-      data.position(dataPos);
-    }
-  }
-  
-  public static int gluBuild3DMipmapLevels( GL gl, int target, int internalFormat,
-          int width, int height, int depth, int format, int type, int userLevel,
-          int baseLevel, int maxLevel, ByteBuffer data ) {
-    int dataPos = data.position();
-    try {
-      int level, levels;
-    
-      int rc = checkMipmapArgs( internalFormat, format, type );
-      if( rc != 0 ) {
-        return( rc );
-      }
-    
-      if( width < 1 || height < 1 || depth < 1 ) {
-        return( GLU.GLU_INVALID_VALUE );
-      }
-    
-      if( type == GL2.GL_BITMAP ) {
-        return( GLU.GLU_INVALID_ENUM );
-      }
-    
-      levels = computeLog( width );
-      level = computeLog( height );
-      if( level > levels ) {
-        levels = level;
-      }
-      level = computeLog( depth );
-      if( level > levels ) {
-        levels = level;
-      }
-    
-      levels += userLevel;
-      if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
-        return( GLU.GLU_INVALID_VALUE );
-      }
-    
-      return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
-              height, depth, width, height, depth, format, type, userLevel,
-              baseLevel, maxLevel, data ) );
-    } finally {
-      data.position(dataPos);
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/PixelStorageModes.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/PixelStorageModes.java
deleted file mode 100644
index 43b5c56..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/PixelStorageModes.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-/**
- *
- * @author  Administrator
- */
-public class PixelStorageModes {
-
-  /**
-   * Holds value of property packAlignment.
-   */
-  private int packAlignment;
-
-  /**
-   * Holds value of property packRowLength.
-   */
-  private int packRowLength;
-
-  /**
-   * Holds value of property packSkipRows.
-   */
-  private int packSkipRows;
-
-  /**
-   * Holds value of property packSkipPixels.
-   */
-  private int packSkipPixels;
-
-  /**
-   * Holds value of property packLsbFirst.
-   */
-  private boolean packLsbFirst;
-
-  /**
-   * Holds value of property packSwapBytes.
-   */
-  private boolean packSwapBytes;
-
-  /**
-   * Holds value of property packSkipImages.
-   */
-  private int packSkipImages;
-
-  /**
-   * Holds value of property packImageHeight.
-   */
-  private int packImageHeight;
-
-  /**
-   * Holds value of property unpackAlignment.
-   */
-  private int unpackAlignment;
-
-  /**
-   * Holds value of property unpackRowLength.
-   */
-  private int unpackRowLength;
-
-  /**
-   * Holds value of property unpackSkipRows.
-   */
-  private int unpackSkipRows;
-
-  /**
-   * Holds value of property unpackSkipPixels.
-   */
-  private int unpackSkipPixels;
-
-  /**
-   * Holds value of property unpackLsbFirst.
-   */
-  private boolean unpackLsbFirst;
-
-  /**
-   * Holds value of property unpackSwapBytes.
-   */
-  private boolean unpackSwapBytes;
-
-  /**
-   * Holds value of property unpackSkipImages.
-   */
-  private int unpackSkipImages;
-
-  /**
-   * Holds value of property unpackImageHeight.
-   */
-  private int unpackImageHeight;
-  
-  /** Creates a new instance of PixelStorageModes */
-  public PixelStorageModes() {
-  }
-
-  /**
-   * Getter for property packAlignment.
-   * @return Value of property packAlignment.
-   */
-  public int getPackAlignment() {
-
-    return this.packAlignment;
-  }
-
-  /**
-   * Setter for property packAlignment.
-   * @param packAlignment New value of property packAlignment.
-   */
-  public void setPackAlignment(int packAlignment) {
-
-    this.packAlignment = packAlignment;
-  }
-
-  /**
-   * Getter for property packRowLength.
-   * @return Value of property packRowLength.
-   */
-  public int getPackRowLength() {
-
-    return this.packRowLength;
-  }
-
-  /**
-   * Setter for property packRowLength.
-   * @param packRowLength New value of property packRowLength.
-   */
-  public void setPackRowLength(int packRowLength) {
-
-    this.packRowLength = packRowLength;
-  }
-
-  /**
-   * Getter for property packSkipRows.
-   * @return Value of property packSkipRows.
-   */
-  public int getPackSkipRows() {
-
-    return this.packSkipRows;
-  }
-
-  /**
-   * Setter for property packSkipRows.
-   * @param packSkipRows New value of property packSkipRows.
-   */
-  public void setPackSkipRows(int packSkipRows) {
-
-    this.packSkipRows = packSkipRows;
-  }
-
-  /**
-   * Getter for property packSkipPixels.
-   * @return Value of property packSkipPixels.
-   */
-  public int getPackSkipPixels() {
-
-    return this.packSkipPixels;
-  }
-
-  /**
-   * Setter for property packSkipPixels.
-   * @param packSkipPixels New value of property packSkipPixels.
-   */
-  public void setPackSkipPixels(int packSkipPixels) {
-
-    this.packSkipPixels = packSkipPixels;
-  }
-
-  /**
-   * Getter for property packLsbFirst.
-   * @return Value of property packLsbFirst.
-   */
-  public boolean getPackLsbFirst() {
-
-    return this.packLsbFirst;
-  }
-
-  /**
-   * Setter for property packLsbFirst.
-   * @param packLsbFirst New value of property packLsbFirst.
-   */
-  public void setPackLsbFirst(boolean packLsbFirst) {
-
-    this.packLsbFirst = packLsbFirst;
-  }
-
-  /**
-   * Getter for property packSwapBytes.
-   * @return Value of property packSwapBytes.
-   */
-  public boolean getPackSwapBytes() {
-
-    return this.packSwapBytes;
-  }
-
-  /**
-   * Setter for property packSwapBytes.
-   * @param packSwapBytes New value of property packSwapBytes.
-   */
-  public void setPackSwapBytes(boolean packSwapBytes) {
-
-    this.packSwapBytes = packSwapBytes;
-  }
-
-  /**
-   * Getter for property packSkipImages.
-   * @return Value of property packSkipImages.
-   */
-  public int getPackSkipImages() {
-
-    return this.packSkipImages;
-  }
-
-  /**
-   * Setter for property packSkipImages.
-   * @param packSkipImages New value of property packSkipImages.
-   */
-  public void setPackSkipImages(int packSkipImages) {
-
-    this.packSkipImages = packSkipImages;
-  }
-
-  /**
-   * Getter for property packImageHeight.
-   * @return Value of property packImageHeight.
-   */
-  public int getPackImageHeight() {
-
-    return this.packImageHeight;
-  }
-
-  /**
-   * Setter for property packImageHeight.
-   * @param packImageHeight New value of property packImageHeight.
-   */
-  public void setPackImageHeight(int packImageHeight) {
-
-    this.packImageHeight = packImageHeight;
-  }
-
-  /**
-   * Getter for property unpackAlignment.
-   * @return Value of property unpackAlignment.
-   */
-  public int getUnpackAlignment() {
-
-    return this.unpackAlignment;
-  }
-
-  /**
-   * Setter for property unpackAlignment.
-   * @param unpackAlignment New value of property unpackAlignment.
-   */
-  public void setUnpackAlignment(int unpackAlignment) {
-
-    this.unpackAlignment = unpackAlignment;
-  }
-
-  /**
-   * Getter for property unpackRowLength.
-   * @return Value of property unpackRowLength.
-   */
-  public int getUnpackRowLength() {
-
-    return this.unpackRowLength;
-  }
-
-  /**
-   * Setter for property unpackRowLength.
-   * @param unpackRowLength New value of property unpackRowLength.
-   */
-  public void setUnpackRowLength(int unpackRowLength) {
-
-    this.unpackRowLength = unpackRowLength;
-  }
-
-  /**
-   * Getter for property unpackSkipRows.
-   * @return Value of property unpackSkipRows.
-   */
-  public int getUnpackSkipRows() {
-
-    return this.unpackSkipRows;
-  }
-
-  /**
-   * Setter for property unpackSkipRows.
-   * @param unpackSkipRows New value of property unpackSkipRows.
-   */
-  public void setUnpackSkipRows(int unpackSkipRows) {
-
-    this.unpackSkipRows = unpackSkipRows;
-  }
-
-  /**
-   * Getter for property unpackSkipPixels.
-   * @return Value of property unpackSkipPixels.
-   */
-  public int getUnpackSkipPixels() {
-
-    return this.unpackSkipPixels;
-  }
-
-  /**
-   * Setter for property unpackSkipPixels.
-   * @param unpackSkipPixels New value of property unpackSkipPixels.
-   */
-  public void setUnpackSkipPixels(int unpackSkipPixels) {
-
-    this.unpackSkipPixels = unpackSkipPixels;
-  }
-
-  /**
-   * Getter for property unpackLsbFirst.
-   * @return Value of property unpackLsbFirst.
-   */
-  public boolean getUnpackLsbFirst() {
-
-    return this.unpackLsbFirst;
-  }
-
-  /**
-   * Setter for property unpackLsbFirst.
-   * @param unpackLsbFirst New value of property unpackLsbFirst.
-   */
-  public void setUnpackLsbFirst(boolean unpackLsbFirst) {
-
-    this.unpackLsbFirst = unpackLsbFirst;
-  }
-
-  /**
-   * Getter for property unpackSwapBytes.
-   * @return Value of property unpackSwapBytes.
-   */
-  public boolean getUnpackSwapBytes() {
-
-    return this.unpackSwapBytes;
-  }
-
-  /**
-   * Setter for property unpackSwapBytes.
-   * @param unpackSwapBytes New value of property unpackSwapBytes.
-   */
-  public void setUnpackSwapBytes(boolean unpackSwapBytes) {
-
-    this.unpackSwapBytes = unpackSwapBytes;
-  }
-
-  /**
-   * Getter for property unpackSkipImages.
-   * @return Value of property unpackSkipImages.
-   */
-  public int getUnpackSkipImages() {
-
-    return this.unpackSkipImages;
-  }
-
-  /**
-   * Setter for property unpackSkipImages.
-   * @param unpackSkipImages New value of property unpackSkipImages.
-   */
-  public void setUnpackSkipImages(int unpackSkipImages) {
-
-    this.unpackSkipImages = unpackSkipImages;
-  }
-
-  /**
-   * Getter for property unpackImageHeight.
-   * @return Value of property unpackImageHeight.
-   */
-  public int getUnpackImageHeight() {
-
-    return this.unpackImageHeight;
-  }
-
-  /**
-   * Setter for property unpackImageHeight.
-   * @param unpackImageHeight New value of property unpackImageHeight.
-   */
-  public void setUnpackImageHeight(int unpackImageHeight) {
-
-    this.unpackImageHeight = unpackImageHeight;
-  }
-  
-  
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ScaleInternal.java
deleted file mode 100644
index 804845f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ScaleInternal.java
+++ /dev/null
@@ -1,2447 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import javax.media.opengl.glu.GLU;
-import java.nio.*;
-import com.jogamp.common.nio.Buffers;
-
-/**
- *
- * @author  Administrator
- */
-public class ScaleInternal {
-  
-  public static final float UINT_MAX = (float)(0x00000000FFFFFFFF);
-  
-  public static void scale_internal( int components, int widthin, int heightin,
-          ShortBuffer datain, int widthout, int heightout, ShortBuffer dataout ) {
-    float x, lowx, highx, convx, halfconvx;
-    float y, lowy, highy, convy, halfconvy;
-    float xpercent, ypercent;
-    float percent;
-    // Max components in a format is 4, so...
-    float[] totals = new float[4];
-    float area;
-    int i, j, k, yint, xint, xindex, yindex;
-    int temp;
-    
-    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage( components, widthin, heightin, datain, dataout );
-      return;
-    }
-    convy = (float)heightin / heightout;
-    convx = (float)widthin / widthout;
-    halfconvx = convx / 2;
-    halfconvy = convy / 2;
-    for( i = 0; i < heightout; i++ ) {
-      y = convy * ( i + 0.5f );
-      if( heightin > heightout ) {
-        highy = y + halfconvy;
-        lowy = y - halfconvy;
-      } else {
-        highy = y + 0.5f;
-        lowy = y - 0.5f;
-      }
-      for( j = 0; j < widthout; j++ ) {
-        x = convx * ( j + 0.5f );
-        if( widthin > widthout ) {
-          highx = x + halfconvx;
-          lowx = x - halfconvx;
-        } else {
-          highx = x + 0.5f;
-          lowx = x - 0.5f;
-        }
-        // Ok, now apply box filter to box that goes from (lowx, lowy)
-        // to (highx, highy) on input data into this pixel on output
-        // data.
-        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        area = 0.0f;
-        
-        y = lowy;
-        yint = (int)Math.floor( y );
-        while( y < highy ) {
-          yindex = ( yint + heightin ) % heightin;
-          if( highy < yint + 1 ) {
-            ypercent = highy - y;
-          } else {
-            ypercent = yint + 1 - y;
-          }
-          
-          x = lowx;
-          xint = (int)Math.floor( x );
-          
-          while( x < highx ) {
-            xindex = ( xint + widthin ) % widthin;
-            if( highx < xint + 1 ) {
-              xpercent = highx -x;
-            } else {
-              xpercent = xint + 1 - x;
-            }
-            
-            percent = xpercent * ypercent;
-            area += percent;
-            temp = ( xindex + ( yindex * widthin) ) * components;
-            for( k = 0; k < components; k++ ) {
-              totals[k] += datain.get( temp + k ) * percent; 
-            }
-            
-            xint++;
-            x = xint;
-          }
-          yint++;
-          y = yint;
-        }
-        
-        temp = ( j + ( i * widthout ) ) * components;
-        for( k = 0; k < components; k++ ) {
-          // totals[] should be rounded in the case of enlarging an RGB
-          // ramp when the type is 332 or 4444
-          dataout.put(  temp + k, (short)((totals[k] + 0.5f) / area) );
-        }
-      }
-    }
-  }
-  
-  public static void scale_internal_ubyte( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
-                              ByteBuffer dataout, int element_size, int ysize, int group_size ) {
-    float x, convx;
-    float y, convy;
-    float percent;
-    // Max components in a format is 4, so...
-    float[] totals = new float[4];
-    float area;
-    int i, j, k, xindex;
-    
-    int temp, temp0;
-    int temp_index;
-    int outindex;
-    
-    int lowx_int, highx_int, lowy_int, highy_int;
-    float x_percent, y_percent;
-    float lowx_float, highx_float, lowy_float, highy_float;
-    float convy_float, convx_float;
-    int convy_int, convx_int;
-    int l, m;
-    int left, right;
-    
-    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_ubyte( components, widthin, heightin, datain, dataout, 
-                        element_size, ysize, group_size );
-      return;
-    }
-    convy = (float)heightin / heightout;
-    convx = (float)widthin / widthout;
-    convy_int = (int)Math.floor( convy );
-    convy_float = convy - convy_int;
-    convx_int = (int)Math.floor( convx );
-    convx_float = convx - convx_int;
-    
-    area = convx * convy;
-    
-    lowy_int = 0;
-    lowy_float = 0.0f;
-    highy_int = convy_int;
-    highy_float = convy_float;
-    
-    for( i = 0; i < heightout; i++ ) {
-      // Clamp here to be sure we don't read beyond input buffer.
-      if (highy_int >= heightin)
-        highy_int = heightin - 1;
-      lowx_int = 0;
-      lowx_float = 0.0f;
-      highx_int = convx_int;
-      highx_float = convx_float;
-      
-      for( j = 0; j < widthout; j++ ) {
-        
-        // Ok, now apply box filter to box that goes from (lowx, lowy)
-        // to (highx, highy) on input data into this pixel on output
-        // data.
-        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
-        // caulate the value for pixels in the 1st row
-        xindex = lowx_int * group_size;
-
-        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
-          y_percent = 1 - lowy_float;
-          temp = xindex + lowy_int * ysize;
-          percent = y_percent * ( 1 - lowx_float );
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += ( 0x000000FF & datain.get() ) * percent;
-          }
-          left = temp;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              totals[k] += ( 0x000000FF & datain.get() ) * y_percent;
-            }
-          }
-          temp += group_size;
-          right = temp;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += ( 0x000000FF & datain.get() ) * percent;
-          }
-          
-          // calculate the value for pixels in the last row
-          y_percent = highy_float;
-          percent = y_percent * ( 1 - lowx_float );
-          temp = xindex + highy_int * ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += ( 0x000000FF & datain.get() ) * percent;
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              totals[k] += ( 0x000000FF & datain.get() ) * y_percent;
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += ( 0x000000FF & datain.get() ) * percent;
-          }
-          
-          // calculate the value for the pixels in the 1st and last column
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            left += ysize;
-            right += ysize;
-            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
-              float f = 0.0f;
-              datain.position( left );
-              f = ( 0x000000FF & datain.get() ) * ( 1.0f - lowx_float );
-              datain.position( right );
-              f += ( 0x000000FF & datain.get() ) * highx_float;
-              totals[k] += f;
-            }
-          }
-        } else if( highy_int > lowy_int ) {
-          x_percent = highx_float - lowx_float;
-          percent = ( 1 - lowy_float) * x_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += ( 0x000000FF & datain.get() ) * percent;
-          }
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            temp += ysize;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              totals[k] += ( 0x000000FF & datain.get() ) * x_percent;
-            }
-          }
-          percent = x_percent * highy_float;
-          temp += ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += ( 0x000000FF & datain.get() ) * percent;
-          }
-        } else if( highx_int > lowx_int ) {
-          y_percent = highy_float - lowy_float;
-          percent = ( 1 - lowx_float ) * y_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += ( 0x000000FF & datain.get() ) * percent;
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              totals[k] += ( 0x000000FF & datain.get() ) * y_percent;
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += ( 0x000000FF & datain.get() ) * percent;
-          }
-        } else {
-          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += ( 0x000000FF & datain.get() ) * percent;
-          }
-        }
-
-        // this is for the pixels in the body
-        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
-        for( m = lowy_int + 1; m < highy_int; m++ ) {
-          temp = temp0;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              totals[k] += ( 0x000000FF & datain.get() );
-            }
-            temp += group_size;
-          }
-          temp0 += ysize;
-        }
-        
-        outindex = ( j + ( i * widthout ) ) * components;
-        for( k = 0; k < components; k++ ) {
-          dataout.position( outindex + k );
-          dataout.put( (byte)(totals[k] / area) );
-        }
-        lowx_int = highx_int;
-        lowx_float = highx_float;
-        highx_int += convx_int;
-        highx_float += convx_float;
-        if( highx_float > 1.0f ) {
-          highx_float -= 1.0f;
-          highx_int++;
-        }
-
-        // Clamp to make sure we don't run off the right edge
-        if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
-          lowx_int -= delta;
-          highx_int -= delta;
-        }
-      }
-      lowy_int = highy_int;
-      lowy_float = highy_float;
-      highy_int += convy_int;
-      highy_float += convy_float;
-      if( highy_float > 1.0f ) {
-        highy_float -= 1.0f;
-        highy_int++;
-      }
-    }
-  }
-  
-  public static void scale_internal_byte( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
-                              ByteBuffer dataout, int element_size, int ysize,
-                              int group_size ) {
-    float x, convx;
-    float y, convy;
-    float percent;
-    // Max components in a format is 4, so...
-    float[] totals = new float[4];
-    float area;
-    int i, j, k, xindex;
-    
-    int temp, temp0;
-    int temp_index;
-    int outindex;
-    
-    int lowx_int, highx_int, lowy_int, highy_int;
-    float x_percent, y_percent;
-    float lowx_float, highx_float, lowy_float, highy_float;
-    float convy_float, convx_float;
-    int convy_int, convx_int;
-    int l, m;
-    int left, right;
-    
-    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_byte( components, widthin, heightin, datain, dataout, 
-                        element_size, ysize, group_size );
-      return;
-    }
-    convy = (float)heightin / heightout;
-    convx = (float)widthin / widthout;
-    convy_int = (int)Math.floor( convy );
-    convy_float = convy - convy_int;
-    convx_int = (int)Math.floor( convx );
-    convx_float = convx - convx_int;
-    
-    area = convx * convy;
-    
-    lowy_int = 0;
-    lowy_float = 0.0f;
-    highy_int = convy_int;
-    highy_float = convy_float;
-    
-    for( i = 0; i < heightout; i++ ) {
-      // Clamp here to be sure we don't read beyond input buffer.
-      if (highy_int >= heightin)
-        highy_int = heightin - 1;
-      lowx_int = 0;
-      lowx_float = 0.0f;
-      highx_int = convx_int;
-      highx_float = convx_float;
-      
-      for( j = 0; j < widthout; j++ ) {
-        
-        // Ok, now apply box filter to box that goes from (lowx, lowy)
-        // to (highx, highy) on input data into this pixel on output
-        // data.
-        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
-        // caulate the value for pixels in the 1st row
-        xindex = lowx_int * group_size;
-        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
-          y_percent = 1 - lowy_float;
-          temp = xindex + lowy_int * ysize;
-          percent = y_percent * ( 1 - lowx_float );
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += datain.get() * percent;
-          }
-          left = temp;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              totals[k] += datain.get() * y_percent;
-            }
-          }
-          temp += group_size;
-          right = temp;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += datain.get() * percent;
-          }
-          
-          // calculate the value for pixels in the last row
-          y_percent = highy_float;
-          percent = y_percent * ( 1 - lowx_float );
-          temp = xindex + highy_int * ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += datain.get() * percent;
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              totals[k] += datain.get() * y_percent;
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += datain.get() * percent;
-          }
-          
-          // calculate the value for the pixels in the 1st and last column
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            left += ysize;
-            right += ysize;
-            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
-              float f = 0.0f;
-              datain.position( left );
-              f = datain.get() * ( 1 - lowx_float );
-              datain.position( right );
-              f += datain.get() * highx_float;
-              totals[k] += f;
-            }
-          }
-        } else if( highy_int > lowy_int ) {
-          x_percent = highx_float - lowx_float;
-          percent = ( 1 - lowy_float) * x_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += datain.get() * percent;
-          }
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            temp += ysize;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              totals[k] += datain.get() * x_percent;
-            }
-          }
-          percent = x_percent * highy_float;
-          temp += ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += datain.get() * percent;
-          }
-        } else if( highx_int > lowx_int ) {
-          y_percent = highy_float - lowy_float;
-          percent = ( 1 - lowx_float ) * y_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += datain.get() * percent;
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              totals[k] += datain.get() * y_percent;
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += datain.get() * percent;
-          }
-        } else {
-          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            totals[k] += datain.get() * percent;
-          }
-        }
-        
-        // this is for the pixels in the body
-        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
-        for( m = lowy_int + 1; m < highy_int; m++ ) {
-          temp = temp0;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              totals[k] += datain.get();
-            }
-            temp += group_size;
-          }
-          temp0 += ysize;
-        }
-        
-        outindex = ( j + ( i * widthout ) ) * components;
-        for( k = 0; k < components; k++ ) {
-          dataout.position( outindex + k );
-          dataout.put( (byte)(totals[k] / area) );
-        }
-        lowx_int = highx_int;
-        lowx_float = highx_float;
-        highx_int += convx_int;
-        highx_float += convx_float;
-        if( highx_float > 1.0f ) {
-          highx_float -= 1.0f;
-          highx_int++;
-        }
-
-        // Clamp to make sure we don't run off the right edge
-        if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
-          lowx_int -= delta;
-          highx_int -= delta;
-        }
-      }
-      lowy_int = highy_int;
-      lowy_float = highy_float;
-      highy_int += convy_int;
-      highy_float += convy_float;
-      if( highy_float > 1.0f ) {
-        highy_float -= 1.0f;
-        highy_int++;
-      }
-    }
-  }
-  
-  public static void scale_internal_ushort( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
-                              ShortBuffer dataout, int element_size, int ysize, 
-                              int group_size, boolean myswap_bytes ) {
-    float x, convx;
-    float y, convy;
-    float percent;
-    // Max components in a format is 4, so...
-    float[] totals = new float[4];
-    float area;
-    int i, j, k, xindex;
-    
-    int temp, temp0;
-    int temp_index;
-    int outindex;
-    
-    int lowx_int, highx_int, lowy_int, highy_int;
-    float x_percent, y_percent;
-    float lowx_float, highx_float, lowy_float, highy_float;
-    float convy_float, convx_float;
-    int convy_int, convx_int;
-    int l, m;
-    int left, right;
-    
-    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_ushort( components, widthin, heightin, datain, dataout, 
-                        element_size, ysize, group_size, myswap_bytes );
-      return;
-    }
-    convy = (float)heightin / heightout;
-    convx = (float)widthin / widthout;
-    convy_int = (int)Math.floor( convy );
-    convy_float = convy - convy_int;
-    convx_int = (int)Math.floor( convx );
-    convx_float = convx - convx_int;
-    
-    area = convx * convy;
-    
-    lowy_int = 0;
-    lowy_float = 0.0f;
-    highy_int = convy_int;
-    highy_float = convy_float;
-    
-    for( i = 0; i < heightout; i++ ) {
-      // Clamp here to be sure we don't read beyond input buffer.
-      if (highy_int >= heightin)
-        highy_int = heightin - 1;
-      lowx_int = 0;
-      lowx_float = 0.0f;
-      highx_int = convx_int;
-      highx_float = convx_float;
-      
-      for( j = 0; j < widthout; j++ ) {
-        
-        // Ok, now apply box filter to box that goes from (lowx, lowy)
-        // to (highx, highy) on input data into this pixel on output
-        // data.
-        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
-        // caulate the value for pixels in the 1st row
-        xindex = lowx_int * group_size;
-        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
-          y_percent = 1 - lowy_float;
-          temp = xindex + lowy_int * ysize;
-          percent = y_percent * ( 1 - lowx_float );
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += ( 0x0000FFFF & ((int)Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * percent;
-            } else {
-              totals[k] += ( 0x0000FFFF & datain.getShort() ) * percent;
-            }
-          }
-          left = temp;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                totals[k] += ( 0x0000FFFF & ((int)Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * y_percent;
-              } else {
-                totals[k] += ( 0x0000FFFF & datain.getShort()) * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          right = temp;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += ( 0x0000FFFF & (Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * percent;
-            } else {
-              totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
-            }
-          }
-          
-          // calculate the value for pixels in the last row
-          y_percent = highy_float;
-          percent = y_percent * ( 1 - lowx_float );
-          temp = xindex + highy_int * ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
-            } else {
-              totals[k] += ( 0x0000FFFF & datain.getShort() ) * percent;
-            }
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                totals[k] += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * y_percent;
-              } else {
-                totals[k] += ( 0x0000FFFF & datain.getShort()) * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
-            } else {
-              totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
-            }
-          }
-          
-          // calculate the value for the pixels in the 1st and last column
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            left += ysize;
-            right += ysize;
-            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
-              if( myswap_bytes ) {
-                datain.position( left );
-                float f = (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES(datain.getShort())) * ( 1 - lowx_float );
-                datain.position( right );
-                f += ((0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES(datain.getShort())) * highx_float);
-                totals[k] += f;
-              } else {
-                datain.position( left );
-                float f = ((0x0000FFFF & datain.getShort()) * ( 1 - lowx_float ));
-                datain.position( right );
-                f += ((0x0000FFFF & datain.getShort()) * highx_float);
-                totals[k] += f;
-              }
-            }
-          }
-        } else if( highy_int > lowy_int ) {
-          x_percent = highx_float - lowx_float;
-          percent = ( 1 - lowy_float) * x_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() )) * percent;
-            } else {
-              totals[k] += (0x0000FFFF & datain.getShort()) * percent;
-            }
-          }
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            temp += ysize;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * x_percent;
-              } else {
-                totals[k] += (0x0000FFFF & datain.getShort()) * x_percent;
-              }
-            }
-          }
-          percent = x_percent * highy_float;
-          temp += ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() )) * percent;
-            } else {
-              totals[k] += (0x0000FFFF & datain.getShort()) * percent;
-            }
-          }
-        } else if( highx_int > lowx_int ) {
-          y_percent = highy_float - lowy_float;
-          percent = ( 1 - lowx_float ) * y_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
-            } else {
-              totals[k] += (0x0000FFFF & datain.getShort()) * percent;
-            }
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * y_percent;
-              } else {
-                totals[k] += (0x0000FFFF & datain.getShort()) * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
-            } else {
-              totals[k] += (0x0000FFFF & datain.getShort()) * percent;
-            }
-          }
-        } else {
-          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
-            } else {
-              totals[k] += (0x0000FFFF & datain.getShort()) * percent;
-            }
-          }
-        }
-        
-        // this is for the pixels in the body
-        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
-        for( m = lowy_int + 1; m < highy_int; m++ ) {
-          temp = temp0;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()));
-              } else {
-                totals[k] += (0x0000FFFF & datain.getShort());
-              }
-            }
-            temp += group_size;
-          }
-          temp0 += ysize;
-        }
-        
-        outindex = ( j + ( i * widthout ) ) * components;
-        for( k = 0; k < components; k++ ) {
-          dataout.position( outindex + k );
-          dataout.put( (short)(totals[k] / area) );
-        }
-        lowx_int = highx_int;
-        lowx_float = highx_float;
-        highx_int += convx_int;
-        highx_float += convx_float;
-        if( highx_float > 1.0f ) {
-          highx_float -= 1.0f;
-          highx_int++;
-        }
-
-        // Clamp to make sure we don't run off the right edge
-        if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
-          lowx_int -= delta;
-          highx_int -= delta;
-        }
-      }
-      lowy_int = highy_int;
-      lowy_float = highy_float;
-      highy_int += convy_int;
-      highy_float += convy_float;
-      if( highy_float > 1.0f ) {
-        highy_float -= 1.0f;
-        highy_int++;
-      }
-    }
-  }
-  
-  public static void scale_internal_short( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout,
-                              ShortBuffer dataout, int element_size, int ysize, 
-                              int group_size, boolean myswap_bytes ) {
-    float x, convx;
-    float y, convy;
-    float percent;
-    // Max components in a format is 4, so...
-    float[] totals = new float[4];
-    float area;
-    int i, j, k, xindex;
-    
-    int temp, temp0;
-    int temp_index;
-    int outindex;
-    
-    int lowx_int, highx_int, lowy_int, highy_int;
-    float x_percent, y_percent;
-    float lowx_float, highx_float, lowy_float, highy_float;
-    float convy_float, convx_float;
-    int convy_int, convx_int;
-    int l, m;
-    int left, right;
-    
-    int swapbuf; // unsigned buffer
-    
-    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_short( components, widthin, heightin, datain, dataout, 
-                        element_size, ysize, group_size, myswap_bytes );
-      return;
-    }
-    convy = (float)heightin / heightout;
-    convx = (float)widthin / widthout;
-    convy_int = (int)Math.floor( convy );
-    convy_float = convy - convy_int;
-    convx_int = (int)Math.floor( convx );
-    convx_float = convx - convx_int;
-    
-    area = convx * convy;
-    
-    lowy_int = 0;
-    lowy_float = 0.0f;
-    highy_int = convy_int;
-    highy_float = convy_float;
-    
-    for( i = 0; i < heightout; i++ ) {
-      // Clamp here to be sure we don't read beyond input buffer.
-      if (highy_int >= heightin)
-        highy_int = heightin - 1;
-      lowx_int = 0;
-      lowx_float = 0.0f;
-      highx_int = convx_int;
-      highx_float = convx_float;
-      
-      for( j = 0; j < widthout; j++ ) {
-        
-        // Ok, now apply box filter to box that goes from (lowx, lowy)
-        // to (highx, highy) on input data into this pixel on output
-        // data.
-        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
-        // caulate the value for pixels in the 1st row
-        xindex = lowx_int * group_size;
-        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
-          y_percent = 1 - lowy_float;
-          temp = xindex + lowy_int * ysize;
-          percent = y_percent * ( 1 - lowx_float );
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getShort() * percent;
-            }
-          }
-          left = temp;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-                totals[k] += swapbuf * y_percent;
-              } else {
-                totals[k] += datain.getShort() * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          right = temp;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getShort() * percent;
-            }
-          }
-          
-          // calculate the value for pixels in the last row
-          y_percent = highy_float;
-          percent = y_percent * ( 1 - lowx_float );
-          temp = xindex + highy_int * ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getShort() * percent;
-            }
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-                totals[k] += swapbuf * y_percent;
-              } else {
-                totals[k] += datain.getShort() * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getShort() * percent;
-            }
-          }
-          
-          // calculate the value for the pixels in the 1st and last column
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            left += ysize;
-            right += ysize;
-            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
-              if( myswap_bytes ) {
-                datain.position( left );
-                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-                totals[k] += swapbuf * ( 1 - lowx_float );
-                datain.position( right );
-                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-                totals[k] += swapbuf * highx_float;
-              } else {
-                datain.position( left );
-                totals[k] += datain.getShort() * ( 1 - lowx_float );
-                datain.position( right );
-                totals[k] += datain.getShort() * highx_float;
-              }
-            }
-          }
-        } else if( highy_int > lowy_int ) {
-          x_percent = highx_float - lowx_float;
-          percent = ( 1 - lowy_float) * x_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getShort() * percent;
-            }
-          }
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            temp += ysize;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort());
-                totals[k] += swapbuf * x_percent;
-              } else {
-                totals[k] += datain.getShort() * x_percent;
-              }
-            }
-          }
-          percent = x_percent * highy_float;
-          temp += ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getShort() * percent;
-            }
-          }
-        } else if( highx_int > lowx_int ) {
-          y_percent = highy_float - lowy_float;
-          percent = ( 1 - lowx_float ) * y_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getShort() * percent;
-            }
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-                totals[k] += swapbuf * y_percent;
-              } else {
-                totals[k] += datain.getShort() * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getShort() * percent;
-            }
-          }
-        } else {
-          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getShort() * percent;
-            }
-          }
-        }
-        
-        // this is for the pixels in the body
-        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
-        for( m = lowy_int + 1; m < highy_int; m++ ) {
-          temp = temp0;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
-                totals[k] += swapbuf;
-              } else {
-                totals[k] += datain.getShort();
-              }
-            }
-            temp += group_size;
-          }
-          temp0 += ysize;
-        }
-        
-        outindex = ( j + ( i * widthout ) ) * components;
-        for( k = 0; k < components; k++ ) {
-          dataout.position( outindex + k );
-          dataout.put( (short)(totals[k] / area) );
-        }
-        lowx_int = highx_int;
-        lowx_float = highx_float;
-        highx_int += convx_int;
-        highx_float += convx_float;
-        if( highx_float > 1.0f ) {
-          highx_float -= 1.0f;
-          highx_int++;
-        }
-
-        // Clamp to make sure we don't run off the right edge
-        if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
-          lowx_int -= delta;
-          highx_int -= delta;
-        }
-      }
-      lowy_int = highy_int;
-      lowy_float = highy_float;
-      highy_int += convy_int;
-      highy_float += convy_float;
-      if( highy_float > 1.0f ) {
-        highy_float -= 1.0f;
-        highy_int++;
-      }
-    }
-  }
-  
-  public static void scale_internal_uint( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
-                              IntBuffer dataout, int element_size, int ysize, 
-                              int group_size, boolean myswap_bytes ) {
-    float x, convx;
-    float y, convy;
-    float percent;
-    // Max components in a format is 4, so...
-    float[] totals = new float[4];
-    float area;
-    int i, j, k, xindex;
-    
-    int temp, temp0;
-    int temp_index;
-    int outindex;
-    
-    int lowx_int, highx_int, lowy_int, highy_int;
-    float x_percent, y_percent;
-    float lowx_float, highx_float, lowy_float, highy_float;
-    float convy_float, convx_float;
-    int convy_int, convx_int;
-    int l, m;
-    int left, right;
-    
-    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_uint( components, widthin, heightin, datain, dataout, 
-                        element_size, ysize, group_size, myswap_bytes );
-      return;
-    }
-    convy = (float)heightin / heightout;
-    convx = (float)widthin / widthout;
-    convy_int = (int)Math.floor( convy );
-    convy_float = convy - convy_int;
-    convx_int = (int)Math.floor( convx );
-    convx_float = convx - convx_int;
-    
-    area = convx * convy;
-    
-    lowy_int = 0;
-    lowy_float = 0.0f;
-    highy_int = convy_int;
-    highy_float = convy_float;
-    
-    for( i = 0; i < heightout; i++ ) {
-      // Clamp here to be sure we don't read beyond input buffer.
-      if (highy_int >= heightin)
-        highy_int = heightin - 1;
-      lowx_int = 0;
-      lowx_float = 0.0f;
-      highx_int = convx_int;
-      highx_float = convx_float;
-      
-      for( j = 0; j < widthout; j++ ) {
-        
-        // Ok, now apply box filter to box that goes from (lowx, lowy)
-        // to (highx, highy) on input data into this pixel on output
-        // data.
-        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
-        // caulate the value for pixels in the 1st row
-        xindex = lowx_int * group_size;
-        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
-          y_percent = 1 - lowy_float;
-          temp = xindex + lowy_int * ysize;
-          percent = y_percent * ( 1 - lowx_float );
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
-            } else {
-              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
-            }
-          }
-          left = temp;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * y_percent;
-              } else {
-                totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          right = temp;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
-            } else {
-              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
-            }
-          }
-          
-          // calculate the value for pixels in the last row
-          y_percent = highy_float;
-          percent = y_percent * ( 1 - lowx_float );
-          temp = xindex + highy_int * ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
-            } else {
-              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
-            }
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * y_percent;
-              } else {
-                totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
-            } else {
-              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
-            }
-          }
-          
-          // calculate the value for the pixels in the 1st and last column
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            left += ysize;
-            right += ysize;
-            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
-              if( myswap_bytes ) {
-                datain.position( left );
-                totals[k] += ((0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES(datain.getInt())) * ( 1 - lowx_float ));
-                datain.position( right );
-                totals[k] += ((0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES(datain.getInt())) * highx_float);
-              } else {
-                datain.position( left );
-                totals[k] += ((0x00000000FFFFFFFF & datain.getInt()) * ( 1 - lowx_float ));
-                datain.position( right );
-                totals[k] += ((0x00000000FFFFFFFF & datain.getInt()) * highx_float);
-              }
-            }
-          }
-        } else if( highy_int > lowy_int ) {
-          x_percent = highx_float - lowx_float;
-          percent = ( 1 - lowy_float) * x_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
-            } else {
-              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
-            }
-          }
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            temp += ysize;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * x_percent;
-              } else {
-                totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * x_percent;
-              }
-            }
-          }
-          percent = x_percent * highy_float;
-          temp += ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
-            } else {
-              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
-            }
-          }
-        } else if( highx_int > lowx_int ) {
-          y_percent = highy_float - lowy_float;
-          percent = ( 1 - lowx_float ) * y_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
-            } else {
-              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
-            }
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * y_percent;
-              } else {
-                totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
-            } else {
-              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
-            }
-          }
-        } else {
-          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            long tempInt0 = ( 0xFFFFFFFFL & datain.getInt( temp_index ) );
-            datain.position( temp_index );
-            long tempInt1 = ( 0xFFFFFFFFL & datain.getInt() );
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
-            } else {
-              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
-            }
-          }
-        }
-        
-        // this is for the pixels in the body
-        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
-        for( m = lowy_int + 1; m < highy_int; m++ ) {
-          temp = temp0;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()));
-              } else {
-                totals[k] += (0x00000000FFFFFFFF & datain.getInt());
-              }
-            }
-            temp += group_size;
-          }
-          temp0 += ysize;
-        }
-        
-        outindex = ( j + ( i * widthout ) ) * components;
-        float value = 0.0f;
-        for( k = 0; k < components; k++ ) {
-          value = totals[k] / area;
-          dataout.position( outindex + k );
-          if( value >= UINT_MAX ) {
-            dataout.put( (int)value );
-          } else {
-            dataout.put( (int)(totals[k] / area) );
-          }
-        }
-        lowx_int = highx_int;
-        lowx_float = highx_float;
-        highx_int += convx_int;
-        highx_float += convx_float;
-        if( highx_float > 1.0f ) {
-          highx_float -= 1.0f;
-          highx_int++;
-        }
-
-        // Clamp to make sure we don't run off the right edge
-        if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
-          lowx_int -= delta;
-          highx_int -= delta;
-        }
-      }
-      lowy_int = highy_int;
-      lowy_float = highy_float;
-      highy_int += convy_int;
-      highy_float += convy_float;
-      if( highy_float > 1.0f ) {
-        highy_float -= 1.0f;
-        highy_int++;
-      }
-    }
-  }
-  
-  public static void scale_internal_int( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
-                              IntBuffer dataout, int element_size, int ysize, 
-                              int group_size, boolean myswap_bytes ) {
-    float x, convx;
-    float y, convy;
-    float percent;
-    // Max components in a format is 4, so...
-    float[] totals = new float[4];
-    float area;
-    int i, j, k, xindex;
-    
-    int temp, temp0;
-    int temp_index;
-    int outindex;
-    
-    int lowx_int, highx_int, lowy_int, highy_int;
-    float x_percent, y_percent;
-    float lowx_float, highx_float, lowy_float, highy_float;
-    float convy_float, convx_float;
-    int convy_int, convx_int;
-    int l, m;
-    int left, right;
-    
-    long swapbuf; // unsigned buffer
-    
-    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_int( components, widthin, heightin, datain, dataout, 
-                        element_size, ysize, group_size, myswap_bytes );
-      return;
-    }
-    convy = (float)heightin / heightout;
-    convx = (float)widthin / widthout;
-    convy_int = (int)Math.floor( convy );
-    convy_float = convy - convy_int;
-    convx_int = (int)Math.floor( convx );
-    convx_float = convx - convx_int;
-    
-    area = convx * convy;
-    
-    lowy_int = 0;
-    lowy_float = 0.0f;
-    highy_int = convy_int;
-    highy_float = convy_float;
-    
-    for( i = 0; i < heightout; i++ ) {
-      // Clamp here to be sure we don't read beyond input buffer.
-      if (highy_int >= heightin)
-        highy_int = heightin - 1;
-      lowx_int = 0;
-      lowx_float = 0.0f;
-      highx_int = convx_int;
-      highx_float = convx_float;
-      
-      for( j = 0; j < widthout; j++ ) {
-        
-        // Ok, now apply box filter to box that goes from (lowx, lowy)
-        // to (highx, highy) on input data into this pixel on output
-        // data.
-        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
-        // caulate the value for pixels in the 1st row
-        xindex = lowx_int * group_size;
-        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
-          y_percent = 1 - lowy_float;
-          temp = xindex + lowy_int * ysize;
-          percent = y_percent * ( 1 - lowx_float );
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getInt() * percent;
-            }
-          }
-          left = temp;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-                totals[k] += swapbuf * y_percent;
-              } else {
-                totals[k] += datain.getInt() * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          right = temp;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getInt() * percent;
-            }
-          }
-          
-          // calculate the value for pixels in the last row
-          y_percent = highy_float;
-          percent = y_percent * ( 1 - lowx_float );
-          temp = xindex + highy_int * ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getInt() * percent;
-            }
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-                totals[k] += swapbuf * y_percent;
-              } else {
-                totals[k] += datain.getInt() * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getInt() * percent;
-            }
-          }
-          
-          // calculate the value for the pixels in the 1st and last column
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            left += ysize;
-            right += ysize;
-            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
-              if( myswap_bytes ) {
-                datain.position( left );
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-                totals[k] += swapbuf * ( 1 - lowx_float );
-                datain.position( right );
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-                totals[k] += swapbuf * highx_float;
-              } else {
-                datain.position( left );
-                totals[k] += (datain.getInt() * ( 1 - lowx_float ));
-                datain.position( right );
-                totals[k] += (datain.getInt() * highx_float);
-              }
-            }
-          }
-        } else if( highy_int > lowy_int ) {
-          x_percent = highx_float - lowx_float;
-          percent = ( 1 - lowy_float) * x_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getInt() * percent;
-            }
-          }
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            temp += ysize;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-                totals[k] += swapbuf * x_percent;
-              } else {
-                totals[k] += datain.getInt() * x_percent;
-              }
-            }
-          }
-          percent = x_percent * highy_float;
-          temp += ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getInt() * percent;
-            }
-          }
-        } else if( highx_int > lowx_int ) {
-          y_percent = highy_float - lowy_float;
-          percent = ( 1 - lowx_float ) * y_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getInt() * percent;
-            }
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-                totals[k] += swapbuf * y_percent;
-              } else {
-                totals[k] += datain.getInt() * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getInt() * percent;
-            }
-          }
-        } else {
-          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getInt() * percent;
-            }
-          }
-        }
-        
-        // this is for the pixels in the body
-        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
-        for( m = lowy_int + 1; m < highy_int; m++ ) {
-          temp = temp0;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
-                totals[k] += swapbuf;
-              } else {
-                totals[k] += datain.getInt();
-              }
-            }
-            temp += group_size;
-          }
-          temp0 += ysize;
-        }
-        
-        outindex = ( j + ( i * widthout ) ) * components;
-        for( k = 0; k < components; k++ ) {
-          dataout.position( outindex + k );
-          dataout.put( (int)(totals[k] / area) );
-        }
-        lowx_int = highx_int;
-        lowx_float = highx_float;
-        highx_int += convx_int;
-        highx_float += convx_float;
-        if( highx_float > 1.0f ) {
-          highx_float -= 1.0f;
-          highx_int++;
-        }
-
-        // Clamp to make sure we don't run off the right edge
-        if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
-          lowx_int -= delta;
-          highx_int -= delta;
-        }
-      }
-      lowy_int = highy_int;
-      lowy_float = highy_float;
-      highy_int += convy_int;
-      highy_float += convy_float;
-      if( highy_float > 1.0f ) {
-        highy_float -= 1.0f;
-        highy_int++;
-      }
-    }
-  }
-  
-  public static void scale_internal_float( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout, 
-                              FloatBuffer dataout, int element_size, int ysize, 
-                              int group_size, boolean myswap_bytes ) {
-    float x, convx;
-    float y, convy;
-    float percent;
-    // Max components in a format is 4, so...
-    float[] totals = new float[4];
-    float area;
-    int i, j, k, xindex;
-    
-    int temp, temp0;
-    int temp_index;
-    int outindex;
-    
-    int lowx_int, highx_int, lowy_int, highy_int;
-    float x_percent, y_percent;
-    float lowx_float, highx_float, lowy_float, highy_float;
-    float convy_float, convx_float;
-    int convy_int, convx_int;
-    int l, m;
-    int left, right;
-    
-    float swapbuf; // unsigned buffer
-    
-    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
-      HalveImage.halveImage_float( components, widthin, heightin, datain, dataout, 
-                        element_size, ysize, group_size, myswap_bytes );
-      return;
-    }
-    convy = (float)heightin / heightout;
-    convx = (float)widthin / widthout;
-    convy_int = (int)Math.floor( convy );
-    convy_float = convy - convy_int;
-    convx_int = (int)Math.floor( convx );
-    convx_float = convx - convx_int;
-    
-    area = convx * convy;
-    
-    lowy_int = 0;
-    lowy_float = 0.0f;
-    highy_int = convy_int;
-    highy_float = convy_float;
-    
-    for( i = 0; i < heightout; i++ ) {
-      // Clamp here to be sure we don't read beyond input buffer.
-      if (highy_int >= heightin)
-        highy_int = heightin - 1;
-      lowx_int = 0;
-      lowx_float = 0.0f;
-      highx_int = convx_int;
-      highx_float = convx_float;
-      
-      for( j = 0; j < widthout; j++ ) {
-        
-        // Ok, now apply box filter to box that goes from (lowx, lowy)
-        // to (highx, highy) on input data into this pixel on output
-        // data.
-        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
-        // caulate the value for pixels in the 1st row
-        xindex = lowx_int * group_size;
-        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-          
-          y_percent = 1 - lowy_float;
-          temp = xindex + lowy_int * ysize;
-          percent = y_percent * ( 1 - lowx_float );
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getFloat() * percent;
-            }
-          }
-          left = temp;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-                totals[k] += swapbuf * y_percent;
-              } else {
-                totals[k] += datain.getFloat() * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          right = temp;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getFloat() * percent;
-            }
-          }
-          
-          // calculate the value for pixels in the last row
-          y_percent = highy_float;
-          percent = y_percent * ( 1 - lowx_float );
-          temp = xindex + highy_int * ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getFloat() * percent;
-            }
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-                totals[k] += swapbuf * y_percent;
-              } else {
-                totals[k] += datain.getFloat() * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getFloat() * percent;
-            }
-          }
-          
-          // calculate the value for the pixels in the 1st and last column
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            left += ysize;
-            right += ysize;
-            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
-              if( myswap_bytes ) {
-                datain.position( left );
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-                totals[k] += swapbuf * ( 1 - lowx_float );
-                datain.position( right );
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-                totals[k] += swapbuf * highx_float;
-              } else {
-                datain.position( left );
-                totals[k] += (datain.getFloat() * ( 1 - lowx_float ));
-                datain.position( right );
-                totals[k] += (datain.getFloat() * highx_float);
-              }
-            }
-          }
-        } else if( highy_int > lowy_int ) {
-          x_percent = highx_float - lowx_float;
-          percent = ( 1 - lowy_float) * x_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getFloat() * percent;
-            }
-          }
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            temp += ysize;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-                totals[k] += swapbuf * x_percent;
-              } else {
-                totals[k] += datain.getFloat() * x_percent;
-              }
-            }
-          }
-          percent = x_percent * highy_float;
-          temp += ysize;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getFloat() * percent;
-            }
-          }
-        } else if( highx_int > lowx_int ) {
-          y_percent = highy_float - lowy_float;
-          percent = ( 1 - lowx_float ) * y_percent;
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getFloat() * percent;
-            }
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += group_size;
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-                totals[k] += swapbuf * y_percent;
-              } else {
-                totals[k] += datain.getFloat() * y_percent;
-              }
-            }
-          }
-          temp += group_size;
-          percent = y_percent * highx_float;
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getFloat() * percent;
-            }
-          }
-        } else {
-          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
-          temp = xindex + (lowy_int * ysize);
-          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            datain.position( temp_index );
-            if( myswap_bytes ) {
-              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-              totals[k] += swapbuf * percent;
-            } else {
-              totals[k] += datain.getFloat() * percent;
-            }
-          }
-        }
-        
-        // this is for the pixels in the body
-        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
-        for( m = lowy_int + 1; m < highy_int; m++ ) {
-          temp = temp0;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-              datain.position( temp_index );
-              if( myswap_bytes ) {
-                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
-                totals[k] += swapbuf;
-              } else {
-                totals[k] += datain.getFloat();
-              }
-            }
-            temp += group_size;
-          }
-          temp0 += ysize;
-        }
-        
-        outindex = ( j + ( i * widthout ) ) * components;
-        for( k = 0; k < components; k++ ) {
-          dataout.position( outindex + k );
-          dataout.put( (totals[k] / area) );
-        }
-        lowx_int = highx_int;
-        lowx_float = highx_float;
-        highx_int += convx_int;
-        highx_float += convx_float;
-        if( highx_float > 1.0f ) {
-          highx_float -= 1.0f;
-          highx_int++;
-        }
-
-        // Clamp to make sure we don't run off the right edge
-        if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
-          lowx_int -= delta;
-          highx_int -= delta;
-        }
-      }
-      lowy_int = highy_int;
-      lowy_float = highy_float;
-      highy_int += convy_int;
-      highy_float += convy_float;
-      if( highy_float > 1.0f ) {
-        highy_float -= 1.0f;
-        highy_int++;
-      }
-    }
-  }
-  
-  public static void scaleInternalPackedPixel( int components, Extract extract, 
-              int widthIn, int heightIn, ByteBuffer dataIn, int widthOut,
-              int heightOut, ByteBuffer dataOut, int pixelSizeInBytes,
-              int rowSizeInBytes, boolean isSwap ) {
-    float x, convx;
-    float y, convy;
-    float percent;
-    
-    // max components in a format is 4, so
-    float[] totals = new float[4];
-    float[] extractTotals = new float[4];
-    float[] extractMoreTotals = new float[4];
-    float[] shoveTotals = new float[4];
-    
-    float area;
-    int i, j, k, xindex;
-    
-    int temp, temp0;
-    int temp_index;
-    int outIndex = 0;
-    
-    int lowx_int, highx_int, lowy_int, highy_int;
-    float x_percent, y_percent;
-    float lowx_float, highx_float, lowy_float, highy_float;
-    float convy_float, convx_float;
-    int convy_int, convx_int;
-    int l, m;
-    int left, right;
-    
-    if( widthIn == widthOut * 2 && heightIn == heightOut * 2 ) {
-      HalveImage.halveImagePackedPixel( components, extract, widthIn, heightIn, dataIn, dataOut,
-                              pixelSizeInBytes, rowSizeInBytes, isSwap );
-      return;
-    }
-    convy = (float)heightIn / (float)heightOut;
-    convx = (float)widthIn / (float)widthOut;
-    convy_int = (int)Math.floor( convy );
-    convy_float = convy - convy_int;
-    convx_int = (int)Math.floor( convx );
-    convx_float = convx - convx_int;
-    
-    area = convx * convy;
-    
-    lowy_int = 0;
-    lowy_float = 0.0f;
-    highy_int = convy_int;
-    highy_float = convx_float;
-    
-    for( i = 0; i < heightOut; i++ ) {
-      // Clamp here to be sure we don't read beyond input buffer.
-      if (highy_int >= heightIn)
-        highy_int = heightIn - 1;
-      lowx_int = 0;
-      lowx_float = 0.0f;
-      highx_int = convx_int;
-      highx_float = convx_float;
-      
-      for( j = 0; j < widthOut; j++ ) {
-        // ok now apply box filter to box that goes from( lowx, lowy )
-        // to ( highx, highy ) on input data into this pixel on output data
-        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-        
-        // calculate that value for pixels in the 1st row
-        xindex = lowx_int * pixelSizeInBytes;
-        if( (highy_int > lowy_int) && (highx_int > lowx_int) ) {
-          
-          y_percent = 1 - lowy_float;
-          temp = xindex + lowy_int * rowSizeInBytes;
-          percent = y_percent * ( 1 - lowx_float );
-          dataIn.position( temp );
-          extract.extract( isSwap, dataIn, extractTotals );
-          for( k = 0; k < components; k++ ) {
-            totals[k] += extractTotals[k] * percent;
-          }
-          left = temp;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += pixelSizeInBytes;
-            dataIn.position( temp );
-            extract.extract( isSwap, dataIn, extractTotals );
-            for( k = 0; k < components; k++ ) {
-              totals[k] += extractTotals[k] * y_percent;
-            }
-          }
-          temp += pixelSizeInBytes;
-          right = temp;
-          percent = y_percent * highx_float;
-          dataIn.position( temp );
-          extract.extract( isSwap, dataIn, extractTotals );
-          for( k = 0; k < components; k++ ) {
-            totals[k] += extractTotals[k] * percent;
-          }
-          // calculate the value for pixels in the last row
-          
-          y_percent = highy_float;
-          percent = y_percent * ( 1 - lowx_float );
-          temp = xindex + highy_int * rowSizeInBytes;
-          dataIn.position( temp );
-          extract.extract( isSwap, dataIn, extractTotals );
-          for( k = 0; k < components; k++ ) {
-            totals[k] += extractTotals[k] * percent;
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += pixelSizeInBytes;
-            dataIn.position( temp );
-            extract.extract( isSwap, dataIn, extractTotals );
-            for( k = 0; k < components; k++ ) {
-              totals[k] += extractTotals[k] * y_percent;
-            }
-          }
-          temp += pixelSizeInBytes;
-          percent = y_percent * highx_float;
-          dataIn.position( temp );
-          for( k = 0; k < components; k++ ) {
-            totals[k] += extractTotals[k] * percent;
-          }
-          
-          // calculate the value for pixels in the 1st and last column
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            left += rowSizeInBytes;
-            right += rowSizeInBytes;
-            dataIn.position( left );
-            extract.extract( isSwap, dataIn, extractTotals );
-            dataIn.position( right );
-            extract.extract( isSwap, dataIn, extractMoreTotals );
-            for( k = 0; k < components; k++ ) {
-              totals[k] += ( extractTotals[k] * ( 1 - lowx_float ) + extractMoreTotals[k] * highx_float );
-            }
-          }
-        } else if( highy_int > lowy_int ) {
-          x_percent = highx_float - lowx_float;
-          percent = ( 1 - lowy_float ) * x_percent;
-          temp = xindex + lowy_int * rowSizeInBytes;
-          dataIn.position( temp );
-          extract.extract( isSwap, dataIn, extractTotals );
-          for( k = 0; k < components; k++ ) {
-            totals[k] += extractTotals[k] * percent;
-          }
-          for( m = lowy_int + 1; m < highy_int; m++ ) {
-            temp += rowSizeInBytes;
-            dataIn.position( temp );
-            extract.extract( isSwap, dataIn, extractTotals );
-            for( k = 0; k < components; k++ ) {
-              totals[k] += extractTotals[k] * x_percent;
-            }
-          }
-          percent = x_percent * highy_float;
-          temp += rowSizeInBytes;
-          dataIn.position( temp );
-          extract.extract( isSwap, dataIn, extractTotals );
-          for( k = 0; k < components; k++ ) {
-            totals[k] += extractTotals[k] * percent;
-          }
-        } else if( highx_int > lowx_int ) {
-          y_percent = highy_float - lowy_float;
-          percent = ( 1 - lowx_float ) * y_percent;
-          temp = xindex + lowy_int * rowSizeInBytes;
-          dataIn.position( temp );
-          extract.extract( isSwap, dataIn, extractTotals );
-          for( k = 0; k < components; k++ ) {
-            totals[k] += extractTotals[k] * percent;
-          }
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            temp += pixelSizeInBytes;
-            dataIn.position( temp );
-            extract.extract( isSwap, dataIn, extractTotals );
-            for( k = 0; k < components; k++ ) {
-              totals[k] += extractTotals[k] * y_percent;
-            }
-          }
-          temp += pixelSizeInBytes;
-          percent = y_percent * highx_float;
-          dataIn.position( temp );
-          extract.extract( isSwap, dataIn, extractTotals );
-          for( k = 0; k < components; k++ ) {
-            totals[k] += extractTotals[k] * percent;
-          }
-        } else {
-          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
-          temp = xindex + lowy_int * rowSizeInBytes;
-          dataIn.position( temp );
-          extract.extract( isSwap, dataIn, extractTotals );
-          for( k = 0; k < components; k++ ) {
-            totals[k] += extractTotals[k] * percent;
-          }
-        }
-        
-        // this is for the pixels in the body
-        temp0 = xindex + pixelSizeInBytes + ( lowy_int + 1 ) * rowSizeInBytes;
-        for( m = lowy_int + 1; m < highy_int; m++ ) {
-          temp = temp0;
-          for( l = lowx_int + 1; l < highx_int; l++ ) {
-            dataIn.position( temp );
-            extract.extract( isSwap, dataIn, extractTotals );
-            for( k = 0; k < components; k++ ) {
-              totals[k] += extractTotals[k] * percent;
-            }
-            temp += pixelSizeInBytes;
-          }
-          temp0 += rowSizeInBytes;
-        }
-        
-        outIndex = ( j + ( i * widthOut ) );
-        for( k = 0; k < components; k++ ) {
-          shoveTotals[k] = totals[k] / area;
-        }
-        extract.shove( shoveTotals, outIndex, dataOut );
-        lowx_int = highx_int;
-        lowx_float = highx_float;
-        highx_int += convx_int;
-        highx_float += convx_float;
-        if( highx_float > 1.0f ) {
-          highx_float -= 1.0f;
-          highx_int++;
-        }
-
-        // Clamp to make sure we don't run off the right edge
-        if (highx_int > widthIn - 1) {
-          int delta = (highx_int - widthIn + 1);
-          lowx_int -= delta;
-          highx_int -= delta;
-        }
-      }
-      lowy_int = highy_int;
-      lowy_float = highy_float;
-      highy_int += convy_int;
-      highy_float += convy_float;
-      if( highy_float > 1.0f ) {
-        highy_float -= 1.0f;
-        highy_int++;
-      }
-    }
-    assert( outIndex == ( widthOut * heightOut - 1) );
-  }
-  
-  public static void scaleInternal3D( int components, int widthIn, int heightIn,
-          int depthIn, ShortBuffer dataIn, int widthOut, int heightOut,
-          int depthOut, ShortBuffer dataOut ) {
-    float x, lowx, highx, convx, halfconvx;
-    float y, lowy, highy, convy, halfconvy;
-    float z, lowz, highz, convz, halfconvz;
-    float xpercent, ypercent, zpercent;
-    float percent;
-    // max compnents in a format is 4
-    float[] totals = new float[4];
-    float volume;
-    int i, j, d, k, zint, yint, xint, xindex, yindex, zindex;
-    int temp;
-    
-    lowy = highy = lowx = highx = 0.0f;
-    
-    convz = (float)depthIn / depthOut;
-    convy = (float)heightIn / heightOut;
-    convx = (float)widthIn / widthOut;
-    halfconvz = convz / 2.0f;
-    halfconvy = convy / 2.0f;
-    halfconvx = convx / 2.0f;
-    for( d = 0; d < depthOut; d++ ) {
-      z = convz * ( d + 0.5f );
-      if( depthIn > depthOut ) {
-        highz = z + halfconvz;
-        lowz = z - halfconvz;
-      } else {
-        highz = z + 0.5f;
-        lowz = z - 0.5f;
-      }
-      for( i = 0; i < heightOut; i++ ) {
-        y = convy * ( i + 0.5f );
-        if( heightIn > heightOut ) {
-          highz = y + halfconvy;
-          lowz = y - halfconvy;
-        } else {
-          highz = y + 0.5f;
-          lowz = y - 0.5f;
-        }
-        for( j = 0; j < widthOut; j++ ) {
-          x = convx * ( j + 0.5f );
-          if( depthIn > depthOut ) {
-            highz = x + halfconvx;
-            lowz = x - halfconvx;
-          } else {
-            highz = x + 0.5f;
-            lowz = x - 0.5f;
-          }
-          
-          // Ok, now apply box filter to box that goes from ( lowx, lowy, lowz )
-          // to ( highx, highy, highz ) on input data into this pixel on output data
-          
-          totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-          volume = 0.0f;
-          
-          z = lowz;
-          zint = (int)(Math.floor( z ) );
-          while( z < highz ) {
-            zindex = ( zint + depthIn ) % depthIn;
-            if( highz < zint + 1 ) {
-              zpercent = highz - z;
-            } else {
-              zpercent = zint + 1 - z;
-            }
-            
-            y = lowy;
-            yint = (int)(Math.floor( y ) );
-            while( y < highy ) {
-              yindex = ( yint + heightIn ) % heightIn;
-              if( highy < yint + 1 ) {
-                ypercent = highy - y;
-              } else {
-                ypercent = yint + 1 - y;
-              }
-              
-              x = lowx;
-              xint = (int)(Math.floor( x ) );
-              
-              while( x < highx ) {
-                xindex = (xint + widthIn ) % widthIn;
-                if( highx < xint + 1 ) {
-                  xpercent = highx - x;
-                } else {
-                  xpercent = xint + 1 - x;
-                }
-                
-                percent = xpercent * ypercent * zpercent;
-                volume += percent;
-                
-                temp = (xindex + ( yindex *widthIn) + (zindex * widthIn *heightIn)) * components;
-                for( k = 0; k < components; k++ ) {
-                  assert( 0 <= (temp+k) && (temp+k) < (widthIn * heightIn * depthIn * components) );
-                  totals[k] += dataIn.get( temp + k ) * percent;
-                }
-                xint++;
-                x = xint;
-              } // while x
-              yint++;
-              y = yint;
-            } // while y
-            zint++;
-            z = zint;
-          } // while z
-          
-          temp = ( j + ( i * widthOut ) + (d * widthOut * heightOut ) ) * components;
-          for( k = 0; k < components; k++ ) {
-            // totals should be rounded in the case of enlarging an rgb ramp when the type is 332 or 4444
-            assert( 0 <= ( temp + k ) && ( temp + k ) < (widthOut * heightOut* depthOut * components) );
-            dataOut.put( temp + k, (short)((totals[k] + 0.5f) / volume ) );
-          }
-        }
-      }
-    }
-  }
-  
-  public static int gluScaleImage3D( GL gl, int format, int widthIn, int heightIn, 
-          int depthIn, int typeIn, ByteBuffer dataIn, int widthOut, int heightOut, 
-          int depthOut, int typeOut, ByteBuffer dataOut ) {
-    int components;
-    ShortBuffer beforeImage, afterImage;
-    PixelStorageModes psm = new PixelStorageModes();
-    
-    if( widthIn == 0 || heightIn == 0 || depthIn == 0 ||
-            widthOut == 0 || heightOut == 0 || depthOut == 0 ) {
-      return( 0 );
-    }
-    
-    if( widthIn < 0 || heightIn < 0 || depthIn < 0 ||
-            widthOut < 0 || heightOut < 0 || depthOut < 0 ) {
-      return( GLU.GLU_INVALID_VALUE );
-    }
-    
-    if( !Mipmap.legalFormat(format) || !Mipmap.legalType(typeIn) || 
-            !Mipmap.legalType(typeOut) || typeIn == GL2.GL_BITMAP ||
-            typeOut == GL2.GL_BITMAP ) {
-      return( GLU.GLU_INVALID_ENUM );
-    }
-    
-    if( !Mipmap.isLegalFormatForPackedPixelType( format, typeIn ) ) {
-      return( GLU.GLU_INVALID_OPERATION );
-    }
-    
-    if( !Mipmap.isLegalFormatForPackedPixelType( format, typeOut ) ) {
-      return( GLU.GLU_INVALID_OPERATION );
-    }
-    
-    try {
-        beforeImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn, 
-                heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
-        afterImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn, 
-                heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
-    } catch( OutOfMemoryError err ) {
-      return( GLU.GLU_OUT_OF_MEMORY );
-    }
-    Mipmap.retrieveStoreModes3D( gl, psm );
-    
-    Image.fillImage3D( psm, widthIn, heightIn, depthIn, format, typeIn,
-            Mipmap.is_index( format ), dataIn, beforeImage );
-    components = Mipmap.elements_per_group( format, 0 );
-    ScaleInternal.scaleInternal3D( components, widthIn, heightIn, depthIn,
-            beforeImage, widthOut, heightOut, depthOut, afterImage );
-    Image.emptyImage3D( psm, widthOut, heightOut, depthOut, format, typeOut,
-            Mipmap.is_index( format ), afterImage, dataOut );
-    
-    return( 0 );
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Type_Widget.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Type_Widget.java
deleted file mode 100644
index b329840..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Type_Widget.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.mipmap;
-
-import java.nio.*;
-
-/**
- *
- * @author  Administrator
- */
-public class Type_Widget {
-  
-  ByteBuffer buffer;
-  
-  /** Creates a new instance of Type_Widget */
-  public Type_Widget() {
-    buffer = ByteBuffer.allocateDirect( 4 );
-  }
-  
-  public void setUB0( byte b ) {
-    buffer.position( 0 );
-    buffer.put( b );
-  }
-  
-  public byte getUB0() {
-    buffer.position( 0 );
-    return( buffer.get() );
-  }
-  
-  public void setUB1( byte b ) {
-    buffer.position( 1 );
-    buffer.put( b );
-  }
-  
-  public byte getUB1() {
-    buffer.position( 1 );
-    return( buffer.get() );
-  }
-  
-  public void setUB2( byte b ) {
-    buffer.position( 2 );
-    buffer.put( b );
-  }
-  
-  public byte getUB2() {
-    buffer.position( 2 );
-    return( buffer.get() );
-  }
-  
-  public void setUB3( byte b ) {
-    buffer.position( 3 );
-    buffer.put( b );
-  }
-  
-  public byte getUB3() {
-    buffer.position( 3 );
-    return( buffer.get() );
-  }
-  
-  public void setUS0( short s ) {
-    buffer.position( 0 );
-    buffer.putShort( s );
-  }
-  
-  public short getUS0() {
-    buffer.position( 0 );
-    return( buffer.getShort() );
-  }
-  
-  public void setUS1( short s ) {
-    buffer.position( 2 );
-    buffer.putShort( s );
-  }
-  
-  public short getUS1() {
-   buffer.position( 2 );
-   return( buffer.getShort() );
-  }
-  
-  public void setUI( int i ) {
-    buffer.position( 0 );
-    buffer.putInt( i );
-  }
-  
-  public int getUI() {
-    buffer.position( 0 );
-    return( buffer.getInt() );
-  }
-  
-  public void setB0( byte b ) {
-    buffer.position( 0 );
-    buffer.put( b );
-  }
-  
-  public byte getB0() {
-    buffer.position( 0 );
-    return( buffer.get() );
-  }
-  
-  public void setB1( byte b ) {
-    buffer.position( 1 );
-    buffer.put( b );
-  }
-  
-  public byte getB1() {
-    buffer.position( 1 );
-    return( buffer.get() );
-  }
-  
-  public void setB2( byte b ) {
-    buffer.position( 2 );
-    buffer.put( b );
-  }
-  
-  public byte getB2() {
-    buffer.position( 2 );
-    return( buffer.get() );
-  }
-  
-  public void setB3( byte b ) {
-    buffer.position( 3 );
-    buffer.put( b );
-  }
-  
-  public byte getB3() {
-    buffer.position( 3 );
-    return( buffer.get() );
-  }
-  
-  public void setS0( short s ) {
-    buffer.position( 0 );
-    buffer.putShort( s );
-  }
-  
-  public short getS0() {
-    buffer.position( 0 );
-    return( buffer.getShort() );
-  }
-  
-  public void setS1( short s ) {
-    buffer.position( 2 );
-    buffer.putShort( s );
-  }
-  
-  public short getS1() {
-    buffer.position( 2 );
-    return( buffer.getShort() );
-  }
-  
-  public void setI( int i ) {
-    buffer.position( 0 );
-    buffer.putInt( i );
-  }
-  
-  public int getI() {
-    buffer.position( 0 );
-    return( buffer.getInt() );
-  }
-  
-  public void setF( float f ) {
-    buffer.position( 0 );
-    buffer.putFloat( f );
-  }
-  
-  public float getF() {
-    buffer.position( 0 );
-    return( buffer.getFloat() );
-  }
-  
-  public ByteBuffer getBuffer() {
-    buffer.rewind();
-    return( buffer );
-  }
-  
-  public static void main( String args[] ) {
-    Type_Widget t = new Type_Widget();
-    t.setI( 1000000 );
-    
-    System.out.println("int: " + Integer.toHexString( t.getI() ) );
-    
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Arc.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Arc.java
deleted file mode 100644
index 9ee2494..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Arc.java
+++ /dev/null
@@ -1,258 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-/**
- * Trimming arc
- * @author Tomas Hrasky
- *
- */
-public class Arc {
-  /**
-   * Corresponding picewise-linear arc
-   */
-  public PwlArc pwlArc;
-
-  /**
-   * Arc type
-   */
-  private long type;
-
-  /**
-   * Arc link in linked list
-   */
-  public Arc link;
-
-  /**
-   * Previous arc
-   */
-  Arc prev;
-
-  /**
-   * Next arc
-   */
-  Arc next;
-
-  /**
-   * Corresponding berizer type arc
-   */
-  private BezierArc bezierArc;
-
-  /**
-   * Makes new arc at specified side
-   * 
-   * @param side
-   *            which side doeas this arc form
-   */
-  public Arc(int side) {
-    bezierArc = null;
-    pwlArc = null;
-    type = 0;
-    setside(side);
-    // nuid=_nuid
-  }
-
-  /**
-   * Sets side the arc is at
-   * 
-   * @param side
-   *            arc side
-   */
-  private void setside(int side) {
-    // DONE
-    clearside();
-    type |= side << 8;
-  }
-
-  /**
-   * Unsets side
-   */
-  private void clearside() {
-    // DONE
-    type &= ~(0x7 << 8);
-  }
-
-  // this one replaces enum arc_side 
-  /**
-   * Side not specified
-   */
-  public static final int ARC_NONE = 0;
-
-  /**
-   * Arc on right
-   */
-  public static final int ARC_RIGHT = 1;
-
-  /**
-   * Arc on top
-   */
-  public static final int ARC_TOP = 2;
-
-  /**
-   * Arc on left
-   */
-  public static final int ARC_LEFT = 3;
-
-  /**
-   * Arc on bottom
-   */
-  public static final int ARC_BOTTOM = 4;
-
-  /**
-   * Bezier type flag
-   */
-  private static final long BEZIER_TAG = 1 << 13;
-
-  /**
-   * Arc type flag
-   */
-  private static final long ARC_TAG = 1 << 3;
-
-  /**
-   * Tail type tag
-   */
-  private static final long TAIL_TAG = 1 << 6;
-
-  /**
-   * Appends arc to the list
-   * 
-   * @param jarc
-   *            arc to be append
-   * @return this
-   */
-  public Arc append(Arc jarc) {
-    // DONE
-    if (jarc != null) {
-      next = jarc.next;
-      prev = jarc;
-      next.prev = this;
-      prev.next = this;
-    } else {
-      next = this;
-      prev = this;
-    }
-
-    return this;
-  }
-
-  /**
-   * Unused
-   * 
-   * @return true
-   */
-  public boolean check() {
-    return true;
-  }
-
-  /**
-   * Sets bezier type flag
-   */
-  public void setbezier() {
-    // DONE
-    type |= BEZIER_TAG;
-
-  }
-
-  /**
-   * Returns tail of linked list coords
-   * 
-   * @return tail coords
-   */
-  public float[] tail() {
-    // DONE
-    return pwlArc.pts[0].param;
-  }
-
-  /**
-   * Returns head of linked list coords
-   * 
-   * @return head coords
-   */
-  public float[] head() {
-    // DONE
-    return next.pwlArc.pts[0].param;
-  }
-
-  /**
-   * Returns whether arc is marked with arc_tag
-   * 
-   * @return is arc marked with arc_tag
-   */
-  public boolean ismarked() {
-    // DONE
-    return ((type & ARC_TAG) > 0) ? true : false;
-  }
-
-  /**
-   * Cleans arc_tag flag
-   */
-  public void clearmark() {
-    // DONE
-    type &= (~ARC_TAG);
-  }
-
-  /**
-   * Sets arc_tag flag
-   */
-  public void setmark() {
-    // DONE
-    type |= ARC_TAG;
-  }
-
-  /**
-   * sets tail tag
-   */
-  public void setitail() {
-    // DONE
-    type |= TAIL_TAG;
-  }
-
-  /**
-   * Returns whether arc is marked tail
-   * 
-   * @return is tail
-   */
-  public boolean getitail() {
-    return false;
-  }
-
-  /**
-   * Unsets tail tag
-   */
-  public void clearitail() {
-    // DONE
-    type &= (~TAIL_TAG);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcSdirSorter.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcSdirSorter.java
deleted file mode 100644
index 3955e31..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcSdirSorter.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class for sorting list of Arcs
- * @author Tomas Hrasky
- *
- */
-public class ArcSdirSorter {
-
-  /**
-   * Makes new ArcSdirSorter with Subdivider
-   * @param subdivider subdivider
-   */ 
-  public ArcSdirSorter(Subdivider subdivider) {
-    //TODO
-    //			System.out.println("TODO arcsdirsorter.constructor");
-  }
-
-  /**
-   * Sorts list of arcs
-   * @param list  arc list to be sorted
-   * @param count size of list
-   */
-  public void qsort(CArrayOfArcs list, int count) {
-    // TODO
-    //			System.out.println("TODO arcsdirsorter.qsort");
-  }
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTdirSorter.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTdirSorter.java
deleted file mode 100644
index 098ba97..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTdirSorter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class for sorting list of Arcs
- * @author Tomas Hrasky
- *
- */
-public class ArcTdirSorter {
-  /**
-   * Makes new ArcSdirSorter with Subdivider
-   * @param subdivider subdivider
-   */ 
-  public ArcTdirSorter(Subdivider subdivider) {
-    // TODO Auto-generated constructor stub
-    //			System.out.println("TODO arcTsorter.konstruktor");
-  }
-  /**
-   * Sorts list of arcs
-   * @param list  arc list to be sorted
-   * @param count size of list
-   */
-  public void qsort(CArrayOfArcs list, int count) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO arcTsorter.qsort");
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTesselator.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTesselator.java
deleted file mode 100644
index edfb890..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTesselator.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class for arc tesselation
- * @author Tomas Hrasky
- *
- */
-public class ArcTesselator {
-
-  /**
-   * Makes given arc an bezier arc
-   * @param arc arc to work with
-   * @param s1 minimum s param
-   * @param s2 maximum s param
-   * @param t1 minimum t param
-   * @param t2 maximum s param
-   */
-  public void bezier(Arc arc, float s1, float s2, float t1, float t2) {
-    // DONE
-    TrimVertex[] p = new TrimVertex[2];
-    p[0] = new TrimVertex();
-    p[1] = new TrimVertex();
-    arc.pwlArc = new PwlArc(2, p);
-    p[0].param[0] = s1;
-    p[0].param[1] = s2;
-    p[1].param[0] = t1;
-    p[1].param[1] = t2;
-    arc.setbezier();
-  }
-
-  /**
-   * Empty method
-   * @param newright arc to work with
-   * @param s first tail
-   * @param t2 second tail
-   * @param t1 third tail
-   * @param f stepsize
-   */
-  public void pwl_right(Arc newright, float s, float t1, float t2, float f) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO arctesselator.pwl_right");
-  }
-
-  /**
-   * Empty method
-   * @param newright arc to work with
-   * @param s first tail
-   * @param t2 second tail
-   * @param t1 third tail
-   * @param f stepsize
-   */
-  public void pwl_left(Arc newright, float s, float t2, float t1, float f) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO arctesselator.pwl_left");
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Backend.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Backend.java
deleted file mode 100644
index 3909772..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Backend.java
+++ /dev/null
@@ -1,217 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class responsible for rendering
- * @author Tomas Hrasky
- *
- */
-public abstract class Backend {
-
-  /**
-   * Fill surface
-   */
-  public static final int N_MESHFILL = 0;
-
-  /**
-   * Draw surface as wire model
-   */
-  public static final int N_MESHLINE = 1;
-
-  /**
-   * Draw surface with points
-   */
-  public static final int N_MESHPOINT = 2;
-
-  /**
-   * Object rendering curves
-   */
-  protected CurveEvaluator curveEvaluator;
-
-  /**
-   * Object rendering surfaces
-   */
-  protected SurfaceEvaluator surfaceEvaluator;
-
-  /**
-   * Makes new backend 
-   */
-  public Backend() {
-    // curveEvaluator = new OpenGLCurveEvaluator();
-    // surfaceEvaluator = new OpenGLSurfaceEvaluator();
-  }
-
-  /**
-   * Begin a curve
-   */
-  public void bgncurv() {
-    // DONE
-    curveEvaluator.bgnmap1f();
-
-  }
-
-  /**
-   * End a curve
-   */
-  public void endcurv() {
-    // DONE
-    curveEvaluator.endmap1f();
-
-  }
-
-  /**
-   * Make cuve with given parameters
-   * @param type curve type
-   * @param ps control points
-   * @param stride control points coordinates number
-   * @param order order of curve
-   * @param ulo smallest u
-   * @param uhi highest u
-   */
-  public void curvpts(int type, CArrayOfFloats ps, int stride, int order,
-                      float ulo, float uhi) {
-    // DONE
-    curveEvaluator.map1f(type, ulo, uhi, stride, order, ps);
-    curveEvaluator.enable(type);
-  }
-
-  /**
-   * Draw curve
-   * @param u1 smallest u
-   * @param u2 highest u
-   * @param nu number of pieces
-   */
-  public void curvgrid(float u1, float u2, int nu) {
-    // DONE
-    curveEvaluator.mapgrid1f(nu, u1, u2);
-
-  }
-
-  /**
-   * Evaluates curve mesh
-   * @param from low param
-   * @param n step
-   */
-  public void curvmesh(int from, int n) {
-    // DONE
-    curveEvaluator.mapmesh1f(N_MESHFILL, from, from + n);
-  }
-
-  /**
-   * Begin surface
-   * @param wiretris use triangles
-   * @param wirequads use quads
-   */
-  public void bgnsurf(int wiretris, int wirequads) {
-    // DONE
-    surfaceEvaluator.bgnmap2f();
-
-    if (wiretris > 0)
-      surfaceEvaluator.polymode(NurbsConsts.N_MESHLINE);
-    else
-      surfaceEvaluator.polymode(NurbsConsts.N_MESHFILL);
-  }
-
-  /**
-   * End surface
-   */
-  public void endsurf() {
-    // DONE
-    surfaceEvaluator.endmap2f();
-  }
-
-  /**
-   * Empty method
-   * @param ulo low u param
-   * @param uhi hig u param
-   * @param vlo low v param
-   * @param vhi high v param
-   */
-  public void patch(float ulo, float uhi, float vlo, float vhi) {
-    // DONE
-    surfaceEvaluator.domain2f(ulo, uhi, vlo, vhi);
-  }
-
-  /**
-   * Draw surface
-   * @param u0 lowest u
-   * @param u1 highest u
-   * @param nu number of pieces in u direction
-   * @param v0 lowest v
-   * @param v1 highest v
-   * @param nv number of pieces in v direction
-   */
-  public void surfgrid(float u0, float u1, int nu, float v0, float v1, int nv) {
-    // DONE
-    surfaceEvaluator.mapgrid2f(nu, u0, u1, nv, v0, v1);
-
-  }
-
-  /**
-   * Evaluates surface mesh
-   * @param u u param
-   * @param v v param
-   * @param n step in u direction
-   * @param m step in v direction
-   */
-  public void surfmesh(int u, int v, int n, int m) {
-    //			System.out.println("TODO backend.surfmesh wireframequads");
-    // TODO wireframequads
-    surfaceEvaluator.mapmesh2f(NurbsConsts.N_MESHFILL, u, u + n, v, v + m);
-  }
-
-  /**
-   * Make surface
-   * @param type surface type
-   * @param pts control points
-   * @param ustride control points coordinates in u direction
-   * @param vstride control points coordinates in v direction
-   * @param uorder surface order in u direction
-   * @param vorder surface order in v direction
-   * @param ulo lowest u
-   * @param uhi hightest u
-   * @param vlo lowest v
-   * @param vhi hightest v
-   */
-  public void surfpts(int type, CArrayOfFloats pts, int ustride, int vstride,
-                      int uorder, int vorder, float ulo, float uhi, float vlo, float vhi) {
-    // DONE
-    surfaceEvaluator.map2f(type, ulo, uhi, ustride, uorder, vlo, vhi,
-                           vstride, vorder, pts);
-    surfaceEvaluator.enable(type);
-
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/BezierArc.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/BezierArc.java
deleted file mode 100644
index d9b390b..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/BezierArc.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Empty class
- * @author Tomas Hrasky
- *
- */
-public class BezierArc {
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Bin.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Bin.java
deleted file mode 100644
index 61316f3..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Bin.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class holding trimming arcs
- * @author Tomas Hrasky
- *
- */
-public class Bin {
-
-  /**
-   * Head of linked list of arcs
-   */
-  private Arc head;
-
-  /**
-   * Current arc
-   */
-  private Arc current;
-
-  /**
-   * Indicates whether there are any Arcs in linked list
-   * @return true if there are any Arcs in linked list
-   */
-  public boolean isnonempty() {
-    // DONE
-    return this.head != null ? true : false;
-  }
-
-  /**
-   * Adds and arc to linked list
-   * @param jarc added arc
-   */
-  public void addarc(Arc jarc) {
-    // DONE
-    // if (head == null)
-    // head = jarc;
-    // else {
-    jarc.link = head;
-    head = jarc;
-    // }
-
-  }
-
-  /**
-   * Returns number of arcs in linked list
-   * @return number of arcs
-   */
-  public int numarcs() {
-    // DONE
-    int count = 0;
-    for (Arc jarc = firstarc(); jarc != null; jarc = nextarc())
-      count++;
-    return count;
-  }
-
-  /**
-   * Removes first arc in list
-   * @return new linked list head
-   */
-  public Arc removearc() {
-    // DONE
-    Arc jarc = head;
-    if (jarc != null)
-      head = jarc.link;
-    return jarc;
-
-  }
-
-  /**
-   * Consolidates linked list
-   */
-  public void adopt() {
-    // DONE
-    markall();
-
-    Arc orphan;
-    while ((orphan = removearc()) != null) {
-      for (Arc parent = orphan.next; !parent.equals(orphan); parent = parent.next) {
-        if (!parent.ismarked()) {
-          orphan.link = parent.link;
-          parent.link = orphan;
-          orphan.clearmark();
-          break;
-        }
-      }
-    }
-
-  }
-
-  /**
-   * Marks all arc in linked list
-   */
-  private void markall() {
-    // DONE
-    for (Arc jarc = firstarc(); jarc != null; jarc = nextarc())
-      jarc.setmark();
-  }
-
-  /**
-   * Returns first arc in linked list
-   * @return first arc in linked list
-   */
-  private Arc firstarc() {
-    // DONE
-    current = head;
-    return nextarc();
-  }
-
-  /**
-   * Returns next arc in linked list
-   * @return next arc
-   * 
-   */
-  private Arc nextarc() {
-    // DONE
-    Arc jarc = current;
-    if (jarc != null)
-      current = jarc.link;
-    return jarc;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Breakpt.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Breakpt.java
deleted file mode 100644
index b5b88ad..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Breakpt.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class holding break point parameters
- * 
- * @author Tomas Hrasky
- * 
- */
-public class Breakpt {
-
-  /**
-   * Breakpoint multiplicity
-   */
-  public int multi;
-
-  /**
-   * Breakpint value
-   */
-  public float value;
-
-  /**
-   * Breakpoint deficit (how many times it has to be added)
-   */
-  public int def;
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfArcs.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfArcs.java
deleted file mode 100644
index 0646e1d..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfArcs.java
+++ /dev/null
@@ -1,194 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/**
- * Class replacing C language pointer
- * 
- * @author Tomas Hrasky
- * 
- */
-public class CArrayOfArcs {
-  /**
-   * Underlaying array
-   */
-  private Arc[] array;
-
-  /**
-   * Pointer to array member
-   */
-  private int pointer;
-
-  /**
-   * Don't check for array borders?
-   */
-  private boolean noCheck = true;
-
-  /**
-   * Makes new CArray
-   * 
-   * @param array
-   *            underlaying array
-   * @param pointer
-   *            pointer (index) to array
-   */
-  public CArrayOfArcs(Arc[] array, int pointer) {
-    this.array = array;
-    // this.pointer=pointer;
-    setPointer(pointer);
-  }
-
-  /**
-   * Makes new CArray from other CArray
-   * 
-   * @param carray
-   *            reference array
-   */
-  public CArrayOfArcs(CArrayOfArcs carray) {
-    this.array = carray.array;
-    // this.pointer=carray.pointer;
-    setPointer(carray.pointer);
-  }
-
-  /**
-   * Makes new CArray with pointer set to 0
-   * 
-   * @param ctlarray
-   *            underlaying array
-   */
-  public CArrayOfArcs(Arc[] ctlarray) {
-    this.array = ctlarray;
-    this.pointer = 0;
-  }
-
-  /**
-   * Returns element at pointer
-   * 
-   * @return element at pointer
-   */
-  public Arc get() {
-    return array[pointer];
-  }
-
-  /**
-   * Increases pointer by one (++)
-   */
-  public void pp() {
-    // pointer++;
-    setPointer(pointer + 1);
-  }
-
-  /**
-   * Sets element at pointer
-   * 
-   * @param f
-   *            desired value
-   */
-  public void set(Arc f) {
-    array[pointer] = f;
-
-  }
-
-  /**
-   * Returns array element at specified index
-   * 
-   * @param i
-   *            array index
-   * @return element at index
-   */
-  public Arc get(int i) {
-    return array[i];
-  }
-
-  /**
-   * Returns array element at specified index relatively to pointer
-   * 
-   * @param i
-   *            relative index
-   * @return element at relative index
-   */
-  public Arc getRelative(int i) {
-    return array[pointer + i];
-  }
-
-  /**
-   * Sets value of element at specified index relatively to pointer
-   * 
-   * @param i
-   *            relative index
-   * @param value
-   *            value to be set
-   */
-  public void setRelative(int i, Arc value) {
-    array[pointer + i] = value;
-  }
-
-  /**
-   * Lessens pointer by value
-   * 
-   * @param i
-   *            lessen by
-   */
-  public void lessenPointerBy(int i) {
-    // pointer-=i;
-    setPointer(pointer - i);
-  }
-
-  /**
-   * Returns pointer value
-   * 
-   * @return pointer value
-   */
-  public int getPointer() {
-    return pointer;
-  }
-
-  /**
-   * Sets ponter value
-   * 
-   * @param pointer
-   *            pointer value to be set
-   */
-  public void setPointer(int pointer) {
-    if (!noCheck && pointer > array.length)
-      throw new IllegalArgumentException("Pointer " + pointer
-                                         + " out of bounds " + array.length);
-    this.pointer = pointer;
-  }
-
-  /**
-   * Raises pointer by value
-   * 
-   * @param i
-   *            raise by
-   */
-  public void raisePointerBy(int i) {
-    // pointer+=i;
-    setPointer(pointer + i);
-  }
-
-  /**
-   * Lessens ponter by one (--)
-   */
-  public void mm() {
-    // pointer--;
-    setPointer(pointer - 1);
-  }
-
-  /**
-   * Returns underlaying array
-   * 
-   * @return underlaying array
-   */
-  public Arc[] getArray() {
-    return array;
-  }
-
-  /**
-   * Sets underlaying array
-   * 
-   * @param array
-   *            underlaying array
-   */
-  public void setArray(Arc[] array) {
-    this.array = array;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfBreakpts.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfBreakpts.java
deleted file mode 100644
index e47fdf9..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfBreakpts.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/**
- * Class replacing C language pointer
- * 
- * @author Tomas Hrasky
- * 
- */
-public class CArrayOfBreakpts {
-  /**
-   * Underlaying array
-   */
-  private Breakpt[] pole;
-
-  /**
-   * Pointer to array member
-   */
-  private int pointer;
-
-  /**
-   * Makes new CArray
-   * 
-   * @param array
-   *            underlaying array
-   * @param pointer
-   *            pointer (index) to array
-   */
-  public CArrayOfBreakpts(Breakpt[] array, int pointer) {
-    this.pole = array;
-    this.pointer = pointer;
-  }
-
-  /**
-   * Makes new CArray from other CArray
-   * 
-   * @param carray
-   *            reference array
-   */
-  public CArrayOfBreakpts(CArrayOfBreakpts carray) {
-    this.pole = carray.pole;
-    this.pointer = carray.pointer;
-  }
-
-  /**
-   * Returns element at pointer
-   * 
-   * @return element at pointer
-   */
-  public Breakpt get() {
-    return pole[pointer];
-  }
-
-  /**
-   * Increases pointer by one (++)
-   */
-  public void pp() {
-    pointer++;
-  }
-
-  /**
-   * Sets element at pointer
-   * 
-   * @param f
-   *            desired value
-   */
-  public void set(Breakpt f) {
-    pole[pointer] = f;
-
-  }
-
-  /**
-   * Returns array element at specified index
-   * 
-   * @param i
-   *            array index
-   * @return element at index
-   */
-  public Breakpt get(int i) {
-    return pole[i];
-  }
-
-  /**
-   * Lessens pointer by value
-   * 
-   * @param i
-   *            lessen by
-   */
-  public void lessenPointerBy(int i) {
-    pointer -= i;
-
-  }
-
-  /**
-   * Returns pointer value
-   * 
-   * @return pointer value
-   */
-  public int getPointer() {
-    return pointer;
-  }
-
-  /**
-   * Sets ponter value
-   * 
-   * @param pointer
-   *            pointer value to be set
-   */
-  public void setPointer(int pointer) {
-    this.pointer = pointer;
-  }
-
-  /**
-   * Raises pointer by value
-   * 
-   * @param i
-   *            raise by
-   */
-  public void raisePointerBy(int i) {
-    pointer += i;
-
-  }
-
-  /**
-   * Lessens ponter by one (--)
-   */
-  public void mm() {
-    pointer--;
-
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfFloats.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfFloats.java
deleted file mode 100644
index 60cef99..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfFloats.java
+++ /dev/null
@@ -1,195 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/**
- * Class replacing C language pointer
- * 
- * @author Tomas Hrasky
- * 
- */
-public class CArrayOfFloats {
-
-  /**
-   * Underlaying array
-   */
-  private float[] array;
-
-  /**
-   * Pointer to array member
-   */
-  private int pointer;
-
-  /**
-   * Don't check for array borders?
-   */
-  private boolean noCheck = true;
-
-  /**
-   * Makes new CArray
-   * 
-   * @param array
-   *            underlaying array
-   * @param pointer
-   *            pointer (index) to array
-   */
-  public CArrayOfFloats(float[] array, int pointer) {
-    this.array = array;
-    // this.pointer=pointer;
-    setPointer(pointer);
-  }
-
-  /**
-   * Makes new CArray from other CArray
-   * 
-   * @param carray
-   *            reference array
-   */
-  public CArrayOfFloats(CArrayOfFloats carray) {
-    this.array = carray.array;
-    // this.pointer=carray.pointer;
-    setPointer(carray.pointer);
-  }
-
-  /**
-   * Makes new CArray with pointer set to 0
-   * 
-   * @param ctlarray
-   *            underlaying array
-   */
-  public CArrayOfFloats(float[] ctlarray) {
-    this.array = ctlarray;
-    this.pointer = 0;
-  }
-
-  /**
-   * Returns element at pointer
-   * 
-   * @return element at pointer
-   */
-  public float get() {
-    return array[pointer];
-  }
-
-  /**
-   * Increases pointer by one (++)
-   */
-  public void pp() {
-    // pointer++;
-    setPointer(pointer + 1);
-  }
-
-  /**
-   * Sets element at pointer
-   * 
-   * @param f
-   *            desired value
-   */
-  public void set(float f) {
-    array[pointer] = f;
-
-  }
-
-  /**
-   * Returns array element at specified index
-   * 
-   * @param i
-   *            array index
-   * @return element at index
-   */
-  public float get(int i) {
-    return array[i];
-  }
-
-  /**
-   * Returns array element at specified index relatively to pointer
-   * 
-   * @param i
-   *            relative index
-   * @return element at relative index
-   */
-  public float getRelative(int i) {
-    return array[pointer + i];
-  }
-
-  /**
-   * Sets value of element at specified index relatively to pointer
-   * 
-   * @param i
-   *            relative index
-   * @param value
-   *            value to be set
-   */
-  public void setRelative(int i, float value) {
-    array[pointer + i] = value;
-  }
-
-  /**
-   * Lessens pointer by value
-   * 
-   * @param i
-   *            lessen by
-   */
-  public void lessenPointerBy(int i) {
-    // pointer-=i;
-    setPointer(pointer - i);
-  }
-
-  /**
-   * Returns pointer value
-   * 
-   * @return pointer value
-   */
-  public int getPointer() {
-    return pointer;
-  }
-
-  /**
-   * Sets ponter value
-   * 
-   * @param pointer
-   *            pointer value to be set
-   */
-  public void setPointer(int pointer) {
-    if (!noCheck && pointer > array.length)
-      throw new IllegalArgumentException("Pointer " + pointer
-                                         + " out of bounds " + array.length);
-    this.pointer = pointer;
-  }
-
-  /**
-   * Raises pointer by value
-   * 
-   * @param i
-   *            raise by
-   */
-  public void raisePointerBy(int i) {
-    // pointer+=i;
-    setPointer(pointer + i);
-  }
-
-  /**
-   * Lessens ponter by one (--)
-   */
-  public void mm() {
-    // pointer--;
-    setPointer(pointer - 1);
-  }
-
-  /**
-   * Returns underlaying array
-   * 
-   * @return underlaying array
-   */
-  public float[] getArray() {
-    return array;
-  }
-
-  /**
-   * Sets underlaying array
-   * 
-   * @param array
-   *            underlaying array
-   */
-  public void setArray(float[] array) {
-    this.array = array;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java
deleted file mode 100644
index ef16a82..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/**
- * Class replacing C language pointer
- * 
- * @author Tomas Hrasky
- * 
- */
-public class CArrayOfQuiltspecs {
-  /**
-   * Underlaying array
-   */
-  private Quiltspec[] array;
-
-  /**
-   * Pointer to array member
-   */
-  private int pointer;
-
-  /**
-   * Makes new CArray
-   * 
-   * @param array
-   *            underlaying array
-   * @param pointer
-   *            pointer (index) to array
-   */
-  public CArrayOfQuiltspecs(Quiltspec[] array, int pointer) {
-    this.array = array;
-    this.pointer = pointer;
-  }
-
-  /**
-   * Makes new CArray from other CArray
-   * 
-   * @param carray
-   *            reference array
-   */
-  public CArrayOfQuiltspecs(CArrayOfQuiltspecs carray) {
-    this.array = carray.array;
-    this.pointer = carray.pointer;
-  }
-
-  /**
-   * Makes new CArray with pointer set to 0
-   * 
-   * @param array
-   *            underlaying array
-   */
-  public CArrayOfQuiltspecs(Quiltspec[] array) {
-    this.array = array;
-    this.pointer = 0;
-  }
-
-  /**
-   * Returns element at pointer
-   * 
-   * @return element at pointer
-   */
-  public Quiltspec get() {
-    return array[pointer];
-  }
-
-  /**
-   * Increases pointer by one (++)
-   */
-  public void pp() {
-    pointer++;
-  }
-
-  /**
-   * Sets element at pointer
-   * 
-   * @param f
-   *            desired value
-   */
-  public void set(Quiltspec f) {
-    array[pointer] = f;
-
-  }
-
-  /**
-   * Returns array element at specified index
-   * 
-   * @param i
-   *            array index
-   * @return element at index
-   */
-  public Quiltspec get(int i) {
-    return array[i];
-  }
-
-  /**
-   * Lessens pointer by value
-   * 
-   * @param i
-   *            lessen by
-   */
-  public void lessenPointerBy(int i) {
-    pointer -= i;
-
-  }
-
-  /**
-   * Returns pointer value
-   * 
-   * @return pointer value
-   */
-  public int getPointer() {
-    return pointer;
-  }
-
-  /**
-   * Sets ponter value
-   * 
-   * @param pointer
-   *            pointer value to be set
-   */
-  public void setPointer(int pointer) {
-    this.pointer = pointer;
-  }
-
-  /**
-   * Raises pointer by value
-   * 
-   * @param i
-   *            raise by
-   */
-  public void raisePointerBy(int i) {
-    pointer += i;
-
-  }
-
-  /**
-   * Lessens ponter by one (--)
-   */
-  public void mm() {
-    pointer--;
-
-  }
-
-  /**
-   * Returns underlaying array
-   * 
-   * @return underlaying array
-   */
-  public Quiltspec[] getArray() {
-    return array;
-  }
-
-  /**
-   * Sets underlaying array
-   * 
-   * @param array
-   *            underlaying array
-   */
-  public void setArray(Quiltspec[] array) {
-    this.array = array;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curve.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curve.java
deleted file mode 100644
index fb1a5ac..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curve.java
+++ /dev/null
@@ -1,238 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class holding curve definition
- * @author Tomáš Hráský
- *
- */
-public class Curve {
-
-  /**
-   * Maximum coordinates per control point
-   */
-  private static final int MAXCOORDS = 5;
-
-  /**
-   * Max curve order
-   */
-  private static final int MAXORDER = 24;
-
-  /**
-   * Next curve in linked list
-   */
-  public Curve next;
-
-  /**
-   * OpenGL maps
-   */
-  private Mapdesc mapdesc;
-
-  /**
-   * Does the curve need sampling
-   */
-  private boolean needsSampling;
-
-  /**
-   * Culling
-   */
-  private int cullval;
-
-  /**
-   * Number of coords
-   */
-  private int stride;
-
-  /**
-   * Curve order
-   */
-  private int order;
-
-  /**
-   * Holds conversion range borders
-   */
-  private float[] range;
-
-  /**
-   * Subdivision stepsize
-   */
-  public float stepsize;
-
-  /**
-   * Minimal subdivision stepsize
-   */
-  private float minstepsize;
-
-  /**
-   * Sampling points
-   */
-  float[] spts;
-
-  /**
-   * Makes new Curve
-   * 
-   * @param geo
-   * @param pta
-   * @param ptb
-   * @param c
-   *            next curve in linked list
-   */
-  public Curve(Quilt geo, float[] pta, float[] ptb, Curve c) {
-
-    spts = new float[MAXORDER * MAXCOORDS];
-
-    mapdesc = geo.mapdesc;
-
-    next = c;
-    needsSampling = mapdesc.isRangeSampling() ? true : false;
-
-    cullval = mapdesc.isCulling() ? Subdivider.CULL_ACCEPT
-      : Subdivider.CULL_TRIVIAL_REJECT;
-    order = geo.qspec.get(0).order;
-    stride = MAXCOORDS;
-
-    // CArrayOfFloats ps = geo.cpts;
-    CArrayOfFloats ps = new CArrayOfFloats(geo.cpts.getArray(), 0);
-    CArrayOfQuiltspecs qs = geo.qspec;
-    ps.raisePointerBy(qs.get().offset);
-    ps.raisePointerBy(qs.get().index * qs.get().order * qs.get().stride);
-
-    if (needsSampling) {
-      mapdesc.xformSampling(ps, qs.get().order, qs.get().stride, spts,
-                            stride);
-    }
-    if (cullval == Subdivider.CULL_ACCEPT) {
-      //				System.out.println("TODO curve.Curve-cullval");
-      // mapdesc.xformCulling(ps,qs.get().order,qs.get().stride,cpts,stride);
-    }
-
-    range = new float[3];
-    range[0] = qs.get().breakpoints[qs.get().index];
-    range[1] = qs.get().breakpoints[qs.get().index + 1];
-    range[2] = range[1] - range[0];
-    // TODO it is necessary to solve problem with "this" pointer here 
-    if (range[0] != pta[0]) {
-      //				System.out.println("TODO curve.Curve-range0");
-      // Curve lower=new Curve(this,pta,0);
-      // lower.next=next;
-      // this=lower;
-    }
-    if (range[1] != ptb[0]) {
-      //				System.out.println("TODO curve.Curve-range1");
-      // Curve lower=new Curve(this,ptb,0);
-    }
-  }
-
-  /**
-   * Checks culling type
-   * @return Subdivider.CULL_ACCEPT
-   */
-  public int cullCheck() {
-    if (cullval == Subdivider.CULL_ACCEPT) {
-      //				System.out.println("TODO curve.cullval");
-      // cullval=mapdesc.cullCheck(cpts,order,stride);
-    }
-    // TODO compute cullval and return the computed value
-    // return cullval;
-    return Subdivider.CULL_ACCEPT;
-  }
-
-  /**
-   * Computes subdivision step size
-   */
-  public void getStepSize() {
-    minstepsize = 0;
-    if (mapdesc.isConstantSampling()) {
-      setstepsize(mapdesc.maxrate);
-    } else if (mapdesc.isDomainSampling()) {
-      setstepsize(mapdesc.maxrate * range[2]);
-    } else {
-      assert (order <= MAXORDER);
-
-      float tmp[][] = new float[MAXORDER][MAXCOORDS];
-
-      int tstride = (MAXORDER);
-
-      int val = 0;
-      // mapdesc.project(spts,stride,tmp,tstride,order);
-
-      //				System.out.println("TODO curve.getsptepsize mapdesc.project");
-
-      if (val == 0) {
-        setstepsize(mapdesc.maxrate);
-      } else {
-        float t = mapdesc.getProperty(NurbsConsts.N_PIXEL_TOLERANCE);
-        if (mapdesc.isParametricDistanceSampling()) {
-          //						System.out.println("TODO curve.getstepsize - parametric");
-        } else if (mapdesc.isPathLengthSampling()) {
-          //						System.out.println("TODO curve.getstepsize - pathlength");
-        } else {
-          setstepsize(mapdesc.maxrate);
-        }
-      }
-
-    }
-
-  }
-
-  /**
-   * Sets maximum subdivision step size
-   * @param max maximum subdivision step size
-   */
-  private void setstepsize(float max) {
-    // DONE
-    stepsize = (max >= 1) ? (range[2] / max) : range[2];
-    minstepsize = stepsize;
-  }
-
-  /**
-   * Clamps the curve
-   */
-  public void clamp() {
-    // DONE
-    if (stepsize < minstepsize)
-      stepsize = mapdesc.clampfactor * minstepsize;
-  }
-
-  /**
-   * Tells whether curve needs subdivision
-   * 
-   * @return curve needs subdivison
-   */
-  public boolean needsSamplingSubdivision() {
-    return (stepsize < minstepsize);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CurveEvaluator.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CurveEvaluator.java
deleted file mode 100644
index c27ffd4..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CurveEvaluator.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class rendering curves with OpenGL
- * @author Tomáš Hráský
- *
- */
-public interface CurveEvaluator {
-  /**
-   * Pushes eval bit
-   */
-  public void bgnmap1f();
-
-  /**
-   * Pops all OpenGL attributes
-   */
-  public void endmap1f() ;
-
-  /**
-   * Initializes opengl evaluator
-   * @param type curve type
-   * @param ulo lowest u
-   * @param uhi highest u
-   * @param stride control point coords
-   * @param order curve order
-   * @param ps control points
-   */
-  public void map1f(int type, float ulo, float uhi, int stride, int order,
-                    CArrayOfFloats ps) ;
-
-  /**
-   * Calls opengl enable
-   * @param type what to enable
-   */
-  public void enable(int type) ;
-
-  /**
-   * Calls glMapGrid1f
-   * @param nu steps
-   * @param u1 low u
-   * @param u2 high u
-   */
-  public void mapgrid1f(int nu, float u1, float u2) ;
-
-  /**
-   * Evaluates a curve using glEvalMesh1f
-   * @param style Backend.N_MESHFILL/N_MESHLINE/N_MESHPOINT
-   * @param from lowest param
-   * @param to highest param
-   */
-  public void mapmesh1f(int style, int from, int to) ;
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curvelist.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curvelist.java
deleted file mode 100644
index fc30188..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curvelist.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class for woking with linked list of curves
- * @author Tomas Hrasky
- *
- */
-public class Curvelist {
-
-  /**
-   * Head of linked list
-   */
-  private Curve curve;
-
-  /**
-   * Holds conversion range borders
-   */
-  float[] range;
-
-  /**
-   * Subdivision step size
-   */
-  public float stepsize;
-
-  /**
-   * Do curves need subdivision?
-   */
-  private boolean needsSubdivision;
-
-  /**
-   * Makes new instance on top of specified lis of Quilts
-   * @param qlist underlaying list of quilts
-   * @param pta range start
-   * @param ptb range end
-   */
-  public Curvelist(Quilt qlist, float[] pta, float[] ptb) {
-    // DONE
-    curve = null;
-    range = new float[3];
-
-    for (Quilt q = qlist; q != null; q = q.next) {
-      curve = new Curve(q, pta, ptb, curve);
-    }
-    range[0] = pta[0];
-    range[1] = ptb[0];
-    range[2] = range[1] - range[0];
-  }
-
-  /**
-   * Compute step size
-   */
-  public void getstepsize() {
-    // DONE
-    stepsize = range[2];
-    Curve c;
-    for (c = curve; c != null; c = c.next) {
-      c.getStepSize();
-      c.clamp();
-      stepsize = (c.stepsize < stepsize) ? c.stepsize : stepsize;
-      if (c.needsSamplingSubdivision())
-        break;
-    }
-    needsSubdivision = (c != null) ? true : false;
-
-  }
-
-  /**
-   * Indicates whether curves need subdivision
-   * @return curves need subdivision
-   */
-  public boolean needsSamplingSubdivision() {
-    // DONE
-    return needsSubdivision;
-  }
-
-  /**
-   * Checks for culling
-   * @return Subdivider.CULL_TRIVIAL_REJECT or Subdivider.CULL_ACCEPT
-   */
-  public int cullCheck() {
-    // DONE
-    for (Curve c = curve; c != null; c = c.next)
-      if (c.cullCheck() == Subdivider.CULL_TRIVIAL_REJECT)
-        return Subdivider.CULL_TRIVIAL_REJECT;
-    return Subdivider.CULL_ACCEPT;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/DisplayList.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/DisplayList.java
deleted file mode 100644
index 39a3a28..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/DisplayList.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-import java.lang.reflect.Method;
-
-/**
- * Display list
- * @author Tomas Hrasky
- *
- */
-public class DisplayList {
-
-  /**
-   * Append action to the display list
-   * @param src source object to invoke method on
-   * @param m invoked method
-   * @param arg method argument
-   */
-  public void append(Object src, Method m, Object arg) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO displaylist append");
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Flist.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Flist.java
deleted file mode 100644
index 00757ed..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Flist.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-import java.util.Arrays;
-
-/**
- * List of breakpoints
- * @author Tomas Hrasky
- *
- */
-public class Flist {
-
-  /**
-   * Data elements end index
-   * 
-   */
-  public int end;
-
-  /**
-   *Data elements start index 
-   */
-  public int start;
-
-  /**
-   * Breakpoint values
-   */
-  public float[] pts;
-
-  /**
-   * Number of array fields
-   */
-  private int npts;
-
-  /**
-   * Grows list
-   * @param maxpts maximum desired size
-   */
-  public void grow(int maxpts) {
-    // DONE
-    if (npts < maxpts) {
-      // npts=2*maxpts;
-      npts = maxpts;
-      pts = new float[npts];
-    }
-    start = 0;
-    end = 0;
-  }
-
-  /**
-   * Removes duplicate array elemnts 
-   */
-  public void filter() {
-    // INFO the aim of this method is to remove duplicates from array
-
-    Arrays.sort(pts);
-
-    start = 0;
-
-    int j = 0;
-
-    for (int i = 1; i < end; i++) {
-      if (pts[i] == pts[i - j - 1])
-        j++;
-      pts[i - j] = pts[i];
-    }
-
-    end -= j;
-
-  }
-
-  /**
-   * Sets start and and to real start and end of array elements
-   * @param from start from
-   * @param to end at
-   */
-  public void taper(float from, float to) {
-    // DONE
-
-    while (pts[start] != from) {
-      start++;
-    }
-
-    while (pts[end - 1] != to) {
-      end--;
-    }
-
-  }
-
-  /**
-   * Adds breakpoint value
-   * @param f value
-   */
-  public void add(float f) {
-    //DONE
-    pts[end++] = f;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotspec.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotspec.java
deleted file mode 100644
index 9251aa2..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotspec.java
+++ /dev/null
@@ -1,557 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Knot vector specification
- * 
- * @author Tomas Hrasky
- * 
- */
-public class Knotspec {
-
-  /**
-   * Begin of input knots
-   */
-  public CArrayOfFloats inkbegin;
-
-  /**
-   * End of input knots
-   */
-  public CArrayOfFloats inkend;
-
-  /**
-   * Stride before knot operations
-   */
-  public int prestride;
-
-  /**
-   * Curve order
-   */
-  public int order;
-
-  /**
-   * Next knot specification in linked list (used in surfaces)
-   */
-  public Knotspec next;
-
-  /**
-   * Last knot
-   */
-  public CArrayOfFloats klast;
-
-  /**
-   * First knot
-   */
-  CArrayOfFloats kfirst;
-
-  /**
-   * Beginning of breakpoints
-   */
-  CArrayOfBreakpts bbegin;
-
-  /**
-   * End of breakpoints
-   */
-  CArrayOfBreakpts bend;
-
-  /**
-   * Considered left end knot
-   */
-  CArrayOfFloats kleft;
-
-  /**
-   * Considered right end knot
-   */
-  CArrayOfFloats kright;
-
-  /**
-   * Offset before knot operations
-   */
-  int preoffset;
-
-  /**
-   * Control points array Length after knot operations
-   */
-  int postwidth;
-
-  /**
-   * Beginning of coeficients array
-   */
-  private CArrayOfFloats sbegin;
-
-  /**
-   * Beginning of output knots
-   */
-  private CArrayOfFloats outkbegin;
-
-  /**
-   * End of output knots
-   */
-  private CArrayOfFloats outkend;
-
-  /**
-   * Control points aray length before knot operations
-   */
-  int prewidth;
-
-  /**
-   * Offset after knot operations
-   */
-  int postoffset;
-
-  /**
-   * Number of control points' coordinates after knot operations
-   */
-  public int poststride;
-
-  /**
-   * Number of control points' coordinates
-   */
-  public int ncoords;
-
-  /**
-   * Tell whether knotspec has already benn transformed
-   */
-  public boolean istransformed;
-
-  /**
-   * Knotspec to be transformed
-   */
-  public Knotspec kspectotrans;
-
-  /**
-   * Finds knot border of knot insertion and required multiplicities
-   */
-  public void preselect() {
-    // DONE
-    float kval;
-
-    klast = new CArrayOfFloats(inkend);
-    klast.lessenPointerBy(order);
-    for (kval = klast.get(); klast.getPointer() != inkend.getPointer(); klast
-           .pp()) {
-      if (!Knotvector.identical(klast.get(), kval))
-        break;
-    }
-
-    kfirst = new CArrayOfFloats(inkbegin);
-    kfirst.raisePointerBy(order - 1);
-    for (kval = kfirst.get(); kfirst.getPointer() != inkend.getPointer(); kfirst
-           .pp()) {
-      if (!Knotvector.identical(kfirst.get(), kval))
-        break;
-    }
-
-    CArrayOfFloats k = new CArrayOfFloats(kfirst);
-    k.mm();
-
-    for (; k.getPointer() >= inkbegin.getPointer(); k.mm())
-      if (!Knotvector.identical(kval, k.get()))
-        break;
-    k.pp();
-
-    Breakpt[] bbeginArray = new Breakpt[(klast.getPointer() - kfirst
-                                         .getPointer()) + 1];
-    for (int i = 0; i < bbeginArray.length; i++)
-      bbeginArray[i] = new Breakpt();
-    bbegin = new CArrayOfBreakpts(bbeginArray, 0);
-    bbegin.get().multi = kfirst.getPointer() - k.getPointer();
-    bbegin.get().value = kval;
-
-    bend = new CArrayOfBreakpts(bbegin);
-    kleft = new CArrayOfFloats(kfirst);
-    kright = new CArrayOfFloats(kfirst);
-
-  }
-
-  /**
-   * Perpares knotspec for transformation
-   */
-  public void select() {
-    // DONE
-    breakpoints();
-    knots();
-    factors();
-
-    preoffset = kleft.getPointer() - (inkbegin.getPointer() + order);
-    postwidth = ((bend.getPointer() - bbegin.getPointer()) * order);
-    prewidth = (outkend.getPointer() - outkbegin.getPointer()) - order;
-    postoffset = (bbegin.get().def > 1) ? (bbegin.get().def - 1) : 0;
-
-  }
-
-  /**
-   * Computes alpha factors for computing new control points
-   */
-  private void factors() {
-    // DONE
-    CArrayOfFloats mid = new CArrayOfFloats(outkend.getArray(), (outkend
-                                                                 .getPointer() - 1)
-                                            - order + bend.get().multi);
-
-    CArrayOfFloats fptr = null;
-    if (sbegin != null)
-      fptr = new CArrayOfFloats(sbegin);
-
-    for (CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend); bpt
-           .getPointer() >= bbegin.getPointer(); bpt.mm()) {
-      mid.lessenPointerBy(bpt.get().multi);
-      int def = bpt.get().def - 1;
-      if (def < 0)
-        continue;
-      float kv = bpt.get().value;
-
-      CArrayOfFloats kf = new CArrayOfFloats(mid.getArray(), (mid
-                                                              .getPointer() - def)
-                                             + (order - 1));
-      for (CArrayOfFloats kl = new CArrayOfFloats(kf.getArray(), kf
-                                                  .getPointer()
-                                                  + def); kl.getPointer() != kf.getPointer(); kl.mm()) {
-        CArrayOfFloats kh, kt;
-        for (kt = new CArrayOfFloats(kl), kh = new CArrayOfFloats(mid); kt
-               .getPointer() != kf.getPointer(); kh.mm(), kt.mm()) {
-          fptr.set((kv - kh.get()) / (kt.get() - kh.get()));
-          fptr.pp();
-        }
-        kl.set(kv);
-      }
-    }
-
-  }
-
-  /**
-   * Makes new knot vector
-   */
-  private void knots() {
-    // DONE
-    CArrayOfFloats inkpt = new CArrayOfFloats(kleft.getArray(), kleft
-                                              .getPointer()
-                                              - order);
-    CArrayOfFloats inkend = new CArrayOfFloats(kright.getArray(), kright
-                                               .getPointer()
-                                               + bend.get().def);
-
-    outkbegin = new CArrayOfFloats(new float[inkend.getPointer()
-                                             - inkpt.getPointer()], 0);
-    CArrayOfFloats outkpt;
-    for (outkpt = new CArrayOfFloats(outkbegin); inkpt.getPointer() != inkend
-           .getPointer(); inkpt.pp(), outkpt.pp()) {
-      outkpt.set(inkpt.get());
-    }
-    outkend = new CArrayOfFloats(outkpt);
-  }
-
-  /**
-   * Analyzes breakpoints
-   */
-  private void breakpoints() {
-    // DONE
-    CArrayOfBreakpts ubpt = new CArrayOfBreakpts(bbegin);
-    CArrayOfBreakpts ubend = new CArrayOfBreakpts(bend);
-    int nfactors = 0;
-
-    ubpt.get().value = ubend.get().value;
-    ubpt.get().multi = ubend.get().multi;
-
-    kleft = new CArrayOfFloats(kright);
-
-    for (; kright.getPointer() != klast.getPointer(); kright.pp()) {
-      if (Knotvector.identical(kright.get(), ubpt.get().value)) {
-        ubpt.get().multi++;
-      } else {
-        ubpt.get().def = order - ubpt.get().multi;
-        nfactors += (ubpt.get().def * (ubpt.get().def - 1)) / 2;
-        ubpt.pp();
-        ubpt.get().value = kright.get();
-        ubpt.get().multi = 1;
-      }
-    }
-    ubpt.get().def = order - ubpt.get().multi;
-    nfactors += (ubpt.get().def * (ubpt.get().def - 1)) / 2;
-
-    bend = new CArrayOfBreakpts(ubpt);
-
-    if (nfactors > 0) {
-      sbegin = new CArrayOfFloats(new float[nfactors], 0);
-    } else {
-      sbegin = null;
-    }
-
-  }
-
-  /**
-   * Copies control points
-   * 
-   * @param _inpt
-   *            input control points
-   * @param _outpt
-   *            output control points
-   */
-  public void copy(CArrayOfFloats _inpt, CArrayOfFloats _outpt) {
-    CArrayOfFloats inpt = new CArrayOfFloats(_inpt);
-    CArrayOfFloats outpt = new CArrayOfFloats(_outpt);
-
-    inpt.raisePointerBy(preoffset);
-    if (next != null) {
-      for (CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
-                                                   outpt.getPointer() + prewidth); outpt.getPointer() != lpt
-             .getPointer(); outpt.raisePointerBy(poststride)) {
-        next.copy(inpt, outpt);
-        inpt.raisePointerBy(prestride);
-      }
-
-    } else {
-      for (CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
-                                                   outpt.getPointer() + prewidth); outpt.getPointer() != lpt
-             .getPointer(); outpt.raisePointerBy(poststride)) {
-        pt_io_copy(outpt, inpt);
-        inpt.raisePointerBy(prestride);
-      }
-    }
-
-  }
-
-  /**
-   * Copies one control point to other
-   * 
-   * @param topt
-   *            source control point
-   * @param frompt
-   *            destination control point
-   */
-  private void pt_io_copy(CArrayOfFloats topt, CArrayOfFloats frompt) {
-    // DONE
-    switch (ncoords) {
-    case 4:
-      topt.setRelative(3, frompt.getRelative(3));
-    case 3:
-      topt.setRelative(2, frompt.getRelative(2));
-    case 2:
-      topt.setRelative(1, frompt.getRelative(1));
-    case 1:
-      topt.set(frompt.get());
-      break;
-    default:
-      // TODO break with copying in general case
-      //				System.out.println("TODO knotspec.pt_io_copy");
-      break;
-    }
-
-  }
-
-  /**
-   * Inserts a knot
-   * 
-   * @param _p
-   *            inserted knot
-   */
-  public void transform(CArrayOfFloats _p) {
-    CArrayOfFloats p = new CArrayOfFloats(_p);
-    // DONE
-    if (next != null) {//surface code
-      if (this.equals(kspectotrans)) {
-        next.transform(p);
-      } else {
-        if (istransformed) {
-          p.raisePointerBy(postoffset);
-          for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
-							p.getPointer() + postwidth); p.getPointer() != pend
-                 .getPointer(); p.raisePointerBy(poststride))
-            next.transform(p);
-
-        } else {
-          CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
-                                                   .getPointer()
-                                                   + prewidth);
-          for (; p.getPointer() != pend.getPointer(); p
-                 .raisePointerBy(poststride))
-            next.transform(p);
-        }
-      }
-
-    } else {//code for curve 
-      if (this.equals(kspectotrans)) {
-        insert(p);
-      } else {
-        if (istransformed) {
-          p.raisePointerBy(postoffset);
-          for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
-							p.getPointer() + postwidth); p.getPointer() != pend
-                 .getPointer(); p.raisePointerBy(poststride)) {
-            kspectotrans.insert(p);
-          }
-        } else {
-          CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
-                                                   .getPointer()
-                                                   + prewidth);
-          for (; p.getPointer() != pend.getPointer(); p
-                 .raisePointerBy(poststride))
-            kspectotrans.insert(p);
-        }
-      }
-    }
-
-  }
-
-  /**
-   * Inserts a knot and computes new control points
-   * 
-   * @param p
-   *            inserted knot
-   */
-  private void insert(CArrayOfFloats p) {
-    // DONE
-    CArrayOfFloats fptr = null;
-    if (sbegin != null)
-      fptr = new CArrayOfFloats(sbegin);
-    CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), p.getPointer()
-                                              + prewidth - poststride);
-    // CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), prewidth -
-    // poststride);
-    CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), p.getPointer()
-                                              + postwidth + postoffset - poststride);
-    // CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), postwidth +
-    // postoffset - poststride);
-    CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend);
-
-    for (CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(), srcpt
-                                                  .getPointer()
-                                                  - poststride * bpt.get().def); srcpt.getPointer() != pend
-           .getPointer(); pend.raisePointerBy(poststride)) {
-      CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
-      for (CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(), srcpt
-                                                  .getPointer()
-                                                  - poststride); p2.getPointer() != pend.getPointer(); p1
-             .setPointer(p2.getPointer()), p2
-             .lessenPointerBy(poststride)) {
-        pt_oo_sum(p1, p1, p2, fptr.get(), 1.0 - fptr.get());
-        fptr.pp();
-      }
-    }
-    bpt.mm();
-    for (; bpt.getPointer() >= bbegin.getPointer(); bpt.mm()) {
-
-      for (int multi = bpt.get().multi; multi > 0; multi--) {
-        pt_oo_copy(dstpt, srcpt);
-        dstpt.lessenPointerBy(poststride);
-        srcpt.lessenPointerBy(poststride);
-      }
-      for (CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(),
-                                                    srcpt.getPointer() - poststride * bpt.get().def); srcpt
-             .getPointer() != pend.getPointer(); pend
-             .raisePointerBy(poststride), dstpt
-             .lessenPointerBy(poststride)) {
-        pt_oo_copy(dstpt, srcpt);
-        CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
-
-        for (CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(),
-                                                    srcpt.getPointer() - poststride); p2.getPointer() != pend
-               .getPointer(); p1.setPointer(p2.getPointer()), p2
-               .lessenPointerBy(poststride)) {
-          pt_oo_sum(p1, p1, p2, fptr.get(), 1.0 - fptr.get());
-          fptr.pp();
-        }
-      }
-    }
-  }
-
-  /**
-   * Copies one control point to another
-   * 
-   * @param topt
-   *            source ctrl point
-   * @param frompt
-   *            distance ctrl point
-   */
-  private void pt_oo_copy(CArrayOfFloats topt, CArrayOfFloats frompt) {
-    // DONE
-    // this is a "trick" with case - "break" is omitted so it comes through all cases
-    switch (ncoords) {
-    case 4:
-      topt.setRelative(3, frompt.getRelative(3));
-    case 3:
-      topt.setRelative(2, frompt.getRelative(2));
-    case 2:
-      topt.setRelative(1, frompt.getRelative(1));
-    case 1:
-      topt.setRelative(0, frompt.getRelative(0));
-      break;
-    default:
-      // default uses memcpy but it is not needed (we probably won't have more than 4 coords)
-      // TODO not sure about it
-      break;
-    }
-
-  }
-
-  /**
-   * Computes new control point
-   * 
-   * @param x
-   *            first point
-   * @param y
-   *            second point
-   * @param z
-   *            third pont
-   * @param a
-   *            alpha
-   * @param b
-   *            1 - alpha
-   */
-  private void pt_oo_sum(CArrayOfFloats x, CArrayOfFloats y,
-                         CArrayOfFloats z, float a, double b) {
-    // DONE
-    switch (ncoords) {
-    case 4:
-      x.setRelative(3, (float) (a * y.getRelative(3) + b
-                                * z.getRelative(3)));
-    case 3:
-      x.setRelative(2, (float) (a * y.getRelative(2) + b
-                                * z.getRelative(2)));
-    case 2:
-      x.setRelative(1, (float) (a * y.getRelative(1) + b
-                                * z.getRelative(1)));
-    case 1:
-      x.setRelative(0, (float) (a * y.getRelative(0) + b
-                                * z.getRelative(0)));
-      break;
-    default:
-      //no need of default - see previous method and its case statement				
-      //				System.out.println("TODO pt_oo_sum default");
-      break;
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotvector.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotvector.java
deleted file mode 100644
index 658a1cb..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotvector.java
+++ /dev/null
@@ -1,179 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Knot vector used in curve specification
- * 
- * @author Tomas Hrasky
- * 
- */
-public class Knotvector {
-
-  /**
-   * Tolerance used when comparing knots - when difference is smaller, knots
-   * are considered equal
-   */
-  public static final float TOLERANCE = 1.0e-5f;
-
-  /**
-   * Maximum curve order
-   */
-  private static final int MAXORDER = 24;
-
-  /**
-   * Number of knots
-   */
-  int knotcount;
-
-  /**
-   * Number of control points' coordinates
-   */
-  int stride;
-
-  /**
-   * Curve order
-   */
-  int order;
-
-  /**
-   * Knots
-   */
-  float[] knotlist;
-
-  /**
-   * Makes new knotvector
-   * 
-   * @param nknots
-   *            number of knots
-   * @param stride
-   *            number of ctrl points' corrdinates
-   * @param order
-   *            curve order
-   * @param knot
-   *            knots
-   */
-  public Knotvector(int nknots, int stride, int order, float[] knot) {
-    // DONE
-    init(nknots, stride, order, knot);
-  }
-
-  /**
-   * Initializes knotvector
-   * 
-   * @param nknots
-   *            number of knots
-   * @param stride
-   *            number of ctrl points' corrdinates
-   * @param order
-   *            curve order
-   * @param knot
-   *            knots
-   */
-  public void init(int nknots, int stride, int order, float[] knot) {
-    // DONE
-    this.knotcount = nknots;
-    this.stride = stride;
-    this.order = order;
-    this.knotlist = new float[nknots];
-    for (int i = 0; i < nknots; i++) {
-      this.knotlist[i] = knot[i];
-    }
-
-  }
-
-  /**
-   * Validates knot vector parameters
-   * 
-   * @return knot vector validity
-   */
-  public int validate() {
-    int kindex = knotcount - 1;
-    if (order < 1 || order > MAXORDER) {
-      return 1;
-    }
-    if (knotcount < 2 * order) {
-      return 2;
-    }
-    if (identical(knotlist[kindex - (order - 1)], knotlist[order - 1])) {
-      return 3;
-    }
-    for (int i = 0; i < kindex; i++) {
-      if (knotlist[i] > knotlist[i + 1])
-        return 4;
-    }
-    int multi = 1;
-    for (; kindex >= 1; kindex--) {
-      if (knotlist[kindex] - knotlist[kindex - 1] < TOLERANCE) {
-        multi++;
-        continue;
-      }
-      if (multi > order) {
-        return 5;
-      }
-      multi = 1;
-    }
-    if (multi > order) {
-      return 5;
-    }
-
-    return 0;
-  }
-
-  /**
-   * Show specified message
-   * 
-   * @param msg
-   *            message to be shown
-   */
-  public void show(String msg) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO knotvector.show");
-
-  }
-
-  /**
-   * Compares two knots for equality
-   * 
-   * @param a
-   *            first knot
-   * @param b
-   *            second knot
-   * @return knots are/are not equal
-   */
-  public static boolean identical(float a, float b) {
-    return ((a - b) < TOLERANCE) ? true : false;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Mapdesc.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Mapdesc.java
deleted file mode 100644
index 568eddc..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Mapdesc.java
+++ /dev/null
@@ -1,442 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class holding properties of OpenGL map
- * @author Tomas Hrasky
- *
- */
-public class Mapdesc {
-
-  /**
-   * Maximum control point coords
-   */
-  private static final int MAXCOORDS = 5;
-
-  /**
-   * Next description in list
-   */
-  public Mapdesc next;
-
-  /**
-   * Is map rational
-   */
-  public int isrational;
-
-  /**
-   * Number of control point coords
-   */
-  public int ncoords;
-
-  /**
-   * Map type
-   */
-  private int type;
-
-  /**
-   * Number of homogenous coords
-   */
-  private int hcoords;
-
-  /**
-   * Number of inhomogenous coords
-   */
-  private int inhcoords;
-
-  /**
-   * Not used
-   */
-  private int mask;
-
-  /**
-   * Value of N_PIXEL_TOLERANCE property
-   */
-  private float pixel_tolerance;
-
-  /**
-   * Value of N_ERROR_TOLERANCE property
-   */
-  private float error_tolerance;
-
-  /**
-   * Value of N_BBOX_SUBDIVIDING property
-   */
-  private float bbox_subdividing;
-
-  /**
-   * Value of N_CULLING property
-   */
-  private float culling_method;
-
-  /**
-   * Value of N_SAMPLINGMETHOD property
-   */
-  private float sampling_method;
-
-  /**
-   * Value of N_CLAMPFACTOR property
-   */
-  float clampfactor;
-
-  /**
-   * Value of N_MINSAVINGS property 
-   */
-  private float minsavings;
-
-  /**
-   * Steps in u direction
-   */
-  private float s_steps;
-
-  /**
-   * Steps in v direction
-   */
-  private float t_steps;
-
-  /**
-   * Maximal step
-   */
-  float maxrate;
-
-  /**
-   * Maximal u direction step
-   */
-  private float maxsrate;
-
-  /**
-   * Maximal v direction step
-   */
-  private float maxtrate;
-
-  /**
-   * Not used
-   */
-  private float[][] bmat;
-
-  /**
-   * Sampling matrix
-   */
-  private float[][] smat;
-
-  /**
-   * Not used
-   */
-  private float[][] cmat;
-
-  /**
-   * Not used
-   */
-  private float[] bboxsize;
-
-  /**
-   * Makes new mapdesc 
-   * @param type map type
-   * @param rational is rational
-   * @param ncoords number of control points coords
-   * @param backend backend object
-   */
-  public Mapdesc(int type, int rational, int ncoords, Backend backend) {
-    // DONE
-    this.type = type;
-    this.isrational = rational;
-    this.ncoords = ncoords;
-    this.hcoords = ncoords + (isrational > 0 ? 0 : 1);
-    this.inhcoords = ncoords - (isrational > 0 ? 1 : 0);
-    this.mask = ((1 << (inhcoords * 2)) - 1);
-    next = null;
-
-    assert (hcoords <= MAXCOORDS);
-    assert (inhcoords >= 1);
-
-    pixel_tolerance = 1f;
-    error_tolerance = 1f;
-    bbox_subdividing = NurbsConsts.N_NOBBOXSUBDIVISION;
-    culling_method = NurbsConsts.N_NOCULLING;
-    sampling_method = NurbsConsts.N_NOSAMPLING;
-    clampfactor = NurbsConsts.N_NOCLAMPING;
-    minsavings = NurbsConsts.N_NOSAVINGSSUBDIVISION;
-    s_steps = 0f;
-    t_steps = 0f;
-
-    maxrate = (s_steps < 0) ? 0 : s_steps;
-    maxsrate = (s_steps < 0) ? 0 : s_steps;
-    maxtrate = (t_steps < 0) ? 0 : t_steps;
-    bmat = new float[MAXCOORDS][MAXCOORDS];
-    cmat = new float[MAXCOORDS][MAXCOORDS];
-    smat = new float[MAXCOORDS][MAXCOORDS];
-
-    identify(bmat);
-    identify(cmat);
-    identify(smat);
-    bboxsize = new float[MAXCOORDS];
-    for (int i = 0; i < inhcoords; i++)
-      bboxsize[i] = 1;
-  }
-
-  /**
-   * Make matrix identity matrix
-   * @param arr matrix
-   */
-  private void identify(float[][] arr) {
-    // DONE
-    for (int i = 0; i < MAXCOORDS; i++)
-      for (int j = 0; j < MAXCOORDS; j++)
-        arr[i][j] = 0;
-    for (int i = 0; i < MAXCOORDS; i++)
-      arr[i][i] = 1;
-
-  }
-
-  /**
-   * Tells whether tag is property tag
-   * @param tag property tag
-   * @return is/is not property
-   */
-  public boolean isProperty(int tag) {
-    boolean ret;
-    switch (tag) {
-    case NurbsConsts.N_PIXEL_TOLERANCE:
-    case NurbsConsts.N_ERROR_TOLERANCE:
-    case NurbsConsts.N_CULLING:
-    case NurbsConsts.N_BBOX_SUBDIVIDING:
-    case NurbsConsts.N_S_STEPS:
-    case NurbsConsts.N_T_STEPS:
-    case NurbsConsts.N_SAMPLINGMETHOD:
-    case NurbsConsts.N_CLAMPFACTOR:
-    case NurbsConsts.N_MINSAVINGS:
-      ret = true;
-      break;
-    default:
-      ret = false;
-      break;
-    }
-    return ret;
-  }
-
-  /**
-   * Returns number of control points' coords
-   * @return number of control points' coords
-   */
-  public int getNCoords() {
-    return ncoords;
-  }
-
-  /**
-   * Returns map type
-   * @return map type
-   */
-  public int getType() {
-    return type;
-  }
-
-  /**
-   * Tells whether map is range sampling
-   * @return is map range sampling
-   */
-  public boolean isRangeSampling() {
-    // DONE
-    return (isParametricDistanceSampling() || isPathLengthSampling()
-            || isSurfaceAreaSampling() || isObjectSpaceParaSampling() || isObjectSpacePathSampling());
-  }
-
-  /**
-   * Tells whether map is object space sampling
-   * @return is map object space sampling
-   */
-  private boolean isObjectSpacePathSampling() {
-    // DONE
-    return sampling_method == NurbsConsts.N_OBJECTSPACE_PATH;
-  }
-
-  /**
-   * Tells whether map is object space parasampling
-   * @return is map object space parasampling
-   */
-  private boolean isObjectSpaceParaSampling() {
-    // DONE
-    return sampling_method == NurbsConsts.N_OBJECTSPACE_PARA;
-  }
-
-  /**
-   * Tells whether map is area sampling surface
-   * @return is map area sampling surface
-   */
-  private boolean isSurfaceAreaSampling() {
-    // DONE
-    return sampling_method == NurbsConsts.N_SURFACEAREA;
-  }
-
-  /**
-   * Tells whether map is path length sampling
-   * @return is map path length sampling
-   */
-  boolean isPathLengthSampling() {
-    // DONE
-    return sampling_method == NurbsConsts.N_PATHLENGTH;
-  }
-
-  /**
-   * Tells whether map is parametric distance sampling
-   * @return is map parametric distance sampling
-   */
-  boolean isParametricDistanceSampling() {
-    // DONE
-    return sampling_method == NurbsConsts.N_PARAMETRICDISTANCE;
-  }
-
-  /**
-   * Tells whether map is culling 
-   * @return is map culling
-   */
-  public boolean isCulling() {
-    // DONE
-    return culling_method != NurbsConsts.N_NOCULLING ? true : false;
-  }
-
-  /**
-   * Tells whether map is constantly sampling 
-   * @return is map constant sampling
-   */
-  public boolean isConstantSampling() {
-    return (sampling_method == NurbsConsts.N_FIXEDRATE) ? true : false;
-  }
-
-  /**
-   * Tells whether map is domain sampling 
-   * @return is map domain sampling
-   */
-  public boolean isDomainSampling() {
-    return (sampling_method == NurbsConsts.N_DOMAINDISTANCE) ? true : false;
-  }
-
-  /**
-   * Returns property of specified tag value 
-   * @param tag property tag
-   * @return property value
-   */
-  public float getProperty(int tag) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO mapdesc.getproperty");
-    return 0;
-  }
-
-  /**
-   * Sets property with given tag
-   * @param tag property tag
-   * @param value desired value
-   */
-  public void setProperty(int tag, float value) {
-    // TODO Auto-generated method stub
-    switch (tag) {
-    case NurbsConsts.N_PIXEL_TOLERANCE:
-      pixel_tolerance = value;
-      break;
-    case NurbsConsts.N_ERROR_TOLERANCE:
-      error_tolerance = value;
-      break;
-    case NurbsConsts.N_CULLING:
-      culling_method = value;
-      break;
-    case NurbsConsts.N_BBOX_SUBDIVIDING:
-      if (value <= 0)
-        value = NurbsConsts.N_NOBBOXSUBDIVISION;
-      bbox_subdividing = value;
-      break;
-    case NurbsConsts.N_S_STEPS:
-      if (value < 0)
-        value = 0;
-      s_steps = value;
-      maxrate = value;
-      maxsrate = value;
-      break;
-    case NurbsConsts.N_T_STEPS:
-      if (value < 0)
-        value = 0;
-      t_steps = value;
-      maxtrate = value;
-      break;
-    case NurbsConsts.N_SAMPLINGMETHOD:
-      sampling_method = value;
-      break;
-    case NurbsConsts.N_CLAMPFACTOR:
-      if (value < 0)
-        value = 0;
-      clampfactor = value;
-      break;
-    case NurbsConsts.N_MINSAVINGS:
-      if (value <= 0)
-        value = NurbsConsts.N_NOSAVINGSSUBDIVISION;
-      minsavings = value;
-      break;
-    }
-  }
-
-  /**
-   * Samples curve
-   * @param pts control points
-   * @param order curve order
-   * @param stride number of control points' coordinates
-   * @param sp breakpoints
-   * @param outstride output number of control points' coordinates
-   */
-  public void xformSampling(CArrayOfFloats pts, int order, int stride,
-                            float[] sp, int outstride) {
-    // DONE
-    xFormMat(smat, pts, order, stride, sp, outstride);
-  }
-
-  /**
-   * Empty method
-   * @param mat sampling matrix
-   * @param pts ontrol points
-   * @param order curve order
-   * @param stride number of control points' coordinates
-   * @param cp breakpoints
-   * @param outstride output number of control points' coordinates
-   */
-  private void xFormMat(float[][] mat, CArrayOfFloats pts, int order,
-			int stride, float[] cp, int outstride) {
-    // TODO Auto-generated method stub
-
-    //		System.out.println("TODO mapdsc.xformmat ; change cp from float[] to carrayoffloats");
-
-    if (isrational > 0) {
-
-    } else {
-
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Maplist.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Maplist.java
deleted file mode 100644
index b23a1f6..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Maplist.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class holding list of Mapdescs
- * @author Tomáš Hráský
- *
- */
-public class Maplist {
-  /**
-   * Head of linked list
-   */
-  private Mapdesc maps;
-
-  /**
-   * Backend class
-   */
-  private Backend backend;
-
-  /**
-   * Makes new Maplist
-   * @param backend Backend class
-   */
-  public Maplist(Backend backend) {
-    this.backend = backend;
-  }
-
-  /**
-   * Sets linked list beginning to null
-   */
-  public void initialize() {
-    // TODO mapdespool.clear ?
-    maps = null;
-  }
-
-  /**
-   * Defines new Mapdesc if it is not defined and appends it to linked list
-   * @param type map type
-   * @param rational is map rational
-   * @param ncoords number of coords
-   */
-  public void define(int type, int rational, int ncoords) {
-    // DONE
-    Mapdesc m = locate(type);
-    assert (m == null || (m.isrational == rational && m.ncoords == ncoords));
-    add(type, rational, ncoords);
-
-  }
-
-  /**
-   * Adds new Mapdesc to linked list
-   * @param type map type
-   * @param rational is map rational
-   * @param ncoords number of coords
-   */
-  private void add(int type, int rational, int ncoords) {
-    // DONE
-    Mapdesc map = new Mapdesc(type, rational, ncoords, backend);
-    if (maps == null) {
-      maps = map;
-    } else {
-      map.next = maps;
-      maps = map;
-    }
-  }
-
-  /**
-   * Tries to find Mapdesc in linked list
-   * @param type map type
-   * @return Mapdesc of type or null if there is no such map
-   */
-  public Mapdesc locate(int type) {
-    // DONE
-    Mapdesc m = null;
-    for (m = maps; m != null; m = m.next)
-      if (m.getType() == type)
-        break;
-    return m;
-  }
-
-  /**
-   * Alias for locate
-   * @param type maptype
-   * @return Mapdesc of type or null if there is no such map
-   */
-  public Mapdesc find(int type) {
-    return locate(type);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/NurbsConsts.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/NurbsConsts.java
deleted file mode 100644
index ee7f3b3..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/NurbsConsts.java
+++ /dev/null
@@ -1,184 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class hodling NURBS constants as seen in OpenGL GLU documentation
- * @author JOGL project
- *
- */
-public class NurbsConsts {
-  /*
-   * NURBS Properties - one set per map, each takes a single INREAL arg
-   */
-  public static final int N_SAMPLING_TOLERANCE = 1;
-
-  public static final int N_S_RATE = 6;
-
-  public static final int N_T_RATE = 7;
-
-  public static final int N_CLAMPFACTOR = 13;
-
-  public static final float N_NOCLAMPING = 0.0f;
-
-  public static final int N_MINSAVINGS = 14;
-
-  public static final float N_NOSAVINGSSUBDIVISION = 0.0f;
-
-  /*
-   * NURBS Properties - one set per map, each takes an enumerated value
-   */
-  public static final int N_CULLING = 2;
-
-  public static final float N_NOCULLING = 0.0f;
-
-  public static final float N_CULLINGON = 1.0f;
-
-  public static final int N_SAMPLINGMETHOD = 10;
-
-  public static final float N_NOSAMPLING = 0.0f;
-
-  public static final float N_FIXEDRATE = 3.0f;
-
-  public static final float N_DOMAINDISTANCE = 2.0f;
-
-  public static final float N_PARAMETRICDISTANCE = 5.0f;
-
-  public static final float N_PATHLENGTH = 6.0f;
-
-  public static final float N_SURFACEAREA = 7.0f;
-
-  public static final float N_OBJECTSPACE_PARA = 8.0f;
-
-  public static final float N_OBJECTSPACE_PATH = 9.0f;
-
-  public static final int N_BBOX_SUBDIVIDING = 17;
-
-  public static final float N_NOBBOXSUBDIVISION = 0.0f;
-
-  public static final float N_BBOXTIGHT = 1.0f;
-
-  public static final float N_BBOXROUND = 2.0f;
-
-  /*
-   * NURBS Rendering Properties - one set per renderer each takes an
-   * enumerated value
-   */
-  public static final int N_DISPLAY = 3;
-
-  public static final int N_FILL = 1;
-
-  public static final int N_OUTLINE_POLY = 2;
-
-  public static final int N_OUTLINE_TRI = 3;
-
-  public static final int N_OUTLINE_QUAD = 4;
-
-  public static final int N_OUTLINE_PATCH = 5;
-
-  public static final int N_OUTLINE_PARAM = 6;
-
-  public static final int N_OUTLINE_PARAM_S = 7;
-
-  public static final int N_OUTLINE_PARAM_ST = 8;
-
-  public static final int N_OUTLINE_SUBDIV = 9;
-
-  public static final int N_OUTLINE_SUBDIV_S = 10;
-
-  public static final int N_OUTLINE_SUBDIV_ST = 11;
-
-  public static final int N_ISOLINE_S = 12;
-
-  public static final int N_ERRORCHECKING = 4;
-
-  public static final int N_NOMSG = 0;
-
-  public static final int N_MSG = 1;
-
-  /* GL 4.0 propeties not defined above */
-
-  public static final int N_PIXEL_TOLERANCE = N_SAMPLING_TOLERANCE;
-
-  public static final int N_ERROR_TOLERANCE = 20;
-
-  public static final int N_SUBDIVISIONS = 5;
-
-  public static final int N_TILES = 8;
-
-  public static final int N_TMP1 = 9;
-
-  public static final int N_TMP2 = N_SAMPLINGMETHOD;
-
-  public static final int N_TMP3 = 11;
-
-  public static final int N_TMP4 = 12;
-
-  public static final int N_TMP5 = N_CLAMPFACTOR;
-
-  public static final int N_TMP6 = N_MINSAVINGS;
-
-  public static final int N_S_STEPS = N_S_RATE;
-
-  public static final int N_T_STEPS = N_T_RATE;
-
-  /*
-   * NURBS Rendering Properties - one set per map, each takes an INREAL matrix
-   * argument
-   */
-  public static final int N_CULLINGMATRIX = 1;
-
-  public static final int N_SAMPLINGMATRIX = 2;
-
-  public static final int N_BBOXMATRIX = 3;
-
-  /*
-   * NURBS Rendering Properties - one set per map, each takes an INREAL vector
-   * argument
-   */
-  public static final int N_BBOXSIZE = 4;
-
-  /* type argument for trimming curves */
-
-  public static final int N_P2D = 0x8;
-
-  public static final int N_P2DR = 0xd;
-
-  public static final int N_MESHLINE = 1;
-
-  public static final int N_MESHFILL = 0;
-
-  public static final int N_MESHPOINT = 2;
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_curve.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_curve.java
deleted file mode 100644
index 900f8e5..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_curve.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Struct holding curve links
- * @author Tomáš Hráský
- *
- */
-public class O_curve {
-
-  /**
-   * Curve type
-   */
-  public int curvetype;
-
-  /**
-   * Next curve in linked list
-   */
-  public O_curve next;
-
-  /**
-   * Curve of picewiselinear type
-   */
-  public O_pwlcurve o_pwlcurve;
-
-  /**
-   * NURBS curve
-   */
-  public O_nurbscurve o_nurbscurve;
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbscurve.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbscurve.java
deleted file mode 100644
index 8111081..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbscurve.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * NURBS curve object
- * @author Tomáš Hráský
- *
- */
-public class O_nurbscurve {
-
-  /**
-   * List of bezier curves
-   */
-  public Quilt bezier_curves;
-
-  /**
-   * Curve type
-   */
-  public int type;
-
-  /**
-   * Was curve used ?
-   */
-  public boolean used;
-
-  /**
-   * Parent curve
-   */
-  public O_curve owner;
-
-  /**
-   * Next curve in list
-   */
-  public O_nurbscurve next;
-
-  /**
-   * Makes new O_nurbscurve
-   * @param realType type of curve 
-   */
-  public O_nurbscurve(int realType) {
-    // DONE
-    this.type = realType;
-    this.owner = null;
-    this.next = null;
-    this.used = false;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbssurface.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbssurface.java
deleted file mode 100644
index b598f52..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbssurface.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * NURBS surface object
- * @author Tomáš Hráský
- *
- */
-public class O_nurbssurface {
-
-  /**
-   * List of bezier patches forming NURBS surface
-   */
-  public Quilt bezier_patches;
-
-  /**
-   * Was surface used
-   */
-  public boolean used;
-
-  /**
-   * Parent O_surface
-   */
-  public O_surface owner;
-
-  /**
-   * Next surface in list
-   */
-  public O_nurbssurface next;
-
-  /**
-   * Surface type
-   */
-  private int type;
-
-  /**
-   * Makes new O_nurbssurface of type
-   * @param type surface type
-   */
-  public O_nurbssurface(int type) {
-    this.type = type;
-    this.owner = null;
-    this.next = null;
-    this.used = false;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_pwlcurve.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_pwlcurve.java
deleted file mode 100644
index e50f41d..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_pwlcurve.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Empty class
- * @author Tomáš Hráský
- *
- */
-public class O_pwlcurve {
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_surface.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_surface.java
deleted file mode 100644
index 76ac79f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_surface.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Surface object
- * @author Tomáš Hráský
- *
- */
-public class O_surface {
-  /**
-   * NURBS surface
-   */
-  public O_nurbssurface o_nurbssurface;
-
-  /**
-   * Trims
-   */
-  public O_trim o_trim;
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_trim.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_trim.java
deleted file mode 100644
index 17e5002..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_trim.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Empty class
- * @author Tomáš Hráský
- *
- */
-public class O_trim {
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patch.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patch.java
deleted file mode 100644
index d3066cc..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patch.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Empty class
- * @author Tomas Hrasky
- *
- */
-public class Patch {
-
-  /**
-   * Empty constructor
-   * @param q
-   * @param pta
-   * @param ptb
-   * @param patch
-   */
-  public Patch(Quilt q, float[] pta, float[] ptb, Patch patch) {
-    //			System.out.println("TODO patch.constructor");
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patchlist.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patchlist.java
deleted file mode 100644
index 8b439a0..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patchlist.java
+++ /dev/null
@@ -1,145 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * List of patches
- * @author Tomáš Hráský
- *
- */
-public class Patchlist {
-
-  /**
-   * Array of ranges
-   */
-  public Pspec[] pspec;
-
-  /**
-   * head of list of patches
-   */
-  private Patch patch;
-
-  /**
-   * Makes new list of patches 
-   * @param quilts list of quilts
-   * @param pta low border
-   * @param ptb high border
-   */
-  public Patchlist(Quilt quilts, float[] pta, float[] ptb) {
-    // DONE
-    patch = null;
-
-    for (Quilt q = quilts; q != null; q = q.next)
-      patch = new Patch(q, pta, ptb, patch);
-    pspec[0] = new Pspec();
-    pspec[0].range[0] = pta[0];
-    pspec[0].range[1] = ptb[0];
-    pspec[0].range[2] = ptb[0] - pta[0];
-    pspec[1] = new Pspec();
-    pspec[1].range[0] = pta[1];
-    pspec[1].range[1] = ptb[1];
-    pspec[1].range[2] = ptb[1] - pta[1];
-
-  }
-
-  /**
-   * Empty constructor
-   * @param patchlist
-   * @param param
-   * @param mid
-   */
-  public Patchlist(Patchlist patchlist, int param, float mid) {
-    // TODO Auto-generated constructor stub
-    //			System.out.println("TODO patchlist.konstruktor 2");
-  }
-
-  /**
-   * Empty method
-   * @return 0
-   */
-  public int cullCheck() {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO patchlist.cullcheck");
-    return 0;
-  }
-
-  /**
-   * Empty method
-   */
-  public void getstepsize() {
-    //			System.out.println("TODO patchlist.getsptepsize");
-    // TODO Auto-generated method stub
-
-  }
-
-  /**
-   * Empty method
-   * @return false
-   */
-  public boolean needsSamplingSubdivision() {
-    // TODO Auto-generated method stub
-    //			System.out.println("patchlist.needsSamplingSubdivision");
-    return false;
-  }
-
-  /**
-   * Empty method
-   * @param i
-   * @return false
-   */
-  public boolean needsSubdivision(int i) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO patchlist.needsSubdivision");
-    return false;
-  }
-
-  /**
-   * Empty method
-   * @return false
-   */
-  public boolean needsNonSamplingSubdivision() {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO patchlist.needsNonSamplingSubdivision");
-    return false;
-  }
-
-  /**
-   * Empty method
-   */
-  public void bbox() {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO patchlist.bbox");
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Property.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Property.java
deleted file mode 100644
index b486a0e..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Property.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class representing property
- * 
- * @author Tomas Hrasky
- * 
- */
-public class Property {
-
-  /**
-   * Property type
-   */
-  public int type;
-
-  /**
-   * Property id
-   */
-  public int tag;
-
-  /**
-   * Property value
-   */
-  public float value;
-
-  /**
-   * Makes new property with given parameters
-   * 
-   * @param type
-   *            property type
-   * @param tag
-   *            property id
-   * @param value
-   *            property value
-   */
-  public Property(int type, int tag, float value) {
-    this.type = type;
-    this.tag = tag;
-    this.value = value;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Pspec.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Pspec.java
deleted file mode 100644
index 1e60ed3..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Pspec.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class holding range
- * @author Tomáš Hráský
- *
- */
-public class Pspec {
-  /**
-   * Range
-   */
-  public float[] range;
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/PwlArc.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/PwlArc.java
deleted file mode 100644
index 0c9eca9..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/PwlArc.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Picewiselinar trimming arc
- * @author Tomáš Hráský
- *
- */
-public class PwlArc {
-
-  /**
-   * Number of points
-   */
-  private int npts;
-
-  /**
-   * Vertexes
-   */
-  public TrimVertex[] pts;
-
-  /**
-   * Arc type
-   */
-  private int type;
-
-  /**
-   * Makes new trimming arc
-   * @param i num ber of vertexes
-   * @param p trimming vertexes array
-   */
-  public PwlArc(int i, TrimVertex[] p) {
-    // DONE
-    this.npts = i;
-    this.pts = p;
-    type = NurbsConsts.N_P2D;
-
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quilt.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quilt.java
deleted file mode 100644
index 03e809d..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quilt.java
+++ /dev/null
@@ -1,282 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class for converting NURBS curves and surfaces to list of bezier arcs or patches repectively
- * @author Tomáš Hráský
- *
- */
-public class Quilt {
-  /**
-   * Maximum quilt dimension
-   */
-  private static final int MAXDIM = 2;
-
-  /**
-   * List of map descriptions
-   */
-  Mapdesc mapdesc;
-
-  /**
-   *  Array of quiltspecs pointer
-   */
-  public CArrayOfQuiltspecs qspec;
-
-  /**
-   * End array of quilt specs pointer
-   */
-  public CArrayOfQuiltspecs eqspec;
-
-  /**
-   * Control points
-   */
-  public CArrayOfFloats cpts;
-
-  /**
-   * Next quilt in list
-   */
-  public Quilt next;
-
-  /**
-   * Makes new quilt with mapdesc
-   * @param mapdesc map description
-   */
-  public Quilt(Mapdesc mapdesc) {
-    // DONE
-    this.mapdesc = mapdesc;
-    Quiltspec[] tmpquilts = new Quiltspec[MAXDIM];
-    for (int i = 0; i < tmpquilts.length; i++)
-      tmpquilts[i] = new Quiltspec();
-    this.qspec = new CArrayOfQuiltspecs(tmpquilts);
-
-  }
-
-  /**
-   * Converts NURBS surface to bezier patches
-   * @param sknotvector knots in u direction
-   * @param tknotvector knots in v direction
-   * @param ctrlarr control points
-   * @param coords control points coords
-   */
-  public void toBezier(Knotvector sknotvector, Knotvector tknotvector,
-                       CArrayOfFloats ctrlarr, int coords) {
-    Splinespec spline = new Splinespec(2);
-    spline.kspecinit(sknotvector, tknotvector);
-    spline.select();
-    spline.layout(coords);
-    spline.setupquilt(this);
-    spline.copy(ctrlarr);
-    spline.transform();
-  }
-
-  /**
-   * Converts NURBS curve to list of bezier curves
-   * @param knots knot vector
-   * @param ctlarray control points
-   * @param ncoords number of coordinates
-   */
-  public void toBezier(Knotvector knots, CArrayOfFloats ctlarray, int ncoords) {
-    // DONE
-    Splinespec spline = new Splinespec(1);
-    spline.kspecinit(knots);
-    spline.select();
-    spline.layout(ncoords);
-    spline.setupquilt(this);
-    spline.copy(ctlarray);
-    spline.transform();
-  }
-
-  /**
-   * Walks thru all arcs/patches
-   * @param pta low border
-   * @param ptb high border
-   * @param backend Backend
-   */
-  public void downloadAll(float[] pta, float[] ptb, Backend backend) {
-    // DONE
-    for (Quilt m = this; m != null; m = m.next) {
-      m.select(pta, ptb);
-      m.download(backend);
-    }
-
-  }
-
-  /**
-   * Renders arcs/patches
-   * @param backend Backend for rendering
-   */
-  private void download(Backend backend) {
-    // DONE
-    if (getDimension() == 2) {
-
-      CArrayOfFloats ps = new CArrayOfFloats(cpts);
-      ps.raisePointerBy(qspec.get(0).offset);
-      ps.raisePointerBy(qspec.get(1).offset);
-      ps.raisePointerBy(qspec.get(0).index * qspec.get(0).order
-                        * qspec.get(0).stride);
-      ps.raisePointerBy(qspec.get(1).index * qspec.get(1).order
-                        * qspec.get(1).stride);
-
-      backend.surfpts(mapdesc.getType(), ps, qspec.get(0).stride, qspec
-                      .get(1).stride, qspec.get(0).order, qspec.get(1).order,
-                      qspec.get(0).breakpoints[qspec.get(0).index],
-                      qspec.get(0).breakpoints[qspec.get(0).index + 1], qspec
-                      .get(1).breakpoints[qspec.get(1).index], qspec
-                      .get(1).breakpoints[qspec.get(1).index + 1]);
-
-    } else {// code for curves
-      // CArrayOfFloats ps=new CArrayOfFloats(cpts);
-      CArrayOfFloats ps = new CArrayOfFloats(cpts.getArray(), 0);
-      ps.raisePointerBy(qspec.get(0).offset);
-      ps.raisePointerBy(qspec.get(0).index * qspec.get(0).order
-                        * qspec.get(0).stride);
-      backend.curvpts(mapdesc.getType(), ps, qspec.get(0).stride, qspec
-                      .get(0).order,
-                      qspec.get(0).breakpoints[qspec.get(0).index],
-                      qspec.get(0).breakpoints[qspec.get(0).index + 1]);
-    }
-
-  }
-
-  /**
-   * Returns quilt dimension
-   * @return quilt dimesion
-   */
-  private int getDimension() {
-    // DONE
-    return eqspec.getPointer() - qspec.getPointer();
-  }
-
-  /**
-   * Finds Quiltspec.index
-   * @param pta range
-   * @param ptb range
-   */
-  private void select(float[] pta, float[] ptb) {
-    // DONE
-    int dim = eqspec.getPointer() - qspec.getPointer();
-    int i, j;
-    for (i = 0; i < dim; i++) {
-      for (j = qspec.get(i).width - 1; j >= 0; j--)
-        if (qspec.get(i).breakpoints[j] <= pta[i]
-            && ptb[i] <= qspec.get(i).breakpoints[j + 1])
-          break;
-      assert (j != -1);
-      qspec.get(i).index = j;
-    }
-  }
-
-  /**
-   * Find range according to breakpoints
-   * @param from low param
-   * @param to high param
-   * @param bpts breakpoints
-   */
-  public void getRange(float[] from, float[] to, Flist bpts) {
-    // DONE
-    getRange(from, to, 0, bpts);
-
-  }
-
-  /**
-   * Find range according to breakpoints
-   * @param from low param
-   * @param to high param
-   * @param i from/to array index
-   * @param list breakpoints
-   */
-  private void getRange(float[] from, float[] to, int i, Flist list) {
-    // DONE
-    Quilt maps = this;
-    from[i] = maps.qspec.get(i).breakpoints[0];
-    to[i] = maps.qspec.get(i).breakpoints[maps.qspec.get(i).width];
-    int maxpts = 0;
-    Quilt m;
-    for (m = maps; m != null; m = m.next) {
-      if (m.qspec.get(i).breakpoints[0] > from[i])
-        from[i] = m.qspec.get(i).breakpoints[0];
-      if (m.qspec.get(i).breakpoints[m.qspec.get(i).width] < to[i])
-        to[i] = m.qspec.get(i).breakpoints[m.qspec.get(i).width];
-      maxpts += m.qspec.get(i).width + 1;
-    }
-    list.grow(maxpts);
-    for (m = maps; m != null; m = m.next) {
-      for (int j = 0; j <= m.qspec.get(i).width; j++) {
-        list.add(m.qspec.get(i).breakpoints[j]);
-      }
-    }
-    list.filter();
-    list.taper(from[i], to[i]);
-  }
-
-  /**
-   * Is this quilt culled
-   * @return 0 or Subdivider.CULL_ACCEPT
-   */
-  public int isCulled() {
-    if (mapdesc.isCulling()) {
-      //				System.out.println("TODO quilt.isculled mapdesc.isculling");
-      return 0;
-    } else {
-      return Subdivider.CULL_ACCEPT;
-    }
-  }
-
-  /**
-   * Finds range for surface
-   * @param from low param
-   * @param to high param
-   * @param slist u direction breakpoints
-   * @param tlist v direction breakpoints
-   */
-  public void getRange(float[] from, float[] to, Flist slist, Flist tlist) {
-    // DONE
-    getRange(from, to, 0, slist);
-    getRange(from, to, 1, tlist);
-
-  }
-
-  /**
-   * Empty method
-   * @param sbrkpts
-   * @param tbrkpts
-   * @param rate
-   */
-  public void findRates(Flist sbrkpts, Flist tbrkpts, float[] rate) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO quilt.findrates");
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quiltspec.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quiltspec.java
deleted file mode 100644
index 6c8e55e..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quiltspec.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Quilt definition
- * @author Tomas Hrasky
- *
- */
-public class Quiltspec {
-
-  /**
-   * Stride between control points
-   */
-  public int stride;
-
-  /**
-   * Quilt width in breakpoints
-   */
-  public int width;
-
-  /**
-   * Quilt order
-   */
-  public int order;
-
-  /**
-   * Start offset
-   */
-  public int offset;
-
-  /**
-   * Breakpoint index
-   */
-  public int index;
-
-  /**
-   * Boundary
-   */
-  public int[] bdry;
-
-  /**
-   * Breakpoints
-   */
-  public float[] breakpoints;
-
-  /**
-   * Makes new quiltspec
-   */
-  public Quiltspec() {
-    this.bdry = new int[2];
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Renderhints.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Renderhints.java
deleted file mode 100644
index d1a23fb..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Renderhints.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class holding rendering params 
- * @author Tomas Hrasky
- *
- */
-public class Renderhints {
-
-  /**
-   * Check for errors
-   */
-  public int errorchecking;
-
-  /**
-   * Maximum subdivisions
-   */
-  public int maxsubdivisions;
-
-  /**
-   * Number of subdivisions
-   */
-  private int subdivisions;
-
-  /**
-   * Display method
-   */
-  int display_method;
-
-  /**
-   * Output triangles
-   */
-  int wiretris;
-
-  /**
-   * Output quads
-   */
-  int wirequads;
-
-  /**
-   * Makes new Renderinghints
-   */
-  public Renderhints() {
-    display_method = NurbsConsts.N_FILL;
-    errorchecking = NurbsConsts.N_MSG;
-    subdivisions = 6;
-    // tmp1=0;
-  }
-
-  /**
-   * Set property value
-   * @param prop property
-   */
-  public void setProperty(Property prop) {
-    switch (prop.type) {
-    case NurbsConsts.N_DISPLAY:
-      display_method = (int) prop.value;
-      break;
-    case NurbsConsts.N_ERRORCHECKING:
-      errorchecking = (int) prop.value;
-      break;
-    case NurbsConsts.N_SUBDIVISIONS:
-      subdivisions = (int) prop.value;
-      break;
-    default:
-      // abort - end program
-      break;
-    }
-  }
-
-  /**
-   * Initialization
-   */
-  public void init() {
-    // DONE
-    maxsubdivisions = subdivisions;
-    if (maxsubdivisions < 0)
-      maxsubdivisions = 0;
-
-    if (display_method == NurbsConsts.N_FILL) {
-      wiretris = 0;
-      wirequads = 0;
-    } else if (display_method == NurbsConsts.N_OUTLINE_TRI) {
-      wiretris = 1;
-      wirequads = 0;
-    } else if (display_method == NurbsConsts.N_OUTLINE_QUAD) {
-      wiretris = 0;
-      wirequads = 1;
-    } else {
-      wiretris = 1;
-      wirequads = 1;
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Splinespec.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Splinespec.java
deleted file mode 100644
index 487b47f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Splinespec.java
+++ /dev/null
@@ -1,204 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * NURBS definition
- * @author Tomas Hrasky
- *
- */
-public class Splinespec {
-
-  /**
-   * Dimension
-   */
-  private int dim;
-
-  /**
-   * Knot vector specs
-   */
-  private Knotspec kspec;
-
-  /**
-   * Control points after conversion
-   */
-  private CArrayOfFloats outcpts;
-
-  /**
-   * Makes new Splinespec with given dimension
-   * @param i dimension
-   */
-  public Splinespec(int i) {
-    // DONE
-    this.dim = i;
-  }
-
-  /**
-   * Initializes knotspec according to knotvector
-   * @param knotvector basic knotvector
-   */
-  public void kspecinit(Knotvector knotvector) {
-    // DONE
-    this.kspec = new Knotspec();
-    kspec.inkbegin = new CArrayOfFloats(knotvector.knotlist, 0);
-    kspec.inkend = new CArrayOfFloats(knotvector.knotlist,
-                                      knotvector.knotcount);
-    kspec.prestride = knotvector.stride;
-    kspec.order = knotvector.order;
-    kspec.next = null;
-  }
-
-  /**
-   * Initializes knotspec according to knotvector - SURFACE
-   * @param sknotvector knotvector in u dir
-   * @param tknotvector knotvector in v dir
-   */
-  public void kspecinit(Knotvector sknotvector, Knotvector tknotvector) {
-    // DONE
-    this.kspec = new Knotspec();
-    Knotspec tkspec = new Knotspec();
-
-    kspec.inkbegin = new CArrayOfFloats(sknotvector.knotlist, 0);
-    kspec.inkend = new CArrayOfFloats(sknotvector.knotlist,
-                                      sknotvector.knotcount);
-    kspec.prestride = sknotvector.stride;
-    kspec.order = sknotvector.order;
-    kspec.next = tkspec;
-
-    tkspec.inkbegin = new CArrayOfFloats(tknotvector.knotlist, 0);
-    tkspec.inkend = new CArrayOfFloats(tknotvector.knotlist,
-                                       tknotvector.knotcount);
-    tkspec.prestride = tknotvector.stride;
-    tkspec.order = tknotvector.order;
-    tkspec.next = null;
-  }
-
-  /**
-   * Preselect and select knotspecs
-   */
-  public void select() {
-    // DONE
-    for (Knotspec knotspec = kspec; knotspec != null; knotspec = knotspec.next) {
-      knotspec.preselect();
-      knotspec.select();
-    }
-
-  }
-
-  /**
-   * Prepares for conversion
-   * @param ncoords number of coords
-   */
-  public void layout(int ncoords) {
-    // DONE
-    int stride = ncoords;
-    for (Knotspec knotspec = kspec; knotspec != null; knotspec = knotspec.next) {
-      knotspec.poststride = stride;
-      stride *= (knotspec.bend.getPointer() - knotspec.bbegin
-                 .getPointer())
-        * knotspec.order + knotspec.postoffset;
-      knotspec.preoffset *= knotspec.prestride;
-      knotspec.prewidth *= knotspec.poststride;
-      knotspec.postwidth *= knotspec.poststride;
-      knotspec.postoffset *= knotspec.poststride;
-      knotspec.ncoords = ncoords;
-    }
-    outcpts = new CArrayOfFloats(new float[stride]);
-
-  }
-
-  /**
-   * Prepares quilt for conversion
-   * @param quilt quilt to work with
-   */
-  public void setupquilt(Quilt quilt) {
-    // DONE
-    CArrayOfQuiltspecs qspec = new CArrayOfQuiltspecs(quilt.qspec);
-    quilt.eqspec = new CArrayOfQuiltspecs(qspec.getArray(), dim);
-    for (Knotspec knotspec = kspec; knotspec != null;) {
-      qspec.get().stride = knotspec.poststride;
-      qspec.get().width = knotspec.bend.getPointer()
-        - knotspec.bbegin.getPointer();
-      qspec.get().order = knotspec.order;
-      qspec.get().offset = knotspec.postoffset;
-      qspec.get().index = 0;
-      qspec.get().bdry[0] = (knotspec.kleft.getPointer() == knotspec.kfirst
-                             .getPointer()) ? 1 : 0;
-      qspec.get().bdry[1] = (knotspec.kright.getPointer() == knotspec.klast
-                             .getPointer()) ? 1 : 0;
-      qspec.get().breakpoints = new float[qspec.get().width + 1];
-      CArrayOfFloats k = new CArrayOfFloats(qspec.get().breakpoints, 0);
-      for (CArrayOfBreakpts bk = new CArrayOfBreakpts(knotspec.bbegin); bk
-             .getPointer() <= knotspec.bend.getPointer(); bk.pp()) {
-        k.set(bk.get().value);
-        k.pp();
-      }
-      knotspec = knotspec.next;
-      if (knotspec != null)
-        qspec.pp();
-    }
-    quilt.cpts = new CArrayOfFloats(outcpts);
-    quilt.next = null;
-  }
-
-  /**
-   * Copies array of control points to output array
-   * @param ctlarray control points array
-   */
-  public void copy(CArrayOfFloats ctlarray) {
-    // DONE
-    kspec.copy(ctlarray, outcpts);
-
-  }
-
-  /**
-   * Transforms knotspecs - conversion
-   */
-  public void transform() {
-    // DONE
-    Knotspec knotspec;
-    outcpts.setPointer(0);
-    for (knotspec = kspec; knotspec != null; knotspec = knotspec.next)
-      knotspec.istransformed = false;
-
-    for (knotspec = kspec; knotspec != null; knotspec = knotspec.next) {
-      for (Knotspec kspec2 = kspec; kspec2 != null; kspec2 = kspec2.next)
-        kspec2.kspectotrans = knotspec;
-      kspec.transform(outcpts);
-      knotspec.istransformed = true;
-    }
-
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Subdivider.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Subdivider.java
deleted file mode 100644
index 99c1b74..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Subdivider.java
+++ /dev/null
@@ -1,1167 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class working with curves and surfaces
- * @author Tomas Hrasky
- *
- */
-public class Subdivider {
-  /**
-   * Cull type 
-   */
-  public static final int CULL_TRIVIAL_REJECT = 0;
-
-  /**
-   * Cull type
-   */
-  public static final int CULL_ACCEPT = 1;
-
-  /**
-   * Maximum trimming arcs
-   */
-  private static final int MAXARCS = 10;
-
-  /**
-   * Linked list of Quilts
-   */
-  Quilt qlist;
-
-  /**
-   * Object holding rendering honts information
-   */
-  private Renderhints renderhints;
-
-  /**
-   * Backend object
-   */
-  private Backend backend;
-
-  /**
-   * Number of subdivisions
-   */
-  private int subdivisions;
-
-  /**
-   * U step when using domain distance sampling 
-   */
-  private float domain_distance_u_rate;
-
-  /**
-   * Use domain distance sampling
-   */
-  private int is_domain_distance_sampling;
-
-  /**
-   * Initial class holding trimming arcs
-   */
-  private Bin initialbin;
-
-  /**
-   * Not used
-   */
-  private boolean showDegenerate;
-
-  /**
-   * Is triming arc type bezier arc
-   */
-  private boolean isArcTypeBezier;
-
-  /**
-   * Breakpoints in v direction
-   */
-  private Flist tpbrkpts;
-
-  /**
-   * Breakpoints in u direction
-   */
-  private Flist spbrkpts;
-
-  /**
-   * Unused
-   */
-  private int s_index;
-
-  /**
-   * Head of linked list of trimming arcs
-   */
-  private Arc pjarc;
-
-  /**
-   * Class tesselating trimming arcs
-   */
-  private ArcTesselator arctesselator;
-
-  /**
-   * Unused
-   */
-  private int t_index;
-
-  /**
-   * Breakpoints
-   */
-  private Flist smbrkpts;
-
-  /**
-   * Not used
-   */
-  private float[] stepsizes;
-
-  /**
-   * Domain distance in V direction
-   */
-  private float domain_distance_v_rate;
-
-  /**
-   * Initializes quilt list
-   */
-  public void beginQuilts(Backend backend) {
-    // DONE
-    qlist = null;
-    renderhints = new Renderhints();
-    this.backend = backend;
-
-    initialbin = new Bin();
-    arctesselator = new ArcTesselator();
-  }
-
-  /**
-   * Adds quilt to linked list
-   * @param quilt added quilt
-   */
-  public void addQuilt(Quilt quilt) {
-    // DONE
-    if (qlist == null)
-      qlist = quilt;
-    else {
-      quilt.next = qlist;
-      qlist = quilt;
-    }
-
-  }
-
-  /**
-   * Empty method
-   */
-  public void endQuilts() {
-    // DONE
-  }
-
-  /**
-   * Draws a surface
-   */
-  public void drawSurfaces() {
-    renderhints.init();
-
-    if (qlist == null) {
-      //				System.out.println("qlist is null");
-      return;
-    }
-
-    for (Quilt q = qlist; q != null; q = q.next) {
-      if (q.isCulled() == CULL_TRIVIAL_REJECT) {
-        freejarcs(initialbin);
-        return;
-      }
-    }
-
-    float[] from = new float[2];
-    float[] to = new float[2];
-
-    spbrkpts = new Flist();
-    tpbrkpts = new Flist();
-    qlist.getRange(from, to, spbrkpts, tpbrkpts);
-
-    boolean optimize = (is_domain_distance_sampling > 0 && (renderhints.display_method != NurbsConsts.N_OUTLINE_PATCH));
-
-    // TODO decide whether to optimize (when there is gluNurbsProperty implemented)
-    optimize = true;
-
-    if (!initialbin.isnonempty()) {
-      if (!optimize) {
-        makeBorderTrim(from, to);
-      }
-    } else {
-      float[] rate = new float[2];
-      qlist.findRates(spbrkpts, tpbrkpts, rate);
-      //				System.out.println("subdivider.drawsurfaces decompose");
-    }
-
-    backend.bgnsurf(renderhints.wiretris, renderhints.wirequads);
-
-    // TODO partition test
-
-    if (!initialbin.isnonempty() && optimize) {
-
-      int i, j;
-      int num_u_steps;
-      int num_v_steps;
-      for (i = spbrkpts.start; i < spbrkpts.end - 1; i++) {
-        for (j = tpbrkpts.start; j < tpbrkpts.end - 1; j++) {
-          float[] pta = new float[2];
-          float[] ptb = new float[2];
-
-          pta[0] = spbrkpts.pts[i];
-          ptb[0] = spbrkpts.pts[i + 1];
-          pta[1] = tpbrkpts.pts[j];
-          ptb[1] = tpbrkpts.pts[j + 1];
-          qlist.downloadAll(pta, ptb, backend);
-
-          num_u_steps = (int) (domain_distance_u_rate * (ptb[0] - pta[0]));
-          num_v_steps = (int) (domain_distance_v_rate * (ptb[1] - pta[1]));
-
-          if (num_u_steps <= 0)
-            num_u_steps = 1;
-          if (num_v_steps <= 0)
-            num_v_steps = 1;
-
-          backend.surfgrid(pta[0], ptb[0], num_u_steps, ptb[1],
-                           pta[1], num_v_steps);
-          backend.surfmesh(0, 0, num_u_steps, num_v_steps);
-
-        }
-      }
-
-    } else
-
-      subdivideInS(initialbin);
-
-    backend.endsurf();
-  }
-
-  /**
-   * Empty method
-   * @param initialbin2
-   */
-  private void freejarcs(Bin initialbin2) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.freejarcs");
-  }
-
-  /**
-   * Subdivide in U direction
-   * @param source Trimming arcs source
-   */
-  private void subdivideInS(Bin source) {
-    // DONE
-    if (renderhints.display_method == NurbsConsts.N_OUTLINE_PARAM) {
-      outline(source);
-      freejarcs(source);
-    } else {
-      setArcTypeBezier();
-      setNonDegenerate();
-      splitInS(source, spbrkpts.start, spbrkpts.end);
-    }
-
-  }
-
-  /**
-   * Split in U direction
-   * @param source Trimming arcs source
-   * @param start breakpoints start
-   * @param end breakpoints end
-   */
-  private void splitInS(Bin source, int start, int end) {
-    // DONE
-    if (source.isnonempty()) {
-      if (start != end) {
-        int i = start + (end - start) / 2;
-        Bin left = new Bin();
-        Bin right = new Bin();
-
-        split(source, left, right, 0, spbrkpts.pts[i]);
-        splitInS(left, start, i);
-        splitInS(right, i + 1, end);
-      } else {
-        if (start == spbrkpts.start || start == spbrkpts.end) {
-          freejarcs(source);
-        } else if (renderhints.display_method == NurbsConsts.N_OUTLINE_PARAM_S) {
-          outline(source);
-          freejarcs(source);
-        } else {
-          setArcTypeBezier();
-          setNonDegenerate();
-          s_index = start;
-          splitInT(source, tpbrkpts.start, tpbrkpts.end);
-        }
-      }
-    } else{
-      //				System.out.println("Source is empty - subdivider.splitins");
-    }
-  }
-
-  /**
-   * Split in V direction
-   * @param source
-   * @param start
-   * @param end
-   */
-  private void splitInT(Bin source, int start, int end) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.splitint");
-
-    if (source.isnonempty()) {
-      if (start != end) {
-        int i = start + (end - start) / 2;
-        Bin left = new Bin();
-        Bin right = new Bin();
-        split(source, left, right, 1, tpbrkpts.pts[i + 1]);
-        splitInT(left, start, i);
-        splitInT(right, i + 1, end);
-      } else {
-        if (start == tpbrkpts.start || start == tpbrkpts.end) {
-          freejarcs(source);
-        } else if (renderhints.display_method == NurbsConsts.N_OUTLINE_PARAM_ST) {
-          outline(source);
-          freejarcs(source);
-        } else {
-          t_index = start;
-          setArcTypeBezier();
-          setDegenerate();
-
-          float[] pta = new float[2];
-          float[] ptb = new float[2];
-
-          pta[0] = spbrkpts.pts[s_index - 1];
-          pta[1] = tpbrkpts.pts[t_index - 1];
-
-          ptb[0] = spbrkpts.pts[s_index];
-          ptb[1] = tpbrkpts.pts[t_index];
-          qlist.downloadAll(pta, ptb, backend);
-
-          Patchlist patchlist = new Patchlist(qlist, pta, ptb);
-
-          samplingSplit(source, patchlist,
-                        renderhints.maxsubdivisions, 0);
-          setNonDegenerate();
-          setArcTypeBezier();
-        }
-      }
-    }
-
-  }
-
-  /**
-   * Sample 
-   * @param source
-   * @param patchlist
-   * @param subdivisions
-   * @param param
-   */
-  private void samplingSplit(Bin source, Patchlist patchlist,
-                             int subdivisions, int param) {
-    // DONE
-    if (!source.isnonempty())
-      return;
-    if (patchlist.cullCheck() == CULL_TRIVIAL_REJECT) {
-      freejarcs(source);
-      return;
-    }
-
-    patchlist.getstepsize();
-    if (renderhints.display_method == NurbsConsts.N_OUTLINE_PATCH) {
-      tesselation(source, patchlist);
-      outline(source);
-      freejarcs(source);
-      return;
-    }
-
-    tesselation(source, patchlist);
-    if (patchlist.needsSamplingSubdivision() && subdivisions > 0) {
-      if (!patchlist.needsSubdivision(0)) {
-        param = 1;
-      } else if (patchlist.needsSubdivision(1))
-        param = 0;
-      else
-        param = 1 - param;
-
-      Bin left = new Bin();
-      Bin right = new Bin();
-
-      float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
-
-      split(source, left, right, param, mid);
-      Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
-      samplingSplit(left, subpatchlist, subdivisions - 1, param);
-      samplingSplit(right, subpatchlist, subdivisions - 1, param);
-    } else {
-      setArcTypePwl();
-      setDegenerate();
-      nonSamplingSplit(source, patchlist, subdivisions, param);
-      setDegenerate();
-      setArcTypeBezier();
-    }
-  }
-
-  /**
-   * Not used
-   * @param source
-   * @param patchlist
-   * @param subdivisions
-   * @param param
-   */
-  private void nonSamplingSplit(Bin source, Patchlist patchlist,
-                                int subdivisions, int param) {
-    // DONE
-    if (patchlist.needsNonSamplingSubdivision() && subdivisions > 0) {
-      param = 1 - param;
-
-      Bin left = new Bin();
-      Bin right = new Bin();
-
-      float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
-      split(source, left, right, param, mid);
-      Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
-      if (left.isnonempty()) {
-        if (subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT)
-          freejarcs(left);
-        else
-          nonSamplingSplit(left, subpatchlist, subdivisions - 1,
-                           param);
-      }
-      if (right.isnonempty()) {
-        if (patchlist.cullCheck() == CULL_TRIVIAL_REJECT)
-          freejarcs(right);
-        else
-          nonSamplingSplit(right, subpatchlist, subdivisions - 1,
-                           param);
-      }
-    } else {
-      patchlist.bbox();
-      backend.patch(patchlist.pspec[0].range[0],
-                    patchlist.pspec[0].range[1], patchlist.pspec[1].range[0],
-                    patchlist.pspec[1].range[1]);
-      if (renderhints.display_method == NurbsConsts.N_OUTLINE_SUBDIV) {
-        outline(source);
-        freejarcs(source);
-      } else {
-        setArcTypePwl();
-        setDegenerate();
-        findIrregularS(source);
-        monosplitInS(source, smbrkpts.start, smbrkpts.end);
-      }
-    }
-
-  }
-
-  /**
-   * Not used
-   * @param source
-   * @param start
-   * @param end
-   */
-  private void monosplitInS(Bin source, int start, int end) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.monosplitins");
-  }
-
-  /**
-   * Not used
-   * @param source
-   */
-  private void findIrregularS(Bin source) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.findIrregularS");
-  }
-
-  /**
-   * Not used
-   */
-  private void setArcTypePwl() {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.setarctypepwl");
-  }
-
-  /**
-   * Not used
-   * @param source
-   * @param patchlist
-   */
-  private void tesselation(Bin source, Patchlist patchlist) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.tesselation");
-  }
-
-  /**
-   * Not used
-   */
-  private void setDegenerate() {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.setdegenerate");
-  }
-
-  /**
-   * Not used
-   * @param bin
-   * @param left
-   * @param right
-   * @param param
-   * @param value
-   */
-  private void split(Bin bin, Bin left, Bin right, int param, float value) {
-    // DONE
-    Bin intersections = new Bin();
-    Bin unknown = new Bin();
-
-    partition(bin, left, intersections, right, unknown, param, value);
-
-    int count = intersections.numarcs();
-    // TODO jumpbuffer ??
-
-    if (count % 2 == 0) {
-
-      Arc[] arclist = new Arc[MAXARCS];
-      CArrayOfArcs list;
-      if (count >= MAXARCS) {
-        list = new CArrayOfArcs(new Arc[count]);
-      } else {
-        list = new CArrayOfArcs(arclist);
-      }
-
-      CArrayOfArcs last, lptr;
-      Arc jarc;
-
-      for (last = new CArrayOfArcs(list); (jarc = intersections
-                                           .removearc()) != null; last.pp())
-        last.set(jarc);
-
-      if (param == 0) {// sort into incrasing t order
-        ArcSdirSorter sorter = new ArcSdirSorter(this);
-        sorter.qsort(list, count);
-
-        for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
-               .getPointer(); lptr.raisePointerBy(2))
-          check_s(lptr.get(), lptr.getRelative(1));
-        for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
-               .getPointer(); lptr.raisePointerBy(2))
-          join_s(left, right, lptr.get(), lptr.getRelative(1));
-        for (lptr = new CArrayOfArcs(list); lptr.getPointer() != last
-               .getPointer(); lptr.pp()) {
-          if (lptr.get().head()[0] <= value
-              && lptr.get().tail()[0] <= value)
-            left.addarc(lptr.get());
-          else
-            right.addarc(lptr.get());
-        }
-
-      } else {// sort into decreasing s order
-        ArcTdirSorter sorter = new ArcTdirSorter(this);
-        sorter.qsort(list, count);
-
-        for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
-               .getPointer(); lptr.raisePointerBy(2))
-          check_t(lptr.get(), lptr.getRelative(1));
-        for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
-               .getPointer(); lptr.raisePointerBy(2))
-          join_t(left, right, lptr.get(), lptr.getRelative(1));
-        for (lptr = new CArrayOfArcs(list); lptr.getPointer() != last
-               .getPointer(); lptr.raisePointerBy(2)) {
-          if (lptr.get().head()[0] <= value
-              && lptr.get().tail()[0] <= value)
-            left.addarc(lptr.get());
-          else
-            right.addarc(lptr.get());
-        }
-
-      }
-
-      unknown.adopt();
-    }
-  }
-
-  /**
-   * Not used
-   * @param left
-   * @param right
-   * @param arc
-   * @param relative
-   */
-  private void join_t(Bin left, Bin right, Arc arc, Arc relative) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.join_t");
-  }
-
-  /**
-   * Not used
-   * @param arc
-   * @param relative
-   */
-  private void check_t(Arc arc, Arc relative) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.check_t");
-  }
-
-  /**
-   * Not used
-   * @param left
-   * @param right
-   * @param jarc1
-   * @param jarc2
-   */
-  private void join_s(Bin left, Bin right, Arc jarc1, Arc jarc2) {
-    // DONE
-    if (!jarc1.getitail())
-      jarc1 = jarc1.next;
-    if (!jarc2.getitail())
-      jarc2 = jarc2.next;
-
-    float s = jarc1.tail()[0];
-    float t1 = jarc1.tail()[1];
-    float t2 = jarc2.tail()[1];
-
-    if (t1 == t2) {
-      simplelink(jarc1, jarc2);
-    } else {
-      Arc newright = new Arc(Arc.ARC_RIGHT);
-      Arc newleft = new Arc(Arc.ARC_LEFT);
-      if (isBezierArcType()) {
-        arctesselator.bezier(newright, s, s, t1, t2);
-        arctesselator.bezier(newleft, s, s, t2, t1);
-      } else {
-        arctesselator.pwl_right(newright, s, t1, t2, stepsizes[0]);
-        arctesselator.pwl_left(newright, s, t2, t1, stepsizes[2]);
-      }
-      link(jarc1, jarc2, newright, newleft);
-      left.addarc(newright);
-      right.addarc(newleft);
-    }
-
-  }
-
-  /**
-   * Not used
-   * @param jarc1
-   * @param jarc2
-   * @param newright
-   * @param newleft
-   */
-  private void link(Arc jarc1, Arc jarc2, Arc newright, Arc newleft) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.link");
-  }
-
-  /**
-   * Not used
-   * @return true
-   */
-  private boolean isBezierArcType() {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.isbezierarc");
-    return true;
-  }
-
-  /**
-   * Not used
-   * @param jarc1
-   * @param jarc2
-   */
-  private void simplelink(Arc jarc1, Arc jarc2) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.simplelink");
-  }
-
-  /**
-   * Not used
-   * @param arc
-   * @param relative
-   */
-  private void check_s(Arc arc, Arc relative) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.check_s");
-
-  }
-
-  /**
-   * Not used
-   * @param bin
-   * @param left
-   * @param intersections
-   * @param right
-   * @param unknown
-   * @param param
-   * @param value
-   */
-  private void partition(Bin bin, Bin left, Bin intersections, Bin right,
-                         Bin unknown, int param, float value) {
-
-    Bin headonleft = new Bin();
-    Bin headonright = new Bin();
-    Bin tailonleft = new Bin();
-    Bin tailonright = new Bin();
-
-    for (Arc jarc = bin.removearc(); jarc != null; jarc = bin.removearc()) {
-      float tdiff = jarc.tail()[param] - value;
-      float hdiff = jarc.head()[param] - value;
-
-      if (tdiff > 0) {
-        if (hdiff > 0) {
-          right.addarc(jarc);
-        } else if (hdiff == 0) {
-          tailonright.addarc(jarc);
-        } else {
-          Arc jtemp;
-          switch (arc_split(jarc, param, value, 0)) {
-          case 2:
-            tailonright.addarc(jarc);
-            headonleft.addarc(jarc.next);
-            break;
-            // TODO rest cases
-          default:
-            System.out
-              .println("TODO subdivider.partition rest cases");
-            break;
-          }
-        }
-      } else if (tdiff == 0) {
-        if (hdiff > 0) {
-          headonright.addarc(jarc);
-        } else if (hdiff == 0) {
-          unknown.addarc(jarc);
-        } else {
-          headonright.addarc(jarc);
-        }
-      } else {
-        if (hdiff > 0) {
-          // TODO rest
-          //						System.out.println("TODO subdivider.partition rest of else");
-        } else if (hdiff == 0) {
-          tailonleft.addarc(jarc);
-        } else {
-          left.addarc(jarc);
-        }
-      }
-
-    }
-    if (param == 0) {
-      classify_headonleft_s(headonleft, intersections, left, value);
-      classify_tailonleft_s(tailonleft, intersections, left, value);
-      classify_headonright_s(headonright, intersections, right, value);
-      classify_tailonright_s(tailonright, intersections, right, value);
-    } else {
-      classify_headonleft_t(headonleft, intersections, left, value);
-      classify_tailonleft_t(tailonleft, intersections, left, value);
-      classify_headonright_t(headonright, intersections, right, value);
-      classify_tailonright_t(tailonright, intersections, right, value);
-    }
-  }
-
-  /**
-   * Not used
-   * @param tailonright
-   * @param intersections
-   * @param right
-   * @param value
-   */
-  private void classify_tailonright_t(Bin tailonright, Bin intersections,
-                                      Bin right, float value) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.classify_tailonright_t");
-
-  }
-
-  /**
-   * Not used
-   * @param bin
-   * @param in
-   * @param out
-   * @param val
-   */
-  private void classify_tailonleft_s(Bin bin, Bin in, Bin out, float val) {
-
-    // DONE
-    Arc j;
-    while ((j = bin.removearc()) != null) {
-      j.clearitail();
-
-      float diff = j.next.head()[0] - val;
-      if (diff > 0) {
-        in.addarc(j);
-      } else if (diff < 0) {
-        if (ccwTurn_sl(j, j.next))
-          out.addarc(j);
-        else
-          in.addarc(j);
-      } else {
-        if (j.next.tail()[1] > j.next.head()[1])
-          in.addarc(j);
-        else
-          out.addarc(j);
-      }
-    }
-
-  }
-
-  /**
-   * Not used
-   * @param bin
-   * @param in
-   * @param out
-   * @param val
-   */
-  private void classify_headonright_s(Bin bin, Bin in, Bin out, float val) {
-    // DONE
-    Arc j;
-    while ((j = bin.removearc()) != null) {
-      j.setitail();
-
-      float diff = j.prev.tail()[0] - val;
-      if (diff > 0) {
-        if (ccwTurn_sr(j.prev, j))
-          out.addarc(j);
-        else
-          in.addarc(j);
-      } else if (diff < 0) {
-        out.addarc(j);
-      } else {
-        if (j.prev.tail()[1] > j.prev.head()[1])
-          out.addarc(j);
-        else
-          in.addarc(j);
-      }
-    }
-  }
-
-  /**
-   * Not used
-   * @param prev
-   * @param j
-   * @return false
-   */
-  private boolean ccwTurn_sr(Arc prev, Arc j) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO ccwTurn_sr");
-    return false;
-  }
-
-  /**
-   * Not used
-   * @param headonright
-   * @param intersections
-   * @param right
-   * @param value
-   */
-  private void classify_headonright_t(Bin headonright, Bin intersections,
-                                      Bin right, float value) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.classify_headonright_t");
-  }
-
-  /**
-   * Not used
-   * @param tailonleft
-   * @param intersections
-   * @param left
-   * @param value
-   */
-  private void classify_tailonleft_t(Bin tailonleft, Bin intersections,
-                                     Bin left, float value) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.classify_tailonleft_t");
-  }
-
-  /**
-   * Not used
-   * @param bin
-   * @param in
-   * @param out
-   * @param val
-   */
-  private void classify_headonleft_t(Bin bin, Bin in, Bin out, float val) {
-    // DONE
-    Arc j;
-    while ((j = bin.removearc()) != null) {
-      j.setitail();
-
-      float diff = j.prev.tail()[1] - val;
-      if (diff > 0) {
-        out.addarc(j);
-      } else if (diff < 0) {
-        if (ccwTurn_tl(j.prev, j))
-          out.addarc(j);
-        else
-          in.addarc(j);
-      } else {
-        if (j.prev.tail()[0] > j.prev.head()[0])
-          out.addarc(j);
-        else
-          in.addarc(j);
-      }
-    }
-  }
-
-  /**
-   * Not used
-   * @param prev
-   * @param j
-   * @return false
-   */
-  private boolean ccwTurn_tl(Arc prev, Arc j) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.ccwTurn_tl");
-    return false;
-  }
-
-  /**
-   * Not used
-   * @param bin
-   * @param in
-   * @param out
-   * @param val
-   */
-  private void classify_tailonright_s(Bin bin, Bin in, Bin out, float val) {
-    // DONE
-    Arc j;
-    while ((j = bin.removearc()) != null) {
-      j.clearitail();
-
-      float diff = j.next.head()[0] - val;
-      if (diff > 0) {
-        if (ccwTurn_sr(j, j.next))
-          out.addarc(j);
-        else
-          in.addarc(j);
-      } else if (diff < 0) {
-        in.addarc(j);
-      } else {
-        if (j.next.tail()[1] > j.next.head()[1])
-          out.addarc(j);
-        else
-          in.addarc(j);
-      }
-    }
-
-  }
-
-  /**
-   * Not used
-   * @param bin
-   * @param in
-   * @param out
-   * @param val
-   */
-  private void classify_headonleft_s(Bin bin, Bin in, Bin out, float val) {
-    // DONE
-    Arc j;
-    while ((j = bin.removearc()) != null) {
-      j.setitail();
-
-      float diff = j.prev.tail()[0] - val;
-      if (diff > 0) {
-        out.addarc(j);
-      } else if (diff < 0) {
-        if (ccwTurn_sl(j.prev, j))
-          out.addarc(j);
-        else
-          in.addarc(j);
-      } else {
-        if (j.prev.tail()[1] > j.prev.head()[1])
-          in.addarc(j);
-        else
-          out.addarc(j);
-      }
-    }
-
-  }
-
-  /**
-   * Not used
-   * @param prev
-   * @param j
-   * @return false
-   */
-  private boolean ccwTurn_sl(Arc prev, Arc j) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.ccwTurn_sl");
-    return false;
-  }
-
-  /**
-   * Not used
-   * @param jarc
-   * @param param
-   * @param value
-   * @param i
-   * @return 0
-   */
-  private int arc_split(Arc jarc, int param, float value, int i) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.arc_split");
-    return 0;
-  }
-
-  /**
-   * Not used
-   */
-  private void setNonDegenerate() {
-    // DONE
-    this.showDegenerate = false;
-
-  }
-
-  /**
-   * sets trimming arc default type to bezier
-   */
-  private void setArcTypeBezier() {
-    // DONE
-    isArcTypeBezier = true;
-  }
-
-  /**
-   * Not used
-   * @param source
-   */
-  private void outline(Bin source) {
-    // TODO Auto-generated method stub
-    //			System.out.println("TODO subdivider.outline");
-  }
-
-  /**
-   * Makes default trim along surface borders
-   * @param from range beginnings
-   * @param to range ends
-   */
-  private void makeBorderTrim(float[] from, float[] to) {
-    // DONE
-    float smin = from[0];
-    float smax = to[0];
-
-    float tmin = from[1];
-    float tmax = to[1];
-
-    pjarc = null;
-    Arc jarc = null;
-
-    jarc = new Arc(Arc.ARC_BOTTOM);
-    arctesselator.bezier(jarc, smin, smax, tmin, tmin);
-    initialbin.addarc(jarc);
-    pjarc = jarc.append(pjarc);
-
-    jarc = new Arc(Arc.ARC_RIGHT);
-    arctesselator.bezier(jarc, smax, smax, tmin, tmax);
-    initialbin.addarc(jarc);
-    pjarc = jarc.append(pjarc);
-
-    jarc = new Arc(Arc.ARC_TOP);
-    arctesselator.bezier(jarc, smax, smin, tmax, tmax);
-    initialbin.addarc(jarc);
-    pjarc = jarc.append(pjarc);
-
-    jarc = new Arc(Arc.ARC_LEFT);
-    arctesselator.bezier(jarc, smin, smin, tmax, tmin);
-    initialbin.addarc(jarc);
-    jarc = jarc.append(pjarc);
-
-    // assert (jarc.check() == true);
-  }
-
-  /**
-   * Draws NURBS curve
-   */
-  public void drawCurves() {
-    // DONE
-    float[] from = new float[1];
-    float[] to = new float[1];
-
-    Flist bpts = new Flist();
-    qlist.getRange(from, to, bpts);
-
-    renderhints.init();
-
-    backend.bgncurv();
-
-    for (int i = bpts.start; i < bpts.end - 1; i++) {
-      float[] pta = new float[1];
-      float[] ptb = new float[1];
-      pta[0] = bpts.pts[i];
-      ptb[0] = bpts.pts[i + 1];
-
-      qlist.downloadAll(pta, ptb, backend);
-      Curvelist curvelist = new Curvelist(qlist, pta, ptb);
-      samplingSplit(curvelist, renderhints.maxsubdivisions);
-    }
-    backend.endcurv();
-  }
-
-  /**
-   * Samples a curve in case of need, or sends curve to backend
-   * @param curvelist list of curves
-   * @param maxsubdivisions maximum number of subdivisions
-   */
-  private void samplingSplit(Curvelist curvelist, int maxsubdivisions) {
-    if (curvelist.cullCheck() == CULL_TRIVIAL_REJECT)
-      return;
-
-    curvelist.getstepsize();
-
-    if (curvelist.needsSamplingSubdivision() && (subdivisions > 0)) {
-      // TODO kód
-      //				System.out.println("TODO subdivider-needsSamplingSubdivision");
-    } else {
-      int nu = (int) (1 + curvelist.range[2] / curvelist.stepsize);
-      backend.curvgrid(curvelist.range[0], curvelist.range[1], nu);
-      backend.curvmesh(0, nu);
-    }
-
-  }
-
-  /**
-   * Sets new domain_distance_u_rate value
-   * @param d new domain_distance_u_rate value
-
-  */
-  public void set_domain_distance_u_rate(double d) {
-    // DONE
-    domain_distance_u_rate = (float) d;
-  }
-
-  /**
-   * Sets new domain_distance_v_rate value
-   * @param d new domain_distance_v_rate value
-   */
-  public void set_domain_distance_v_rate(double d) {
-    // DONE
-    domain_distance_v_rate = (float) d;
-  }
-
-  /**
-   * Sets new is_domain_distance_sampling value
-   * @param i new is_domain_distance_sampling value
-   */
-  public void set_is_domain_distance_sampling(int i) {
-    // DONE
-    this.is_domain_distance_sampling = i;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/SurfaceEvaluator.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/SurfaceEvaluator.java
deleted file mode 100644
index fe23f9c..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/SurfaceEvaluator.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Class rendering surfaces with OpenGL
- * @author Tomas Hrasky
- *
- */
-public interface SurfaceEvaluator {
-
-  /**
-   * Pushes eval bit
-   */
-  public void bgnmap2f() ;
-
-  /**
-   * Sets  glPolygonMode
-   * @param style polygon mode (N_MESHFILL/N_MESHLINE/N_MESHPOINT)
-   */
-  public void polymode(int style) ;
-
-  /**
-   * Pops all attributes
-   */
-  public void endmap2f() ;
-
-  /**
-   * Empty method
-   * @param ulo
-   * @param uhi
-   * @param vlo
-   * @param vhi
-   */
-  public void domain2f(float ulo, float uhi, float vlo, float vhi) ;
-
-  /**
-   * Defines 2D mesh
-   * @param nu number of steps in u direction
-   * @param u0 lowest u
-   * @param u1 highest u
-   * @param nv number of steps in v direction
-   * @param v0 lowest v
-   * @param v1 highest v
-   */
-  public void mapgrid2f(int nu, float u0, float u1, int nv, float v0, float v1) ;
-
-  /**
-   * Evaluates surface
-   * @param style surface style
-   * @param umin minimum U
-   * @param umax maximum U
-   * @param vmin minimum V
-   * @param vmax maximum V
-   */
-  public void mapmesh2f(int style, int umin, int umax, int vmin, int vmax) ;
-
-  /**
-   * Initializes evaluator
-   * @param type surface type
-   * @param ulo lowest u
-   * @param uhi highest u
-   * @param ustride number of objects between control points in u direction
-   * @param uorder surface order in u direction
-   * @param vlo lowest v
-   * @param vhi highest v
-   * @param vstride number of control points' coords
-   * @param vorder surface order in v direction
-   * @param pts control points
-   */
-  public void map2f(int type, float ulo, float uhi, int ustride, int uorder,
-                    float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) ;
-
-  /**
-   * Calls opengl enable
-   * @param type what to enable
-   */
-  public void enable(int type) ;
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/TrimVertex.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/TrimVertex.java
deleted file mode 100644
index 6608f8f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/TrimVertex.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.jogamp.opengl.impl.glu.nurbs;
-
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-/**
- * Holds vertex used in trim
- * 
- * @author Tomas Hrasky
- * 
- */
-public class TrimVertex {
-
-  /**
-   * Trim vertex coords
-   */
-  public float[] param;
-
-  /**
-   * Makes new empty trim vertex
-   */
-  public TrimVertex() {
-    param = new float[2];
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/registry/Registry.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/registry/Registry.java
deleted file mode 100644
index 21b15f4..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/registry/Registry.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * License Applicability. Except to the extent portions of this file are
- * made subject to an alternative license as permitted in the SGI Free
- * Software License B, Version 2.0 (the "License"), the contents of this
- * file are subject only to the provisions of the License. You may not use
- * this file except in compliance with the License. You may obtain a copy
- * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- * 
- * http://oss.sgi.com/projects/FreeB
- * 
- * Note that, as provided in the License, the Software is distributed on an
- * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- * 
- * NOTE:  The Original Code (as defined below) has been licensed to Sun
- * Microsystems, Inc. ("Sun") under the SGI Free Software License B
- * (Version 1.1), shown above ("SGI License").   Pursuant to Section
- * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
- * you under an alternative license ("Alternative License").  This
- * Alternative License includes all of the provisions of the SGI License
- * except that Section 2.2 and 11 are omitted.  Any differences between
- * the Alternative License and the SGI License are offered solely by Sun
- * and not by SGI.
- *
- * Original Code. The Original Code is: OpenGL Sample Implementation,
- * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- * Copyright in any portions created by third parties is as indicated
- * elsewhere herein. All Rights Reserved.
- * 
- * Additional Notice Provisions: The application programming interfaces
- * established by SGI in conjunction with the Original Code are The
- * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- * Window System(R) (Version 1.3), released October 19, 1998. This software
- * was created using the OpenGL(R) version 1.2.1 Sample Implementation
- * published by SGI, but has not been independently verified as being
- * compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
-package com.jogamp.opengl.impl.glu.registry;
-
-import javax.media.opengl.glu.GLU;
-
-/**
- *
- * @author  Administrator
- */
-public class Registry {
-  
-  /** Creates a new instance of Registry */
-  public Registry() {
-  }
-  
-  public static String gluGetString(int name) {
-    if( name == GLU.GLU_VERSION ) {
-      return( "1.3" );
-    } else if( name == GLU.GLU_EXTENSIONS ) {
-      return( "GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess " );
-    }
-    return( null );
-  }
-  
-  public static boolean gluCheckExtension( String extName, String extString ) {
-    if( extName == null || extString == null ) {
-      return( false );
-    }
-    if ((extString.indexOf(extName + " ") >= 0) ||
-        extString.endsWith(extName) ||
-        extString.equals(extName)) {
-        return true;
-    }
-    return false;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/ActiveRegion.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/ActiveRegion.java
deleted file mode 100644
index 85397dd..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/ActiveRegion.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-
-class ActiveRegion {
-    GLUhalfEdge eUp;		/* upper edge, directed right to left */
-    DictNode nodeUp;	/* dictionary node corresponding to eUp */
-    int windingNumber;	/* used to determine which regions are
-                                 * inside the polygon */
-    boolean inside;		/* is this region inside the polygon? */
-    boolean sentinel;	/* marks fake edges at t = +/-infinity */
-    boolean dirty;		/* marks regions where the upper or lower
-                                 * edge has changed, but we haven't checked
-                                 * whether they intersect yet */
-    boolean fixUpperEdge;	/* marks temporary edges introduced when
-                                 * we process a "right vertex" (one without
-                                 * any edges leaving to the right) */
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/CachedVertex.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/CachedVertex.java
deleted file mode 100644
index 8948acf..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/CachedVertex.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class CachedVertex {
-    public double[] coords = new double[3];
-    public Object data;
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Dict.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Dict.java
deleted file mode 100644
index d26948e..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Dict.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class Dict {
-    DictNode head;
-    Object frame;
-    DictLeq leq;
-
-    private Dict() {
-    }
-
-    static Dict dictNewDict(Object frame, DictLeq leq) {
-        Dict dict = new Dict();
-        dict.head = new DictNode();
-
-        dict.head.key = null;
-        dict.head.next = dict.head;
-        dict.head.prev = dict.head;
-
-        dict.frame = frame;
-        dict.leq = leq;
-
-        return dict;
-    }
-
-    static void dictDeleteDict(Dict dict) {
-        dict.head = null;
-        dict.frame = null;
-        dict.leq = null;
-    }
-
-    static DictNode dictInsert(Dict dict, Object key) {
-        return dictInsertBefore(dict, dict.head, key);
-    }
-
-    static DictNode dictInsertBefore(Dict dict, DictNode node, Object key) {
-        do {
-            node = node.prev;
-        } while (node.key != null && !dict.leq.leq(dict.frame, node.key, key));
-
-        DictNode newNode = new DictNode();
-        newNode.key = key;
-        newNode.next = node.next;
-        node.next.prev = newNode;
-        newNode.prev = node;
-        node.next = newNode;
-
-        return newNode;
-    }
-
-    static Object dictKey(DictNode aNode) {
-        return aNode.key;
-    }
-
-    static DictNode dictSucc(DictNode aNode) {
-        return aNode.next;
-    }
-
-    static DictNode dictPred(DictNode aNode) {
-        return aNode.prev;
-    }
-
-    static DictNode dictMin(Dict aDict) {
-        return aDict.head.next;
-    }
-
-    static DictNode dictMax(Dict aDict) {
-        return aDict.head.prev;
-    }
-
-    static void dictDelete(Dict dict, DictNode node) {
-        node.next.prev = node.prev;
-        node.prev.next = node.next;
-    }
-
-    static DictNode dictSearch(Dict dict, Object key) {
-        DictNode node = dict.head;
-
-        do {
-            node = node.next;
-        } while (node.key != null && !(dict.leq.leq(dict.frame, key, node.key)));
-
-        return node;
-    }
-
-    public interface DictLeq {
-        boolean leq(Object frame, Object key1, Object key2);
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/DictNode.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/DictNode.java
deleted file mode 100644
index 8864de1..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/DictNode.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class DictNode {
-    Object key;
-    DictNode next;
-    DictNode prev;
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUface.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUface.java
deleted file mode 100644
index 2ff4aae..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUface.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class GLUface {
-    public GLUface next;		/* next face (never NULL) */
-    public GLUface prev;		/* previous face (never NULL) */
-    public GLUhalfEdge anEdge;	/* a half edge with this left face */
-    public Object data;		/* room for client's data */
-
-    /* Internal data (keep hidden) */
-    public GLUface trail;		/* "stack" for conversion to strips */
-    public boolean marked;		/* flag for conversion to strips */
-    public boolean inside;		/* this face is in the polygon interior */
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUhalfEdge.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUhalfEdge.java
deleted file mode 100644
index c2128b6..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUhalfEdge.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class GLUhalfEdge {
-    public GLUhalfEdge next;		/* doubly-linked list (prev==Sym->next) */
-    public GLUhalfEdge Sym;		/* same edge, opposite direction */
-    public GLUhalfEdge Onext;		/* next edge CCW around origin */
-    public GLUhalfEdge Lnext;		/* next edge CCW around left face */
-    public GLUvertex Org;		/* origin vertex (Overtex too long) */
-    public com.jogamp.opengl.impl.glu.tessellator.GLUface Lface;		/* left face */
-
-    /* Internal data (keep hidden) */
-    public com.jogamp.opengl.impl.glu.tessellator.ActiveRegion activeRegion;	/* a region with this upper edge (sweep.c) */
-    public int winding;	/* change in winding number when crossing */
-    public boolean first;
-
-    public GLUhalfEdge(boolean first) {
-        this.first = first;
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUmesh.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUmesh.java
deleted file mode 100644
index 493eb20..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUmesh.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class GLUmesh {
-    GLUvertex vHead = new GLUvertex();		/* dummy header for vertex list */
-    com.jogamp.opengl.impl.glu.tessellator.GLUface fHead = new GLUface();		/* dummy header for face list */
-    com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eHead = new GLUhalfEdge(true);		/* dummy header for edge list */
-    com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eHeadSym = new GLUhalfEdge(false);	/* and its symmetric counterpart */
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUtessellatorImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUtessellatorImpl.java
deleted file mode 100644
index b219983..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUtessellatorImpl.java
+++ /dev/null
@@ -1,646 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-import com.jogamp.opengl.impl.glu.tessellator.*;
-import javax.media.opengl.*;
-import javax.media.opengl.glu.*;
-
-public class GLUtessellatorImpl implements GLUtessellator {
-    public static final int TESS_MAX_CACHE = 100;
-
-    private int state;		/* what begin/end calls have we seen? */
-
-    private GLUhalfEdge lastEdge;	/* lastEdge->Org is the most recent vertex */
-    GLUmesh mesh;		/* stores the input contours, and eventually
-                                   the tessellation itself */
-
-    /*** state needed for projecting onto the sweep plane ***/
-
-    double[] normal = new double[3];	/* user-specified normal (if provided) */
-    double[] sUnit = new double[3];	/* unit vector in s-direction (debugging) */
-    double[] tUnit = new double[3];	/* unit vector in t-direction (debugging) */
-
-    /*** state needed for the line sweep ***/
-
-    private double relTolerance;	/* tolerance for merging features */
-    int windingRule;	/* rule for determining polygon interior */
-    boolean fatalError;	/* fatal error: needed combine callback */
-
-    Dict dict;		/* edge dictionary for sweep line */
-    PriorityQ pq;		/* priority queue of vertex events */
-    GLUvertex event;		/* current sweep event being processed */
-
-    /*** state needed for rendering callbacks (see render.c) ***/
-
-    boolean flagBoundary;	/* mark boundary edges (use EdgeFlag) */
-    boolean boundaryOnly;	/* Extract contours, not triangles */
-    boolean avoidDegenerateTris; /* JOGL-specific hint to try to improve triangulation
-                                    by avoiding producing degenerate (zero-area) triangles;
-                                    has not been tested exhaustively and is therefore an option */
-
-    GLUface lonelyTriList;
-    /* list of triangles which could not be rendered as strips or fans */
-
-
-
-    /*** state needed to cache single-contour polygons for renderCache() */
-
-    private boolean flushCacheOnNextVertex;		/* empty cache on next vertex() call */
-    int cacheCount;		/* number of cached vertices */
-    CachedVertex[] cache = new CachedVertex[TESS_MAX_CACHE];	/* the vertex data */
-
-    /*** rendering callbacks that also pass polygon data  ***/
-    private Object polygonData;		/* client data for current polygon */
-
-    private GLUtessellatorCallback callBegin;
-    private GLUtessellatorCallback callEdgeFlag;
-    private GLUtessellatorCallback callVertex;
-    private GLUtessellatorCallback callEnd;
-//    private GLUtessellatorCallback callMesh;
-    private GLUtessellatorCallback callError;
-    private GLUtessellatorCallback callCombine;
-
-    private GLUtessellatorCallback callBeginData;
-    private GLUtessellatorCallback callEdgeFlagData;
-    private GLUtessellatorCallback callVertexData;
-    private GLUtessellatorCallback callEndData;
-//    private GLUtessellatorCallback callMeshData;
-    private GLUtessellatorCallback callErrorData;
-    private GLUtessellatorCallback callCombineData;
-
-    private static final double GLU_TESS_DEFAULT_TOLERANCE = 0.0;
-//    private static final int GLU_TESS_MESH = 100112;	/* void (*)(GLUmesh *mesh)	    */
-    private static GLUtessellatorCallback NULL_CB = new GLUtessellatorCallbackAdapter();
-
-//    #define MAX_FAST_ALLOC	(MAX(sizeof(EdgePair), \
-//                 MAX(sizeof(GLUvertex),sizeof(GLUface))))
-
-    private GLUtessellatorImpl() {
-        state = TessState.T_DORMANT;
-
-        normal[0] = 0;
-        normal[1] = 0;
-        normal[2] = 0;
-
-        relTolerance = GLU_TESS_DEFAULT_TOLERANCE;
-        windingRule = GLU.GLU_TESS_WINDING_ODD;
-        flagBoundary = false;
-        boundaryOnly = false;
-
-        callBegin = NULL_CB;
-        callEdgeFlag = NULL_CB;
-        callVertex = NULL_CB;
-        callEnd = NULL_CB;
-        callError = NULL_CB;
-        callCombine = NULL_CB;
-//        callMesh = NULL_CB;
-
-        callBeginData = NULL_CB;
-        callEdgeFlagData = NULL_CB;
-        callVertexData = NULL_CB;
-        callEndData = NULL_CB;
-        callErrorData = NULL_CB;
-        callCombineData = NULL_CB;
-
-        polygonData = null;
-
-        for (int i = 0; i < cache.length; i++) {
-            cache[i] = new CachedVertex();
-        }
-    }
-
-    static public GLUtessellator gluNewTess()
-    {
-        return new GLUtessellatorImpl();
-    }
-
-
-    private void makeDormant() {
-        /* Return the tessellator to its original dormant state. */
-
-        if (mesh != null) {
-            Mesh.__gl_meshDeleteMesh(mesh);
-        }
-        state = TessState.T_DORMANT;
-        lastEdge = null;
-        mesh = null;
-    }
-
-    private void requireState(int newState) {
-        if (state != newState) gotoState(newState);
-    }
-
-    private void gotoState(int newState) {
-        while (state != newState) {
-            /* We change the current state one level at a time, to get to
-             * the desired state.
-             */
-            if (state < newState) {
-                if (state == TessState.T_DORMANT) {
-                    callErrorOrErrorData(GLU.GLU_TESS_MISSING_BEGIN_POLYGON);
-                    gluTessBeginPolygon(null);
-                } else if (state == TessState.T_IN_POLYGON) {
-                    callErrorOrErrorData(GLU.GLU_TESS_MISSING_BEGIN_CONTOUR);
-                    gluTessBeginContour();
-                }
-            } else {
-                if (state == TessState.T_IN_CONTOUR) {
-                    callErrorOrErrorData(GLU.GLU_TESS_MISSING_END_CONTOUR);
-                    gluTessEndContour();
-                } else if (state == TessState.T_IN_POLYGON) {
-                    callErrorOrErrorData(GLU.GLU_TESS_MISSING_END_POLYGON);
-                    /* gluTessEndPolygon( tess ) is too much work! */
-                    makeDormant();
-                }
-            }
-        }
-    }
-
-    public void gluDeleteTess() {
-        requireState(TessState.T_DORMANT);
-    }
-
-    public void gluTessProperty(int which, double value) {
-        switch (which) {
-            case GLU.GLU_TESS_TOLERANCE:
-                if (value < 0.0 || value > 1.0) break;
-                relTolerance = value;
-                return;
-
-            case GLU.GLU_TESS_WINDING_RULE:
-                int windingRule = (int) value;
-                if (windingRule != value) break;	/* not an integer */
-
-                switch (windingRule) {
-                    case GLU.GLU_TESS_WINDING_ODD:
-                    case GLU.GLU_TESS_WINDING_NONZERO:
-                    case GLU.GLU_TESS_WINDING_POSITIVE:
-                    case GLU.GLU_TESS_WINDING_NEGATIVE:
-                    case GLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
-                        this.windingRule = windingRule;
-                        return;
-                    default:
-                        break;
-                }
-
-            case GLU.GLU_TESS_BOUNDARY_ONLY:
-                boundaryOnly = (value != 0);
-                return;
-
-            case GLU.GLU_TESS_AVOID_DEGENERATE_TRIANGLES:
-                avoidDegenerateTris = (value != 0);
-                return;
-
-            default:
-                callErrorOrErrorData(GLU.GLU_INVALID_ENUM);
-                return;
-        }
-        callErrorOrErrorData(GLU.GLU_INVALID_VALUE);
-    }
-
-/* Returns tessellator property */
-    public void gluGetTessProperty(int which, double[] value, int value_offset) {
-        switch (which) {
-            case GLU.GLU_TESS_TOLERANCE:
-/* tolerance should be in range [0..1] */
-                assert (0.0 <= relTolerance && relTolerance <= 1.0);
-                value[value_offset] = relTolerance;
-                break;
-            case GLU.GLU_TESS_WINDING_RULE:
-                assert (windingRule == GLU.GLU_TESS_WINDING_ODD ||
-                        windingRule == GLU.GLU_TESS_WINDING_NONZERO ||
-                        windingRule == GLU.GLU_TESS_WINDING_POSITIVE ||
-                        windingRule == GLU.GLU_TESS_WINDING_NEGATIVE ||
-                        windingRule == GLU.GLU_TESS_WINDING_ABS_GEQ_TWO);
-                value[value_offset] = windingRule;
-                break;
-            case GLU.GLU_TESS_BOUNDARY_ONLY:
-                assert (boundaryOnly == true || boundaryOnly == false);
-                value[value_offset] = boundaryOnly ? 1 : 0;
-                break;
-            case GLU.GLU_TESS_AVOID_DEGENERATE_TRIANGLES:
-                value[value_offset] = avoidDegenerateTris ? 1 : 0;
-                break;
-            default:
-                value[value_offset] = 0.0;
-                callErrorOrErrorData(GLU.GLU_INVALID_ENUM);
-                break;
-        }
-    } /* gluGetTessProperty() */
-
-    public void gluTessNormal(double x, double y, double z) {
-        normal[0] = x;
-        normal[1] = y;
-        normal[2] = z;
-    }
-
-    public void gluTessCallback(int which, GLUtessellatorCallback aCallback) {
-        switch (which) {
-            case GLU.GLU_TESS_BEGIN:
-                callBegin = aCallback == null ? NULL_CB : aCallback;
-                return;
-            case GLU.GLU_TESS_BEGIN_DATA:
-                callBeginData = aCallback == null ? NULL_CB : aCallback;
-                return;
-            case GLU.GLU_TESS_EDGE_FLAG:
-                callEdgeFlag = aCallback == null ? NULL_CB : aCallback;
-/* If the client wants boundary edges to be flagged,
- * we render everything as separate triangles (no strips or fans).
- */
-                flagBoundary = aCallback != null;
-                return;
-            case GLU.GLU_TESS_EDGE_FLAG_DATA:
-                callEdgeFlagData = callBegin = aCallback == null ? NULL_CB : aCallback;
-/* If the client wants boundary edges to be flagged,
- * we render everything as separate triangles (no strips or fans).
- */
-                flagBoundary = (aCallback != null);
-                return;
-            case GLU.GLU_TESS_VERTEX:
-                callVertex = aCallback == null ? NULL_CB : aCallback;
-                return;
-            case GLU.GLU_TESS_VERTEX_DATA:
-                callVertexData = aCallback == null ? NULL_CB : aCallback;
-                return;
-            case GLU.GLU_TESS_END:
-                callEnd = aCallback == null ? NULL_CB : aCallback;
-                return;
-            case GLU.GLU_TESS_END_DATA:
-                callEndData = aCallback == null ? NULL_CB : aCallback;
-                return;
-            case GLU.GLU_TESS_ERROR:
-                callError = aCallback == null ? NULL_CB : aCallback;
-                return;
-            case GLU.GLU_TESS_ERROR_DATA:
-                callErrorData = aCallback == null ? NULL_CB : aCallback;
-                return;
-            case GLU.GLU_TESS_COMBINE:
-                callCombine = aCallback == null ? NULL_CB : aCallback;
-                return;
-            case GLU.GLU_TESS_COMBINE_DATA:
-                callCombineData = aCallback == null ? NULL_CB : aCallback;
-                return;
-//            case GLU_TESS_MESH:
-//                callMesh = aCallback == null ? NULL_CB : aCallback;
-//                return;
-            default:
-                callErrorOrErrorData(GLU.GLU_INVALID_ENUM);
-                return;
-        }
-    }
-
-    private boolean addVertex(double[] coords, Object vertexData) {
-        GLUhalfEdge e;
-
-        e = lastEdge;
-        if (e == null) {
-/* Make a self-loop (one vertex, one edge). */
-
-            e = Mesh.__gl_meshMakeEdge(mesh);
-            if (e == null) return false;
-            if (!Mesh.__gl_meshSplice(e, e.Sym)) return false;
-        } else {
-/* Create a new vertex and edge which immediately follow e
- * in the ordering around the left face.
- */
-            if (Mesh.__gl_meshSplitEdge(e) == null) return false;
-            e = e.Lnext;
-        }
-
-/* The new vertex is now e.Org. */
-        e.Org.data = vertexData;
-        e.Org.coords[0] = coords[0];
-        e.Org.coords[1] = coords[1];
-        e.Org.coords[2] = coords[2];
-
-/* The winding of an edge says how the winding number changes as we
- * cross from the edge''s right face to its left face.  We add the
- * vertices in such an order that a CCW contour will add +1 to
- * the winding number of the region inside the contour.
- */
-        e.winding = 1;
-        e.Sym.winding = -1;
-
-        lastEdge = e;
-
-        return true;
-    }
-
-    private void cacheVertex(double[] coords, Object vertexData) {
-        if (cache[cacheCount] == null) {
-            cache[cacheCount] = new CachedVertex();
-        }
-
-        CachedVertex v = cache[cacheCount];
-
-        v.data = vertexData;
-        v.coords[0] = coords[0];
-        v.coords[1] = coords[1];
-        v.coords[2] = coords[2];
-        ++cacheCount;
-    }
-
-
-    private boolean flushCache() {
-        CachedVertex[] v = cache;
-
-        mesh = Mesh.__gl_meshNewMesh();
-        if (mesh == null) return false;
-
-        for (int i = 0; i < cacheCount; i++) {
-            CachedVertex vertex = v[i];
-            if (!addVertex(vertex.coords, vertex.data)) return false;
-        }
-        cacheCount = 0;
-        flushCacheOnNextVertex = false;
-
-        return true;
-    }
-
-    public void gluTessVertex(double[] coords, int coords_offset, Object vertexData) {
-        int i;
-        boolean tooLarge = false;
-        double x;
-        double[] clamped = new double[3];
-
-        requireState(TessState.T_IN_CONTOUR);
-
-        if (flushCacheOnNextVertex) {
-            if (!flushCache()) {
-                callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
-                return;
-            }
-            lastEdge = null;
-        }
-        for (i = 0; i < 3; ++i) {
-            x = coords[i+coords_offset];
-            if (x < -GLU.GLU_TESS_MAX_COORD) {
-                x = -GLU.GLU_TESS_MAX_COORD;
-                tooLarge = true;
-            }
-            if (x > GLU.GLU_TESS_MAX_COORD) {
-                x = GLU.GLU_TESS_MAX_COORD;
-                tooLarge = true;
-            }
-            clamped[i] = x;
-        }
-        if (tooLarge) {
-            callErrorOrErrorData(GLU.GLU_TESS_COORD_TOO_LARGE);
-        }
-
-        if (mesh == null) {
-            if (cacheCount < TESS_MAX_CACHE) {
-                cacheVertex(clamped, vertexData);
-                return;
-            }
-            if (!flushCache()) {
-                callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
-                return;
-            }
-        }
-
-        if (!addVertex(clamped, vertexData)) {
-            callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
-        }
-    }
-
-
-    public void gluTessBeginPolygon(Object data) {
-        requireState(TessState.T_DORMANT);
-
-        state = TessState.T_IN_POLYGON;
-        cacheCount = 0;
-        flushCacheOnNextVertex = false;
-        mesh = null;
-
-        polygonData = data;
-    }
-
-
-    public void gluTessBeginContour() {
-        requireState(TessState.T_IN_POLYGON);
-
-        state = TessState.T_IN_CONTOUR;
-        lastEdge = null;
-        if (cacheCount > 0) {
-/* Just set a flag so we don't get confused by empty contours
- * -- these can be generated accidentally with the obsolete
- * NextContour() interface.
- */
-            flushCacheOnNextVertex = true;
-        }
-    }
-
-
-    public void gluTessEndContour() {
-        requireState(TessState.T_IN_CONTOUR);
-        state = TessState.T_IN_POLYGON;
-    }
-
-    public void gluTessEndPolygon() {
-        GLUmesh mesh;
-
-        try {
-            requireState(TessState.T_IN_POLYGON);
-            state = TessState.T_DORMANT;
-
-            if (this.mesh == null) {
-                if (!flagBoundary /*&& callMesh == NULL_CB*/) {
-
-/* Try some special code to make the easy cases go quickly
- * (eg. convex polygons).  This code does NOT handle multiple contours,
- * intersections, edge flags, and of course it does not generate
- * an explicit mesh either.
- */
-                    if (Render.__gl_renderCache(this)) {
-                        polygonData = null;
-                        return;
-                    }
-                }
-                if (!flushCache()) throw new RuntimeException(); /* could've used a label*/
-            }
-
-/* Determine the polygon normal and project vertices onto the plane
-         * of the polygon.
-         */
-            Normal.__gl_projectPolygon(this);
-
-/* __gl_computeInterior( tess ) computes the planar arrangement specified
- * by the given contours, and further subdivides this arrangement
- * into regions.  Each region is marked "inside" if it belongs
- * to the polygon, according to the rule given by windingRule.
- * Each interior region is guaranteed be monotone.
- */
-            if (!Sweep.__gl_computeInterior(this)) {
-                throw new RuntimeException();	/* could've used a label */
-            }
-
-            mesh = this.mesh;
-            if (!fatalError) {
-                boolean rc = true;
-
-/* If the user wants only the boundary contours, we throw away all edges
- * except those which separate the interior from the exterior.
- * Otherwise we tessellate all the regions marked "inside".
- */
-                if (boundaryOnly) {
-                    rc = TessMono.__gl_meshSetWindingNumber(mesh, 1, true);
-                } else {
-                    rc = TessMono.__gl_meshTessellateInterior(mesh, avoidDegenerateTris);
-                }
-                if (!rc) throw new RuntimeException();	/* could've used a label */
-
-                Mesh.__gl_meshCheckMesh(mesh);
-
-                if (callBegin != NULL_CB || callEnd != NULL_CB
-                        || callVertex != NULL_CB || callEdgeFlag != NULL_CB
-                        || callBeginData != NULL_CB
-                        || callEndData != NULL_CB
-                        || callVertexData != NULL_CB
-                        || callEdgeFlagData != NULL_CB) {
-                    if (boundaryOnly) {
-                        Render.__gl_renderBoundary(this, mesh);  /* output boundary contours */
-                    } else {
-                        Render.__gl_renderMesh(this, mesh);	   /* output strips and fans */
-                    }
-                }
-//                if (callMesh != NULL_CB) {
-//
-///* Throw away the exterior faces, so that all faces are interior.
-//                 * This way the user doesn't have to check the "inside" flag,
-//                 * and we don't need to even reveal its existence.  It also leaves
-//                 * the freedom for an implementation to not generate the exterior
-//                 * faces in the first place.
-//                 */
-//                    TessMono.__gl_meshDiscardExterior(mesh);
-//                    callMesh.mesh(mesh);		/* user wants the mesh itself */
-//                    mesh = null;
-//                    polygonData = null;
-//                    return;
-//                }
-            }
-            Mesh.__gl_meshDeleteMesh(mesh);
-            polygonData = null;
-            mesh = null;
-        } catch (Exception e) {
-            e.printStackTrace();
-            callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
-        }
-    }
-
-    /*******************************************************/
-
-/* Obsolete calls -- for backward compatibility */
-
-    public void gluBeginPolygon() {
-        gluTessBeginPolygon(null);
-        gluTessBeginContour();
-    }
-
-
-/*ARGSUSED*/
-    public void gluNextContour(int type) {
-        gluTessEndContour();
-        gluTessBeginContour();
-    }
-
-
-    public void gluEndPolygon() {
-        gluTessEndContour();
-        gluTessEndPolygon();
-    }
-
-    void callBeginOrBeginData(int a) {
-        if (callBeginData != NULL_CB)
-            callBeginData.beginData(a, polygonData);
-        else
-            callBegin.begin(a);
-    }
-
-    void callVertexOrVertexData(Object a) {
-        if (callVertexData != NULL_CB)
-            callVertexData.vertexData(a, polygonData);
-        else
-            callVertex.vertex(a);
-    }
-
-    void callEdgeFlagOrEdgeFlagData(boolean a) {
-        if (callEdgeFlagData != NULL_CB)
-            callEdgeFlagData.edgeFlagData(a, polygonData);
-        else
-            callEdgeFlag.edgeFlag(a);
-    }
-
-    void callEndOrEndData() {
-        if (callEndData != NULL_CB)
-            callEndData.endData(polygonData);
-        else
-            callEnd.end();
-    }
-
-    void callCombineOrCombineData(double[] coords, Object[] vertexData, float[] weights, Object[] outData) {
-        if (callCombineData != NULL_CB)
-            callCombineData.combineData(coords, vertexData, weights, outData, polygonData);
-        else
-            callCombine.combine(coords, vertexData, weights, outData);
-    }
-
-    void callErrorOrErrorData(int a) {
-        if (callErrorData != NULL_CB)
-            callErrorData.errorData(a, polygonData);
-        else
-            callError.error(a);
-    }
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUvertex.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUvertex.java
deleted file mode 100644
index af294ca..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUvertex.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class GLUvertex {
-    public GLUvertex next;		/* next vertex (never NULL) */
-    public GLUvertex prev;		/* previous vertex (never NULL) */
-    public com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge anEdge;	/* a half-edge with this origin */
-    public Object data;		/* client's data */
-
-    /* Internal data (keep hidden) */
-    public double[] coords = new double[3];	/* vertex location in 3D */
-    public double s, t;		/* projection onto the sweep plane */
-    public int pqHandle;	/* to allow deletion from priority queue */
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Geom.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Geom.java
deleted file mode 100644
index 2710346..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Geom.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class Geom {
-    private Geom() {
-    }
-
-    /* Given three vertices u,v,w such that VertLeq(u,v) && VertLeq(v,w),
-     * evaluates the t-coord of the edge uw at the s-coord of the vertex v.
-     * Returns v->t - (uw)(v->s), ie. the signed distance from uw to v.
-     * If uw is vertical (and thus passes thru v), the result is zero.
-     *
-     * The calculation is extremely accurate and stable, even when v
-     * is very close to u or w.  In particular if we set v->t = 0 and
-     * let r be the negated result (this evaluates (uw)(v->s)), then
-     * r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t).
-     */
-    static double EdgeEval(GLUvertex u, GLUvertex v, GLUvertex w) {
-        double gapL, gapR;
-
-        assert (VertLeq(u, v) && VertLeq(v, w));
-
-        gapL = v.s - u.s;
-        gapR = w.s - v.s;
-
-        if (gapL + gapR > 0) {
-            if (gapL < gapR) {
-                return (v.t - u.t) + (u.t - w.t) * (gapL / (gapL + gapR));
-            } else {
-                return (v.t - w.t) + (w.t - u.t) * (gapR / (gapL + gapR));
-            }
-        }
-        /* vertical line */
-        return 0;
-    }
-
-    static double EdgeSign(GLUvertex u, GLUvertex v, GLUvertex w) {
-        double gapL, gapR;
-
-        assert (VertLeq(u, v) && VertLeq(v, w));
-
-        gapL = v.s - u.s;
-        gapR = w.s - v.s;
-
-        if (gapL + gapR > 0) {
-            return (v.t - w.t) * gapL + (v.t - u.t) * gapR;
-        }
-        /* vertical line */
-        return 0;
-    }
-
-
-    /***********************************************************************
-     * Define versions of EdgeSign, EdgeEval with s and t transposed.
-     */
-
-    static double TransEval(GLUvertex u, GLUvertex v, GLUvertex w) {
-        /* Given three vertices u,v,w such that TransLeq(u,v) && TransLeq(v,w),
-         * evaluates the t-coord of the edge uw at the s-coord of the vertex v.
-         * Returns v->s - (uw)(v->t), ie. the signed distance from uw to v.
-         * If uw is vertical (and thus passes thru v), the result is zero.
-         *
-         * The calculation is extremely accurate and stable, even when v
-         * is very close to u or w.  In particular if we set v->s = 0 and
-         * let r be the negated result (this evaluates (uw)(v->t)), then
-         * r is guaranteed to satisfy MIN(u->s,w->s) <= r <= MAX(u->s,w->s).
-         */
-        double gapL, gapR;
-
-        assert (TransLeq(u, v) && TransLeq(v, w));
-
-        gapL = v.t - u.t;
-        gapR = w.t - v.t;
-
-        if (gapL + gapR > 0) {
-            if (gapL < gapR) {
-                return (v.s - u.s) + (u.s - w.s) * (gapL / (gapL + gapR));
-            } else {
-                return (v.s - w.s) + (w.s - u.s) * (gapR / (gapL + gapR));
-            }
-        }
-        /* vertical line */
-        return 0;
-    }
-
-    static double TransSign(GLUvertex u, GLUvertex v, GLUvertex w) {
-        /* Returns a number whose sign matches TransEval(u,v,w) but which
-         * is cheaper to evaluate.  Returns > 0, == 0 , or < 0
-         * as v is above, on, or below the edge uw.
-         */
-        double gapL, gapR;
-
-        assert (TransLeq(u, v) && TransLeq(v, w));
-
-        gapL = v.t - u.t;
-        gapR = w.t - v.t;
-
-        if (gapL + gapR > 0) {
-            return (v.s - w.s) * gapL + (v.s - u.s) * gapR;
-        }
-        /* vertical line */
-        return 0;
-    }
-
-
-    static boolean VertCCW(GLUvertex u, GLUvertex v, GLUvertex w) {
-        /* For almost-degenerate situations, the results are not reliable.
-         * Unless the floating-point arithmetic can be performed without
-         * rounding errors, *any* implementation will give incorrect results
-         * on some degenerate inputs, so the client must have some way to
-         * handle this situation.
-         */
-        return (u.s * (v.t - w.t) + v.s * (w.t - u.t) + w.s * (u.t - v.t)) >= 0;
-    }
-
-/* Given parameters a,x,b,y returns the value (b*x+a*y)/(a+b),
- * or (x+y)/2 if a==b==0.  It requires that a,b >= 0, and enforces
- * this in the rare case that one argument is slightly negative.
- * The implementation is extremely stable numerically.
- * In particular it guarantees that the result r satisfies
- * MIN(x,y) <= r <= MAX(x,y), and the results are very accurate
- * even when a and b differ greatly in magnitude.
- */
-    static double Interpolate(double a, double x, double b, double y) {
-        a = (a < 0) ? 0 : a;
-        b = (b < 0) ? 0 : b;
-        if (a <= b) {
-            if (b == 0) {
-                return (x + y) / 2.0;
-            } else {
-                return (x + (y - x) * (a / (a + b)));
-            }
-        } else {
-            return (y + (x - y) * (b / (a + b)));
-        }
-    }
-
-    static void EdgeIntersect(GLUvertex o1, GLUvertex d1,
-                              GLUvertex o2, GLUvertex d2,
-                              GLUvertex v)
-/* Given edges (o1,d1) and (o2,d2), compute their point of intersection.
- * The computed point is guaranteed to lie in the intersection of the
- * bounding rectangles defined by each edge.
- */ {
-        double z1, z2;
-
-        /* This is certainly not the most efficient way to find the intersection
-         * of two line segments, but it is very numerically stable.
-         *
-         * Strategy: find the two middle vertices in the VertLeq ordering,
-         * and interpolate the intersection s-value from these.  Then repeat
-         * using the TransLeq ordering to find the intersection t-value.
-         */
-
-        if (!VertLeq(o1, d1)) {
-            GLUvertex temp = o1;
-            o1 = d1;
-            d1 = temp;
-        }
-        if (!VertLeq(o2, d2)) {
-            GLUvertex temp = o2;
-            o2 = d2;
-            d2 = temp;
-        }
-        if (!VertLeq(o1, o2)) {
-            GLUvertex temp = o1;
-            o1 = o2;
-            o2 = temp;
-            temp = d1;
-            d1 = d2;
-            d2 = temp;
-        }
-
-        if (!VertLeq(o2, d1)) {
-            /* Technically, no intersection -- do our best */
-            v.s = (o2.s + d1.s) / 2.0;
-        } else if (VertLeq(d1, d2)) {
-            /* Interpolate between o2 and d1 */
-            z1 = EdgeEval(o1, o2, d1);
-            z2 = EdgeEval(o2, d1, d2);
-            if (z1 + z2 < 0) {
-                z1 = -z1;
-                z2 = -z2;
-            }
-            v.s = Interpolate(z1, o2.s, z2, d1.s);
-        } else {
-            /* Interpolate between o2 and d2 */
-            z1 = EdgeSign(o1, o2, d1);
-            z2 = -EdgeSign(o1, d2, d1);
-            if (z1 + z2 < 0) {
-                z1 = -z1;
-                z2 = -z2;
-            }
-            v.s = Interpolate(z1, o2.s, z2, d2.s);
-        }
-
-        /* Now repeat the process for t */
-
-        if (!TransLeq(o1, d1)) {
-            GLUvertex temp = o1;
-            o1 = d1;
-            d1 = temp;
-        }
-        if (!TransLeq(o2, d2)) {
-            GLUvertex temp = o2;
-            o2 = d2;
-            d2 = temp;
-        }
-        if (!TransLeq(o1, o2)) {
-            GLUvertex temp = o2;
-            o2 = o1;
-            o1 = temp;
-            temp = d2;
-            d2 = d1;
-            d1 = temp;
-        }
-
-        if (!TransLeq(o2, d1)) {
-            /* Technically, no intersection -- do our best */
-            v.t = (o2.t + d1.t) / 2.0;
-        } else if (TransLeq(d1, d2)) {
-            /* Interpolate between o2 and d1 */
-            z1 = TransEval(o1, o2, d1);
-            z2 = TransEval(o2, d1, d2);
-            if (z1 + z2 < 0) {
-                z1 = -z1;
-                z2 = -z2;
-            }
-            v.t = Interpolate(z1, o2.t, z2, d1.t);
-        } else {
-            /* Interpolate between o2 and d2 */
-            z1 = TransSign(o1, o2, d1);
-            z2 = -TransSign(o1, d2, d1);
-            if (z1 + z2 < 0) {
-                z1 = -z1;
-                z2 = -z2;
-            }
-            v.t = Interpolate(z1, o2.t, z2, d2.t);
-        }
-    }
-
-    static boolean VertEq(GLUvertex u, GLUvertex v) {
-        return u.s == v.s && u.t == v.t;
-    }
-
-    static boolean VertLeq(GLUvertex u, GLUvertex v) {
-        return u.s < v.s || (u.s == v.s && u.t <= v.t);
-    }
-
-/* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */
-
-    static boolean TransLeq(GLUvertex u, GLUvertex v) {
-        return u.t < v.t || (u.t == v.t && u.s <= v.s);
-    }
-
-    static boolean EdgeGoesLeft(GLUhalfEdge e) {
-        return VertLeq(e.Sym.Org, e.Org);
-    }
-
-    static boolean EdgeGoesRight(GLUhalfEdge e) {
-        return VertLeq(e.Org, e.Sym.Org);
-    }
-
-    static double VertL1dist(GLUvertex u, GLUvertex v) {
-        return Math.abs(u.s - v.s) + Math.abs(u.t - v.t);
-    }
-
-    /***********************************************************************/
-
-    // Compute the cosine of the angle between the edges between o and
-    // v1 and between o and v2
-    static double EdgeCos(GLUvertex o, GLUvertex v1, GLUvertex v2) {
-        double ov1s = v1.s - o.s;
-        double ov1t = v1.t - o.t;
-        double ov2s = v2.s - o.s;
-        double ov2t = v2.t - o.t;
-        double dotp = ov1s * ov2s + ov1t * ov2t;
-        double len = Math.sqrt(ov1s * ov1s + ov1t * ov1t) * Math.sqrt(ov2s * ov2s + ov2t * ov2t);
-        if (len > 0.0) {
-            dotp /= len;
-        }
-        return dotp;
-    }
-
-    static final double EPSILON = 1.0e-5;
-    static final double ONE_MINUS_EPSILON = 1.0 - EPSILON;
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Mesh.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Mesh.java
deleted file mode 100644
index b8be9f8..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Mesh.java
+++ /dev/null
@@ -1,734 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class Mesh {
-    private Mesh() {
-    }
-
-    /************************ Utility Routines ************************/
-/* MakeEdge creates a new pair of half-edges which form their own loop.
- * No vertex or face structures are allocated, but these must be assigned
- * before the current edge operation is completed.
- */
-    static com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge MakeEdge(com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eNext) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eSym;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge ePrev;
-
-//        EdgePair * pair = (EdgePair *)
-//        memAlloc(sizeof(EdgePair));
-//        if (pair == NULL) return NULL;
-//
-//        e = &pair - > e;
-        e = new com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge(true);
-//        eSym = &pair - > eSym;
-        eSym = new com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge(false);
-
-
-        /* Make sure eNext points to the first edge of the edge pair */
-        if (!eNext.first) {
-            eNext = eNext.Sym;
-        }
-
-        /* Insert in circular doubly-linked list before eNext.
-         * Note that the prev pointer is stored in Sym->next.
-         */
-        ePrev = eNext.Sym.next;
-        eSym.next = ePrev;
-        ePrev.Sym.next = e;
-        e.next = eNext;
-        eNext.Sym.next = eSym;
-
-        e.Sym = eSym;
-        e.Onext = e;
-        e.Lnext = eSym;
-        e.Org = null;
-        e.Lface = null;
-        e.winding = 0;
-        e.activeRegion = null;
-
-        eSym.Sym = e;
-        eSym.Onext = eSym;
-        eSym.Lnext = e;
-        eSym.Org = null;
-        eSym.Lface = null;
-        eSym.winding = 0;
-        eSym.activeRegion = null;
-
-        return e;
-    }
-
-/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
- * CS348a notes (see mesh.h).  Basically it modifies the mesh so that
- * a->Onext and b->Onext are exchanged.  This can have various effects
- * depending on whether a and b belong to different face or vertex rings.
- * For more explanation see __gl_meshSplice() below.
- */
-    static void Splice(com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge a, com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge b) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge aOnext = a.Onext;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge bOnext = b.Onext;
-
-        aOnext.Sym.Lnext = b;
-        bOnext.Sym.Lnext = a;
-        a.Onext = bOnext;
-        b.Onext = aOnext;
-    }
-
-/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
- * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
- * a place to insert the new vertex in the global vertex list.  We insert
- * the new vertex *before* vNext so that algorithms which walk the vertex
- * list will not see the newly created vertices.
- */
-    static void MakeVertex(com.jogamp.opengl.impl.glu.tessellator.GLUvertex newVertex,
-                           com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eOrig, com.jogamp.opengl.impl.glu.tessellator.GLUvertex vNext) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e;
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex vPrev;
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex vNew = newVertex;
-
-        assert (vNew != null);
-
-        /* insert in circular doubly-linked list before vNext */
-        vPrev = vNext.prev;
-        vNew.prev = vPrev;
-        vPrev.next = vNew;
-        vNew.next = vNext;
-        vNext.prev = vNew;
-
-        vNew.anEdge = eOrig;
-        vNew.data = null;
-        /* leave coords, s, t undefined */
-
-        /* fix other edges on this vertex loop */
-        e = eOrig;
-        do {
-            e.Org = vNew;
-            e = e.Onext;
-        } while (e != eOrig);
-    }
-
-/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
- * face of all edges in the face loop to which eOrig belongs.  "fNext" gives
- * a place to insert the new face in the global face list.  We insert
- * the new face *before* fNext so that algorithms which walk the face
- * list will not see the newly created faces.
- */
-    static void MakeFace(com.jogamp.opengl.impl.glu.tessellator.GLUface newFace, com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eOrig, com.jogamp.opengl.impl.glu.tessellator.GLUface fNext) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e;
-        com.jogamp.opengl.impl.glu.tessellator.GLUface fPrev;
-        com.jogamp.opengl.impl.glu.tessellator.GLUface fNew = newFace;
-
-        assert (fNew != null);
-
-        /* insert in circular doubly-linked list before fNext */
-        fPrev = fNext.prev;
-        fNew.prev = fPrev;
-        fPrev.next = fNew;
-        fNew.next = fNext;
-        fNext.prev = fNew;
-
-        fNew.anEdge = eOrig;
-        fNew.data = null;
-        fNew.trail = null;
-        fNew.marked = false;
-
-        /* The new face is marked "inside" if the old one was.  This is a
-         * convenience for the common case where a face has been split in two.
-         */
-        fNew.inside = fNext.inside;
-
-        /* fix other edges on this face loop */
-        e = eOrig;
-        do {
-            e.Lface = fNew;
-            e = e.Lnext;
-        } while (e != eOrig);
-    }
-
-/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
- * and removes from the global edge list.
- */
-    static void KillEdge(com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eDel) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge ePrev, eNext;
-
-        /* Half-edges are allocated in pairs, see EdgePair above */
-        if (!eDel.first) {
-            eDel = eDel.Sym;
-        }
-
-        /* delete from circular doubly-linked list */
-        eNext = eDel.next;
-        ePrev = eDel.Sym.next;
-        eNext.Sym.next = ePrev;
-        ePrev.Sym.next = eNext;
-    }
-
-
-/* KillVertex( vDel ) destroys a vertex and removes it from the global
- * vertex list.  It updates the vertex loop to point to a given new vertex.
- */
-    static void KillVertex(com.jogamp.opengl.impl.glu.tessellator.GLUvertex vDel, com.jogamp.opengl.impl.glu.tessellator.GLUvertex newOrg) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e, eStart = vDel.anEdge;
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex vPrev, vNext;
-
-        /* change the origin of all affected edges */
-        e = eStart;
-        do {
-            e.Org = newOrg;
-            e = e.Onext;
-        } while (e != eStart);
-
-        /* delete from circular doubly-linked list */
-        vPrev = vDel.prev;
-        vNext = vDel.next;
-        vNext.prev = vPrev;
-        vPrev.next = vNext;
-    }
-
-/* KillFace( fDel ) destroys a face and removes it from the global face
- * list.  It updates the face loop to point to a given new face.
- */
-    static void KillFace(com.jogamp.opengl.impl.glu.tessellator.GLUface fDel, com.jogamp.opengl.impl.glu.tessellator.GLUface newLface) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e, eStart = fDel.anEdge;
-        com.jogamp.opengl.impl.glu.tessellator.GLUface fPrev, fNext;
-
-        /* change the left face of all affected edges */
-        e = eStart;
-        do {
-            e.Lface = newLface;
-            e = e.Lnext;
-        } while (e != eStart);
-
-        /* delete from circular doubly-linked list */
-        fPrev = fDel.prev;
-        fNext = fDel.next;
-        fNext.prev = fPrev;
-        fPrev.next = fNext;
-    }
-
-
-    /****************** Basic Edge Operations **********************/
-
-/* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face).
- * The loop consists of the two new half-edges.
- */
-    public static com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge __gl_meshMakeEdge(com.jogamp.opengl.impl.glu.tessellator.GLUmesh mesh) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex newVertex1 = new com.jogamp.opengl.impl.glu.tessellator.GLUvertex();
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex newVertex2 = new com.jogamp.opengl.impl.glu.tessellator.GLUvertex();
-        com.jogamp.opengl.impl.glu.tessellator.GLUface newFace = new com.jogamp.opengl.impl.glu.tessellator.GLUface();
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e;
-
-        e = MakeEdge(mesh.eHead);
-        if (e == null) return null;
-
-        MakeVertex(newVertex1, e, mesh.vHead);
-        MakeVertex(newVertex2, e.Sym, mesh.vHead);
-        MakeFace(newFace, e, mesh.fHead);
-        return e;
-    }
-
-
-/* __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the
- * mesh connectivity and topology.  It changes the mesh so that
- *	eOrg->Onext <- OLD( eDst->Onext )
- *	eDst->Onext <- OLD( eOrg->Onext )
- * where OLD(...) means the value before the meshSplice operation.
- *
- * This can have two effects on the vertex structure:
- *  - if eOrg->Org != eDst->Org, the two vertices are merged together
- *  - if eOrg->Org == eDst->Org, the origin is split into two vertices
- * In both cases, eDst->Org is changed and eOrg->Org is untouched.
- *
- * Similarly (and independently) for the face structure,
- *  - if eOrg->Lface == eDst->Lface, one loop is split into two
- *  - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
- * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
- *
- * Some special cases:
- * If eDst == eOrg, the operation has no effect.
- * If eDst == eOrg->Lnext, the new face will have a single edge.
- * If eDst == eOrg->Lprev, the old face will have a single edge.
- * If eDst == eOrg->Onext, the new vertex will have a single edge.
- * If eDst == eOrg->Oprev, the old vertex will have a single edge.
- */
-    public static boolean __gl_meshSplice(com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eOrg, com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eDst) {
-        boolean joiningLoops = false;
-        boolean joiningVertices = false;
-
-        if (eOrg == eDst) return true;
-
-        if (eDst.Org != eOrg.Org) {
-            /* We are merging two disjoint vertices -- destroy eDst->Org */
-            joiningVertices = true;
-            KillVertex(eDst.Org, eOrg.Org);
-        }
-        if (eDst.Lface != eOrg.Lface) {
-            /* We are connecting two disjoint loops -- destroy eDst.Lface */
-            joiningLoops = true;
-            KillFace(eDst.Lface, eOrg.Lface);
-        }
-
-        /* Change the edge structure */
-        Splice(eDst, eOrg);
-
-        if (!joiningVertices) {
-            com.jogamp.opengl.impl.glu.tessellator.GLUvertex newVertex = new com.jogamp.opengl.impl.glu.tessellator.GLUvertex();
-
-            /* We split one vertex into two -- the new vertex is eDst.Org.
-             * Make sure the old vertex points to a valid half-edge.
-             */
-            MakeVertex(newVertex, eDst, eOrg.Org);
-            eOrg.Org.anEdge = eOrg;
-        }
-        if (!joiningLoops) {
-            com.jogamp.opengl.impl.glu.tessellator.GLUface newFace = new com.jogamp.opengl.impl.glu.tessellator.GLUface();
-
-            /* We split one loop into two -- the new loop is eDst.Lface.
-             * Make sure the old face points to a valid half-edge.
-             */
-            MakeFace(newFace, eDst, eOrg.Lface);
-            eOrg.Lface.anEdge = eOrg;
-        }
-
-        return true;
-    }
-
-
-/* __gl_meshDelete( eDel ) removes the edge eDel.  There are several cases:
- * if (eDel.Lface != eDel.Rface), we join two loops into one; the loop
- * eDel.Lface is deleted.  Otherwise, we are splitting one loop into two;
- * the newly created loop will contain eDel.Dst.  If the deletion of eDel
- * would create isolated vertices, those are deleted as well.
- *
- * This function could be implemented as two calls to __gl_meshSplice
- * plus a few calls to memFree, but this would allocate and delete
- * unnecessary vertices and faces.
- */
-    static boolean __gl_meshDelete(com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eDel) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eDelSym = eDel.Sym;
-        boolean joiningLoops = false;
-
-        /* First step: disconnect the origin vertex eDel.Org.  We make all
-         * changes to get a consistent mesh in this "intermediate" state.
-         */
-        if (eDel.Lface != eDel.Sym.Lface) {
-            /* We are joining two loops into one -- remove the left face */
-            joiningLoops = true;
-            KillFace(eDel.Lface, eDel.Sym.Lface);
-        }
-
-        if (eDel.Onext == eDel) {
-            KillVertex(eDel.Org, null);
-        } else {
-            /* Make sure that eDel.Org and eDel.Sym.Lface point to valid half-edges */
-            eDel.Sym.Lface.anEdge = eDel.Sym.Lnext;
-            eDel.Org.anEdge = eDel.Onext;
-
-            Splice(eDel, eDel.Sym.Lnext);
-            if (!joiningLoops) {
-                com.jogamp.opengl.impl.glu.tessellator.GLUface newFace = new com.jogamp.opengl.impl.glu.tessellator.GLUface();
-
-                /* We are splitting one loop into two -- create a new loop for eDel. */
-                MakeFace(newFace, eDel, eDel.Lface);
-            }
-        }
-
-        /* Claim: the mesh is now in a consistent state, except that eDel.Org
-         * may have been deleted.  Now we disconnect eDel.Dst.
-         */
-        if (eDelSym.Onext == eDelSym) {
-            KillVertex(eDelSym.Org, null);
-            KillFace(eDelSym.Lface, null);
-        } else {
-            /* Make sure that eDel.Dst and eDel.Lface point to valid half-edges */
-            eDel.Lface.anEdge = eDelSym.Sym.Lnext;
-            eDelSym.Org.anEdge = eDelSym.Onext;
-            Splice(eDelSym, eDelSym.Sym.Lnext);
-        }
-
-        /* Any isolated vertices or faces have already been freed. */
-        KillEdge(eDel);
-
-        return true;
-    }
-
-
-    /******************** Other Edge Operations **********************/
-
-/* All these routines can be implemented with the basic edge
- * operations above.  They are provided for convenience and efficiency.
- */
-
-
-/* __gl_meshAddEdgeVertex( eOrg ) creates a new edge eNew such that
- * eNew == eOrg.Lnext, and eNew.Dst is a newly created vertex.
- * eOrg and eNew will have the same left face.
- */
-    static com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge __gl_meshAddEdgeVertex(com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eOrg) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eNewSym;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
-
-        eNewSym = eNew.Sym;
-
-        /* Connect the new edge appropriately */
-        Splice(eNew, eOrg.Lnext);
-
-        /* Set the vertex and face information */
-        eNew.Org = eOrg.Sym.Org;
-        {
-            com.jogamp.opengl.impl.glu.tessellator.GLUvertex newVertex = new com.jogamp.opengl.impl.glu.tessellator.GLUvertex();
-
-            MakeVertex(newVertex, eNewSym, eNew.Org);
-        }
-        eNew.Lface = eNewSym.Lface = eOrg.Lface;
-
-        return eNew;
-    }
-
-
-/* __gl_meshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
- * such that eNew == eOrg.Lnext.  The new vertex is eOrg.Sym.Org == eNew.Org.
- * eOrg and eNew will have the same left face.
- */
-    public static com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge __gl_meshSplitEdge(com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eOrg) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eNew;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge tempHalfEdge = __gl_meshAddEdgeVertex(eOrg);
-
-        eNew = tempHalfEdge.Sym;
-
-        /* Disconnect eOrg from eOrg.Sym.Org and connect it to eNew.Org */
-        Splice(eOrg.Sym, eOrg.Sym.Sym.Lnext);
-        Splice(eOrg.Sym, eNew);
-
-        /* Set the vertex and face information */
-        eOrg.Sym.Org = eNew.Org;
-        eNew.Sym.Org.anEdge = eNew.Sym;	/* may have pointed to eOrg.Sym */
-        eNew.Sym.Lface = eOrg.Sym.Lface;
-        eNew.winding = eOrg.winding;	/* copy old winding information */
-        eNew.Sym.winding = eOrg.Sym.winding;
-
-        return eNew;
-    }
-
-
-/* __gl_meshConnect( eOrg, eDst ) creates a new edge from eOrg.Sym.Org
- * to eDst.Org, and returns the corresponding half-edge eNew.
- * If eOrg.Lface == eDst.Lface, this splits one loop into two,
- * and the newly created loop is eNew.Lface.  Otherwise, two disjoint
- * loops are merged into one, and the loop eDst.Lface is destroyed.
- *
- * If (eOrg == eDst), the new face will have only two edges.
- * If (eOrg.Lnext == eDst), the old face is reduced to a single edge.
- * If (eOrg.Lnext.Lnext == eDst), the old face is reduced to two edges.
- */
-    static com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge __gl_meshConnect(com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eOrg, com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eDst) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eNewSym;
-        boolean joiningLoops = false;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
-
-        eNewSym = eNew.Sym;
-
-        if (eDst.Lface != eOrg.Lface) {
-            /* We are connecting two disjoint loops -- destroy eDst.Lface */
-            joiningLoops = true;
-            KillFace(eDst.Lface, eOrg.Lface);
-        }
-
-        /* Connect the new edge appropriately */
-        Splice(eNew, eOrg.Lnext);
-        Splice(eNewSym, eDst);
-
-        /* Set the vertex and face information */
-        eNew.Org = eOrg.Sym.Org;
-        eNewSym.Org = eDst.Org;
-        eNew.Lface = eNewSym.Lface = eOrg.Lface;
-
-        /* Make sure the old face points to a valid half-edge */
-        eOrg.Lface.anEdge = eNewSym;
-
-        if (!joiningLoops) {
-            com.jogamp.opengl.impl.glu.tessellator.GLUface newFace = new com.jogamp.opengl.impl.glu.tessellator.GLUface();
-
-            /* We split one loop into two -- the new loop is eNew.Lface */
-            MakeFace(newFace, eNew, eOrg.Lface);
-        }
-        return eNew;
-    }
-
-
-    /******************** Other Operations **********************/
-
-/* __gl_meshZapFace( fZap ) destroys a face and removes it from the
- * global face list.  All edges of fZap will have a null pointer as their
- * left face.  Any edges which also have a null pointer as their right face
- * are deleted entirely (along with any isolated vertices this produces).
- * An entire mesh can be deleted by zapping its faces, one at a time,
- * in any order.  Zapped faces cannot be used in further mesh operations!
- */
-    static void __gl_meshZapFace(com.jogamp.opengl.impl.glu.tessellator.GLUface fZap) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eStart = fZap.anEdge;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e, eNext, eSym;
-        com.jogamp.opengl.impl.glu.tessellator.GLUface fPrev, fNext;
-
-        /* walk around face, deleting edges whose right face is also null */
-        eNext = eStart.Lnext;
-        do {
-            e = eNext;
-            eNext = e.Lnext;
-
-            e.Lface = null;
-            if (e.Sym.Lface == null) {
-                /* delete the edge -- see __gl_MeshDelete above */
-
-                if (e.Onext == e) {
-                    KillVertex(e.Org, null);
-                } else {
-                    /* Make sure that e.Org points to a valid half-edge */
-                    e.Org.anEdge = e.Onext;
-                    Splice(e, e.Sym.Lnext);
-                }
-                eSym = e.Sym;
-                if (eSym.Onext == eSym) {
-                    KillVertex(eSym.Org, null);
-                } else {
-                    /* Make sure that eSym.Org points to a valid half-edge */
-                    eSym.Org.anEdge = eSym.Onext;
-                    Splice(eSym, eSym.Sym.Lnext);
-                }
-                KillEdge(e);
-            }
-        } while (e != eStart);
-
-        /* delete from circular doubly-linked list */
-        fPrev = fZap.prev;
-        fNext = fZap.next;
-        fNext.prev = fPrev;
-        fPrev.next = fNext;
-    }
-
-
-/* __gl_meshNewMesh() creates a new mesh with no edges, no vertices,
- * and no loops (what we usually call a "face").
- */
-    public static com.jogamp.opengl.impl.glu.tessellator.GLUmesh __gl_meshNewMesh() {
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex v;
-        com.jogamp.opengl.impl.glu.tessellator.GLUface f;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eSym;
-        com.jogamp.opengl.impl.glu.tessellator.GLUmesh mesh = new com.jogamp.opengl.impl.glu.tessellator.GLUmesh();
-
-        v = mesh.vHead;
-        f = mesh.fHead;
-        e = mesh.eHead;
-        eSym = mesh.eHeadSym;
-
-        v.next = v.prev = v;
-        v.anEdge = null;
-        v.data = null;
-
-        f.next = f.prev = f;
-        f.anEdge = null;
-        f.data = null;
-        f.trail = null;
-        f.marked = false;
-        f.inside = false;
-
-        e.next = e;
-        e.Sym = eSym;
-        e.Onext = null;
-        e.Lnext = null;
-        e.Org = null;
-        e.Lface = null;
-        e.winding = 0;
-        e.activeRegion = null;
-
-        eSym.next = eSym;
-        eSym.Sym = e;
-        eSym.Onext = null;
-        eSym.Lnext = null;
-        eSym.Org = null;
-        eSym.Lface = null;
-        eSym.winding = 0;
-        eSym.activeRegion = null;
-
-        return mesh;
-    }
-
-
-/* __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in
- * both meshes, and returns the new mesh (the old meshes are destroyed).
- */
-    static com.jogamp.opengl.impl.glu.tessellator.GLUmesh __gl_meshUnion(com.jogamp.opengl.impl.glu.tessellator.GLUmesh mesh1, com.jogamp.opengl.impl.glu.tessellator.GLUmesh mesh2) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUface f1 = mesh1.fHead;
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex v1 = mesh1.vHead;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e1 = mesh1.eHead;
-        com.jogamp.opengl.impl.glu.tessellator.GLUface f2 = mesh2.fHead;
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex v2 = mesh2.vHead;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e2 = mesh2.eHead;
-
-        /* Add the faces, vertices, and edges of mesh2 to those of mesh1 */
-        if (f2.next != f2) {
-            f1.prev.next = f2.next;
-            f2.next.prev = f1.prev;
-            f2.prev.next = f1;
-            f1.prev = f2.prev;
-        }
-
-        if (v2.next != v2) {
-            v1.prev.next = v2.next;
-            v2.next.prev = v1.prev;
-            v2.prev.next = v1;
-            v1.prev = v2.prev;
-        }
-
-        if (e2.next != e2) {
-            e1.Sym.next.Sym.next = e2.next;
-            e2.next.Sym.next = e1.Sym.next;
-            e2.Sym.next.Sym.next = e1;
-            e1.Sym.next = e2.Sym.next;
-        }
-
-        return mesh1;
-    }
-
-
-/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
- */
-    static void __gl_meshDeleteMeshZap(com.jogamp.opengl.impl.glu.tessellator.GLUmesh mesh) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUface fHead = mesh.fHead;
-
-        while (fHead.next != fHead) {
-            __gl_meshZapFace(fHead.next);
-        }
-        assert (mesh.vHead.next == mesh.vHead);
-    }
-
-/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
- */
-    public static void __gl_meshDeleteMesh(com.jogamp.opengl.impl.glu.tessellator.GLUmesh mesh) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUface f, fNext;
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex v, vNext;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e, eNext;
-
-        for (f = mesh.fHead.next; f != mesh.fHead; f = fNext) {
-            fNext = f.next;
-        }
-
-        for (v = mesh.vHead.next; v != mesh.vHead; v = vNext) {
-            vNext = v.next;
-        }
-
-        for (e = mesh.eHead.next; e != mesh.eHead; e = eNext) {
-            /* One call frees both e and e.Sym (see EdgePair above) */
-            eNext = e.next;
-        }
-    }
-
-/* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
- */
-    public static void __gl_meshCheckMesh(com.jogamp.opengl.impl.glu.tessellator.GLUmesh mesh) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUface fHead = mesh.fHead;
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex vHead = mesh.vHead;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eHead = mesh.eHead;
-        com.jogamp.opengl.impl.glu.tessellator.GLUface f, fPrev;
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex v, vPrev;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e, ePrev;
-
-        fPrev = fHead;
-        for (fPrev = fHead; (f = fPrev.next) != fHead; fPrev = f) {
-            assert (f.prev == fPrev);
-            e = f.anEdge;
-            do {
-                assert (e.Sym != e);
-                assert (e.Sym.Sym == e);
-                assert (e.Lnext.Onext.Sym == e);
-                assert (e.Onext.Sym.Lnext == e);
-                assert (e.Lface == f);
-                e = e.Lnext;
-            } while (e != f.anEdge);
-        }
-        assert (f.prev == fPrev && f.anEdge == null && f.data == null);
-
-        vPrev = vHead;
-        for (vPrev = vHead; (v = vPrev.next) != vHead; vPrev = v) {
-            assert (v.prev == vPrev);
-            e = v.anEdge;
-            do {
-                assert (e.Sym != e);
-                assert (e.Sym.Sym == e);
-                assert (e.Lnext.Onext.Sym == e);
-                assert (e.Onext.Sym.Lnext == e);
-                assert (e.Org == v);
-                e = e.Onext;
-            } while (e != v.anEdge);
-        }
-        assert (v.prev == vPrev && v.anEdge == null && v.data == null);
-
-        ePrev = eHead;
-        for (ePrev = eHead; (e = ePrev.next) != eHead; ePrev = e) {
-            assert (e.Sym.next == ePrev.Sym);
-            assert (e.Sym != e);
-            assert (e.Sym.Sym == e);
-            assert (e.Org != null);
-            assert (e.Sym.Org != null);
-            assert (e.Lnext.Onext.Sym == e);
-            assert (e.Onext.Sym.Lnext == e);
-        }
-        assert (e.Sym.next == ePrev.Sym
-                && e.Sym == mesh.eHeadSym
-                && e.Sym.Sym == e
-                && e.Org == null && e.Sym.Org == null
-                && e.Lface == null && e.Sym.Lface == null);
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Normal.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Normal.java
deleted file mode 100644
index fe1a20c..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Normal.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-import javax.media.opengl.*;
-import javax.media.opengl.glu.*;
-
-class Normal {
-    private Normal() {
-    }
-
-    static boolean SLANTED_SWEEP = false;
-    static double S_UNIT_X;	/* Pre-normalized */
-    static double S_UNIT_Y;
-    private static final boolean TRUE_PROJECT = false;
-
-    static {
-        if (SLANTED_SWEEP) {
-/* The "feature merging" is not intended to be complete.  There are
- * special cases where edges are nearly parallel to the sweep line
- * which are not implemented.  The algorithm should still behave
- * robustly (ie. produce a reasonable tesselation) in the presence
- * of such edges, however it may miss features which could have been
- * merged.  We could minimize this effect by choosing the sweep line
- * direction to be something unusual (ie. not parallel to one of the
- * coordinate axes).
- */
-            S_UNIT_X = 0.50941539564955385;	/* Pre-normalized */
-            S_UNIT_Y = 0.86052074622010633;
-        } else {
-            S_UNIT_X = 1.0;
-            S_UNIT_Y = 0.0;
-        }
-    }
-
-    private static double Dot(double[] u, double[] v) {
-        return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);
-    }
-
-    static void Normalize(double[] v) {
-        double len = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
-
-        assert (len > 0);
-        len = Math.sqrt(len);
-        v[0] /= len;
-        v[1] /= len;
-        v[2] /= len;
-    }
-
-    static int LongAxis(double[] v) {
-        int i = 0;
-
-        if (Math.abs(v[1]) > Math.abs(v[0])) {
-            i = 1;
-        }
-        if (Math.abs(v[2]) > Math.abs(v[i])) {
-            i = 2;
-        }
-        return i;
-    }
-
-    static void ComputeNormal(GLUtessellatorImpl tess, double[] norm) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex v, v1, v2;
-        double c, tLen2, maxLen2;
-        double[] maxVal, minVal, d1, d2, tNorm;
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex[] maxVert, minVert;
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
-        int i;
-
-        maxVal = new double[3];
-        minVal = new double[3];
-        minVert = new com.jogamp.opengl.impl.glu.tessellator.GLUvertex[3];
-        maxVert = new com.jogamp.opengl.impl.glu.tessellator.GLUvertex[3];
-        d1 = new double[3];
-        d2 = new double[3];
-        tNorm = new double[3];
-
-        maxVal[0] = maxVal[1] = maxVal[2] = -2 * GLU.GLU_TESS_MAX_COORD;
-        minVal[0] = minVal[1] = minVal[2] = 2 * GLU.GLU_TESS_MAX_COORD;
-
-        for (v = vHead.next; v != vHead; v = v.next) {
-            for (i = 0; i < 3; ++i) {
-                c = v.coords[i];
-                if (c < minVal[i]) {
-                    minVal[i] = c;
-                    minVert[i] = v;
-                }
-                if (c > maxVal[i]) {
-                    maxVal[i] = c;
-                    maxVert[i] = v;
-                }
-            }
-        }
-
-/* Find two vertices separated by at least 1/sqrt(3) of the maximum
-         * distance between any two vertices
-         */
-        i = 0;
-        if (maxVal[1] - minVal[1] > maxVal[0] - minVal[0]) {
-            i = 1;
-        }
-        if (maxVal[2] - minVal[2] > maxVal[i] - minVal[i]) {
-            i = 2;
-        }
-        if (minVal[i] >= maxVal[i]) {
-/* All vertices are the same -- normal doesn't matter */
-            norm[0] = 0;
-            norm[1] = 0;
-            norm[2] = 1;
-            return;
-        }
-
-/* Look for a third vertex which forms the triangle with maximum area
-         * (Length of normal == twice the triangle area)
-         */
-        maxLen2 = 0;
-        v1 = minVert[i];
-        v2 = maxVert[i];
-        d1[0] = v1.coords[0] - v2.coords[0];
-        d1[1] = v1.coords[1] - v2.coords[1];
-        d1[2] = v1.coords[2] - v2.coords[2];
-        for (v = vHead.next; v != vHead; v = v.next) {
-            d2[0] = v.coords[0] - v2.coords[0];
-            d2[1] = v.coords[1] - v2.coords[1];
-            d2[2] = v.coords[2] - v2.coords[2];
-            tNorm[0] = d1[1] * d2[2] - d1[2] * d2[1];
-            tNorm[1] = d1[2] * d2[0] - d1[0] * d2[2];
-            tNorm[2] = d1[0] * d2[1] - d1[1] * d2[0];
-            tLen2 = tNorm[0] * tNorm[0] + tNorm[1] * tNorm[1] + tNorm[2] * tNorm[2];
-            if (tLen2 > maxLen2) {
-                maxLen2 = tLen2;
-                norm[0] = tNorm[0];
-                norm[1] = tNorm[1];
-                norm[2] = tNorm[2];
-            }
-        }
-
-        if (maxLen2 <= 0) {
-/* All points lie on a single line -- any decent normal will do */
-            norm[0] = norm[1] = norm[2] = 0;
-            norm[LongAxis(d1)] = 1;
-        }
-    }
-
-    static void CheckOrientation(GLUtessellatorImpl tess) {
-        double area;
-        com.jogamp.opengl.impl.glu.tessellator.GLUface f, fHead = tess.mesh.fHead;
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e;
-
-/* When we compute the normal automatically, we choose the orientation
- * so that the the sum of the signed areas of all contours is non-negative.
- */
-        area = 0;
-        for (f = fHead.next; f != fHead; f = f.next) {
-            e = f.anEdge;
-            if (e.winding <= 0) continue;
-            do {
-                area += (e.Org.s - e.Sym.Org.s) * (e.Org.t + e.Sym.Org.t);
-                e = e.Lnext;
-            } while (e != f.anEdge);
-        }
-        if (area < 0) {
-/* Reverse the orientation by flipping all the t-coordinates */
-            for (v = vHead.next; v != vHead; v = v.next) {
-                v.t = -v.t;
-            }
-            tess.tUnit[0] = -tess.tUnit[0];
-            tess.tUnit[1] = -tess.tUnit[1];
-            tess.tUnit[2] = -tess.tUnit[2];
-        }
-    }
-
-/* Determine the polygon normal and project vertices onto the plane
- * of the polygon.
- */
-    public static void __gl_projectPolygon(GLUtessellatorImpl tess) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead;
-        double w;
-        double[] norm = new double[3];
-        double[] sUnit, tUnit;
-        int i;
-        boolean computedNormal = false;
-
-        norm[0] = tess.normal[0];
-        norm[1] = tess.normal[1];
-        norm[2] = tess.normal[2];
-        if (norm[0] == 0 && norm[1] == 0 && norm[2] == 0) {
-            ComputeNormal(tess, norm);
-            computedNormal = true;
-        }
-        sUnit = tess.sUnit;
-        tUnit = tess.tUnit;
-        i = LongAxis(norm);
-
-        if (TRUE_PROJECT) {
-/* Choose the initial sUnit vector to be approximately perpendicular
- * to the normal.
- */
-            Normalize(norm);
-
-            sUnit[i] = 0;
-            sUnit[(i + 1) % 3] = S_UNIT_X;
-            sUnit[(i + 2) % 3] = S_UNIT_Y;
-
-/* Now make it exactly perpendicular */
-            w = Dot(sUnit, norm);
-            sUnit[0] -= w * norm[0];
-            sUnit[1] -= w * norm[1];
-            sUnit[2] -= w * norm[2];
-            Normalize(sUnit);
-
-/* Choose tUnit so that (sUnit,tUnit,norm) form a right-handed frame */
-            tUnit[0] = norm[1] * sUnit[2] - norm[2] * sUnit[1];
-            tUnit[1] = norm[2] * sUnit[0] - norm[0] * sUnit[2];
-            tUnit[2] = norm[0] * sUnit[1] - norm[1] * sUnit[0];
-            Normalize(tUnit);
-        } else {
-/* Project perpendicular to a coordinate axis -- better numerically */
-            sUnit[i] = 0;
-            sUnit[(i + 1) % 3] = S_UNIT_X;
-            sUnit[(i + 2) % 3] = S_UNIT_Y;
-
-            tUnit[i] = 0;
-            tUnit[(i + 1) % 3] = (norm[i] > 0) ? -S_UNIT_Y : S_UNIT_Y;
-            tUnit[(i + 2) % 3] = (norm[i] > 0) ? S_UNIT_X : -S_UNIT_X;
-        }
-
-/* Project the vertices onto the sweep plane */
-        for (v = vHead.next; v != vHead; v = v.next) {
-            v.s = Dot(v.coords, sUnit);
-            v.t = Dot(v.coords, tUnit);
-        }
-        if (computedNormal) {
-            CheckOrientation(tess);
-        }
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQ.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQ.java
deleted file mode 100644
index b77305a..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQ.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-abstract class PriorityQ {
-    public static final int INIT_SIZE = 32;
-
-    public static class PQnode {
-        int handle;
-    }
-
-    public static class PQhandleElem {
-        Object key;
-        int node;
-    }
-
-    public static interface Leq {
-        boolean leq(Object key1, Object key2);
-    }
-
-    //    #ifdef FOR_TRITE_TEST_PROGRAM
-//    private static boolean LEQ(PriorityQCommon.Leq leq, Object x,Object y) {
-//        return pq.leq.leq(x,y);
-//    }
-//    #else
-/* Violates modularity, but a little faster */
-//    #include "geom.h"
-    public static boolean LEQ(Leq leq, Object x, Object y) {
-        return com.jogamp.opengl.impl.glu.tessellator.Geom.VertLeq((com.jogamp.opengl.impl.glu.tessellator.GLUvertex) x, (com.jogamp.opengl.impl.glu.tessellator.GLUvertex) y);
-    }
-
-    static PriorityQ pqNewPriorityQ(Leq leq) {
-        return new PriorityQSort(leq);
-    }
-
-    abstract void pqDeletePriorityQ();
-
-    abstract boolean pqInit();
-
-    abstract int pqInsert(Object keyNew);
-
-    abstract Object pqExtractMin();
-
-    abstract void pqDelete(int hCurr);
-
-    abstract Object pqMinimum();
-
-    abstract boolean pqIsEmpty();
-//    #endif
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQHeap.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQHeap.java
deleted file mode 100644
index 61aa957..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQHeap.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class PriorityQHeap extends com.jogamp.opengl.impl.glu.tessellator.PriorityQ {
-    com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQnode[] nodes;
-    com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] handles;
-    int size, max;
-    int freeList;
-    boolean initialized;
-    com.jogamp.opengl.impl.glu.tessellator.PriorityQ.Leq leq;
-
-/* really __gl_pqHeapNewPriorityQ */
-    public PriorityQHeap(com.jogamp.opengl.impl.glu.tessellator.PriorityQ.Leq leq) {
-        size = 0;
-        max = com.jogamp.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE;
-        nodes = new com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQnode[com.jogamp.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE + 1];
-        for (int i = 0; i < nodes.length; i++) {
-            nodes[i] = new PQnode();
-        }
-        handles = new com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[com.jogamp.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE + 1];
-        for (int i = 0; i < handles.length; i++) {
-            handles[i] = new PQhandleElem();
-        }
-        initialized = false;
-        freeList = 0;
-        this.leq = leq;
-
-        nodes[1].handle = 1;	/* so that Minimum() returns NULL */
-        handles[1].key = null;
-    }
-
-/* really __gl_pqHeapDeletePriorityQ */
-    void pqDeletePriorityQ() {
-        handles = null;
-        nodes = null;
-    }
-
-    void FloatDown(int curr) {
-        com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
-        com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
-        int hCurr, hChild;
-        int child;
-
-        hCurr = n[curr].handle;
-        for (; ;) {
-            child = curr << 1;
-            if (child < size && LEQ(leq, h[n[child + 1].handle].key,
-                    h[n[child].handle].key)) {
-                ++child;
-            }
-
-            assert (child <= max);
-
-            hChild = n[child].handle;
-            if (child > size || LEQ(leq, h[hCurr].key, h[hChild].key)) {
-                n[curr].handle = hCurr;
-                h[hCurr].node = curr;
-                break;
-            }
-            n[curr].handle = hChild;
-            h[hChild].node = curr;
-            curr = child;
-        }
-    }
-
-
-    void FloatUp(int curr) {
-        com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
-        com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
-        int hCurr, hParent;
-        int parent;
-
-        hCurr = n[curr].handle;
-        for (; ;) {
-            parent = curr >> 1;
-            hParent = n[parent].handle;
-            if (parent == 0 || LEQ(leq, h[hParent].key, h[hCurr].key)) {
-                n[curr].handle = hCurr;
-                h[hCurr].node = curr;
-                break;
-            }
-            n[curr].handle = hParent;
-            h[hParent].node = curr;
-            curr = parent;
-        }
-    }
-
-/* really __gl_pqHeapInit */
-    boolean pqInit() {
-        int i;
-
-        /* This method of building a heap is O(n), rather than O(n lg n). */
-
-        for (i = size; i >= 1; --i) {
-            FloatDown(i);
-        }
-        initialized = true;
-
-        return true;
-    }
-
-/* really __gl_pqHeapInsert */
-/* returns LONG_MAX iff out of memory */
-    int pqInsert(Object keyNew) {
-        int curr;
-        int free;
-
-        curr = ++size;
-        if ((curr * 2) > max) {
-            com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQnode[] saveNodes = nodes;
-            com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] saveHandles = handles;
-
-            /* If the heap overflows, double its size. */
-            max <<= 1;
-//            pq->nodes = (PQnode *)memRealloc( pq->nodes, (size_t) ((pq->max + 1) * sizeof( pq->nodes[0] )));
-            PriorityQ.PQnode[] pqNodes = new PriorityQ.PQnode[max + 1];
-            System.arraycopy( nodes, 0, pqNodes, 0, nodes.length );
-            for (int i = nodes.length; i < pqNodes.length; i++) {
-                pqNodes[i] = new PQnode();
-            }
-            nodes = pqNodes;
-            if (nodes == null) {
-                nodes = saveNodes;	/* restore ptr to free upon return */
-                return Integer.MAX_VALUE;
-            }
-
-//            pq->handles = (PQhandleElem *)memRealloc( pq->handles,(size_t)((pq->max + 1) * sizeof( pq->handles[0] )));
-            PriorityQ.PQhandleElem[] pqHandles = new PriorityQ.PQhandleElem[max + 1];
-            System.arraycopy( handles, 0, pqHandles, 0, handles.length );
-            for (int i = handles.length; i < pqHandles.length; i++) {
-                pqHandles[i] = new PQhandleElem();
-            }
-            handles = pqHandles;
-            if (handles == null) {
-                handles = saveHandles; /* restore ptr to free upon return */
-                return Integer.MAX_VALUE;
-            }
-        }
-
-        if (freeList == 0) {
-            free = curr;
-        } else {
-            free = freeList;
-            freeList = handles[free].node;
-        }
-
-        nodes[curr].handle = free;
-        handles[free].node = curr;
-        handles[free].key = keyNew;
-
-        if (initialized) {
-            FloatUp(curr);
-        }
-        assert (free != Integer.MAX_VALUE);
-        return free;
-    }
-
-/* really __gl_pqHeapExtractMin */
-    Object pqExtractMin() {
-        com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
-        com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
-        int hMin = n[1].handle;
-        Object min = h[hMin].key;
-
-        if (size > 0) {
-            n[1].handle = n[size].handle;
-            h[n[1].handle].node = 1;
-
-            h[hMin].key = null;
-            h[hMin].node = freeList;
-            freeList = hMin;
-
-            if (--size > 0) {
-                FloatDown(1);
-            }
-        }
-        return min;
-    }
-
-/* really __gl_pqHeapDelete */
-    void pqDelete(int hCurr) {
-        com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
-        com.jogamp.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
-        int curr;
-
-        assert (hCurr >= 1 && hCurr <= max && h[hCurr].key != null);
-
-        curr = h[hCurr].node;
-        n[curr].handle = n[size].handle;
-        h[n[curr].handle].node = curr;
-
-        if (curr <= --size) {
-            if (curr <= 1 || LEQ(leq, h[n[curr >> 1].handle].key, h[n[curr].handle].key)) {
-                FloatDown(curr);
-            } else {
-                FloatUp(curr);
-            }
-        }
-        h[hCurr].key = null;
-        h[hCurr].node = freeList;
-        freeList = hCurr;
-    }
-
-    Object pqMinimum() {
-        return handles[nodes[1].handle].key;
-    }
-
-    boolean pqIsEmpty() {
-        return size == 0;
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQSort.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQSort.java
deleted file mode 100644
index f115b8f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQSort.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class PriorityQSort extends com.jogamp.opengl.impl.glu.tessellator.PriorityQ {
-    com.jogamp.opengl.impl.glu.tessellator.PriorityQHeap heap;
-    Object[] keys;
-
-    // JAVA: 'order' contains indices into the keys array.
-    // This simulates the indirect pointers used in the original C code
-    // (from Frank Suykens, Luciad.com).
-    int[] order;
-    int size, max;
-    boolean initialized;
-    com.jogamp.opengl.impl.glu.tessellator.PriorityQ.Leq leq;
-
-    public PriorityQSort(com.jogamp.opengl.impl.glu.tessellator.PriorityQ.Leq leq) {
-        heap = new com.jogamp.opengl.impl.glu.tessellator.PriorityQHeap(leq);
-
-        keys = new Object[com.jogamp.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE];
-
-        size = 0;
-        max = com.jogamp.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE;
-        initialized = false;
-        this.leq = leq;
-    }
-
-/* really __gl_pqSortDeletePriorityQ */
-    void pqDeletePriorityQ() {
-        if (heap != null) heap.pqDeletePriorityQ();
-        order = null;
-        keys = null;
-    }
-
-    private static boolean LT(com.jogamp.opengl.impl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) {
-        return (!com.jogamp.opengl.impl.glu.tessellator.PriorityQHeap.LEQ(leq, y, x));
-    }
-
-    private static boolean GT(com.jogamp.opengl.impl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) {
-        return (!com.jogamp.opengl.impl.glu.tessellator.PriorityQHeap.LEQ(leq, x, y));
-    }
-
-    private static void Swap(int[] array, int a, int b) {
-        if (true) {
-            int tmp = array[a];
-            array[a] = array[b];
-            array[b] = tmp;
-        } else {
-
-        }
-    }
-
-    private static class Stack {
-        int p, r;
-    }
-
-/* really __gl_pqSortInit */
-    boolean pqInit() {
-        int p, r, i, j;
-        int piv;
-        Stack[] stack = new Stack[50];
-        for (int k = 0; k < stack.length; k++) {
-            stack[k] = new Stack();
-        }
-        int top = 0;
-
-        int seed = 2016473283;
-
-        /* Create an array of indirect pointers to the keys, so that we
-         * the handles we have returned are still valid.
-         */
-        order = new int[size + 1];
-/* the previous line is a patch to compensate for the fact that IBM */
-/* machines return a null on a malloc of zero bytes (unlike SGI),   */
-/* so we have to put in this defense to guard against a memory      */
-/* fault four lines down. from fossum at austin.ibm.com.               */
-        p = 0;
-        r = size - 1;
-        for (piv = 0, i = p; i <= r; ++piv, ++i) {
-            // indirect pointers: keep an index into the keys array, not a direct pointer to its contents
-            order[i] = piv;
-        }
-
-        /* Sort the indirect pointers in descending order,
-         * using randomized Quicksort
-         */
-        stack[top].p = p;
-        stack[top].r = r;
-        ++top;
-        while (--top >= 0) {
-            p = stack[top].p;
-            r = stack[top].r;
-            while (r > p + 10) {
-                seed = Math.abs( seed * 1539415821 + 1 );
-                i = p + seed % (r - p + 1);
-                piv = order[i];
-                order[i] = order[p];
-                order[p] = piv;
-                i = p - 1;
-                j = r + 1;
-                do {
-                    do {
-                        ++i;
-                    } while (GT(leq, keys[order[i]], keys[piv]));
-                    do {
-                        --j;
-                    } while (LT(leq, keys[order[j]], keys[piv]));
-                    Swap(order, i, j);
-                } while (i < j);
-                Swap(order, i, j);	/* Undo last swap */
-                if (i - p < r - j) {
-                    stack[top].p = j + 1;
-                    stack[top].r = r;
-                    ++top;
-                    r = i - 1;
-                } else {
-                    stack[top].p = p;
-                    stack[top].r = i - 1;
-                    ++top;
-                    p = j + 1;
-                }
-            }
-            /* Insertion sort small lists */
-            for (i = p + 1; i <= r; ++i) {
-                piv = order[i];
-                for (j = i; j > p && LT(leq, keys[order[j - 1]], keys[piv]); --j) {
-                    order[j] = order[j - 1];
-                }
-                order[j] = piv;
-            }
-        }
-        max = size;
-        initialized = true;
-        heap.pqInit();	/* always succeeds */
-
-/*        #ifndef NDEBUG
-        p = order;
-        r = p + size - 1;
-        for (i = p; i < r; ++i) {
-            Assertion.doAssert(LEQ(     * * (i + 1), **i ));
-        }
-        #endif*/
-
-        return true;
-    }
-
-/* really __gl_pqSortInsert */
-/* returns LONG_MAX iff out of memory */
-    int pqInsert(Object keyNew) {
-        int curr;
-
-        if (initialized) {
-            return heap.pqInsert(keyNew);
-        }
-        curr = size;
-        if (++size >= max) {
-            Object[] saveKey = keys;
-
-            /* If the heap overflows, double its size. */
-            max <<= 1;
-//            pq->keys = (PQHeapKey *)memRealloc( pq->keys,(size_t)(pq->max * sizeof( pq->keys[0] )));
-            Object[] pqKeys = new Object[max];
-            System.arraycopy( keys, 0, pqKeys, 0, keys.length );
-            keys = pqKeys;
-            if (keys == null) {
-                keys = saveKey;	/* restore ptr to free upon return */
-                return Integer.MAX_VALUE;
-            }
-        }
-        assert curr != Integer.MAX_VALUE;
-        keys[curr] = keyNew;
-
-        /* Negative handles index the sorted array. */
-        return -(curr + 1);
-    }
-
-/* really __gl_pqSortExtractMin */
-    Object pqExtractMin() {
-        Object sortMin, heapMin;
-
-        if (size == 0) {
-            return heap.pqExtractMin();
-        }
-        sortMin = keys[order[size - 1]];
-        if (!heap.pqIsEmpty()) {
-            heapMin = heap.pqMinimum();
-            if (LEQ(leq, heapMin, sortMin)) {
-                return heap.pqExtractMin();
-            }
-        }
-        do {
-            --size;
-        } while (size > 0 && keys[order[size - 1]] == null);
-        return sortMin;
-    }
-
-/* really __gl_pqSortMinimum */
-    Object pqMinimum() {
-        Object sortMin, heapMin;
-
-        if (size == 0) {
-            return heap.pqMinimum();
-        }
-        sortMin = keys[order[size - 1]];
-        if (!heap.pqIsEmpty()) {
-            heapMin = heap.pqMinimum();
-            if (com.jogamp.opengl.impl.glu.tessellator.PriorityQHeap.LEQ(leq, heapMin, sortMin)) {
-                return heapMin;
-            }
-        }
-        return sortMin;
-    }
-
-/* really __gl_pqSortIsEmpty */
-    boolean pqIsEmpty() {
-        return (size == 0) && heap.pqIsEmpty();
-    }
-
-/* really __gl_pqSortDelete */
-    void pqDelete(int curr) {
-        if (curr >= 0) {
-            heap.pqDelete(curr);
-            return;
-        }
-        curr = -(curr + 1);
-        assert curr < max && keys[curr] != null;
-
-        keys[curr] = null;
-        while (size > 0 && keys[order[size - 1]] == null) {
-            --size;
-        }
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Render.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Render.java
deleted file mode 100644
index 9761200..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Render.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-import javax.media.opengl.*;
-import javax.media.opengl.glu.*;
-
-class Render {
-    private static final boolean USE_OPTIMIZED_CODE_PATH = false;
-
-    private Render() {
-    }
-
-    private static final RenderFan renderFan = new RenderFan();
-    private static final RenderStrip renderStrip = new RenderStrip();
-    private static final RenderTriangle renderTriangle = new RenderTriangle();
-
-/* This structure remembers the information we need about a primitive
- * to be able to render it later, once we have determined which
- * primitive is able to use the most triangles.
- */
-    private static class FaceCount {
-        public FaceCount() {
-        }
-
-        public FaceCount(long size, com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eStart, renderCallBack render) {
-            this.size = size;
-            this.eStart = eStart;
-            this.render = render;
-        }
-
-        long size;		/* number of triangles used */
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eStart;	/* edge where this primitive starts */
-        renderCallBack render;
-    };
-
-    private static interface renderCallBack {
-        void render(GLUtessellatorImpl tess, com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e, long size);
-    }
-
-    /************************ Strips and Fans decomposition ******************/
-
-/* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle
- * fans, strips, and separate triangles.  A substantial effort is made
- * to use as few rendering primitives as possible (ie. to make the fans
- * and strips as large as possible).
- *
- * The rendering output is provided as callbacks (see the api).
- */
-    public static void __gl_renderMesh(GLUtessellatorImpl tess, com.jogamp.opengl.impl.glu.tessellator.GLUmesh mesh) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUface f;
-
-        /* Make a list of separate triangles so we can render them all at once */
-        tess.lonelyTriList = null;
-
-        for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
-            f.marked = false;
-        }
-        for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
-
-            /* We examine all faces in an arbitrary order.  Whenever we find
-             * an unprocessed face F, we output a group of faces including F
-             * whose size is maximum.
-             */
-            if (f.inside && !f.marked) {
-                RenderMaximumFaceGroup(tess, f);
-                assert (f.marked);
-            }
-        }
-        if (tess.lonelyTriList != null) {
-            RenderLonelyTriangles(tess, tess.lonelyTriList);
-            tess.lonelyTriList = null;
-        }
-    }
-
-
-    static void RenderMaximumFaceGroup(GLUtessellatorImpl tess, com.jogamp.opengl.impl.glu.tessellator.GLUface fOrig) {
-        /* We want to find the largest triangle fan or strip of unmarked faces
-         * which includes the given face fOrig.  There are 3 possible fans
-         * passing through fOrig (one centered at each vertex), and 3 possible
-         * strips (one for each CCW permutation of the vertices).  Our strategy
-         * is to try all of these, and take the primitive which uses the most
-         * triangles (a greedy approach).
-         */
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e = fOrig.anEdge;
-        FaceCount max = new FaceCount();
-        FaceCount newFace = new FaceCount();
-
-        max.size = 1;
-        max.eStart = e;
-        max.render = renderTriangle;
-
-        if (!tess.flagBoundary) {
-            newFace = MaximumFan(e);
-            if (newFace.size > max.size) {
-                max = newFace;
-            }
-            newFace = MaximumFan(e.Lnext);
-            if (newFace.size > max.size) {
-                max = newFace;
-            }
-            newFace = MaximumFan(e.Onext.Sym);
-            if (newFace.size > max.size) {
-                max = newFace;
-            }
-
-            newFace = MaximumStrip(e);
-            if (newFace.size > max.size) {
-                max = newFace;
-            }
-            newFace = MaximumStrip(e.Lnext);
-            if (newFace.size > max.size) {
-                max = newFace;
-            }
-            newFace = MaximumStrip(e.Onext.Sym);
-            if (newFace.size > max.size) {
-                max = newFace;
-            }
-        }
-        max.render.render(tess, max.eStart, max.size);
-    }
-
-
-/* Macros which keep track of faces we have marked temporarily, and allow
- * us to backtrack when necessary.  With triangle fans, this is not
- * really necessary, since the only awkward case is a loop of triangles
- * around a single origin vertex.  However with strips the situation is
- * more complicated, and we need a general tracking method like the
- * one here.
- */
-    private static boolean Marked(com.jogamp.opengl.impl.glu.tessellator.GLUface f) {
-        return !f.inside || f.marked;
-    }
-
-    private static GLUface AddToTrail(com.jogamp.opengl.impl.glu.tessellator.GLUface f, com.jogamp.opengl.impl.glu.tessellator.GLUface t) {
-        f.trail = t;
-        f.marked = true;
-        return f;
-    }
-
-    private static void FreeTrail(com.jogamp.opengl.impl.glu.tessellator.GLUface t) {
-        if (true) {
-            while (t != null) {
-                t.marked = false;
-                t = t.trail;
-            }
-        } else {
-            /* absorb trailing semicolon */
-        }
-    }
-
-    static FaceCount MaximumFan(com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eOrig) {
-        /* eOrig.Lface is the face we want to render.  We want to find the size
-         * of a maximal fan around eOrig.Org.  To do this we just walk around
-         * the origin vertex as far as possible in both directions.
-         */
-        FaceCount newFace = new FaceCount(0, null, renderFan);
-        com.jogamp.opengl.impl.glu.tessellator.GLUface trail = null;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e;
-
-        for (e = eOrig; !Marked(e.Lface); e = e.Onext) {
-            trail = AddToTrail(e.Lface, trail);
-            ++newFace.size;
-        }
-        for (e = eOrig; !Marked(e.Sym.Lface); e = e.Sym.Lnext) {
-            trail = AddToTrail(e.Sym.Lface, trail);
-            ++newFace.size;
-        }
-        newFace.eStart = e;
-        /*LINTED*/
-        FreeTrail(trail);
-        return newFace;
-    }
-
-
-    private static boolean IsEven(long n) {
-        return (n & 0x1L) == 0;
-    }
-
-    static FaceCount MaximumStrip(com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eOrig) {
-        /* Here we are looking for a maximal strip that contains the vertices
-         * eOrig.Org, eOrig.Dst, eOrig.Lnext.Dst (in that order or the
-         * reverse, such that all triangles are oriented CCW).
-         *
-         * Again we walk forward and backward as far as possible.  However for
-         * strips there is a twist: to get CCW orientations, there must be
-         * an *even* number of triangles in the strip on one side of eOrig.
-         * We walk the strip starting on a side with an even number of triangles;
-         * if both side have an odd number, we are forced to shorten one side.
-         */
-        FaceCount newFace = new FaceCount(0, null, renderStrip);
-        long headSize = 0, tailSize = 0;
-        com.jogamp.opengl.impl.glu.tessellator.GLUface trail = null;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e, eTail, eHead;
-
-        for (e = eOrig; !Marked(e.Lface); ++tailSize, e = e.Onext) {
-            trail = AddToTrail(e.Lface, trail);
-            ++tailSize;
-            e = e.Lnext.Sym;
-            if (Marked(e.Lface)) break;
-            trail = AddToTrail(e.Lface, trail);
-        }
-        eTail = e;
-
-        for (e = eOrig; !Marked(e.Sym.Lface); ++headSize, e = e.Sym.Onext.Sym) {
-            trail = AddToTrail(e.Sym.Lface, trail);
-            ++headSize;
-            e = e.Sym.Lnext;
-            if (Marked(e.Sym.Lface)) break;
-            trail = AddToTrail(e.Sym.Lface, trail);
-        }
-        eHead = e;
-
-        newFace.size = tailSize + headSize;
-        if (IsEven(tailSize)) {
-            newFace.eStart = eTail.Sym;
-        } else if (IsEven(headSize)) {
-            newFace.eStart = eHead;
-        } else {
-            /* Both sides have odd length, we must shorten one of them.  In fact,
-             * we must start from eHead to guarantee inclusion of eOrig.Lface.
-             */
-            --newFace.size;
-            newFace.eStart = eHead.Onext;
-        }
-        /*LINTED*/
-        FreeTrail(trail);
-        return newFace;
-    }
-
-    private static class RenderTriangle implements renderCallBack {
-        public void render(GLUtessellatorImpl tess, com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e, long size) {
-            /* Just add the triangle to a triangle list, so we can render all
-             * the separate triangles at once.
-             */
-            assert (size == 1);
-            tess.lonelyTriList = AddToTrail(e.Lface, tess.lonelyTriList);
-        }
-    }
-
-
-    static void RenderLonelyTriangles(GLUtessellatorImpl tess, com.jogamp.opengl.impl.glu.tessellator.GLUface f) {
-        /* Now we render all the separate triangles which could not be
-         * grouped into a triangle fan or strip.
-         */
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e;
-        int newState;
-        int edgeState = -1;	/* force edge state output for first vertex */
-
-        tess.callBeginOrBeginData(GL.GL_TRIANGLES);
-
-        for (; f != null; f = f.trail) {
-            /* Loop once for each edge (there will always be 3 edges) */
-
-            e = f.anEdge;
-            do {
-                if (tess.flagBoundary) {
-                    /* Set the "edge state" to true just before we output the
-                     * first vertex of each edge on the polygon boundary.
-                     */
-                    newState = (!e.Sym.Lface.inside) ? 1 : 0;
-                    if (edgeState != newState) {
-                        edgeState = newState;
-                        tess.callEdgeFlagOrEdgeFlagData( edgeState != 0);
-                    }
-                }
-                tess.callVertexOrVertexData( e.Org.data);
-
-                e = e.Lnext;
-            } while (e != f.anEdge);
-        }
-        tess.callEndOrEndData();
-    }
-
-    private static class RenderFan implements renderCallBack {
-        public void render(GLUtessellatorImpl tess, com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e, long size) {
-            /* Render as many CCW triangles as possible in a fan starting from
-             * edge "e".  The fan *should* contain exactly "size" triangles
-             * (otherwise we've goofed up somewhere).
-             */
-            tess.callBeginOrBeginData( GL.GL_TRIANGLE_FAN);
-            tess.callVertexOrVertexData( e.Org.data);
-            tess.callVertexOrVertexData( e.Sym.Org.data);
-
-            while (!Marked(e.Lface)) {
-                e.Lface.marked = true;
-                --size;
-                e = e.Onext;
-                tess.callVertexOrVertexData( e.Sym.Org.data);
-            }
-
-            assert (size == 0);
-            tess.callEndOrEndData();
-        }
-    }
-
-    private static class RenderStrip implements renderCallBack {
-        public void render(GLUtessellatorImpl tess, com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e, long size) {
-            /* Render as many CCW triangles as possible in a strip starting from
-             * edge "e".  The strip *should* contain exactly "size" triangles
-             * (otherwise we've goofed up somewhere).
-             */
-            tess.callBeginOrBeginData( GL.GL_TRIANGLE_STRIP);
-            tess.callVertexOrVertexData( e.Org.data);
-            tess.callVertexOrVertexData( e.Sym.Org.data);
-
-            while (!Marked(e.Lface)) {
-                e.Lface.marked = true;
-                --size;
-                e = e.Lnext.Sym;
-                tess.callVertexOrVertexData( e.Org.data);
-                if (Marked(e.Lface)) break;
-
-                e.Lface.marked = true;
-                --size;
-                e = e.Onext;
-                tess.callVertexOrVertexData( e.Sym.Org.data);
-            }
-
-            assert (size == 0);
-            tess.callEndOrEndData();
-        }
-    }
-
-    /************************ Boundary contour decomposition ******************/
-
-/* __gl_renderBoundary( tess, mesh ) takes a mesh, and outputs one
- * contour for each face marked "inside".  The rendering output is
- * provided as callbacks (see the api).
- */
-    public static void __gl_renderBoundary(GLUtessellatorImpl tess, com.jogamp.opengl.impl.glu.tessellator.GLUmesh mesh) {
-        com.jogamp.opengl.impl.glu.tessellator.GLUface f;
-        com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e;
-
-        for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
-            if (f.inside) {
-                tess.callBeginOrBeginData( GL.GL_LINE_LOOP);
-                e = f.anEdge;
-                do {
-                    tess.callVertexOrVertexData( e.Org.data);
-                    e = e.Lnext;
-                } while (e != f.anEdge);
-                tess.callEndOrEndData();
-            }
-        }
-    }
-
-
-    /************************ Quick-and-dirty decomposition ******************/
-
-    private static final int SIGN_INCONSISTENT = 2;
-
-    static int ComputeNormal(GLUtessellatorImpl tess, double[] norm, boolean check)
-/*
- * If check==false, we compute the polygon normal and place it in norm[].
- * If check==true, we check that each triangle in the fan from v0 has a
- * consistent orientation with respect to norm[].  If triangles are
- * consistently oriented CCW, return 1; if CW, return -1; if all triangles
- * are degenerate return 0; otherwise (no consistent orientation) return
- * SIGN_INCONSISTENT.
- */ {
-        com.jogamp.opengl.impl.glu.tessellator.CachedVertex[] v = tess.cache;
-//            CachedVertex vn = v0 + tess.cacheCount;
-        int vn = tess.cacheCount;
-//            CachedVertex vc;
-        int vc;
-        double dot, xc, yc, zc, xp, yp, zp;
-        double[] n = new double[3];
-        int sign = 0;
-
-        /* Find the polygon normal.  It is important to get a reasonable
-         * normal even when the polygon is self-intersecting (eg. a bowtie).
-         * Otherwise, the computed normal could be very tiny, but perpendicular
-         * to the true plane of the polygon due to numerical noise.  Then all
-         * the triangles would appear to be degenerate and we would incorrectly
-         * decompose the polygon as a fan (or simply not render it at all).
-         *
-         * We use a sum-of-triangles normal algorithm rather than the more
-         * efficient sum-of-trapezoids method (used in CheckOrientation()
-         * in normal.c).  This lets us explicitly reverse the signed area
-         * of some triangles to get a reasonable normal in the self-intersecting
-         * case.
-         */
-        if (!check) {
-            norm[0] = norm[1] = norm[2] = 0.0;
-        }
-
-        vc = 1;
-        xc = v[vc].coords[0] - v[0].coords[0];
-        yc = v[vc].coords[1] - v[0].coords[1];
-        zc = v[vc].coords[2] - v[0].coords[2];
-        while (++vc < vn) {
-            xp = xc;
-            yp = yc;
-            zp = zc;
-            xc = v[vc].coords[0] - v[0].coords[0];
-            yc = v[vc].coords[1] - v[0].coords[1];
-            zc = v[vc].coords[2] - v[0].coords[2];
-
-            /* Compute (vp - v0) cross (vc - v0) */
-            n[0] = yp * zc - zp * yc;
-            n[1] = zp * xc - xp * zc;
-            n[2] = xp * yc - yp * xc;
-
-            dot = n[0] * norm[0] + n[1] * norm[1] + n[2] * norm[2];
-            if (!check) {
-                /* Reverse the contribution of back-facing triangles to get
-                 * a reasonable normal for self-intersecting polygons (see above)
-                 */
-                if (dot >= 0) {
-                    norm[0] += n[0];
-                    norm[1] += n[1];
-                    norm[2] += n[2];
-                } else {
-                    norm[0] -= n[0];
-                    norm[1] -= n[1];
-                    norm[2] -= n[2];
-                }
-            } else if (dot != 0) {
-                /* Check the new orientation for consistency with previous triangles */
-                if (dot > 0) {
-                    if (sign < 0) return SIGN_INCONSISTENT;
-                    sign = 1;
-                } else {
-                    if (sign > 0) return SIGN_INCONSISTENT;
-                    sign = -1;
-                }
-            }
-        }
-        return sign;
-    }
-
-/* __gl_renderCache( tess ) takes a single contour and tries to render it
- * as a triangle fan.  This handles convex polygons, as well as some
- * non-convex polygons if we get lucky.
- *
- * Returns true if the polygon was successfully rendered.  The rendering
- * output is provided as callbacks (see the api).
- */
-    public static boolean __gl_renderCache(GLUtessellatorImpl tess) {
-        com.jogamp.opengl.impl.glu.tessellator.CachedVertex[] v = tess.cache;
-//            CachedVertex vn = v0 + tess.cacheCount;
-        int vn = tess.cacheCount;
-//            CachedVertex vc;
-        int vc;
-        double[] norm = new double[3];
-        int sign;
-
-        if (tess.cacheCount < 3) {
-            /* Degenerate contour -- no output */
-            return true;
-        }
-
-        norm[0] = tess.normal[0];
-        norm[1] = tess.normal[1];
-        norm[2] = tess.normal[2];
-        if (norm[0] == 0 && norm[1] == 0 && norm[2] == 0) {
-            ComputeNormal( tess, norm, false);
-        }
-
-        sign = ComputeNormal( tess, norm, true);
-        if (sign == SIGN_INCONSISTENT) {
-            /* Fan triangles did not have a consistent orientation */
-            return false;
-        }
-        if (sign == 0) {
-            /* All triangles were degenerate */
-            return true;
-        }
-
-        if ( !USE_OPTIMIZED_CODE_PATH ) {
-            return false;
-        } else {
-            /* Make sure we do the right thing for each winding rule */
-            switch (tess.windingRule) {
-                case GLU.GLU_TESS_WINDING_ODD:
-                case GLU.GLU_TESS_WINDING_NONZERO:
-                    break;
-                case GLU.GLU_TESS_WINDING_POSITIVE:
-                    if (sign < 0) return true;
-                    break;
-                case GLU.GLU_TESS_WINDING_NEGATIVE:
-                    if (sign > 0) return true;
-                    break;
-                case GLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
-                    return true;
-            }
-
-            tess.callBeginOrBeginData( tess.boundaryOnly ? GL.GL_LINE_LOOP
-                    : (tess.cacheCount > 3) ? GL.GL_TRIANGLE_FAN
-                    : GL.GL_TRIANGLES);
-
-            tess.callVertexOrVertexData( v[0].data);
-            if (sign > 0) {
-                for (vc = 1; vc < vn; ++vc) {
-                    tess.callVertexOrVertexData( v[vc].data);
-                }
-            } else {
-                for (vc = vn - 1; vc > 0; --vc) {
-                    tess.callVertexOrVertexData( v[vc].data);
-                }
-            }
-            tess.callEndOrEndData();
-            return true;
-        }
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Sweep.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Sweep.java
deleted file mode 100644
index 8ffeadb..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Sweep.java
+++ /dev/null
@@ -1,1353 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-import javax.media.opengl.*;
-import javax.media.opengl.glu.*;
-
-class Sweep {
-    private Sweep() {
-    }
-
-//    #ifdef FOR_TRITE_TEST_PROGRAM
-//    extern void DebugEvent( GLUtessellator *tess );
-//    #else
-    private static void DebugEvent(GLUtessellatorImpl tess) {
-
-    }
-//    #endif
-
-/*
- * Invariants for the Edge Dictionary.
- * - each pair of adjacent edges e2=Succ(e1) satisfies EdgeLeq(e1,e2)
- *   at any valid location of the sweep event
- * - if EdgeLeq(e2,e1) as well (at any valid sweep event), then e1 and e2
- *   share a common endpoint
- * - for each e, e.Dst has been processed, but not e.Org
- * - each edge e satisfies VertLeq(e.Dst,event) && VertLeq(event,e.Org)
- *   where "event" is the current sweep line event.
- * - no edge e has zero length
- *
- * Invariants for the Mesh (the processed portion).
- * - the portion of the mesh left of the sweep line is a planar graph,
- *   ie. there is *some* way to embed it in the plane
- * - no processed edge has zero length
- * - no two processed vertices have identical coordinates
- * - each "inside" region is monotone, ie. can be broken into two chains
- *   of monotonically increasing vertices according to VertLeq(v1,v2)
- *   - a non-invariant: these chains may intersect (very slightly)
- *
- * Invariants for the Sweep.
- * - if none of the edges incident to the event vertex have an activeRegion
- *   (ie. none of these edges are in the edge dictionary), then the vertex
- *   has only right-going edges.
- * - if an edge is marked "fixUpperEdge" (it is a temporary edge introduced
- *   by ConnectRightVertex), then it is the only right-going edge from
- *   its associated vertex.  (This says that these edges exist only
- *   when it is necessary.)
- */
-
-/* When we merge two edges into one, we need to compute the combined
- * winding of the new edge.
- */
-    private static void AddWinding(GLUhalfEdge eDst, GLUhalfEdge eSrc) {
-        eDst.winding += eSrc.winding;
-        eDst.Sym.winding += eSrc.Sym.winding;
-    }
-
-
-    private static ActiveRegion RegionBelow(ActiveRegion r) {
-        return ((ActiveRegion) Dict.dictKey(Dict.dictPred(r.nodeUp)));
-    }
-
-    private static ActiveRegion RegionAbove(ActiveRegion r) {
-        return ((ActiveRegion) Dict.dictKey(Dict.dictSucc(r.nodeUp)));
-    }
-
-    static boolean EdgeLeq(GLUtessellatorImpl tess, ActiveRegion reg1, ActiveRegion reg2)
-/*
- * Both edges must be directed from right to left (this is the canonical
- * direction for the upper edge of each region).
- *
- * The strategy is to evaluate a "t" value for each edge at the
- * current sweep line position, given by tess.event.  The calculations
- * are designed to be very stable, but of course they are not perfect.
- *
- * Special case: if both edge destinations are at the sweep event,
- * we sort the edges by slope (they would otherwise compare equally).
- */ {
-        GLUvertex event = tess.event;
-        GLUhalfEdge e1, e2;
-        double t1, t2;
-
-        e1 = reg1.eUp;
-        e2 = reg2.eUp;
-
-        if (e1.Sym.Org == event) {
-            if (e2.Sym.Org == event) {
-                /* Two edges right of the sweep line which meet at the sweep event.
-                 * Sort them by slope.
-                 */
-                if (Geom.VertLeq(e1.Org, e2.Org)) {
-                    return Geom.EdgeSign(e2.Sym.Org, e1.Org, e2.Org) <= 0;
-                }
-                return Geom.EdgeSign(e1.Sym.Org, e2.Org, e1.Org) >= 0;
-            }
-            return Geom.EdgeSign(e2.Sym.Org, event, e2.Org) <= 0;
-        }
-        if (e2.Sym.Org == event) {
-            return Geom.EdgeSign(e1.Sym.Org, event, e1.Org) >= 0;
-        }
-
-        /* General case - compute signed distance *from* e1, e2 to event */
-        t1 = Geom.EdgeEval(e1.Sym.Org, event, e1.Org);
-        t2 = Geom.EdgeEval(e2.Sym.Org, event, e2.Org);
-        return (t1 >= t2);
-    }
-
-
-    static void DeleteRegion(GLUtessellatorImpl tess, ActiveRegion reg) {
-        if (reg.fixUpperEdge) {
-            /* It was created with zero winding number, so it better be
-             * deleted with zero winding number (ie. it better not get merged
-             * with a real edge).
-             */
-            assert (reg.eUp.winding == 0);
-        }
-        reg.eUp.activeRegion = null;
-        Dict.dictDelete(tess.dict, reg.nodeUp); /* __gl_dictListDelete */
-    }
-
-
-    static boolean FixUpperEdge(ActiveRegion reg, GLUhalfEdge newEdge)
-/*
- * Replace an upper edge which needs fixing (see ConnectRightVertex).
- */ {
-        assert (reg.fixUpperEdge);
-        if (!Mesh.__gl_meshDelete(reg.eUp)) return false;
-        reg.fixUpperEdge = false;
-        reg.eUp = newEdge;
-        newEdge.activeRegion = reg;
-
-        return true;
-    }
-
-    static ActiveRegion TopLeftRegion(ActiveRegion reg) {
-        GLUvertex org = reg.eUp.Org;
-        GLUhalfEdge e;
-
-        /* Find the region above the uppermost edge with the same origin */
-        do {
-            reg = RegionAbove(reg);
-        } while (reg.eUp.Org == org);
-
-        /* If the edge above was a temporary edge introduced by ConnectRightVertex,
-         * now is the time to fix it.
-         */
-        if (reg.fixUpperEdge) {
-            e = Mesh.__gl_meshConnect(RegionBelow(reg).eUp.Sym, reg.eUp.Lnext);
-            if (e == null) return null;
-            if (!FixUpperEdge(reg, e)) return null;
-            reg = RegionAbove(reg);
-        }
-        return reg;
-    }
-
-    static ActiveRegion TopRightRegion(ActiveRegion reg) {
-        GLUvertex dst = reg.eUp.Sym.Org;
-
-        /* Find the region above the uppermost edge with the same destination */
-        do {
-            reg = RegionAbove(reg);
-        } while (reg.eUp.Sym.Org == dst);
-        return reg;
-    }
-
-    static ActiveRegion AddRegionBelow(GLUtessellatorImpl tess,
-                                       ActiveRegion regAbove,
-                                       GLUhalfEdge eNewUp)
-/*
- * Add a new active region to the sweep line, *somewhere* below "regAbove"
- * (according to where the new edge belongs in the sweep-line dictionary).
- * The upper edge of the new region will be "eNewUp".
- * Winding number and "inside" flag are not updated.
- */ {
-        ActiveRegion regNew = new ActiveRegion();
-        if (regNew == null) throw new RuntimeException();
-
-        regNew.eUp = eNewUp;
-        /* __gl_dictListInsertBefore */
-        regNew.nodeUp = Dict.dictInsertBefore(tess.dict, regAbove.nodeUp, regNew);
-        if (regNew.nodeUp == null) throw new RuntimeException();
-        regNew.fixUpperEdge = false;
-        regNew.sentinel = false;
-        regNew.dirty = false;
-
-        eNewUp.activeRegion = regNew;
-        return regNew;
-    }
-
-    static boolean IsWindingInside(GLUtessellatorImpl tess, int n) {
-        switch (tess.windingRule) {
-            case GLU.GLU_TESS_WINDING_ODD:
-                return (n & 1) != 0;
-            case GLU.GLU_TESS_WINDING_NONZERO:
-                return (n != 0);
-            case GLU.GLU_TESS_WINDING_POSITIVE:
-                return (n > 0);
-            case GLU.GLU_TESS_WINDING_NEGATIVE:
-                return (n < 0);
-            case GLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
-                return (n >= 2) || (n <= -2);
-        }
-        /*LINTED*/
-//        assert (false);
-        throw new InternalError();
-        /*NOTREACHED*/
-    }
-
-
-    static void ComputeWinding(GLUtessellatorImpl tess, ActiveRegion reg) {
-        reg.windingNumber = RegionAbove(reg).windingNumber + reg.eUp.winding;
-        reg.inside = IsWindingInside(tess, reg.windingNumber);
-    }
-
-
-    static void FinishRegion(GLUtessellatorImpl tess, ActiveRegion reg)
-/*
- * Delete a region from the sweep line.  This happens when the upper
- * and lower chains of a region meet (at a vertex on the sweep line).
- * The "inside" flag is copied to the appropriate mesh face (we could
- * not do this before -- since the structure of the mesh is always
- * changing, this face may not have even existed until now).
- */ {
-        GLUhalfEdge e = reg.eUp;
-        GLUface f = e.Lface;
-
-        f.inside = reg.inside;
-        f.anEdge = e;   /* optimization for __gl_meshTessellateMonoRegion() */
-        DeleteRegion(tess, reg);
-    }
-
-
-    static GLUhalfEdge FinishLeftRegions(GLUtessellatorImpl tess,
-                                         ActiveRegion regFirst, ActiveRegion regLast)
-/*
- * We are given a vertex with one or more left-going edges.  All affected
- * edges should be in the edge dictionary.  Starting at regFirst.eUp,
- * we walk down deleting all regions where both edges have the same
- * origin vOrg.  At the same time we copy the "inside" flag from the
- * active region to the face, since at this point each face will belong
- * to at most one region (this was not necessarily true until this point
- * in the sweep).  The walk stops at the region above regLast; if regLast
- * is null we walk as far as possible.  At the same time we relink the
- * mesh if necessary, so that the ordering of edges around vOrg is the
- * same as in the dictionary.
- */ {
-        ActiveRegion reg, regPrev;
-        GLUhalfEdge e, ePrev;
-
-        regPrev = regFirst;
-        ePrev = regFirst.eUp;
-        while (regPrev != regLast) {
-            regPrev.fixUpperEdge = false;	/* placement was OK */
-            reg = RegionBelow(regPrev);
-            e = reg.eUp;
-            if (e.Org != ePrev.Org) {
-                if (!reg.fixUpperEdge) {
-                    /* Remove the last left-going edge.  Even though there are no further
-                     * edges in the dictionary with this origin, there may be further
-                     * such edges in the mesh (if we are adding left edges to a vertex
-                     * that has already been processed).  Thus it is important to call
-                     * FinishRegion rather than just DeleteRegion.
-                     */
-                    FinishRegion(tess, regPrev);
-                    break;
-                }
-                /* If the edge below was a temporary edge introduced by
-                 * ConnectRightVertex, now is the time to fix it.
-                 */
-                e = Mesh.__gl_meshConnect(ePrev.Onext.Sym, e.Sym);
-                if (e == null) throw new RuntimeException();
-                if (!FixUpperEdge(reg, e)) throw new RuntimeException();
-            }
-
-            /* Relink edges so that ePrev.Onext == e */
-            if (ePrev.Onext != e) {
-                if (!Mesh.__gl_meshSplice(e.Sym.Lnext, e)) throw new RuntimeException();
-                if (!Mesh.__gl_meshSplice(ePrev, e)) throw new RuntimeException();
-            }
-            FinishRegion(tess, regPrev);	/* may change reg.eUp */
-            ePrev = reg.eUp;
-            regPrev = reg;
-        }
-        return ePrev;
-    }
-
-
-    static void AddRightEdges(GLUtessellatorImpl tess, ActiveRegion regUp,
-                              GLUhalfEdge eFirst, GLUhalfEdge eLast, GLUhalfEdge eTopLeft,
-                              boolean cleanUp)
-/*
- * Purpose: insert right-going edges into the edge dictionary, and update
- * winding numbers and mesh connectivity appropriately.  All right-going
- * edges share a common origin vOrg.  Edges are inserted CCW starting at
- * eFirst; the last edge inserted is eLast.Sym.Lnext.  If vOrg has any
- * left-going edges already processed, then eTopLeft must be the edge
- * such that an imaginary upward vertical segment from vOrg would be
- * contained between eTopLeft.Sym.Lnext and eTopLeft; otherwise eTopLeft
- * should be null.
- */ {
-        ActiveRegion reg, regPrev;
-        GLUhalfEdge e, ePrev;
-        boolean firstTime = true;
-
-        /* Insert the new right-going edges in the dictionary */
-        e = eFirst;
-        do {
-            assert (Geom.VertLeq(e.Org, e.Sym.Org));
-            AddRegionBelow(tess, regUp, e.Sym);
-            e = e.Onext;
-        } while (e != eLast);
-
-        /* Walk *all* right-going edges from e.Org, in the dictionary order,
-         * updating the winding numbers of each region, and re-linking the mesh
-         * edges to match the dictionary ordering (if necessary).
-         */
-        if (eTopLeft == null) {
-            eTopLeft = RegionBelow(regUp).eUp.Sym.Onext;
-        }
-        regPrev = regUp;
-        ePrev = eTopLeft;
-        for (; ;) {
-            reg = RegionBelow(regPrev);
-            e = reg.eUp.Sym;
-            if (e.Org != ePrev.Org) break;
-
-            if (e.Onext != ePrev) {
-                /* Unlink e from its current position, and relink below ePrev */
-                if (!Mesh.__gl_meshSplice(e.Sym.Lnext, e)) throw new RuntimeException();
-                if (!Mesh.__gl_meshSplice(ePrev.Sym.Lnext, e)) throw new RuntimeException();
-            }
-            /* Compute the winding number and "inside" flag for the new regions */
-            reg.windingNumber = regPrev.windingNumber - e.winding;
-            reg.inside = IsWindingInside(tess, reg.windingNumber);
-
-            /* Check for two outgoing edges with same slope -- process these
-             * before any intersection tests (see example in __gl_computeInterior).
-             */
-            regPrev.dirty = true;
-            if (!firstTime && CheckForRightSplice(tess, regPrev)) {
-                AddWinding(e, ePrev);
-                DeleteRegion(tess, regPrev);
-                if (!Mesh.__gl_meshDelete(ePrev)) throw new RuntimeException();
-            }
-            firstTime = false;
-            regPrev = reg;
-            ePrev = e;
-        }
-        regPrev.dirty = true;
-        assert (regPrev.windingNumber - e.winding == reg.windingNumber);
-
-        if (cleanUp) {
-            /* Check for intersections between newly adjacent edges. */
-            WalkDirtyRegions(tess, regPrev);
-        }
-    }
-
-
-    static void CallCombine(GLUtessellatorImpl tess, GLUvertex isect,
-                            Object[] data, float[] weights, boolean needed) {
-        double[] coords = new double[3];
-
-        /* Copy coord data in case the callback changes it. */
-        coords[0] = isect.coords[0];
-        coords[1] = isect.coords[1];
-        coords[2] = isect.coords[2];
-
-        Object[] outData = new Object[1];
-        tess.callCombineOrCombineData(coords, data, weights, outData);
-        isect.data = outData[0];
-        if (isect.data == null) {
-            if (!needed) {
-                isect.data = data[0];
-            } else if (!tess.fatalError) {
-                /* The only way fatal error is when two edges are found to intersect,
-                 * but the user has not provided the callback necessary to handle
-                 * generated intersection points.
-                 */
-                tess.callErrorOrErrorData(GLU.GLU_TESS_NEED_COMBINE_CALLBACK);
-                tess.fatalError = true;
-            }
-        }
-    }
-
-    static void SpliceMergeVertices(GLUtessellatorImpl tess, GLUhalfEdge e1,
-                                    GLUhalfEdge e2)
-/*
- * Two vertices with idential coordinates are combined into one.
- * e1.Org is kept, while e2.Org is discarded.
- */ {
-        Object[] data = new Object[4];
-        float[] weights = new float[]{0.5f, 0.5f, 0.0f, 0.0f};
-
-        data[0] = e1.Org.data;
-        data[1] = e2.Org.data;
-        CallCombine(tess, e1.Org, data, weights, false);
-        if (!Mesh.__gl_meshSplice(e1, e2)) throw new RuntimeException();
-    }
-
-    static void VertexWeights(GLUvertex isect, GLUvertex org, GLUvertex dst,
-                              float[] weights)
-/*
- * Find some weights which describe how the intersection vertex is
- * a linear combination of "org" and "dest".  Each of the two edges
- * which generated "isect" is allocated 50% of the weight; each edge
- * splits the weight between its org and dst according to the
- * relative distance to "isect".
- */ {
-        double t1 = Geom.VertL1dist(org, isect);
-        double t2 = Geom.VertL1dist(dst, isect);
-
-        weights[0] = (float) (0.5 * t2 / (t1 + t2));
-        weights[1] = (float) (0.5 * t1 / (t1 + t2));
-        isect.coords[0] += weights[0] * org.coords[0] + weights[1] * dst.coords[0];
-        isect.coords[1] += weights[0] * org.coords[1] + weights[1] * dst.coords[1];
-        isect.coords[2] += weights[0] * org.coords[2] + weights[1] * dst.coords[2];
-    }
-
-
-    static void GetIntersectData(GLUtessellatorImpl tess, GLUvertex isect,
-                                 GLUvertex orgUp, GLUvertex dstUp,
-                                 GLUvertex orgLo, GLUvertex dstLo)
-/*
- * We've computed a new intersection point, now we need a "data" pointer
- * from the user so that we can refer to this new vertex in the
- * rendering callbacks.
- */ {
-        Object[] data = new Object[4];
-        float[] weights = new float[4];
-        float[] weights1 = new float[2];
-        float[] weights2 = new float[2];
-
-        data[0] = orgUp.data;
-        data[1] = dstUp.data;
-        data[2] = orgLo.data;
-        data[3] = dstLo.data;
-
-        isect.coords[0] = isect.coords[1] = isect.coords[2] = 0;
-        VertexWeights(isect, orgUp, dstUp, weights1);
-        VertexWeights(isect, orgLo, dstLo, weights2);
-        System.arraycopy(weights1, 0, weights, 0, 2);
-        System.arraycopy(weights2, 0, weights, 2, 2);
-
-        CallCombine(tess, isect, data, weights, true);
-    }
-
-    static boolean CheckForRightSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
-/*
- * Check the upper and lower edge of "regUp", to make sure that the
- * eUp.Org is above eLo, or eLo.Org is below eUp (depending on which
- * origin is leftmost).
- *
- * The main purpose is to splice right-going edges with the same
- * dest vertex and nearly identical slopes (ie. we can't distinguish
- * the slopes numerically).  However the splicing can also help us
- * to recover from numerical errors.  For example, suppose at one
- * point we checked eUp and eLo, and decided that eUp.Org is barely
- * above eLo.  Then later, we split eLo into two edges (eg. from
- * a splice operation like this one).  This can change the result of
- * our test so that now eUp.Org is incident to eLo, or barely below it.
- * We must correct this condition to maintain the dictionary invariants.
- *
- * One possibility is to check these edges for intersection again
- * (ie. CheckForIntersect).  This is what we do if possible.  However
- * CheckForIntersect requires that tess.event lies between eUp and eLo,
- * so that it has something to fall back on when the intersection
- * calculation gives us an unusable answer.  So, for those cases where
- * we can't check for intersection, this routine fixes the problem
- * by just splicing the offending vertex into the other edge.
- * This is a guaranteed solution, no matter how degenerate things get.
- * Basically this is a combinatorial solution to a numerical problem.
- */ {
-        ActiveRegion regLo = RegionBelow(regUp);
-        GLUhalfEdge eUp = regUp.eUp;
-        GLUhalfEdge eLo = regLo.eUp;
-
-        if (Geom.VertLeq(eUp.Org, eLo.Org)) {
-            if (Geom.EdgeSign(eLo.Sym.Org, eUp.Org, eLo.Org) > 0) return false;
-
-            /* eUp.Org appears to be below eLo */
-            if (!Geom.VertEq(eUp.Org, eLo.Org)) {
-                /* Splice eUp.Org into eLo */
-                if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
-                if (!Mesh.__gl_meshSplice(eUp, eLo.Sym.Lnext)) throw new RuntimeException();
-                regUp.dirty = regLo.dirty = true;
-
-            } else if (eUp.Org != eLo.Org) {
-                /* merge the two vertices, discarding eUp.Org */
-                tess.pq.pqDelete(eUp.Org.pqHandle); /* __gl_pqSortDelete */
-                SpliceMergeVertices(tess, eLo.Sym.Lnext, eUp);
-            }
-        } else {
-            if (Geom.EdgeSign(eUp.Sym.Org, eLo.Org, eUp.Org) < 0) return false;
-
-            /* eLo.Org appears to be above eUp, so splice eLo.Org into eUp */
-            RegionAbove(regUp).dirty = regUp.dirty = true;
-            if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
-            if (!Mesh.__gl_meshSplice(eLo.Sym.Lnext, eUp)) throw new RuntimeException();
-        }
-        return true;
-    }
-
-    static boolean CheckForLeftSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
-/*
- * Check the upper and lower edge of "regUp", to make sure that the
- * eUp.Sym.Org is above eLo, or eLo.Sym.Org is below eUp (depending on which
- * destination is rightmost).
- *
- * Theoretically, this should always be true.  However, splitting an edge
- * into two pieces can change the results of previous tests.  For example,
- * suppose at one point we checked eUp and eLo, and decided that eUp.Sym.Org
- * is barely above eLo.  Then later, we split eLo into two edges (eg. from
- * a splice operation like this one).  This can change the result of
- * the test so that now eUp.Sym.Org is incident to eLo, or barely below it.
- * We must correct this condition to maintain the dictionary invariants
- * (otherwise new edges might get inserted in the wrong place in the
- * dictionary, and bad stuff will happen).
- *
- * We fix the problem by just splicing the offending vertex into the
- * other edge.
- */ {
-        ActiveRegion regLo = RegionBelow(regUp);
-        GLUhalfEdge eUp = regUp.eUp;
-        GLUhalfEdge eLo = regLo.eUp;
-        GLUhalfEdge e;
-
-        assert (!Geom.VertEq(eUp.Sym.Org, eLo.Sym.Org));
-
-        if (Geom.VertLeq(eUp.Sym.Org, eLo.Sym.Org)) {
-            if (Geom.EdgeSign(eUp.Sym.Org, eLo.Sym.Org, eUp.Org) < 0) return false;
-
-            /* eLo.Sym.Org is above eUp, so splice eLo.Sym.Org into eUp */
-            RegionAbove(regUp).dirty = regUp.dirty = true;
-            e = Mesh.__gl_meshSplitEdge(eUp);
-            if (e == null) throw new RuntimeException();
-            if (!Mesh.__gl_meshSplice(eLo.Sym, e)) throw new RuntimeException();
-            e.Lface.inside = regUp.inside;
-        } else {
-            if (Geom.EdgeSign(eLo.Sym.Org, eUp.Sym.Org, eLo.Org) > 0) return false;
-
-            /* eUp.Sym.Org is below eLo, so splice eUp.Sym.Org into eLo */
-            regUp.dirty = regLo.dirty = true;
-            e = Mesh.__gl_meshSplitEdge(eLo);
-            if (e == null) throw new RuntimeException();
-            if (!Mesh.__gl_meshSplice(eUp.Lnext, eLo.Sym)) throw new RuntimeException();
-            e.Sym.Lface.inside = regUp.inside;
-        }
-        return true;
-    }
-
-
-    static boolean CheckForIntersect(GLUtessellatorImpl tess, ActiveRegion regUp)
-/*
- * Check the upper and lower edges of the given region to see if
- * they intersect.  If so, create the intersection and add it
- * to the data structures.
- *
- * Returns true if adding the new intersection resulted in a recursive
- * call to AddRightEdges(); in this case all "dirty" regions have been
- * checked for intersections, and possibly regUp has been deleted.
- */ {
-        ActiveRegion regLo = RegionBelow(regUp);
-        GLUhalfEdge eUp = regUp.eUp;
-        GLUhalfEdge eLo = regLo.eUp;
-        GLUvertex orgUp = eUp.Org;
-        GLUvertex orgLo = eLo.Org;
-        GLUvertex dstUp = eUp.Sym.Org;
-        GLUvertex dstLo = eLo.Sym.Org;
-        double tMinUp, tMaxLo;
-        GLUvertex isect = new GLUvertex();
-        GLUvertex orgMin;
-        GLUhalfEdge e;
-
-        assert (!Geom.VertEq(dstLo, dstUp));
-        assert (Geom.EdgeSign(dstUp, tess.event, orgUp) <= 0);
-        assert (Geom.EdgeSign(dstLo, tess.event, orgLo) >= 0);
-        assert (orgUp != tess.event && orgLo != tess.event);
-        assert (!regUp.fixUpperEdge && !regLo.fixUpperEdge);
-
-        if (orgUp == orgLo) return false;	/* right endpoints are the same */
-
-        tMinUp = Math.min(orgUp.t, dstUp.t);
-        tMaxLo = Math.max(orgLo.t, dstLo.t);
-        if (tMinUp > tMaxLo) return false;	/* t ranges do not overlap */
-
-        if (Geom.VertLeq(orgUp, orgLo)) {
-            if (Geom.EdgeSign(dstLo, orgUp, orgLo) > 0) return false;
-        } else {
-            if (Geom.EdgeSign(dstUp, orgLo, orgUp) < 0) return false;
-        }
-
-        /* At this point the edges intersect, at least marginally */
-        DebugEvent(tess);
-
-        Geom.EdgeIntersect(dstUp, orgUp, dstLo, orgLo, isect);
-        /* The following properties are guaranteed: */
-        assert (Math.min(orgUp.t, dstUp.t) <= isect.t);
-        assert (isect.t <= Math.max(orgLo.t, dstLo.t));
-        assert (Math.min(dstLo.s, dstUp.s) <= isect.s);
-        assert (isect.s <= Math.max(orgLo.s, orgUp.s));
-
-        if (Geom.VertLeq(isect, tess.event)) {
-            /* The intersection point lies slightly to the left of the sweep line,
-             * so move it until it''s slightly to the right of the sweep line.
-             * (If we had perfect numerical precision, this would never happen
-             * in the first place).  The easiest and safest thing to do is
-             * replace the intersection by tess.event.
-             */
-            isect.s = tess.event.s;
-            isect.t = tess.event.t;
-        }
-        /* Similarly, if the computed intersection lies to the right of the
-         * rightmost origin (which should rarely happen), it can cause
-         * unbelievable inefficiency on sufficiently degenerate inputs.
-         * (If you have the test program, try running test54.d with the
-         * "X zoom" option turned on).
-         */
-        orgMin = Geom.VertLeq(orgUp, orgLo) ? orgUp : orgLo;
-        if (Geom.VertLeq(orgMin, isect)) {
-            isect.s = orgMin.s;
-            isect.t = orgMin.t;
-        }
-
-        if (Geom.VertEq(isect, orgUp) || Geom.VertEq(isect, orgLo)) {
-            /* Easy case -- intersection at one of the right endpoints */
-            CheckForRightSplice(tess, regUp);
-            return false;
-        }
-
-        if ((!Geom.VertEq(dstUp, tess.event)
-                && Geom.EdgeSign(dstUp, tess.event, isect) >= 0)
-                || (!Geom.VertEq(dstLo, tess.event)
-                && Geom.EdgeSign(dstLo, tess.event, isect) <= 0)) {
-            /* Very unusual -- the new upper or lower edge would pass on the
-             * wrong side of the sweep event, or through it.  This can happen
-             * due to very small numerical errors in the intersection calculation.
-             */
-            if (dstLo == tess.event) {
-                /* Splice dstLo into eUp, and process the new region(s) */
-                if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
-                if (!Mesh.__gl_meshSplice(eLo.Sym, eUp)) throw new RuntimeException();
-                regUp = TopLeftRegion(regUp);
-                if (regUp == null) throw new RuntimeException();
-                eUp = RegionBelow(regUp).eUp;
-                FinishLeftRegions(tess, RegionBelow(regUp), regLo);
-                AddRightEdges(tess, regUp, eUp.Sym.Lnext, eUp, eUp, true);
-                return true;
-            }
-            if (dstUp == tess.event) {
-                /* Splice dstUp into eLo, and process the new region(s) */
-                if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
-                if (!Mesh.__gl_meshSplice(eUp.Lnext, eLo.Sym.Lnext)) throw new RuntimeException();
-                regLo = regUp;
-                regUp = TopRightRegion(regUp);
-                e = RegionBelow(regUp).eUp.Sym.Onext;
-                regLo.eUp = eLo.Sym.Lnext;
-                eLo = FinishLeftRegions(tess, regLo, null);
-                AddRightEdges(tess, regUp, eLo.Onext, eUp.Sym.Onext, e, true);
-                return true;
-            }
-            /* Special case: called from ConnectRightVertex.  If either
-             * edge passes on the wrong side of tess.event, split it
-             * (and wait for ConnectRightVertex to splice it appropriately).
-             */
-            if (Geom.EdgeSign(dstUp, tess.event, isect) >= 0) {
-                RegionAbove(regUp).dirty = regUp.dirty = true;
-                if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
-                eUp.Org.s = tess.event.s;
-                eUp.Org.t = tess.event.t;
-            }
-            if (Geom.EdgeSign(dstLo, tess.event, isect) <= 0) {
-                regUp.dirty = regLo.dirty = true;
-                if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
-                eLo.Org.s = tess.event.s;
-                eLo.Org.t = tess.event.t;
-            }
-            /* leave the rest for ConnectRightVertex */
-            return false;
-        }
-
-        /* General case -- split both edges, splice into new vertex.
-         * When we do the splice operation, the order of the arguments is
-         * arbitrary as far as correctness goes.  However, when the operation
-         * creates a new face, the work done is proportional to the size of
-         * the new face.  We expect the faces in the processed part of
-         * the mesh (ie. eUp.Lface) to be smaller than the faces in the
-         * unprocessed original contours (which will be eLo.Sym.Lnext.Lface).
-         */
-        if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
-        if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
-        if (!Mesh.__gl_meshSplice(eLo.Sym.Lnext, eUp)) throw new RuntimeException();
-        eUp.Org.s = isect.s;
-        eUp.Org.t = isect.t;
-        eUp.Org.pqHandle = tess.pq.pqInsert(eUp.Org); /* __gl_pqSortInsert */
-        if (eUp.Org.pqHandle == Long.MAX_VALUE) {
-            tess.pq.pqDeletePriorityQ();	/* __gl_pqSortDeletePriorityQ */
-            tess.pq = null;
-            throw new RuntimeException();
-        }
-        GetIntersectData(tess, eUp.Org, orgUp, dstUp, orgLo, dstLo);
-        RegionAbove(regUp).dirty = regUp.dirty = regLo.dirty = true;
-        return false;
-    }
-
-    static void WalkDirtyRegions(GLUtessellatorImpl tess, ActiveRegion regUp)
-/*
- * When the upper or lower edge of any region changes, the region is
- * marked "dirty".  This routine walks through all the dirty regions
- * and makes sure that the dictionary invariants are satisfied
- * (see the comments at the beginning of this file).  Of course
- * new dirty regions can be created as we make changes to restore
- * the invariants.
- */ {
-        ActiveRegion regLo = RegionBelow(regUp);
-        GLUhalfEdge eUp, eLo;
-
-        for (; ;) {
-            /* Find the lowest dirty region (we walk from the bottom up). */
-            while (regLo.dirty) {
-                regUp = regLo;
-                regLo = RegionBelow(regLo);
-            }
-            if (!regUp.dirty) {
-                regLo = regUp;
-                regUp = RegionAbove(regUp);
-                if (regUp == null || !regUp.dirty) {
-                    /* We've walked all the dirty regions */
-                    return;
-                }
-            }
-            regUp.dirty = false;
-            eUp = regUp.eUp;
-            eLo = regLo.eUp;
-
-            if (eUp.Sym.Org != eLo.Sym.Org) {
-                /* Check that the edge ordering is obeyed at the Dst vertices. */
-                if (CheckForLeftSplice(tess, regUp)) {
-
-                    /* If the upper or lower edge was marked fixUpperEdge, then
-                     * we no longer need it (since these edges are needed only for
-                     * vertices which otherwise have no right-going edges).
-                     */
-                    if (regLo.fixUpperEdge) {
-                        DeleteRegion(tess, regLo);
-                        if (!Mesh.__gl_meshDelete(eLo)) throw new RuntimeException();
-                        regLo = RegionBelow(regUp);
-                        eLo = regLo.eUp;
-                    } else if (regUp.fixUpperEdge) {
-                        DeleteRegion(tess, regUp);
-                        if (!Mesh.__gl_meshDelete(eUp)) throw new RuntimeException();
-                        regUp = RegionAbove(regLo);
-                        eUp = regUp.eUp;
-                    }
-                }
-            }
-            if (eUp.Org != eLo.Org) {
-                if (eUp.Sym.Org != eLo.Sym.Org
-                        && !regUp.fixUpperEdge && !regLo.fixUpperEdge
-                        && (eUp.Sym.Org == tess.event || eLo.Sym.Org == tess.event)) {
-                    /* When all else fails in CheckForIntersect(), it uses tess.event
-                     * as the intersection location.  To make this possible, it requires
-                     * that tess.event lie between the upper and lower edges, and also
-                     * that neither of these is marked fixUpperEdge (since in the worst
-                     * case it might splice one of these edges into tess.event, and
-                     * violate the invariant that fixable edges are the only right-going
-                     * edge from their associated vertex).
-                         */
-                    if (CheckForIntersect(tess, regUp)) {
-                        /* WalkDirtyRegions() was called recursively; we're done */
-                        return;
-                    }
-                } else {
-                    /* Even though we can't use CheckForIntersect(), the Org vertices
-                     * may violate the dictionary edge ordering.  Check and correct this.
-                     */
-                    CheckForRightSplice(tess, regUp);
-                }
-            }
-            if (eUp.Org == eLo.Org && eUp.Sym.Org == eLo.Sym.Org) {
-                /* A degenerate loop consisting of only two edges -- delete it. */
-                AddWinding(eLo, eUp);
-                DeleteRegion(tess, regUp);
-                if (!Mesh.__gl_meshDelete(eUp)) throw new RuntimeException();
-                regUp = RegionAbove(regLo);
-            }
-        }
-    }
-
-
-    static void ConnectRightVertex(GLUtessellatorImpl tess, ActiveRegion regUp,
-                                   GLUhalfEdge eBottomLeft)
-/*
- * Purpose: connect a "right" vertex vEvent (one where all edges go left)
- * to the unprocessed portion of the mesh.  Since there are no right-going
- * edges, two regions (one above vEvent and one below) are being merged
- * into one.  "regUp" is the upper of these two regions.
- *
- * There are two reasons for doing this (adding a right-going edge):
- *  - if the two regions being merged are "inside", we must add an edge
- *    to keep them separated (the combined region would not be monotone).
- *  - in any case, we must leave some record of vEvent in the dictionary,
- *    so that we can merge vEvent with features that we have not seen yet.
- *    For example, maybe there is a vertical edge which passes just to
- *    the right of vEvent; we would like to splice vEvent into this edge.
- *
- * However, we don't want to connect vEvent to just any vertex.  We don''t
- * want the new edge to cross any other edges; otherwise we will create
- * intersection vertices even when the input data had no self-intersections.
- * (This is a bad thing; if the user's input data has no intersections,
- * we don't want to generate any false intersections ourselves.)
- *
- * Our eventual goal is to connect vEvent to the leftmost unprocessed
- * vertex of the combined region (the union of regUp and regLo).
- * But because of unseen vertices with all right-going edges, and also
- * new vertices which may be created by edge intersections, we don''t
- * know where that leftmost unprocessed vertex is.  In the meantime, we
- * connect vEvent to the closest vertex of either chain, and mark the region
- * as "fixUpperEdge".  This flag says to delete and reconnect this edge
- * to the next processed vertex on the boundary of the combined region.
- * Quite possibly the vertex we connected to will turn out to be the
- * closest one, in which case we won''t need to make any changes.
- */ {
-        GLUhalfEdge eNew;
-        GLUhalfEdge eTopLeft = eBottomLeft.Onext;
-        ActiveRegion regLo = RegionBelow(regUp);
-        GLUhalfEdge eUp = regUp.eUp;
-        GLUhalfEdge eLo = regLo.eUp;
-        boolean degenerate = false;
-
-        if (eUp.Sym.Org != eLo.Sym.Org) {
-            CheckForIntersect(tess, regUp);
-        }
-
-        /* Possible new degeneracies: upper or lower edge of regUp may pass
-         * through vEvent, or may coincide with new intersection vertex
-         */
-        if (Geom.VertEq(eUp.Org, tess.event)) {
-            if (!Mesh.__gl_meshSplice(eTopLeft.Sym.Lnext, eUp)) throw new RuntimeException();
-            regUp = TopLeftRegion(regUp);
-            if (regUp == null) throw new RuntimeException();
-            eTopLeft = RegionBelow(regUp).eUp;
-            FinishLeftRegions(tess, RegionBelow(regUp), regLo);
-            degenerate = true;
-        }
-        if (Geom.VertEq(eLo.Org, tess.event)) {
-            if (!Mesh.__gl_meshSplice(eBottomLeft, eLo.Sym.Lnext)) throw new RuntimeException();
-            eBottomLeft = FinishLeftRegions(tess, regLo, null);
-            degenerate = true;
-        }
-        if (degenerate) {
-            AddRightEdges(tess, regUp, eBottomLeft.Onext, eTopLeft, eTopLeft, true);
-            return;
-        }
-
-        /* Non-degenerate situation -- need to add a temporary, fixable edge.
-         * Connect to the closer of eLo.Org, eUp.Org.
-         */
-        if (Geom.VertLeq(eLo.Org, eUp.Org)) {
-            eNew = eLo.Sym.Lnext;
-        } else {
-            eNew = eUp;
-        }
-        eNew = Mesh.__gl_meshConnect(eBottomLeft.Onext.Sym, eNew);
-        if (eNew == null) throw new RuntimeException();
-
-        /* Prevent cleanup, otherwise eNew might disappear before we've even
-         * had a chance to mark it as a temporary edge.
-         */
-        AddRightEdges(tess, regUp, eNew, eNew.Onext, eNew.Onext, false);
-        eNew.Sym.activeRegion.fixUpperEdge = true;
-        WalkDirtyRegions(tess, regUp);
-    }
-
-/* Because vertices at exactly the same location are merged together
- * before we process the sweep event, some degenerate cases can't occur.
- * However if someone eventually makes the modifications required to
- * merge features which are close together, the cases below marked
- * TOLERANCE_NONZERO will be useful.  They were debugged before the
- * code to merge identical vertices in the main loop was added.
- */
-    private static final boolean TOLERANCE_NONZERO = false;
-
-    static void ConnectLeftDegenerate(GLUtessellatorImpl tess,
-                                      ActiveRegion regUp, GLUvertex vEvent)
-/*
- * The event vertex lies exacty on an already-processed edge or vertex.
- * Adding the new vertex involves splicing it into the already-processed
- * part of the mesh.
- */ {
-        GLUhalfEdge e, eTopLeft, eTopRight, eLast;
-        ActiveRegion reg;
-
-        e = regUp.eUp;
-        if (Geom.VertEq(e.Org, vEvent)) {
-            /* e.Org is an unprocessed vertex - just combine them, and wait
-             * for e.Org to be pulled from the queue
-             */
-            assert (TOLERANCE_NONZERO);
-            SpliceMergeVertices(tess, e, vEvent.anEdge);
-            return;
-        }
-
-        if (!Geom.VertEq(e.Sym.Org, vEvent)) {
-            /* General case -- splice vEvent into edge e which passes through it */
-            if (Mesh.__gl_meshSplitEdge(e.Sym) == null) throw new RuntimeException();
-            if (regUp.fixUpperEdge) {
-                /* This edge was fixable -- delete unused portion of original edge */
-                if (!Mesh.__gl_meshDelete(e.Onext)) throw new RuntimeException();
-                regUp.fixUpperEdge = false;
-            }
-            if (!Mesh.__gl_meshSplice(vEvent.anEdge, e)) throw new RuntimeException();
-            SweepEvent(tess, vEvent);	/* recurse */
-            return;
-        }
-
-        /* vEvent coincides with e.Sym.Org, which has already been processed.
-         * Splice in the additional right-going edges.
-         */
-        assert (TOLERANCE_NONZERO);
-        regUp = TopRightRegion(regUp);
-        reg = RegionBelow(regUp);
-        eTopRight = reg.eUp.Sym;
-        eTopLeft = eLast = eTopRight.Onext;
-        if (reg.fixUpperEdge) {
-            /* Here e.Sym.Org has only a single fixable edge going right.
-             * We can delete it since now we have some real right-going edges.
-             */
-            assert (eTopLeft != eTopRight);   /* there are some left edges too */
-            DeleteRegion(tess, reg);
-            if (!Mesh.__gl_meshDelete(eTopRight)) throw new RuntimeException();
-            eTopRight = eTopLeft.Sym.Lnext;
-        }
-        if (!Mesh.__gl_meshSplice(vEvent.anEdge, eTopRight)) throw new RuntimeException();
-        if (!Geom.EdgeGoesLeft(eTopLeft)) {
-            /* e.Sym.Org had no left-going edges -- indicate this to AddRightEdges() */
-            eTopLeft = null;
-        }
-        AddRightEdges(tess, regUp, eTopRight.Onext, eLast, eTopLeft, true);
-    }
-
-
-    static void ConnectLeftVertex(GLUtessellatorImpl tess, GLUvertex vEvent)
-/*
- * Purpose: connect a "left" vertex (one where both edges go right)
- * to the processed portion of the mesh.  Let R be the active region
- * containing vEvent, and let U and L be the upper and lower edge
- * chains of R.  There are two possibilities:
- *
- * - the normal case: split R into two regions, by connecting vEvent to
- *   the rightmost vertex of U or L lying to the left of the sweep line
- *
- * - the degenerate case: if vEvent is close enough to U or L, we
- *   merge vEvent into that edge chain.  The subcases are:
- *	- merging with the rightmost vertex of U or L
- *	- merging with the active edge of U or L
- *	- merging with an already-processed portion of U or L
- */ {
-        ActiveRegion regUp, regLo, reg;
-        GLUhalfEdge eUp, eLo, eNew;
-        ActiveRegion tmp = new ActiveRegion();
-
-        /* assert ( vEvent.anEdge.Onext.Onext == vEvent.anEdge ); */
-
-        /* Get a pointer to the active region containing vEvent */
-        tmp.eUp = vEvent.anEdge.Sym;
-        /* __GL_DICTLISTKEY */ /* __gl_dictListSearch */
-        regUp = (ActiveRegion) Dict.dictKey(Dict.dictSearch(tess.dict, tmp));
-        regLo = RegionBelow(regUp);
-        eUp = regUp.eUp;
-        eLo = regLo.eUp;
-
-        /* Try merging with U or L first */
-        if (Geom.EdgeSign(eUp.Sym.Org, vEvent, eUp.Org) == 0) {
-            ConnectLeftDegenerate(tess, regUp, vEvent);
-            return;
-        }
-
-        /* Connect vEvent to rightmost processed vertex of either chain.
-         * e.Sym.Org is the vertex that we will connect to vEvent.
-         */
-        reg = Geom.VertLeq(eLo.Sym.Org, eUp.Sym.Org) ? regUp : regLo;
-
-        if (regUp.inside || reg.fixUpperEdge) {
-            if (reg == regUp) {
-                eNew = Mesh.__gl_meshConnect(vEvent.anEdge.Sym, eUp.Lnext);
-                if (eNew == null) throw new RuntimeException();
-            } else {
-                GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(eLo.Sym.Onext.Sym, vEvent.anEdge);
-                if (tempHalfEdge == null) throw new RuntimeException();
-
-                eNew = tempHalfEdge.Sym;
-            }
-            if (reg.fixUpperEdge) {
-                if (!FixUpperEdge(reg, eNew)) throw new RuntimeException();
-            } else {
-                ComputeWinding(tess, AddRegionBelow(tess, regUp, eNew));
-            }
-            SweepEvent(tess, vEvent);
-        } else {
-            /* The new vertex is in a region which does not belong to the polygon.
-             * We don''t need to connect this vertex to the rest of the mesh.
-             */
-            AddRightEdges(tess, regUp, vEvent.anEdge, vEvent.anEdge, null, true);
-        }
-    }
-
-
-    static void SweepEvent(GLUtessellatorImpl tess, GLUvertex vEvent)
-/*
- * Does everything necessary when the sweep line crosses a vertex.
- * Updates the mesh and the edge dictionary.
- */ {
-        ActiveRegion regUp, reg;
-        GLUhalfEdge e, eTopLeft, eBottomLeft;
-
-        tess.event = vEvent;		/* for access in EdgeLeq() */
-        DebugEvent(tess);
-
-        /* Check if this vertex is the right endpoint of an edge that is
-         * already in the dictionary.  In this case we don't need to waste
-         * time searching for the location to insert new edges.
-         */
-        e = vEvent.anEdge;
-        while (e.activeRegion == null) {
-            e = e.Onext;
-            if (e == vEvent.anEdge) {
-                /* All edges go right -- not incident to any processed edges */
-                ConnectLeftVertex(tess, vEvent);
-                return;
-            }
-        }
-
-        /* Processing consists of two phases: first we "finish" all the
-         * active regions where both the upper and lower edges terminate
-         * at vEvent (ie. vEvent is closing off these regions).
-         * We mark these faces "inside" or "outside" the polygon according
-         * to their winding number, and delete the edges from the dictionary.
-         * This takes care of all the left-going edges from vEvent.
-         */
-        regUp = TopLeftRegion(e.activeRegion);
-        if (regUp == null) throw new RuntimeException();
-        reg = RegionBelow(regUp);
-        eTopLeft = reg.eUp;
-        eBottomLeft = FinishLeftRegions(tess, reg, null);
-
-        /* Next we process all the right-going edges from vEvent.  This
-         * involves adding the edges to the dictionary, and creating the
-         * associated "active regions" which record information about the
-         * regions between adjacent dictionary edges.
-         */
-        if (eBottomLeft.Onext == eTopLeft) {
-            /* No right-going edges -- add a temporary "fixable" edge */
-            ConnectRightVertex(tess, regUp, eBottomLeft);
-        } else {
-            AddRightEdges(tess, regUp, eBottomLeft.Onext, eTopLeft, eTopLeft, true);
-        }
-    }
-
-
-/* Make the sentinel coordinates big enough that they will never be
- * merged with real input features.  (Even with the largest possible
- * input contour and the maximum tolerance of 1.0, no merging will be
- * done with coordinates larger than 3 * GLU_TESS_MAX_COORD).
- */
-    private static final double SENTINEL_COORD = (4.0 * GLU.GLU_TESS_MAX_COORD);
-
-    static void AddSentinel(GLUtessellatorImpl tess, double t)
-/*
- * We add two sentinel edges above and below all other edges,
- * to avoid special cases at the top and bottom.
- */ {
-        GLUhalfEdge e;
-        ActiveRegion reg = new ActiveRegion();
-        if (reg == null) throw new RuntimeException();
-
-        e = Mesh.__gl_meshMakeEdge(tess.mesh);
-        if (e == null) throw new RuntimeException();
-
-        e.Org.s = SENTINEL_COORD;
-        e.Org.t = t;
-        e.Sym.Org.s = -SENTINEL_COORD;
-        e.Sym.Org.t = t;
-        tess.event = e.Sym.Org;		/* initialize it */
-
-        reg.eUp = e;
-        reg.windingNumber = 0;
-        reg.inside = false;
-        reg.fixUpperEdge = false;
-        reg.sentinel = true;
-        reg.dirty = false;
-        reg.nodeUp = Dict.dictInsert(tess.dict, reg); /* __gl_dictListInsertBefore */
-        if (reg.nodeUp == null) throw new RuntimeException();
-    }
-
-
-    static void InitEdgeDict(final GLUtessellatorImpl tess)
-/*
- * We maintain an ordering of edge intersections with the sweep line.
- * This order is maintained in a dynamic dictionary.
- */ {
-        /* __gl_dictListNewDict */
-        tess.dict = Dict.dictNewDict(tess, new Dict.DictLeq() {
-            public boolean leq(Object frame, Object key1, Object key2) {
-                return EdgeLeq(tess, (ActiveRegion) key1, (ActiveRegion) key2);
-            }
-        });
-        if (tess.dict == null) throw new RuntimeException();
-
-        AddSentinel(tess, -SENTINEL_COORD);
-        AddSentinel(tess, SENTINEL_COORD);
-    }
-
-
-    static void DoneEdgeDict(GLUtessellatorImpl tess) {
-        ActiveRegion reg;
-        int fixedEdges = 0;
-
-        /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */
-        while ((reg = (ActiveRegion) Dict.dictKey(Dict.dictMin(tess.dict))) != null) {
-            /*
-             * At the end of all processing, the dictionary should contain
-             * only the two sentinel edges, plus at most one "fixable" edge
-             * created by ConnectRightVertex().
-             */
-            if (!reg.sentinel) {
-                assert (reg.fixUpperEdge);
-                assert (++fixedEdges == 1);
-            }
-            assert (reg.windingNumber == 0);
-            DeleteRegion(tess, reg);
-/*    __gl_meshDelete( reg.eUp );*/
-        }
-        Dict.dictDeleteDict(tess.dict);	/* __gl_dictListDeleteDict */
-    }
-
-
-    static void RemoveDegenerateEdges(GLUtessellatorImpl tess)
-/*
- * Remove zero-length edges, and contours with fewer than 3 vertices.
- */ {
-        GLUhalfEdge e, eNext, eLnext;
-        GLUhalfEdge eHead = tess.mesh.eHead;
-
-        /*LINTED*/
-        for (e = eHead.next; e != eHead; e = eNext) {
-            eNext = e.next;
-            eLnext = e.Lnext;
-
-            if (Geom.VertEq(e.Org, e.Sym.Org) && e.Lnext.Lnext != e) {
-                /* Zero-length edge, contour has at least 3 edges */
-
-                SpliceMergeVertices(tess, eLnext, e);	/* deletes e.Org */
-                if (!Mesh.__gl_meshDelete(e)) throw new RuntimeException(); /* e is a self-loop */
-                e = eLnext;
-                eLnext = e.Lnext;
-            }
-            if (eLnext.Lnext == e) {
-                /* Degenerate contour (one or two edges) */
-
-                if (eLnext != e) {
-                    if (eLnext == eNext || eLnext == eNext.Sym) {
-                        eNext = eNext.next;
-                    }
-                    if (!Mesh.__gl_meshDelete(eLnext)) throw new RuntimeException();
-                }
-                if (e == eNext || e == eNext.Sym) {
-                    eNext = eNext.next;
-                }
-                if (!Mesh.__gl_meshDelete(e)) throw new RuntimeException();
-            }
-        }
-    }
-
-    static boolean InitPriorityQ(GLUtessellatorImpl tess)
-/*
- * Insert all vertices into the priority queue which determines the
- * order in which vertices cross the sweep line.
- */ {
-        PriorityQ pq;
-        GLUvertex v, vHead;
-
-        /* __gl_pqSortNewPriorityQ */
-        pq = tess.pq = PriorityQ.pqNewPriorityQ(new PriorityQ.Leq() {
-            public boolean leq(Object key1, Object key2) {
-                return Geom.VertLeq(((GLUvertex) key1), (GLUvertex) key2);
-            }
-        });
-        if (pq == null) return false;
-
-        vHead = tess.mesh.vHead;
-        for (v = vHead.next; v != vHead; v = v.next) {
-            v.pqHandle = pq.pqInsert(v); /* __gl_pqSortInsert */
-            if (v.pqHandle == Long.MAX_VALUE) break;
-        }
-        if (v != vHead || !pq.pqInit()) { /* __gl_pqSortInit */
-            tess.pq.pqDeletePriorityQ();	/* __gl_pqSortDeletePriorityQ */
-            tess.pq = null;
-            return false;
-        }
-
-        return true;
-    }
-
-
-    static void DonePriorityQ(GLUtessellatorImpl tess) {
-        tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
-    }
-
-
-    static boolean RemoveDegenerateFaces(GLUmesh mesh)
-/*
- * Delete any degenerate faces with only two edges.  WalkDirtyRegions()
- * will catch almost all of these, but it won't catch degenerate faces
- * produced by splice operations on already-processed edges.
- * The two places this can happen are in FinishLeftRegions(), when
- * we splice in a "temporary" edge produced by ConnectRightVertex(),
- * and in CheckForLeftSplice(), where we splice already-processed
- * edges to ensure that our dictionary invariants are not violated
- * by numerical errors.
- *
- * In both these cases it is *very* dangerous to delete the offending
- * edge at the time, since one of the routines further up the stack
- * will sometimes be keeping a pointer to that edge.
- */ {
-        GLUface f, fNext;
-        GLUhalfEdge e;
-
-        /*LINTED*/
-        for (f = mesh.fHead.next; f != mesh.fHead; f = fNext) {
-            fNext = f.next;
-            e = f.anEdge;
-            assert (e.Lnext != e);
-
-            if (e.Lnext.Lnext == e) {
-                /* A face with only two edges */
-                AddWinding(e.Onext, e);
-                if (!Mesh.__gl_meshDelete(e)) return false;
-            }
-        }
-        return true;
-    }
-
-    public static boolean __gl_computeInterior(GLUtessellatorImpl tess)
-/*
- * __gl_computeInterior( tess ) computes the planar arrangement specified
- * by the given contours, and further subdivides this arrangement
- * into regions.  Each region is marked "inside" if it belongs
- * to the polygon, according to the rule given by tess.windingRule.
- * Each interior region is guaranteed be monotone.
- */ {
-        GLUvertex v, vNext;
-
-        tess.fatalError = false;
-
-        /* Each vertex defines an event for our sweep line.  Start by inserting
-         * all the vertices in a priority queue.  Events are processed in
-         * lexicographic order, ie.
-         *
-         *	e1 < e2  iff  e1.x < e2.x || (e1.x == e2.x && e1.y < e2.y)
-         */
-        RemoveDegenerateEdges(tess);
-        if (!InitPriorityQ(tess)) return false; /* if error */
-        InitEdgeDict(tess);
-
-        /* __gl_pqSortExtractMin */
-        while ((v = (GLUvertex) tess.pq.pqExtractMin()) != null) {
-            for (; ;) {
-                vNext = (GLUvertex) tess.pq.pqMinimum(); /* __gl_pqSortMinimum */
-                if (vNext == null || !Geom.VertEq(vNext, v)) break;
-
-                /* Merge together all vertices at exactly the same location.
-                 * This is more efficient than processing them one at a time,
-                 * simplifies the code (see ConnectLeftDegenerate), and is also
-                 * important for correct handling of certain degenerate cases.
-                 * For example, suppose there are two identical edges A and B
-                 * that belong to different contours (so without this code they would
-                 * be processed by separate sweep events).  Suppose another edge C
-                 * crosses A and B from above.  When A is processed, we split it
-                 * at its intersection point with C.  However this also splits C,
-                 * so when we insert B we may compute a slightly different
-                 * intersection point.  This might leave two edges with a small
-                 * gap between them.  This kind of error is especially obvious
-                 * when using boundary extraction (GLU_TESS_BOUNDARY_ONLY).
-                 */
-                vNext = (GLUvertex) tess.pq.pqExtractMin(); /* __gl_pqSortExtractMin*/
-                SpliceMergeVertices(tess, v.anEdge, vNext.anEdge);
-            }
-            SweepEvent(tess, v);
-        }
-
-        /* Set tess.event for debugging purposes */
-        /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */
-        tess.event = ((ActiveRegion) Dict.dictKey(Dict.dictMin(tess.dict))).eUp.Org;
-        DebugEvent(tess);
-        DoneEdgeDict(tess);
-        DonePriorityQ(tess);
-
-        if (!RemoveDegenerateFaces(tess.mesh)) return false;
-        Mesh.__gl_meshCheckMesh(tess.mesh);
-
-        return true;
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessMono.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessMono.java
deleted file mode 100644
index ef89b16..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessMono.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class TessMono {
-/* __gl_meshTessellateMonoRegion( face ) tessellates a monotone region
- * (what else would it do??)  The region must consist of a single
- * loop of half-edges (see mesh.h) oriented CCW.  "Monotone" in this
- * case means that any vertical line intersects the interior of the
- * region in a single interval.
- *
- * Tessellation consists of adding interior edges (actually pairs of
- * half-edges), to split the region into non-overlapping triangles.
- *
- * The basic idea is explained in Preparata and Shamos (which I don''t
- * have handy right now), although their implementation is more
- * complicated than this one.  The are two edge chains, an upper chain
- * and a lower chain.  We process all vertices from both chains in order,
- * from right to left.
- *
- * The algorithm ensures that the following invariant holds after each
- * vertex is processed: the untessellated region consists of two
- * chains, where one chain (say the upper) is a single edge, and
- * the other chain is concave.  The left vertex of the single edge
- * is always to the left of all vertices in the concave chain.
- *
- * Each step consists of adding the rightmost unprocessed vertex to one
- * of the two chains, and forming a fan of triangles from the rightmost
- * of two chain endpoints.  Determining whether we can add each triangle
- * to the fan is a simple orientation test.  By making the fan as large
- * as possible, we restore the invariant (check it yourself).
- */
-    static boolean __gl_meshTessellateMonoRegion(GLUface face, boolean avoidDegenerateTris) {
-        GLUhalfEdge up, lo;
-
-        /* All edges are oriented CCW around the boundary of the region.
-         * First, find the half-edge whose origin vertex is rightmost.
-         * Since the sweep goes from left to right, face->anEdge should
-         * be close to the edge we want.
-         */
-        up = face.anEdge;
-        assert (up.Lnext != up && up.Lnext.Lnext != up);
-
-        for (; Geom.VertLeq(up.Sym.Org, up.Org); up = up.Onext.Sym)
-            ;
-        for (; Geom.VertLeq(up.Org, up.Sym.Org); up = up.Lnext)
-            ;
-        lo = up.Onext.Sym;
-
-        boolean mustConnect = false; // hack for avoidDegenerateTris
-
-        while (up.Lnext != lo) {
-            if (avoidDegenerateTris && !mustConnect) {
-                // Skip over regions where several vertices are collinear,
-                // to try to avoid producing degenerate (zero-area) triangles
-                //
-                // The "mustConnect" flag is a hack to try to avoid
-                // skipping too large regions and causing incorrect
-                // triangulations. This entire modification is overall
-                // not robust and needs more work
-                if (Geom.EdgeCos(lo.Lnext.Org, lo.Org, lo.Lnext.Lnext.Org) <= -Geom.ONE_MINUS_EPSILON) {
-                    // Lines around lo
-                    do {
-                        lo = lo.Onext.Sym;
-                        mustConnect = true;
-                    } while (up.Lnext != lo &&
-                             Geom.EdgeCos(lo.Lnext.Org, lo.Org, lo.Lnext.Lnext.Org) <= -Geom.ONE_MINUS_EPSILON);
-                } else if (Geom.EdgeCos(up.Onext.Sym.Org, up.Org, up.Onext.Sym.Onext.Sym.Org) <= -Geom.ONE_MINUS_EPSILON) {
-                    // Lines around up
-                    do {
-                        up = up.Lnext;
-                        mustConnect = true;
-                    } while (up.Lnext != lo &&
-                             Geom.EdgeCos(up.Onext.Sym.Org, up.Org, up.Onext.Sym.Onext.Sym.Org) <= -Geom.ONE_MINUS_EPSILON);
-                }
-
-                if (up.Lnext == lo)
-                    break;
-            }
-
-            if (Geom.VertLeq(up.Sym.Org, lo.Org)) {
-                /* up.Sym.Org is on the left.  It is safe to form triangles from lo.Org.
-                 * The EdgeGoesLeft test guarantees progress even when some triangles
-                 * are CW, given that the upper and lower chains are truly monotone.
-                 */
-                while (lo.Lnext != up && (Geom.EdgeGoesLeft(lo.Lnext)
-                        || Geom.EdgeSign(lo.Org, lo.Sym.Org, lo.Lnext.Sym.Org) <= 0)) {
-                    GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
-                    mustConnect = false;
-                    if (tempHalfEdge == null) return false;
-                    lo = tempHalfEdge.Sym;
-                }
-                lo = lo.Onext.Sym;
-            } else {
-                /* lo.Org is on the left.  We can make CCW triangles from up.Sym.Org. */
-                while (lo.Lnext != up && (Geom.EdgeGoesRight(up.Onext.Sym)
-                        || Geom.EdgeSign(up.Sym.Org, up.Org, up.Onext.Sym.Org) >= 0)) {
-                    GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(up, up.Onext.Sym);
-                    mustConnect = false;
-                    if (tempHalfEdge == null) return false;
-                    up = tempHalfEdge.Sym;
-                }
-                up = up.Lnext;
-            }
-        }
-
-        /* Now lo.Org == up.Sym.Org == the leftmost vertex.  The remaining region
-         * can be tessellated in a fan from this leftmost vertex.
-         */
-        assert (lo.Lnext != up);
-        while (lo.Lnext.Lnext != up) {
-            GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
-            if (tempHalfEdge == null) return false;
-            lo = tempHalfEdge.Sym;
-        }
-
-        return true;
-    }
-
-
-/* __gl_meshTessellateInterior( mesh ) tessellates each region of
- * the mesh which is marked "inside" the polygon.  Each such region
- * must be monotone.
- */
-    public static boolean __gl_meshTessellateInterior(GLUmesh mesh, boolean avoidDegenerateTris) {
-        GLUface f, next;
-
-        /*LINTED*/
-        for (f = mesh.fHead.next; f != mesh.fHead; f = next) {
-            /* Make sure we don''t try to tessellate the new triangles. */
-            next = f.next;
-            if (f.inside) {
-                if (!__gl_meshTessellateMonoRegion(f, avoidDegenerateTris)) return false;
-            }
-        }
-
-        return true;
-    }
-
-
-/* __gl_meshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
- * which are not marked "inside" the polygon.  Since further mesh operations
- * on NULL faces are not allowed, the main purpose is to clean up the
- * mesh so that exterior loops are not represented in the data structure.
- */
-    public static void __gl_meshDiscardExterior(GLUmesh mesh) {
-        GLUface f, next;
-
-        /*LINTED*/
-        for (f = mesh.fHead.next; f != mesh.fHead; f = next) {
-            /* Since f will be destroyed, save its next pointer. */
-            next = f.next;
-            if (!f.inside) {
-                Mesh.__gl_meshZapFace(f);
-            }
-        }
-    }
-
-    private static final int MARKED_FOR_DELETION = 0x7fffffff;
-
-/* __gl_meshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
- * winding numbers on all edges so that regions marked "inside" the
- * polygon have a winding number of "value", and regions outside
- * have a winding number of 0.
- *
- * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
- * separate an interior region from an exterior one.
- */
-    public static boolean __gl_meshSetWindingNumber(GLUmesh mesh, int value, boolean keepOnlyBoundary) {
-        GLUhalfEdge e, eNext;
-
-        for (e = mesh.eHead.next; e != mesh.eHead; e = eNext) {
-            eNext = e.next;
-            if (e.Sym.Lface.inside != e.Lface.inside) {
-
-                /* This is a boundary edge (one side is interior, one is exterior). */
-                e.winding = (e.Lface.inside) ? value : -value;
-            } else {
-
-                /* Both regions are interior, or both are exterior. */
-                if (!keepOnlyBoundary) {
-                    e.winding = 0;
-                } else {
-                    if (!Mesh.__gl_meshDelete(e)) return false;
-                }
-            }
-        }
-        return true;
-    }
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessState.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessState.java
deleted file mode 100644
index a8aa41d..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessState.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE:  The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License").   Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License").  This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted.  Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-*/
-package com.jogamp.opengl.impl.glu.tessellator;
-
-class TessState {
-    public static final int T_DORMANT = 0;
-    public static final int T_IN_POLYGON = 1;
-    public static final int T_IN_CONTOUR = 2;
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLContext.java
deleted file mode 100644
index 3cd2aa6..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLContext.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import java.nio.*;
-import java.util.*;
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.gluegen.runtime.ProcAddressTable;
-import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
-
-public abstract class MacOSXCGLContext extends GLContextImpl
-{	
-  protected boolean isNSContext;
-  private CGLExt cglExt;
-  // Table that holds the addresses of the native C-language entry points for
-  // CGL extension functions.
-  private CGLExtProcAddressTable cglExtProcAddressTable;
-  
-  public MacOSXCGLContext(GLDrawableImpl drawable, GLDrawableImpl drawableRead,
-                          GLContext shareWith) {
-    super(drawable, drawableRead, shareWith);
-  }
-
-  public MacOSXCGLContext(GLDrawableImpl drawable,
-                          GLContext shareWith) {
-    this(drawable, null, shareWith);
-  }
-  
-  public Object getPlatformGLExtensions() {
-    return getCGLExt();
-  }
-
-  protected boolean isNSContext() { return isNSContext; }
-
-  public CGLExt getCGLExt() {
-    if (cglExt == null) {
-      cglExt = new CGLExtImpl(this);
-    }
-    return cglExt;
-  }
-
-  public final ProcAddressTable getPlatformExtProcAddressTable() {
-    return getCGLExtProcAddressTable();
-  }
-
-  public final CGLExtProcAddressTable getCGLExtProcAddressTable() {
-    return cglExtProcAddressTable;
-  }
-
-  protected Map/*<String, String>*/ getFunctionNameMap() { return null; }
-
-  protected Map/*<String, String>*/ getExtensionNameMap() { return null; }
-
-  protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
-      return 0; // FIXME
-  }
-
-  protected void destroyContextARBImpl(long _context) {
-      // FIXME
-  }
-
-  /**
-   * Creates and initializes an appropriate OpenGl Context (NS). Should only be
-   * called by {@link makeCurrentImpl()}.
-   */
-  protected boolean create(boolean pbuffer, boolean floatingPoint) {
-    MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(this);
-    long share = 0;
-    if (other != null) {
-      if (!other.isNSContext()) {
-        throw new GLException("GLContextShareSet is not a NS Context");
-      }
-      share = other.getHandle();
-      if (share == 0) {
-        throw new GLException("GLContextShareSet returned a NULL OpenGL context");
-      }
-    }
-    MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    GLCapabilitiesImmutable capabilitiesRequested = (GLCapabilitiesImmutable) config.getRequestedCapabilities();
-    GLProfile glProfile = capabilitiesRequested.getGLProfile();
-    if(glProfile.isGL3()) {
-        throw new GLException("GL3 profile currently not supported on MacOSX, due to the lack of a OpenGL 3.1 implementation");
-    }
-    // HACK .. bring in OnScreen/PBuffer selection to the DrawableFactory !!
-    GLCapabilities capabilities = (GLCapabilities) capabilitiesRequested.cloneMutable();
-    capabilities.setPBuffer(pbuffer);
-    capabilities.setPbufferFloatingPointBuffers(floatingPoint);
-
-    long pixelFormat = MacOSXCGLGraphicsConfiguration.GLCapabilities2NSPixelFormat(capabilities);
-    if (pixelFormat == 0) {
-      throw new GLException("Unable to allocate pixel format with requested GLCapabilities");
-    }
-    config.setChosenPixelFormat(pixelFormat);
-    try {
-      int[] viewNotReady = new int[1];
-      // Try to allocate a context with this
-      contextHandle = CGL.createContext(share,
-                                    drawable.getHandle(),
-                                    pixelFormat,
-                                    viewNotReady, 0);
-      if (contextHandle == 0) {
-        if (viewNotReady[0] == 1) {
-          if (DEBUG) {
-            System.err.println("!!! View not ready for " + getClass().getName());
-          }
-          // View not ready at the window system level -- this is OK
-          return false;
-        }
-        throw new GLException("Error creating NSOpenGLContext with requested pixel format");
-      }
-
-      if (!pbuffer && !capabilities.isBackgroundOpaque()) {
-          // Set the context opacity
-          CGL.setContextOpacity(contextHandle, 0);
-      }
-
-      GLCapabilitiesImmutable caps = MacOSXCGLGraphicsConfiguration.NSPixelFormat2GLCapabilities(glProfile, pixelFormat);
-      config.setChosenCapabilities(caps);
-    } finally {
-      CGL.deletePixelFormat(pixelFormat);
-    }
-    if (!CGL.makeCurrentContext(contextHandle)) {
-      throw new GLException("Error making Context (NS) current");
-    }
-    isNSContext = true;
-    setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);
-    GLContextShareSet.contextCreated(this);
-    return true;
-  }
-
-  protected void makeCurrentImpl(boolean newCreated) throws GLException {
-    if ( isNSContext ) {
-        if (!CGL.makeCurrentContext(contextHandle)) {
-          throw new GLException("Error making Context (NS) current");
-        }
-    } else {
-        if (CGL.kCGLNoError != CGL.CGLSetCurrentContext(contextHandle)) {
-          throw new GLException("Error making Context (CGL) current");
-        }
-    }
-  }
-	
-  protected void releaseImpl() throws GLException {
-    if ( isNSContext ) {
-        if (!CGL.clearCurrentContext(contextHandle)) {
-          throw new GLException("Error freeing OpenGL Context (NS)");
-        }
-    } else {
-        CGL.CGLReleaseContext(contextHandle);
-    }
-  }
-	
-  protected void destroyImpl() throws GLException {
-    if ( !isNSContext ) {
-      if (CGL.kCGLNoError != CGL.CGLDestroyContext(contextHandle)) {
-        throw new GLException("Unable to delete OpenGL Context (CGL)");
-      }
-      if (DEBUG) {
-        System.err.println("!!! Destroyed OpenGL Context (CGL) " + contextHandle);
-      }
-    } else {
-      if (!CGL.deleteContext(contextHandle)) {
-        throw new GLException("Unable to delete OpenGL Context (NS)");
-      }
-      if (DEBUG) {
-        System.err.println("!!! Destroyed OpenGL Context (NS) " + contextHandle);
-      }
-    }
-  }
-
-  protected void copyImpl(GLContext source, int mask) throws GLException {
-    long dst = getHandle();
-    long src = source.getHandle();
-    if( !isNSContext() ) {
-        if ( ((MacOSXCGLContext)source).isNSContext() ) {
-          throw new GLException("Source OpenGL Context is NS ; Destination Context is CGL.");
-        }
-        CGL.CGLCopyContext(src, dst, mask);
-    } else {
-        if ( !((MacOSXCGLContext)source).isNSContext() ) {
-          throw new GLException("Source OpenGL Context is CGL ; Destination Context is NS.");
-        }
-        CGL.copyContext(dst, src, mask);
-    }
-  }
-
-  protected final void updateGLXProcAddressTable(int major, int minor, int ctp) {
-    if (DEBUG) {
-      System.err.println(getThreadName() + ": !!! Initializing CGL extension address table");
-    }
-    CGLExtProcAddressTable table = null;
-    synchronized(mappedContextTypeObjectLock) {
-        table = (CGLExtProcAddressTable) mappedGLXProcAddress.get( contextFQN );
-    }
-    if(null != table) {
-        cglExtProcAddressTable = table;
-        if(DEBUG) {
-            System.err.println(getThreadName() + ": !!! GLContext CGL ProcAddressTable reusing key("+contextFQN+") -> "+table.hashCode());
-        }
-    } else {
-        if (cglExtProcAddressTable == null) {
-          // FIXME: cache ProcAddressTables by capability bits so we can
-          // share them among contexts with the same capabilities
-          cglExtProcAddressTable = new CGLExtProcAddressTable(new GLProcAddressResolver());
-        }
-        resetProcAddressTable(getCGLExtProcAddressTable());
-        synchronized(mappedContextTypeObjectLock) {
-            mappedGLXProcAddress.put(contextFQN, getCGLExtProcAddressTable());
-            if(DEBUG) {
-                System.err.println(getThreadName() + ": !!! GLContext CGL ProcAddressTable mapping key("+contextFQN+") -> "+getCGLExtProcAddressTable().hashCode());
-            }
-        }
-    }
-  }
-	
-  public String getPlatformExtensionsString()
-  {
-    return "";
-  }
-	
-  protected void swapBuffers() {
-    DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)config.getChosenCapabilities();
-    if(caps.isOnscreen()) {
-        if(isNSContext) {
-            if (!CGL.flushBuffer(contextHandle)) {
-              throw new GLException("Error swapping buffers (NS)");
-            }
-        } else {
-            if (CGL.kCGLNoError != CGL.CGLFlushDrawable(contextHandle)) {
-              throw new GLException("Error swapping buffers (CGL)");
-            }
-        }
-    }
-  }
-
-  protected void setSwapIntervalImpl(int interval) {
-    if( ! isCreated() ) {
-        throw new GLException("OpenGL context not created");
-    } 
-    if ( isNSContext ) {
-        CGL.setSwapInterval(contextHandle, interval);
-    } else {
-        int[] lval = new int[] { (int) interval } ;
-        CGL.CGLSetParameter(contextHandle, CGL.kCGLCPSwapInterval, lval, 0);
-    }
-    currentSwapInterval = interval ;
-  }
-
-  public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
-    // FIXME: apparently the Apple extension doesn't require a custom memory allocator
-    throw new GLException("Not yet implemented");
-  }
-
-  public boolean isFunctionAvailable(String glFunctionName)
-  {
-    return super.isFunctionAvailable(glFunctionName);
-  }
-  
-  public boolean isExtensionAvailable(String glExtensionName) {
-    if (glExtensionName.equals("GL_ARB_pbuffer") ||
-        glExtensionName.equals("GL_ARB_pixel_format")) {
-      return true;
-    }
-    return super.isExtensionAvailable(glExtensionName);
-  }
-  
-  public int getOffscreenContextPixelDataType() {
-    throw new GLException("Should not call this");
-  }
-
-  public int getOffscreenContextReadBuffer() {
-    throw new GLException("Should not call this");
-  }
-
-  public boolean offscreenImageNeedsVerticalFlip() {
-    throw new GLException("Should not call this");
-  }
-
-  public void bindPbufferToTexture() {
-    throw new GLException("Should not call this");
-  }
-    
-  public void releasePbufferFromTexture() {
-    throw new GLException("Should not call this");
-  }
-    
-  // Support for "mode switching" as described in MacOSXCGLDrawable
-  public abstract void setOpenGLMode(int mode);
-  public abstract int  getOpenGLMode();
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java
deleted file mode 100644
index 1eeaa55..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-
-public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
-  // The Java2D/OpenGL pipeline on OS X uses low-level CGLContextObjs
-  // to represent the contexts for e.g. the Java2D back buffer. When
-  // the Java2D/JOGL bridge is active, this means that if we want to
-  // be able to share textures and display lists with the Java2D
-  // contexts, we need to use the CGL APIs rather than the NSOpenGL
-  // APIs on the JOGL side. For example, if we create a pbuffer using
-  // the NSOpenGL APIs and want to share textures and display lists
-  // between it and the Java2D back buffer, there is no way to do so,
-  // because the Java2D context is actually a CGLContextObj and the
-  // NSOpenGLContext's initWithFormat:shareContext: only accepts an
-  // NSOpenGLContext as its second argument. Of course there is no way
-  // to wrap an NSOpenGLContext around an arbitrary CGLContextObj.
-  //
-  // The situation we care most about is allowing a GLPbuffer to share
-  // textures, etc. with a GLJPanel when the Java2D/JOGL bridge is
-  // active; several of the demos rely on this functionality. We aim
-  // to get there by allowing a GLPBuffer to switch its implementation
-  // between using an NSOpenGLPixelBuffer and a CGLPBufferObj. In
-  // order to track whether this has been done we need to have the
-  // notion of a "mode" of both the MacOSXCGLDrawable and the
-  // MacOSXGLContext. Initially the mode is "unspecified", meaning it
-  // leans toward the default (NSOpenGL). If sharing is requested
-  // between either a GLJPanel and a GLPbuffer or a GLCanvas and a
-  // GLPbuffer, the GLPbuffer will be switched into the appropriate
-  // mode: CGL mode for a GLJPanel and NSOpenGL mode for a GLCanvas.
-  // To avoid thrashing we support exactly one such switch during the
-  // lifetime of a given GLPbuffer. This is not a fully general
-  // solution (for example, you can't share textures among a
-  // GLPbuffer, a GLJPanel and a GLCanvas simultaneously) but should
-  // be enough to get things off the ground.
-  public static final int NSOPENGL_MODE = 1;
-  public static final int CGL_MODE      = 2;
-
-  public MacOSXCGLDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
-    super(factory, comp, realized);
- }
-
-  protected void setRealizedImpl() {
-  }
-
-  public GLDynamicLookupHelper getGLDynamicLookupHelper() {
-    return getFactoryImpl().getGLDynamicLookupHelper(0);
-  }
-
-  protected static String getThreadName() {
-    return Thread.currentThread().getName();
-  }
-
-  // Support for "mode switching" as per above
-  public abstract void setOpenGLMode(int mode);
-  public abstract int  getOpenGLMode();
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
deleted file mode 100644
index 71b99c2..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import java.nio.*;
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.common.JogampRuntimeException;
-import com.jogamp.common.util.*;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.nativewindow.impl.ProxySurface;
-import java.util.HashMap;
-import javax.media.nativewindow.macosx.MacOSXGraphicsDevice;
-
-public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
-  private static final DesktopGLDynamicLookupHelper macOSXCGLDynamicLookupHelper;
-
-  static {
-        DesktopGLDynamicLookupHelper tmp = null;
-        try {
-            tmp = new DesktopGLDynamicLookupHelper(new MacOSXCGLDynamicLibraryBundleInfo());
-        } catch (GLException gle) {
-            if(DEBUG) {
-                gle.printStackTrace();
-            }
-        }
-        macOSXCGLDynamicLookupHelper = tmp;
-        /** FIXME ?? 
-        if(null!=macOSXCGLDynamicLookupHelper) {
-            CGL.getCGLProcAddressTable().reset(macOSXCGLDynamicLookupHelper);
-        } */
-  }
-
-  public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
-      return macOSXCGLDynamicLookupHelper;
-  }
-
-  public MacOSXCGLDrawableFactory() {
-    super();
-
-    // Register our GraphicsConfigurationFactory implementations
-    // The act of constructing them causes them to be registered
-    new MacOSXCGLGraphicsConfigurationFactory();
-    if(GLProfile.isAWTAvailable()) {
-        try {
-          ReflectionUtil.createInstance("com.jogamp.opengl.impl.macosx.cgl.awt.MacOSXAWTCGLGraphicsConfigurationFactory",
-                                        null, getClass().getClassLoader());
-        } catch (JogampRuntimeException jre) { /* n/a .. */ }
-    }
-
-    defaultDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
-  }
-
-  static class SharedResource {
-      private MacOSXCGLDrawable drawable;
-      private MacOSXCGLContext context;
-
-      SharedResource(MacOSXCGLDrawable draw, MacOSXCGLContext ctx) {
-          drawable = draw;
-          context = ctx;
-      }
-  }
-  HashMap/*<connection, SharedResource>*/ sharedMap = new HashMap();
-  MacOSXGraphicsDevice defaultDevice;
-
-  public final AbstractGraphicsDevice getDefaultDevice() {
-      return defaultDevice;
-  }
-
-  public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
-      if(device instanceof MacOSXGraphicsDevice) {
-          return true;
-      }
-      return false;
-  }
-
-  protected final GLContext getOrCreateSharedContextImpl(AbstractGraphicsDevice device) {
-        // FIXME: not implemented .. needs a dummy OSX surface
-        return null;
-  }
-
-  protected final void shutdownInstance() {}
-
-  protected GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
-    if (target == null) {
-      throw new IllegalArgumentException("Null target");
-    }
-    return new MacOSXOnscreenCGLDrawable(this, target);
-  }
-
-  protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
-    return new MacOSXOffscreenCGLDrawable(this, target);
-  }
-
-  public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) {
-    return true;
-  }
-
-  protected GLDrawableImpl createGLPbufferDrawableImpl(final NativeSurface target) {
-    /** 
-     * FIXME: Think about this ..
-     * should not be necessary ? ..
-    final List returnList = new ArrayList();
-    final GLDrawableFactory factory = this;
-    Runnable r = new Runnable() {
-        public void run() {
-          returnList.add(new MacOSXPbufferCGLDrawable(factory, target));
-        }
-      };
-    maybeDoSingleThreadedWorkaround(r);
-    return (GLDrawableImpl) returnList.get(0);
-    */
-    return new MacOSXPbufferCGLDrawable(this, target);
-  }
-
-  protected NativeSurface createOffscreenSurfaceImpl(GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, int width, int height) {
-    AbstractGraphicsScreen screen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_MACOSX);
-    ProxySurface ns = new ProxySurface(MacOSXCGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, screen, true));
-    ns.setSize(width, height);
-    return ns;
-  }
-
-  protected GLContext createExternalGLContextImpl() {
-    return MacOSXExternalCGLContext.create(this, null);
-  }
-
-  public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
-    return false;
-  }
-
-  protected GLDrawable createExternalGLDrawableImpl() {
-    // FIXME
-    throw new GLException("Not yet implemented");
-  }
-
-  public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) {
-    return false;
-  }
-
-  public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
-    throws GLException {
-    throw new GLException("not supported in non AWT enviroment");
-  }
-  
-  //------------------------------------------------------
-  // Gamma-related functionality
-  //
-
-  private static final int GAMMA_RAMP_LENGTH = 256;
-
-  /** Returns the length of the computed gamma ramp for this OS and
-      hardware. Returns 0 if gamma changes are not supported. */
-  protected int getGammaRampLength() {
-    return GAMMA_RAMP_LENGTH;
-  }
-
-  protected boolean setGammaRamp(float[] ramp) {
-    return CGL.setGammaRamp(ramp.length,
-                            ramp, 0,
-                            ramp, 0,
-                            ramp, 0);
-  }
-
-  protected Buffer getGammaRamp() {
-    return null;
-  }
-
-  protected void resetGammaRamp(Buffer originalGammaRamp) {
-    CGL.resetGammaRamp();
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
deleted file mode 100644
index a9b1a59..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import com.jogamp.opengl.impl.*;
-import com.jogamp.common.os.DynamicLookupHelper;
-import com.jogamp.common.os.NativeLibrary;
-import com.jogamp.common.os.Platform;
-import java.util.*;
-import java.security.*;
-import javax.media.opengl.GLException;
-
-public class MacOSXCGLDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo  {
-    protected MacOSXCGLDynamicLibraryBundleInfo() {
-        super();
-    }
-
-    public List getToolLibNames() {
-        List/*<List>*/ libNamesList = new ArrayList();
-
-        List/*<String>*/ glesLibNames = new ArrayList();
-
-        glesLibNames.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib");
-        glesLibNames.add("GL");
-
-        libNamesList.add(glesLibNames);
-
-        return libNamesList;
-    }
-
-    public final List getToolGetProcAddressFuncNameList() {
-        return null; 
-        /** OSX manual says: NSImage use is discouraged
-        List res = new ArrayList();
-        res.add("GetProcAddress"); // dummy
-        return res; */
-    }
-
-    public final long toolDynamicLookupFunction(long toolGetProcAddressHandle, String funcName) {
-        return 0;
-        /** OSX manual says: NSImage use is discouraged
-            return CGL.getProcAddress(glFuncName); // manual implementation 
-         */
-    }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
deleted file mode 100644
index b912efd..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-
-public class MacOSXCGLGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
-    long pixelformat;
-
-    public MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen, 
-                                          GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
-                                          long pixelformat) {
-        super(screen, capsChosen, capsRequested);
-        this.pixelformat=pixelformat;
-    }
-
-    public Object clone() {
-        return super.clone();
-    }
-
-    protected void setChosenPixelFormat(long pixelformat) {
-        this.pixelformat=pixelformat;
-    }
-
-    protected void setChosenCapabilities(GLCapabilitiesImmutable caps) {
-        super.setChosenCapabilities(caps);
-    }
-
-    protected static final int[] cglInternalAttributeToken = new int[] {
-        CGL.kCGLPFAColorFloat,
-        CGL.NSOpenGLPFAPixelBuffer,
-        CGL.NSOpenGLPFADoubleBuffer,
-        CGL.NSOpenGLPFAStereo,
-        CGL.NSOpenGLPFAColorSize,
-        CGL.NSOpenGLPFAAlphaSize,
-        CGL.NSOpenGLPFADepthSize,
-        CGL.NSOpenGLPFAAccumSize,
-        CGL.NSOpenGLPFAStencilSize,
-        CGL.NSOpenGLPFASampleBuffers,
-        CGL.NSOpenGLPFASamples };
-
-    protected static int[] GLCapabilities2AttribList(GLCapabilitiesImmutable caps) {
-        int[] ivalues = new int[cglInternalAttributeToken.length];
-
-        for (int idx = 0; idx < cglInternalAttributeToken.length; idx++) {
-          int attr = cglInternalAttributeToken[idx];
-          switch (attr) {
-              case CGL.kCGLPFAColorFloat:
-                ivalues[idx] = caps.getPbufferFloatingPointBuffers() ? 1 : 0;
-                break;
-
-              case CGL.NSOpenGLPFAPixelBuffer:
-                ivalues[idx] = caps.isPBuffer() ? 1 : 0;
-                break;
-
-              case CGL.NSOpenGLPFADoubleBuffer:
-                ivalues[idx] = (caps.getDoubleBuffered() ? 1 : 0);
-                break;
-
-              case CGL.NSOpenGLPFAStereo:
-                ivalues[idx] = (caps.getStereo() ? 1 : 0);
-                break;
-
-              case CGL.NSOpenGLPFAColorSize:
-                ivalues[idx] = (caps.getRedBits() + caps.getGreenBits() + caps.getBlueBits());
-                break;
-
-              case CGL.NSOpenGLPFAAlphaSize:
-                ivalues[idx] = caps.getAlphaBits();
-                break;
-
-              case CGL.NSOpenGLPFADepthSize:
-                ivalues[idx] = caps.getDepthBits();
-                break;
-
-              case CGL.NSOpenGLPFAAccumSize:
-                ivalues[idx] = (caps.getAccumRedBits() + caps.getAccumGreenBits() + caps.getAccumBlueBits() + caps.getAccumAlphaBits());
-                break;
-
-              case CGL.NSOpenGLPFAStencilSize:
-                ivalues[idx] = caps.getStencilBits();
-                break;
-
-              case CGL.NSOpenGLPFASampleBuffers:
-                ivalues[idx] = caps.getSampleBuffers() ? 1 : 0;
-                break;
-
-              case CGL.NSOpenGLPFASamples:
-                ivalues[idx] = caps.getSampleBuffers() ? ivalues[idx] = caps.getNumSamples() : 0;
-                break;
-
-              default:
-                break;
-          }
-        }
-        return ivalues;
-    }
-
-    protected static long GLCapabilities2NSPixelFormat(GLCapabilitiesImmutable caps) {
-        int[] ivalues = GLCapabilities2AttribList(caps);
-        return CGL.createPixelFormat(cglInternalAttributeToken, 0, cglInternalAttributeToken.length, ivalues, 0);
-    }
-
-    protected static GLCapabilitiesImmutable NSPixelFormat2GLCapabilities(GLProfile glp, long pixelFormat) {
-        return PixelFormat2GLCapabilities(glp, pixelFormat, true);
-    }
-
-    protected static GLCapabilitiesImmutable CGLPixelFormat2GLCapabilities(GLProfile glp, long pixelFormat) {
-        return PixelFormat2GLCapabilities(glp, pixelFormat, false);
-    }
-
-    private static GLCapabilitiesImmutable PixelFormat2GLCapabilities(GLProfile glp, long pixelFormat, boolean nsUsage) {
-        int[] ivalues = new int[cglInternalAttributeToken.length];
-
-        // On this platform the pixel format is associated with the
-        // context and not the drawable. However it's a reasonable
-        // approximation to just store the chosen pixel format up in the
-        // NativeSurface's AbstractGraphicsConfiguration, 
-        // since the public API doesn't provide for a different GLCapabilities per context.
-        // Note: These restrictions of the platform's API might be considered as a bug anyways.
-
-        // Figure out what attributes we really got
-        GLCapabilities caps = new GLCapabilities(glp);
-        if(nsUsage) {
-            CGL.queryPixelFormat(pixelFormat, cglInternalAttributeToken, 0, cglInternalAttributeToken.length, ivalues, 0);
-        } else {
-            CGL.CGLQueryPixelFormat(pixelFormat, cglInternalAttributeToken, 0, cglInternalAttributeToken.length, ivalues, 0);
-        }
-        for (int i = 0; i < cglInternalAttributeToken.length; i++) {
-          int attr = cglInternalAttributeToken[i];
-          switch (attr) {
-              case CGL.kCGLPFAColorFloat:
-                caps.setPbufferFloatingPointBuffers(ivalues[i] != 0);
-                break;
-
-              case CGL.NSOpenGLPFAPixelBuffer:
-                caps.setPBuffer(ivalues[i] != 0);
-                break;
-
-              case CGL.NSOpenGLPFADoubleBuffer:
-                caps.setDoubleBuffered(ivalues[i] != 0);
-                break;
-
-              case CGL.NSOpenGLPFAStereo:
-                caps.setStereo(ivalues[i] != 0);
-                break;
-
-              case CGL.NSOpenGLPFAColorSize:
-                {
-                  int bitSize = ivalues[i];
-                  if (bitSize == 32)
-                    bitSize = 24;
-                  bitSize /= 3;
-                  caps.setRedBits(bitSize);
-                  caps.setGreenBits(bitSize);
-                  caps.setBlueBits(bitSize);
-                }
-                break;
-
-              case CGL.NSOpenGLPFAAlphaSize:
-                caps.setAlphaBits(ivalues[i]);
-                break;
-
-              case CGL.NSOpenGLPFADepthSize:
-                caps.setDepthBits(ivalues[i]);
-                break;
-
-              case CGL.NSOpenGLPFAAccumSize:
-                {
-                  int bitSize = ivalues[i] / 4;
-                  caps.setAccumRedBits(bitSize);
-                  caps.setAccumGreenBits(bitSize);
-                  caps.setAccumBlueBits(bitSize);
-                  caps.setAccumAlphaBits(bitSize);
-                }
-                break;
-
-              case CGL.NSOpenGLPFAStencilSize:
-                caps.setStencilBits(ivalues[i]);
-                break;
-
-              case CGL.NSOpenGLPFASampleBuffers:
-                caps.setSampleBuffers(ivalues[i] != 0);
-                break;
-
-              case CGL.NSOpenGLPFASamples:
-                caps.setNumSamples(ivalues[i]);
-                break;
-
-              default:
-                break;
-          }
-        }
-
-        return caps;
-      }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
deleted file mode 100644
index f53fff1..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.CapabilitiesChooser;
-import javax.media.nativewindow.CapabilitiesImmutable;
-import javax.media.nativewindow.GraphicsConfigurationFactory;
-import javax.media.opengl.GLCapabilitiesChooser;
-import javax.media.opengl.GLCapabilitiesImmutable;
-
-
-/** Subclass of GraphicsConfigurationFactory used when non-AWT tookits
-    are used on OSX platforms. Toolkits will likely need to delegate
-    to this one to change the accepted and returned types of the
-    GraphicsDevice and GraphicsConfiguration abstractions. */
-
-public class MacOSXCGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
-    protected static final boolean DEBUG = com.jogamp.opengl.impl.Debug.debug("GraphicsConfiguration");
-
-    public MacOSXCGLGraphicsConfigurationFactory() {
-        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.macosx.MacOSXGraphicsDevice.class, this);
-    }
-
-    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
-        return chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, absScreen, false);
-    }
-
-    protected static MacOSXCGLGraphicsConfiguration chooseGraphicsConfigurationStatic(CapabilitiesImmutable capsChosen,
-                                                                                      CapabilitiesImmutable capsRequested,
-                                                                                      CapabilitiesChooser chooser,
-                                                                                      AbstractGraphicsScreen absScreen, boolean usePBuffer) {
-        if (absScreen == null) {
-            throw new IllegalArgumentException("AbstractGraphicsScreen is null");
-        }
-
-        if (! (capsChosen instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - chosen");
-        }
-
-        if (! (capsRequested instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - requested");
-        }
-
-        if (chooser != null &&
-            !(chooser instanceof GLCapabilitiesChooser)) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
-        }
-
-        return new MacOSXCGLGraphicsConfiguration(absScreen, (GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested, 0);
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java
deleted file mode 100644
index 80a396a..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-
-import javax.media.nativewindow.*;
-import com.jogamp.nativewindow.impl.ProxySurface;
-
-public class MacOSXExternalCGLContext extends MacOSXCGLContext {
-  private boolean firstMakeCurrent = true;
-  private GLContext lastContext;
-
-  private MacOSXExternalCGLContext(Drawable drawable, boolean isNSContext, long handle) {
-    super(drawable, null);
-    drawable.setExternalCGLContext(this);
-    this.isNSContext = isNSContext;
-    this.contextHandle = handle;
-    GLContextShareSet.contextCreated(this);
-    setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);
-    getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
-  }
-
-  protected static MacOSXExternalCGLContext create(GLDrawableFactory factory, GLProfile glp) {
-    long pixelFormat = 0;
-    long currentDrawable = 0;
-    long contextHandle = CGL.getCurrentContext(); // Check: MacOSX 10.3 ..
-    boolean isNSContext = 0 != contextHandle;
-    if( isNSContext ) {
-        currentDrawable = CGL.getNSView(contextHandle);
-        long ctx = CGL.getCGLContext(contextHandle);
-        if (ctx == 0) {
-          throw new GLException("Error: NULL Context (CGL) of Context (NS) 0x" +Long.toHexString(contextHandle));
-        }
-        pixelFormat = CGL.CGLGetPixelFormat(ctx);
-        if(DEBUG) {
-            System.err.println("MacOSXExternalCGLContext Create Context (NS) 0x"+Long.toHexString(contextHandle)+
-                               ", Context (CGL) 0x"+Long.toHexString(ctx)+
-                               ", pixelFormat 0x"+Long.toHexString(pixelFormat));
-        }
-    } else {
-        contextHandle = CGL.CGLGetCurrentContext();
-        if (contextHandle == 0) {
-          throw new GLException("Error: current Context (CGL) null, no Context (NS)");
-        }
-        pixelFormat = CGL.CGLGetPixelFormat(contextHandle);
-        if(DEBUG) {
-            System.err.println("MacOSXExternalCGLContext Create Context (CGL) 0x"+Long.toHexString(contextHandle)+
-                               ", pixelFormat 0x"+Long.toHexString(pixelFormat));
-        }
-    }
-
-    if (0 == pixelFormat) {
-      throw new GLException("Error: current pixelformat of current Context 0x"+Long.toHexString(contextHandle)+" is null");
-    }
-    GLCapabilitiesImmutable caps = MacOSXCGLGraphicsConfiguration.CGLPixelFormat2GLCapabilities(glp, pixelFormat);
-    if(DEBUG) {
-        System.err.println("MacOSXExternalCGLContext Create "+caps);
-    }
-
-    AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_MACOSX);
-    MacOSXCGLGraphicsConfiguration cfg = new MacOSXCGLGraphicsConfiguration(aScreen, caps, caps, pixelFormat);
-
-    ProxySurface ns = new ProxySurface(cfg);
-    ns.setSurfaceHandle(currentDrawable);
-    return new MacOSXExternalCGLContext(new Drawable(factory, ns), isNSContext, contextHandle);
-  }
-
-  protected boolean createImpl() throws GLException {
-      return true;
-  }
-
-  public int makeCurrent() throws GLException {
-    // Save last context if necessary to allow external GLContexts to
-    // talk to other GLContexts created by this library
-    GLContext cur = getCurrent();
-    if (cur != null && cur != this) {
-      lastContext = cur;
-      setCurrent(null);
-    }
-    return super.makeCurrent();
-  }  
-
-  public void release() throws GLException {
-    super.release();
-    setCurrent(lastContext);
-    lastContext = null;
-  }
-
-  protected void makeCurrentImpl(boolean newCreated) throws GLException {
-    if (firstMakeCurrent) {
-      firstMakeCurrent = false;
-    }
-  }
-
-  protected void releaseImpl() throws GLException {
-  }
-
-  protected void destroyImpl() throws GLException {
-  }
-
-  public void setOpenGLMode(int mode) {
-    if (mode != MacOSXCGLDrawable.CGL_MODE)
-      throw new GLException("OpenGL mode switching not supported for external GLContexts");
-  }
-    
-  public int  getOpenGLMode() {
-    return MacOSXCGLDrawable.CGL_MODE;
-  }
-
-  // Need to provide the display connection to extension querying APIs
-  static class Drawable extends MacOSXCGLDrawable {
-    MacOSXExternalCGLContext extCtx;
-
-    Drawable(GLDrawableFactory factory, NativeSurface comp) {
-      super(factory, comp, true);
-    }
-
-    void setExternalCGLContext(MacOSXExternalCGLContext externalContext) {
-      extCtx = externalContext;
-    }
-
-    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");
-    }
-
-    protected void swapBuffersImpl() {
-      if (extCtx != null) {
-        extCtx.swapBuffers();
-      }
-    }
-  
-    public void setOpenGLMode(int mode) {
-        if (mode != CGL_MODE)
-          throw new GLException("OpenGL mode switching not supported for external GLContext's drawables");
-    }
-
-    public int  getOpenGLMode() {
-        return CGL_MODE;
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java
deleted file mode 100644
index 89e2936..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-
-public class MacOSXOffscreenCGLContext extends MacOSXPbufferCGLContext
-{  
-  public MacOSXOffscreenCGLContext(MacOSXPbufferCGLDrawable drawable,
-                                  GLContext shareWith) {
-    super(drawable, shareWith);
-  }
-	
-  public int getOffscreenContextPixelDataType() {
-    GL gl = getGL();
-    return gl.isGL2GL3()?GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:GL.GL_UNSIGNED_SHORT_5_5_5_1;
-  }
-
-  public int getOffscreenContextReadBuffer() {
-    return GL.GL_FRONT;
-  }
-
-  public boolean offscreenImageNeedsVerticalFlip() {
-    return true;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
deleted file mode 100644
index f87c89f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-import com.jogamp.opengl.impl.*;
-
-public class MacOSXOffscreenCGLDrawable extends MacOSXPbufferCGLDrawable {
-
-  public MacOSXOffscreenCGLDrawable(GLDrawableFactory factory,
-                                    NativeSurface target) {
-    super(factory, target);
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    return new MacOSXOffscreenCGLContext(this, shareWith);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java
deleted file mode 100644
index e494fd1..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import java.util.*;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-
-public class MacOSXOnscreenCGLContext extends MacOSXCGLContext {
-
-  public MacOSXOnscreenCGLContext(MacOSXOnscreenCGLDrawable drawable,
-                                 GLContext shareWith) {
-    super(drawable, shareWith);
-  }
-
-  protected void makeCurrentImpl(boolean newCreated) throws GLException {
-      super.makeCurrentImpl(newCreated);
-      CGL.updateContext(contextHandle);
-  }
-    
-  protected void releaseImpl() throws GLException {
-    super.releaseImpl();
-  }
-
-  protected void swapBuffers() {
-    if (!CGL.flushBuffer(contextHandle)) {
-      throw new GLException("Error swapping buffers");
-    }
-  }
-
-  protected void update() throws GLException {
-    if (contextHandle == 0) {
-      throw new GLException("Context not created");
-    }
-    CGL.updateContext(contextHandle);
-  }
-
-  protected boolean createImpl() {
-    return create(false, false);
-  }
-
-  public void setOpenGLMode(int mode) {
-    if (mode != MacOSXCGLDrawable.NSOPENGL_MODE)
-      throw new GLException("OpenGL mode switching not supported for on-screen GLContexts");
-  }
-    
-  public int  getOpenGLMode() {
-    return MacOSXCGLDrawable.NSOPENGL_MODE;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
deleted file mode 100644
index 798e39e..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import java.lang.ref.WeakReference;
-import java.security.*;
-import java.util.*;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-
-public class MacOSXOnscreenCGLDrawable extends MacOSXCGLDrawable {
-  private List/*<WeakReference<GLContext>>*/ createdContexts =
-    new ArrayList();
-
-  protected MacOSXOnscreenCGLDrawable(GLDrawableFactory factory, NativeSurface component) {
-    super(factory, component, false);
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    MacOSXOnscreenCGLContext context =
-      new MacOSXOnscreenCGLContext(this, shareWith);
-    // NOTE: we need to keep track of the created contexts in order to
-    // implement swapBuffers() because of how Mac OS X implements its
-    // OpenGL window interface
-    synchronized (this) {
-      List newContexts = new ArrayList();
-      newContexts.addAll(createdContexts);
-      newContexts.add(new WeakReference(context));
-      createdContexts = newContexts;
-    }
-    return context;
-  }
-
-  protected void swapBuffersImpl() {
-    for (Iterator iter = createdContexts.iterator(); iter.hasNext(); ) {
-      WeakReference ref = (WeakReference) iter.next();
-      MacOSXOnscreenCGLContext ctx = (MacOSXOnscreenCGLContext) ref.get();
-      // FIXME: clear out unreachable contexts
-      if (ctx != null) {
-        ctx.swapBuffers();
-      }
-    }
-  }
-  
-  public void setOpenGLMode(int mode) {
-    if (mode != NSOPENGL_MODE)
-      throw new GLException("OpenGL mode switching not supported for on-screen GLDrawables");
-  }
-
-  public int  getOpenGLMode() {
-    return NSOPENGL_MODE;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java
deleted file mode 100644
index 93e5767..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import com.jogamp.common.nio.PointerBuffer;
-import java.security.*;
-import java.util.*;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-import com.jogamp.opengl.impl.*;
-
-public class MacOSXPbufferCGLContext extends MacOSXCGLContext {
-
-  // State for render-to-texture and render-to-texture-rectangle support
-  private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV
-  private int texture;       // actual texture object
-
-  private static boolean isTigerOrLater;
-
-  static {
-    String osVersion = Debug.getProperty("os.version", false, AccessController.getContext());
-    StringTokenizer tok = new StringTokenizer(osVersion, ". ");
-    int major = Integer.parseInt(tok.nextToken());
-    int minor = Integer.parseInt(tok.nextToken());
-    isTigerOrLater = ((major > 10) || (minor > 3));
-  }
-
-  public MacOSXPbufferCGLContext(MacOSXPbufferCGLDrawable drawable,
-                                GLContext shareWith) {
-    super(drawable, shareWith);
-    initOpenGLImpl();
-  }
-
-  public void bindPbufferToTexture() {
-    GL gl = getGL();
-    gl.glBindTexture(textureTarget, texture);
-    // FIXME: not clear whether this is really necessary, but since
-    // the API docs seem to imply it is and since it doesn't seem to
-    // impact performance, leaving it in
-    CGL.setContextTextureImageToPBuffer(contextHandle, drawable.getHandle(), GL.GL_FRONT);
-  }
-
-  public void releasePbufferFromTexture() {
-  }
-
-  protected void makeCurrentImpl(boolean newCreated) throws GLException {
-    if (getOpenGLMode() != ((MacOSXPbufferCGLDrawable)drawable).getOpenGLMode()) {
-      setOpenGLMode(((MacOSXPbufferCGLDrawable)drawable).getOpenGLMode());
-    }
-
-    if (!impl.makeCurrent(contextHandle)) {
-      throw new GLException("Error making Context (NS) current");
-    }
-            
-    if (newCreated) {
-      // Initialize render-to-texture support if requested
-      DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-      GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
-      GL gl = getGL();
-      boolean rect = gl.isGL2GL3() && capabilities.getPbufferRenderToTextureRectangle();
-      if (rect) {
-        if (!gl.isExtensionAvailable("GL_EXT_texture_rectangle")) {
-          System.err.println("MacOSXPbufferCGLContext: WARNING: GL_EXT_texture_rectangle extension not " +
-                             "supported; skipping requested render_to_texture_rectangle support for pbuffer");
-          rect = false;
-        }
-      }
-      textureTarget = (rect ? GL2.GL_TEXTURE_RECTANGLE : GL.GL_TEXTURE_2D);
-      int[] tmp = new int[1];
-      gl.glGenTextures(1, tmp, 0);
-      texture = tmp[0];
-      gl.glBindTexture(textureTarget, texture);
-      gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
-      gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
-      gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP_TO_EDGE);
-      gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP_TO_EDGE);
-      gl.glCopyTexImage2D(textureTarget, 0, GL.GL_RGB, 0, 0, drawable.getWidth(), drawable.getHeight(), 0);
-    }
-  }
-
-  protected void releaseImpl() throws GLException {
-    if (!impl.release(contextHandle)) {
-      throw new GLException("Error releasing OpenGL Context (NS)");
-    }
-  }
-
-  protected void destroyImpl() throws GLException {
-      if (!impl.destroy(contextHandle)) {
-        throw new GLException("Unable to delete OpenGL context");
-      }
-      if (DEBUG) {
-        System.err.println("!!! Destroyed OpenGL context " + contextHandle);
-      }
-  }
-
-  protected void setSwapIntervalImpl(int interval) {
-    impl.setSwapInterval(contextHandle, interval);
-    currentSwapInterval = impl.getSwapInterval() ;
-  }
-
-  public int getFloatingPointMode() {
-    return GLPbuffer.APPLE_FLOAT;
-  }
-
-  protected boolean createImpl() throws GLException {
-    DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
-    if (capabilities.getPbufferFloatingPointBuffers() &&
-	!isTigerOrLater) {
-      throw new GLException("Floating-point pbuffers supported only on OS X 10.4 or later");
-    }
-    // Change our OpenGL mode to match that of any share context before we create ourselves
-    MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(this);
-    if (other != null) {
-      setOpenGLMode(other.getOpenGLMode());
-    }
-    // Will throw exception upon error
-    isNSContext = impl.isNSContext();
-    contextHandle = impl.create();
-
-    if (!impl.makeCurrent(contextHandle)) {
-      throw new GLException("Error making Context (NS:"+isNSContext()+") current");
-    }
-    if(!isNSContext()) { // FIXME: ??
-        throw new GLException("Not a NS Context");
-    }
-    setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);
-    return true;
-  }
-
-  //---------------------------------------------------------------------------
-  // OpenGL "mode switching" functionality
-  //
-  private boolean haveSetOpenGLMode = false;
-  // FIXME: should consider switching the default mode based on
-  // whether the Java2D/JOGL bridge is active -- need to ask ourselves
-  // whether it's more likely that we will share with a GLCanvas or a
-  // GLJPanel when the bridge is turned on
-  private int     openGLMode = MacOSXCGLDrawable.NSOPENGL_MODE;
-  // Implementation object (either NSOpenGL-based or CGL-based)
-  protected Impl impl;
-
-  public void setOpenGLMode(int mode) {
-    if (mode == openGLMode) {
-      return;
-    }
-    if (haveSetOpenGLMode) {
-      throw new GLException("Can't switch between using NSOpenGLPixelBuffer and CGLPBufferObj more than once");
-    }
-    destroyImpl();
-    ((MacOSXPbufferCGLDrawable)drawable).setOpenGLMode(mode);
-    openGLMode = mode;
-    haveSetOpenGLMode = true;
-    if (DEBUG) {
-      System.err.println("Switching PBuffer context mode to " +
-                         ((mode == MacOSXCGLDrawable.NSOPENGL_MODE) ? "NSOPENGL_MODE" : "CGL_MODE"));
-    }
-    initOpenGLImpl();
-  }
-
-  public int  getOpenGLMode() {
-    return openGLMode;
-  }
-
-  private void initOpenGLImpl() {
-    switch (openGLMode) {
-      case MacOSXCGLDrawable.NSOPENGL_MODE:
-        impl = new NSOpenGLImpl();
-        break;
-      case MacOSXCGLDrawable.CGL_MODE:
-        impl = new CGLImpl();
-        break;
-      default:
-        throw new InternalError("Illegal implementation mode " + openGLMode);
-    }
-  }
-
-  // Abstract interface for implementation of this context (either
-  // NSOpenGL-based or CGL-based)
-  interface Impl {
-    public boolean isNSContext();
-    public long    create();
-    public boolean destroy(long ctx);
-    public boolean makeCurrent(long ctx);
-    public boolean release(long ctx);
-    public void    setSwapInterval(long ctx, int interval);
-    public int     getSwapInterval();
-  }
-
-  // NSOpenGLContext-based implementation
-  class NSOpenGLImpl implements Impl {
-    public boolean isNSContext() { return true; }
-    public long create() {
-      DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-      GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
-      if (capabilities.getPbufferFloatingPointBuffers() &&
-          !isTigerOrLater) {
-        throw new GLException("Floating-point pbuffers supported only on OS X 10.4 or later");
-      }
-      if (!MacOSXPbufferCGLContext.this.create(true, capabilities.getPbufferFloatingPointBuffers())) {
-        throw new GLException("Error creating context for pbuffer");
-      }
-      // Must now associate the pbuffer with our newly-created context
-      CGL.setContextPBuffer(contextHandle, drawable.getHandle());
-      return contextHandle;
-    }
-
-    public boolean destroy(long ctx) {
-      return CGL.deleteContext(ctx);
-    }
-
-    public boolean makeCurrent(long ctx) {
-      return CGL.makeCurrentContext(ctx);
-    }
-
-    public boolean release(long ctx) {
-      return CGL.clearCurrentContext(ctx);
-    }
-
-    private int currentSwapInterval = 0 ;
-
-    public void setSwapInterval(long ctx, int interval) {
-      CGL.setSwapInterval(ctx, interval);      
-      currentSwapInterval = interval ;
-    }
-    public int getSwapInterval() {
-        return currentSwapInterval;
-    }
-  }
-
-  class CGLImpl implements Impl {
-    public boolean isNSContext() { return false; }
-    public long create() {
-      // Find and configure share context
-      MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(MacOSXPbufferCGLContext.this);
-      long share = 0;
-      if (other != null) {
-        // Reconfigure pbuffer-based GLContexts
-        if (other instanceof MacOSXPbufferCGLContext) {
-          MacOSXPbufferCGLContext ctx = (MacOSXPbufferCGLContext) other;
-          ctx.setOpenGLMode(MacOSXCGLDrawable.CGL_MODE);
-        } else {
-          if (other.isNSContext()) {
-            throw new GLException("Can't share between NSOpenGLContexts and CGLContextObjs");
-          }
-        }
-        share = other.getHandle();
-        // Note we don't check for a 0 return value, since switching
-        // the context's mode causes it to be destroyed and not
-        // re-initialized until the next makeCurrent
-      }
-
-      // Set up pixel format attributes
-      // FIXME: shall go into MacOSXCGLGraphicsConfiguration
-      int[] attrs = new int[256];
-      int i = 0;
-      attrs[i++] = CGL.kCGLPFAPBuffer;
-      DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-      GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
-      if (capabilities.getPbufferFloatingPointBuffers())
-        attrs[i++] = CGL.kCGLPFAColorFloat;
-      if (capabilities.getDoubleBuffered())
-        attrs[i++] = CGL.kCGLPFADoubleBuffer;
-      if (capabilities.getStereo())
-        attrs[i++] = CGL.kCGLPFAStereo;
-      attrs[i++] = CGL.kCGLPFAColorSize;
-      attrs[i++] = (capabilities.getRedBits() +
-                    capabilities.getGreenBits() +
-                    capabilities.getBlueBits());
-      attrs[i++] = CGL.kCGLPFAAlphaSize;
-      attrs[i++] = capabilities.getAlphaBits();
-      attrs[i++] = CGL.kCGLPFADepthSize;
-      attrs[i++] = capabilities.getDepthBits();
-      // FIXME: should validate stencil size as is done in MacOSXWindowSystemInterface.m
-      attrs[i++] = CGL.kCGLPFAStencilSize;
-      attrs[i++] = capabilities.getStencilBits();
-      attrs[i++] = CGL.kCGLPFAAccumSize;
-      attrs[i++] = (capabilities.getAccumRedBits() +
-                    capabilities.getAccumGreenBits() +
-                    capabilities.getAccumBlueBits() +
-                    capabilities.getAccumAlphaBits());
-      if (capabilities.getSampleBuffers()) {
-        attrs[i++] = CGL.kCGLPFASampleBuffers;
-        attrs[i++] = 1;
-        attrs[i++] = CGL.kCGLPFASamples;
-        attrs[i++] = capabilities.getNumSamples();
-      }
-
-      // Use attribute array to select pixel format
-      PointerBuffer fmt = PointerBuffer.allocateDirect(1);
-      long[] numScreens = new long[1];
-      int res = CGL.CGLChoosePixelFormat(attrs, 0, fmt, numScreens, 0);
-      if (res != CGL.kCGLNoError) {
-        throw new GLException("Error code " + res + " while choosing pixel format");
-      }
-      
-      // Create new context
-      PointerBuffer ctx = PointerBuffer.allocateDirect(1);
-      if (DEBUG) {
-        System.err.println("Share context for CGL-based pbuffer context is " + toHexString(share));
-      }
-      res = CGL.CGLCreateContext(fmt.get(0), share, ctx);
-      CGL.CGLDestroyPixelFormat(fmt.get(0));
-      if (res != CGL.kCGLNoError) {
-        throw new GLException("Error code " + res + " while creating context");
-      }
-      // Attach newly-created context to the pbuffer
-      res = CGL.CGLSetPBuffer(ctx.get(0), drawable.getHandle(), 0, 0, 0);
-      if (res != CGL.kCGLNoError) {
-        throw new GLException("Error code " + res + " while attaching context to pbuffer");
-      }
-      return ctx.get(0);
-    }
-    
-    public boolean destroy(long ctx) {
-      return (CGL.CGLDestroyContext(ctx) == CGL.kCGLNoError);
-    }
-
-    public boolean makeCurrent(long ctx) {
-      return CGL.CGLSetCurrentContext(ctx) == CGL.kCGLNoError;
-    }
-
-    public boolean release(long ctx) {
-      return (CGL.CGLSetCurrentContext(0) == CGL.kCGLNoError);
-    }
-
-    public void setSwapInterval(long ctx, int interval) {
-      // For now not supported (not really relevant for off-screen contexts anyway)
-    }
-    public int getSwapInterval() {
-        return 0;
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
deleted file mode 100644
index 37c6cfb..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl;
-
-import com.jogamp.common.nio.PointerBuffer;
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-import com.jogamp.opengl.impl.*;
-
-public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
-  private static final boolean DEBUG = Debug.debug("MacOSXPbufferCGLDrawable");
-  
-  // State for render-to-texture and render-to-texture-rectangle support
-  private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV
-  private int texture;       // actual texture object
-
-  // NSOpenGLPbuffer (for normal mode)
-  // CGLPbufferObj (for CGL_MODE situation, i.e., when Java2D/JOGL bridge is active)
-  // Note that we can not store this in the NativeSurface because the
-  // semantic is that contains an NSView
-  protected long pBuffer;
-
-  public MacOSXPbufferCGLDrawable(GLDrawableFactory factory, NativeSurface target) {
-    super(factory, target, true);
-
-    if (DEBUG) {
-        System.out.println("Pbuffer config: " + getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration());
-    }
-
-    initOpenGLImpl();
-    createPbuffer();
-
-    if (DEBUG) {
-        System.err.println("Created pbuffer " + this);
-    }
-  }
-
-  protected void setRealizedImpl() {
-    if(realized) {
-        createPbuffer();
-    } else {
-        destroyImpl();
-    }
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    return new MacOSXPbufferCGLContext(this, shareWith);
-  }
-
-  protected void destroyImpl() {
-    if (this.pBuffer != 0) {
-      NativeSurface ns = getNativeSurface();
-      impl.destroy(pBuffer);
-      this.pBuffer = 0;
-      ((SurfaceChangeable)ns).setSurfaceHandle(0);
-      if (DEBUG) {
-        System.err.println("Destroyed pbuffer: " + pBuffer);
-      }
-    }
-  }
-
-  public long getHandle() {
-    return pBuffer;
-  }
-  
-  protected void swapBuffersImpl() {
-    if(DEBUG) {
-        System.err.println("unhandled swapBuffersImpl() called for: "+this);
-    }
-  }
-
-  private void createPbuffer() {
-    NativeSurface ns = getNativeSurface();
-    DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
-    GLProfile glProfile = capabilities.getGLProfile();
-    int renderTarget;
-    if (glProfile.isGL2GL3() && capabilities.getPbufferRenderToTextureRectangle()) {
-      renderTarget = GL2.GL_TEXTURE_RECTANGLE;
-    } else {
-      int w = getNextPowerOf2(getWidth());
-      int h = getNextPowerOf2(getHeight());
-      ((SurfaceChangeable)ns).setSize(w, h);
-      renderTarget = GL.GL_TEXTURE_2D;
-    }
-
-    int internalFormat = GL.GL_RGBA;
-    if (capabilities.getPbufferFloatingPointBuffers()) {
-      // FIXME: want to check availability of GL_APPLE_float_pixels
-      // extension, but need valid OpenGL context in order to do so --
-      // in worst case would need to create dummy window / GLCanvas
-      // (undesirable) -- could maybe also do this with pbuffers
-      /*
-        if (!gl.isExtensionAvailable("GL_APPLE_float_pixels")) {
-        throw new GLException("Floating-point support (GL_APPLE_float_pixels) not available");
-        }
-      */
-      if(glProfile.isGL2GL3()) {
-        switch (capabilities.getRedBits()) {
-        case 16: internalFormat = GL2.GL_RGBA_FLOAT16_APPLE; break;
-        case 32: internalFormat = GL2.GL_RGBA_FLOAT32_APPLE; break;
-        default: throw new GLException("Invalid floating-point bit depth (only 16 and 32 supported)");
-        }
-      } else {
-        internalFormat = GL.GL_RGBA;
-      }
-    }
-            
-    pBuffer = impl.create(renderTarget, internalFormat, getWidth(), getHeight());
-    if (pBuffer == 0) {
-      throw new GLException("pbuffer creation error: CGL.createPBuffer() failed");
-    }
-
-    ((SurfaceChangeable)ns).setSurfaceHandle(pBuffer);
-
-  }
-
-  private int getNextPowerOf2(int number) {
-    if (((number-1) & number) == 0) {
-      //ex: 8 -> 0b1000; 8-1=7 -> 0b0111; 0b1000&0b0111 == 0
-      return number;
-    }
-    int power = 0;
-    while (number > 0) {
-      number = number>>1;
-      power++;
-    }
-    return (1<<power);
-  }
-
-  //---------------------------------------------------------------------------
-  // OpenGL "mode switching" functionality
-  //
-  private boolean haveSetOpenGLMode = false;
-  // FIXME: should consider switching the default mode based on
-  // whether the Java2D/JOGL bridge is active -- need to ask ourselves
-  // whether it's more likely that we will share with a GLCanvas or a
-  // GLJPanel when the bridge is turned on
-  private int     openGLMode = NSOPENGL_MODE;
-  // Implementation object (either NSOpenGL-based or CGL-based)
-  protected Impl impl;
-
-  public void setOpenGLMode(int mode) {
-    if (mode == openGLMode) {
-      return;
-    }
-    if (haveSetOpenGLMode) {
-      throw new GLException("Can't switch between using NSOpenGLPixelBuffer and CGLPBufferObj more than once");
-    }
-    destroyImpl();
-    openGLMode = mode;
-    haveSetOpenGLMode = true;
-    if (DEBUG) {
-      System.err.println("Switching PBuffer drawable mode to " +
-                         ((mode == MacOSXCGLDrawable.NSOPENGL_MODE) ? "NSOPENGL_MODE" : "CGL_MODE"));
-    }
-    initOpenGLImpl();
-    createPbuffer();
-  }
-
-  public int getOpenGLMode() {
-    return openGLMode;
-  }
-
-  private void initOpenGLImpl() {
-    switch (openGLMode) {
-      case NSOPENGL_MODE:
-        impl = new NSOpenGLImpl();
-        break;
-      case CGL_MODE:
-        impl = new CGLImpl();
-        break;
-      default:
-        throw new InternalError("Illegal implementation mode " + openGLMode);
-    }
-  }
-
-  // Abstract interface for implementation of this drawable (either
-  // NSOpenGL-based or CGL-based)
-  interface Impl {
-    public long create(int renderTarget, int internalFormat, int width, int height);
-    public void destroy(long pbuffer);
-  }
-
-  // NSOpenGLPixelBuffer implementation
-  class NSOpenGLImpl implements Impl {
-    public long create(int renderTarget, int internalFormat, int width, int height) {
-      return CGL.createPBuffer(renderTarget, internalFormat, width, height);
-    }
-
-    public void destroy(long pbuffer) {
-      CGL.destroyPBuffer(pbuffer);
-    }
-  }
-
-  // CGL implementation
-  class CGLImpl implements Impl {
-    public long create(int renderTarget, int internalFormat, int width, int height) {
-      PointerBuffer pbuffer = PointerBuffer.allocateDirect(1);
-      int res = CGL.CGLCreatePBuffer(width, height, renderTarget, internalFormat, 0, pbuffer);
-      if (res != CGL.kCGLNoError) {
-        throw new GLException("Error creating CGL-based pbuffer: error code " + res);
-      }
-      return pbuffer.get(0);
-    }
-
-    public void destroy(long pbuffer) {
-      int res = CGL.CGLDestroyPBuffer(pbuffer);
-      if (res != CGL.kCGLNoError) {
-        throw new GLException("Error destroying CGL-based pbuffer: error code " + res);
-      }
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java
deleted file mode 100644
index 4a80990..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl.awt;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.macosx.cgl.*;
-
-public class MacOSXAWTCGLDrawableFactory extends MacOSXCGLDrawableFactory {
-
-  public MacOSXAWTCGLDrawableFactory() {
-    super();
-  }
-
-  public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) {
-    return true;
-  }
-
-  public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
-    throws GLException {
-    return new MacOSXJava2DCGLContext(shareWith);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
deleted file mode 100644
index 702d66f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl.awt;
-
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.CapabilitiesChooser;
-import javax.media.nativewindow.CapabilitiesImmutable;
-import javax.media.nativewindow.DefaultGraphicsScreen;
-import javax.media.nativewindow.GraphicsConfigurationFactory;
-import javax.media.nativewindow.awt.AWTGraphicsConfiguration;
-import javax.media.nativewindow.awt.AWTGraphicsDevice;
-import javax.media.nativewindow.awt.AWTGraphicsScreen;
-import javax.media.nativewindow.macosx.MacOSXGraphicsDevice;
-
-import javax.media.opengl.GLCapabilitiesChooser;
-import javax.media.opengl.GLCapabilitiesImmutable;
-import javax.media.opengl.GLException;
-
-import com.jogamp.opengl.impl.macosx.cgl.MacOSXCGLGraphicsConfiguration;
-
-public class MacOSXAWTCGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
-    protected static final boolean DEBUG = com.jogamp.opengl.impl.Debug.debug("GraphicsConfiguration");
-
-    public MacOSXAWTCGLGraphicsConfigurationFactory() {
-        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this);
-    }
-
-    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
-        GraphicsDevice device = null;
-        if (absScreen != null &&
-            !(absScreen instanceof AWTGraphicsScreen)) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
-        }
-
-        if(null==absScreen) {
-            absScreen = AWTGraphicsScreen.createScreenDevice(-1, AbstractGraphicsDevice.DEFAULT_UNIT);
-        }
-        AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
-        device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
-
-        if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - chosen");
-        }
-
-        if ( !(capsRequested instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - requested");
-        }
-
-        if (chooser != null &&
-            !(chooser instanceof GLCapabilitiesChooser)) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilitiesChooser objects");
-        }
-
-        if(DEBUG) {
-            System.err.println("MacOSXAWTCGLGraphicsConfigurationFactory: got "+absScreen);
-        }
-
-        MacOSXGraphicsDevice macDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
-        DefaultGraphicsScreen macScreen = new DefaultGraphicsScreen(macDevice, awtScreen.getIndex());
-        if(DEBUG) {
-            System.err.println("MacOSXAWTCGLGraphicsConfigurationFactory: made "+macScreen);
-        }
-
-        GraphicsConfiguration gc = device.getDefaultConfiguration();
-        MacOSXCGLGraphicsConfiguration macConfig = (MacOSXCGLGraphicsConfiguration)
-            GraphicsConfigurationFactory.getFactory(macDevice).chooseGraphicsConfiguration(capsChosen,
-                                                                                           capsRequested,
-                                                                                           chooser, macScreen);
-
-        if (macConfig == null) {
-            throw new GLException("Unable to choose a GraphicsConfiguration: "+capsChosen+",\n\t"+chooser+"\n\t"+macScreen);
-        }
-
-        // We have nothing to match .. so choose the default
-        return new AWTGraphicsConfiguration(awtScreen, macConfig.getChosenCapabilities(), macConfig.getRequestedCapabilities(),
-                                            gc, macConfig);
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java
deleted file mode 100644
index b42f113..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.macosx.cgl.awt;
-
-import com.jogamp.opengl.impl.macosx.cgl.*;
-
-import java.awt.Graphics;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.opengl.impl.awt.*;
-import com.jogamp.opengl.impl.macosx.cgl.*;
-
-/** MacOSXCGLContext implementation supporting the Java2D/JOGL bridge
- * on Mac OS X. The external GLDrawable mechanism does not work on Mac
- * OS X due to how drawables and contexts are operated upon on this
- * platform, so it is necessary to supply an alternative means to
- * create, make current, and destroy contexts on the Java2D "drawable"
- * on the Mac platform.
- */
-
-public class MacOSXJava2DCGLContext extends MacOSXCGLContext implements Java2DGLContext {
-  private Graphics graphics;
-
-  // FIXME: ignoring context sharing for the time being; will need to
-  // rethink this in particular if using FBOs to implement the
-  // Java2D/OpenGL pipeline on Mac OS X
-
-  public MacOSXJava2DCGLContext(GLContext shareWith) {
-    super(null, shareWith);
-  }
-
-  public void setGraphics(Graphics g) {
-    this.graphics = g;
-  }
-
-  protected void makeCurrentImpl(boolean newCreated) throws GLException {
-    if (!Java2D.makeOGLContextCurrentOnSurface(graphics, contextHandle)) {
-      throw new GLException("Error making context current");
-    }            
-  }
-
-  protected boolean createImpl() {
-    // Find and configure share context
-    MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(this);
-    long share = 0;
-    if (other != null) {
-      // Reconfigure pbuffer-based GLContexts
-      if (other instanceof MacOSXPbufferCGLContext) {
-        MacOSXPbufferCGLContext ctx = (MacOSXPbufferCGLContext) other;
-        ctx.setOpenGLMode(MacOSXCGLDrawable.CGL_MODE);
-      } else {
-        if (other.getOpenGLMode() != MacOSXCGLDrawable.CGL_MODE) {
-          throw new GLException("Can't share between NSOpenGLContexts and CGLContextObjs");
-        }
-      }
-      share = other.getHandle();
-      // Note we don't check for a 0 return value, since switching
-      // the context's mode causes it to be destroyed and not
-      // re-initialized until the next makeCurrent
-    }
-
-    if (DEBUG) {
-      System.err.println("!!! Share context is " + toHexString(share) + " for " + getClass().getName());
-    }
-
-    long ctx = Java2D.createOGLContextOnSurface(graphics, share);
-    if (ctx == 0) {
-      return false;
-    }
-    setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); // use GL_VERSION
-    // FIXME: think about GLContext sharing
-    contextHandle = ctx;
-    isNSContext = true;
-    return true;
-  }
-
-  protected void releaseImpl() throws GLException {
-    // FIXME: would need another primitive in the Java2D class in
-    // order to implement this; hopefully should not matter for
-    // correctness
-  }
-
-  protected void destroyImpl() throws GLException {
-      Java2D.destroyOGLContext(contextHandle);
-      if (DEBUG) {
-        System.err.println("!!! Destroyed OpenGL context " + contextHandle);
-      }
-  }
-
-  public void setOpenGLMode(int mode) {
-    if (mode != MacOSXCGLDrawable.CGL_MODE)
-      throw new GLException("OpenGL mode switching not supported for Java2D GLContexts");
-  }
-
-  public int  getOpenGLMode() {
-    return MacOSXCGLDrawable.CGL_MODE;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java
deleted file mode 100644
index e87d3cc..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.nativewindow.impl.ProxySurface;
-import com.jogamp.nativewindow.impl.windows.GDI;
-import com.jogamp.nativewindow.impl.windows.PIXELFORMATDESCRIPTOR;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLCapabilitiesImmutable;
-
-public class WindowsDummyWGLDrawable extends WindowsWGLDrawable {
-  private long hwnd, hdc;
-
-  protected WindowsDummyWGLDrawable(GLDrawableFactory factory, GLCapabilitiesImmutable caps) {
-    super(factory, new ProxySurface(WindowsWGLGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(caps, null)), true);
-    hwnd = GDI.CreateDummyWindow(0, 0, 1, 1);
-    hdc = GDI.GetDC(hwnd);
-    ProxySurface ns = (ProxySurface) getNativeSurface();
-    ns.setSurfaceHandle(hdc);
-    WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    // Choose a (hopefully hardware-accelerated) OpenGL pixel format for this device context
-    PIXELFORMATDESCRIPTOR pfd = WindowsWGLGraphicsConfiguration.GLCapabilities2PFD((GLCapabilitiesImmutable)config.getChosenCapabilities());
-    int pixelFormat = GDI.ChoosePixelFormat(hdc, pfd);
-    if ((pixelFormat == 0) ||
-        (!GDI.SetPixelFormat(hdc, pixelFormat, pfd))) {
-      destroy();
-    }
-  }
-
-  public static WindowsDummyWGLDrawable create(GLDrawableFactory factory, GLProfile glp) {
-      GLCapabilities caps = new GLCapabilities(glp);
-      caps.setDepthBits(16);
-      caps.setDoubleBuffered(true);
-      caps.setOnscreen  (true);
-      caps.setPBuffer   (true);
-      return new WindowsDummyWGLDrawable(factory, caps);
-  }
-
-  public void setSize(int width, int height) {
-  }
-
-  public int getWidth() {
-    return 1;
-  }
-
-  public int getHeight() {
-    return 1;
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    if (hdc == 0) {
-      // Construction failed
-      return null;
-    }
-    // FIXME: figure out how to hook back in the Java 2D / JOGL bridge
-    return new WindowsWGLContext(this, shareWith);
-  }
-
-  protected void destroyImpl() {
-    if (hdc != 0) {
-      GDI.ReleaseDC(hwnd, hdc);
-      hdc = 0;
-    }
-    if (hwnd != 0) {
-      GDI.ShowWindow(hwnd, GDI.SW_HIDE);
-      GDI.DestroyWindow(hwnd);
-      hwnd = 0;
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java
deleted file mode 100644
index 173109d..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.DefaultGraphicsScreen;
-import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.nativewindow.impl.ProxySurface;
-import com.jogamp.nativewindow.impl.windows.GDI;
-import com.jogamp.opengl.impl.GLContextShareSet;
-
-
-public class WindowsExternalWGLContext extends WindowsWGLContext {
-  private boolean firstMakeCurrent = true;
-  private GLContext lastContext;
-
-  private WindowsExternalWGLContext(Drawable drawable, long ctx, WindowsWGLGraphicsConfiguration cfg) {
-    super(drawable, null);
-    this.contextHandle = ctx;
-    if (DEBUG) {
-      System.err.println(getThreadName() + ": !!! Created external OpenGL context " + toHexString(ctx) + " for " + this);
-    }
-    GLContextShareSet.contextCreated(this);
-    setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);
-    WindowsWGLGraphicsConfiguration config = 
-        (WindowsWGLGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    config.updateGraphicsConfiguration(drawable.getFactory(), drawable.getNativeSurface());
-    getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
-  }
-
-  protected static WindowsExternalWGLContext create(GLDrawableFactory factory, GLProfile glp) {
-    long hdc = WGL.wglGetCurrentDC();
-    if (0==hdc) {
-      throw new GLException("Error: attempted to make an external GLDrawable without a drawable current");
-    }
-    long ctx = WGL.wglGetCurrentContext();
-    if (ctx == 0) {
-      throw new GLException("Error: attempted to make an external GLContext without a context current");
-    }
-    int pfdID = GDI.GetPixelFormat(hdc);
-    if (pfdID == 0) {
-      throw new GLException("Error: attempted to make an external GLContext without a valid pixelformat");
-    }
-
-    AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
-    WindowsWGLGraphicsConfiguration cfg = WindowsWGLGraphicsConfiguration.create(hdc, pfdID, glp, aScreen, true, true);
-
-    ProxySurface ns = new ProxySurface(cfg);
-    ns.setSurfaceHandle(hdc);
-
-    return new WindowsExternalWGLContext(new Drawable(factory, ns), ctx, cfg);
-  }
-
-  public int makeCurrent() throws GLException {
-    // Save last context if necessary to allow external GLContexts to
-    // talk to other GLContexts created by this library
-    GLContext cur = getCurrent();
-    if (cur != null && cur != this) {
-      lastContext = cur;
-      setCurrent(null);
-    }
-    return super.makeCurrent();
-  }  
-
-  public void release() throws GLException {
-    super.release();
-    setCurrent(lastContext);
-    lastContext = null;
-  }
-
-  protected void makeCurrentImpl(boolean newCreated) throws GLException {
-    if (firstMakeCurrent) {
-      firstMakeCurrent = false;
-    }
-  }
-
-  protected void releaseImpl() throws GLException {
-  }
-
-  protected void destroyImpl() throws GLException {
-  }
-
-  // Need to provide the display connection to extension querying APIs
-  static class Drawable extends WindowsWGLDrawable {
-    Drawable(GLDrawableFactory factory, NativeSurface comp) {
-      super(factory, comp, true);
-    }
-
-    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");
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java
deleted file mode 100644
index 8f41db3..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.DefaultGraphicsScreen;
-import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.nativewindow.impl.ProxySurface;
-import com.jogamp.nativewindow.impl.windows.GDI;
-
-public class WindowsExternalWGLDrawable extends WindowsWGLDrawable {
-
-  private WindowsExternalWGLDrawable(GLDrawableFactory factory, NativeSurface component) {
-    super(factory, component, true);
-  }
-
-  protected static WindowsExternalWGLDrawable create(GLDrawableFactory factory, GLProfile glp) {
-    long hdc = WGL.wglGetCurrentDC();
-    if (0==hdc) {
-      throw new GLException("Error: attempted to make an external GLDrawable without a drawable current");
-    }
-    int pfdID = GDI.GetPixelFormat(hdc);
-    if (pfdID == 0) {
-      throw new GLException("Error: attempted to make an external GLContext without a valid pixelformat");
-    }
-
-    AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
-    WindowsWGLGraphicsConfiguration cfg = WindowsWGLGraphicsConfiguration.create(hdc, pfdID, glp, aScreen, true, true);
-
-    ProxySurface ns = new ProxySurface(cfg);
-    ns.setSurfaceHandle(hdc);
-
-    cfg.updateGraphicsConfiguration(factory, ns);
-
-    return new WindowsExternalWGLDrawable(factory, ns);
-  }
-
-
-  public GLContext createContext(GLContext shareWith) {
-    return new WindowsWGLContext(this, shareWith);
-  }
-  
-  public void setSize(int newWidth, int newHeight) {
-    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");
-  }  
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java
deleted file mode 100644
index 25d93b5..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-
-public class WindowsOffscreenWGLContext extends WindowsWGLContext {
-  public WindowsOffscreenWGLContext(WindowsOffscreenWGLDrawable drawable,
-                                   GLContext shareWith) {
-    super(drawable, shareWith);
-  }
-
-  public int getOffscreenContextPixelDataType() {
-      return GL.GL_UNSIGNED_BYTE;
-  }
-  
-  public int getOffscreenContextReadBuffer() {
-    // On Windows these contexts are always single-buffered
-    return GL.GL_FRONT;
-  }
-
-  public boolean offscreenImageNeedsVerticalFlip() {
-    // We can take care of this in the DIB creation (see below)
-    return false;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
deleted file mode 100644
index 3452d3b..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.SurfaceChangeable;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLException;
-
-import com.jogamp.nativewindow.impl.windows.BITMAPINFO;
-import com.jogamp.nativewindow.impl.windows.BITMAPINFOHEADER;
-import com.jogamp.nativewindow.impl.windows.GDI;
-import javax.media.opengl.GLCapabilitiesImmutable;
-
-public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable {
-  private long origbitmap;
-  private long hbitmap;
-
-  protected WindowsOffscreenWGLDrawable(GLDrawableFactory factory, NativeSurface target) {
-    super(factory, target, true);
-    create();
-  }
-
-  protected void setRealizedImpl() {
-    if(realized) {
-        create();
-    } else {
-        destroyImpl();
-    }
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    return new WindowsOffscreenWGLContext(this, shareWith);
-  }
-
-  private void create() {
-    NativeSurface ns = getNativeSurface();
-    WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getRequestedCapabilities();
-    int width = getWidth();
-    int height = getHeight();
-    BITMAPINFO info = BITMAPINFO.create();
-    BITMAPINFOHEADER header = info.getBmiHeader();
-    int bitsPerPixel = (capabilities.getRedBits() +
-                        capabilities.getGreenBits() +
-                        capabilities.getBlueBits() +
-                        capabilities.getAlphaBits());
-    header.setBiSize(header.size());
-    header.setBiWidth(width);
-    // NOTE: negating the height causes the DIB to be in top-down row
-    // order rather than bottom-up; ends up being correct during pixel
-    // readback
-    header.setBiHeight(-1 * height);
-    header.setBiPlanes((short) 1);
-    header.setBiBitCount((short) bitsPerPixel);
-    header.setBiXPelsPerMeter(0);
-    header.setBiYPelsPerMeter(0);
-    header.setBiClrUsed(0);
-    header.setBiClrImportant(0);
-    header.setBiCompression(GDI.BI_RGB);
-    header.setBiSizeImage(width * height * bitsPerPixel / 8);
-
-    long hdc = GDI.CreateCompatibleDC(0);
-    if (hdc == 0) {
-      System.out.println("LastError: " + GDI.GetLastError());
-      throw new GLException("Error creating device context for offscreen OpenGL context");
-    }
-    ((SurfaceChangeable)ns).setSurfaceHandle(hdc);
-
-    hbitmap = GDI.CreateDIBSection(hdc, info, GDI.DIB_RGB_COLORS, null, 0, 0);
-    if (hbitmap == 0) {
-      GDI.DeleteDC(hdc);
-      hdc = 0;
-      throw new GLException("Error creating offscreen bitmap of width " + width +
-                            ", height " + height);
-    }
-    if ((origbitmap = GDI.SelectObject(hdc, hbitmap)) == 0) {
-      GDI.DeleteObject(hbitmap);
-      hbitmap = 0;
-      GDI.DeleteDC(hdc);
-      hdc = 0;
-      throw new GLException("Error selecting bitmap into new device context");
-    }
-    config.updateGraphicsConfiguration(getFactory(), ns);
-  }
-  
-  protected void destroyImpl() {
-    NativeSurface ns = getNativeSurface();
-    if (ns.getSurfaceHandle() != 0) {
-      // Must destroy bitmap and device context
-      GDI.SelectObject(ns.getSurfaceHandle(), origbitmap);
-      GDI.DeleteObject(hbitmap);
-      GDI.DeleteDC(ns.getSurfaceHandle());
-      origbitmap = 0;
-      hbitmap = 0;
-      ((SurfaceChangeable)ns).setSurfaceHandle(0);
-    }
-  }
-
-  protected void swapBuffersImpl() {
-    if(DEBUG) {
-        System.err.println("unhandled swapBuffersImpl() called for: "+this);
-    }
-  }
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java
deleted file mode 100644
index 475faee..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import java.util.*;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-
-public class WindowsOnscreenWGLContext extends WindowsWGLContext {
-  public WindowsOnscreenWGLContext(WindowsOnscreenWGLDrawable drawable,
-                                  GLContext shareWith) {
-    super(drawable, shareWith);
-  }    
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java
deleted file mode 100644
index b0d62a4..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-
-public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable {
-  protected WindowsOnscreenWGLDrawable(GLDrawableFactory factory, NativeSurface component) {
-    super(factory, component, false);
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    return new WindowsOnscreenWGLContext(this, shareWith);
-  }
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java
deleted file mode 100644
index db86b32..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-
-public class WindowsPbufferWGLContext extends WindowsWGLContext {
-  // State for render-to-texture and render-to-texture-rectangle support
-  private boolean rtt;       // render-to-texture?
-  private boolean hasRTT;    // render-to-texture extension available?
-  private boolean rect;      // render-to-texture-rectangle?
-  private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV
-  private int texture;       // actual texture object
-
-  public WindowsPbufferWGLContext(WindowsPbufferWGLDrawable drawable,
-                                 GLContext shareWith) {
-    super(drawable, shareWith);
-  }
-
-  public void bindPbufferToTexture() {
-    if (!rtt) {
-      throw new GLException("Shouldn't try to bind a pbuffer to a texture if render-to-texture hasn't been " +
-                            "specified in its GLCapabilities");
-    }
-    GL gl = getGL();
-    WGLExt wglExt = getWGLExt();
-    gl.glBindTexture(textureTarget, texture);
-    if (rtt && hasRTT) {
-      if (!wglExt.wglBindTexImageARB(((WindowsPbufferWGLDrawable)drawable).getPbufferHandle(), WGLExt.WGL_FRONT_LEFT_ARB)) {
-        throw new GLException("Binding of pbuffer to texture failed: " + wglGetLastError());
-      }
-    }
-    // FIXME: comment is wrong now
-    // Note that if the render-to-texture extension is not supported,
-    // we perform a glCopyTexImage2D in swapBuffers().
-  }
-
-  public void releasePbufferFromTexture() {
-    if (!rtt) {
-      throw new GLException("Shouldn't try to bind a pbuffer to a texture if render-to-texture hasn't been " +
-                            "specified in its GLCapabilities");
-    }
-    if (rtt && hasRTT) {
-      WGLExt wglExt = getWGLExt();
-      if (!wglExt.wglReleaseTexImageARB(((WindowsPbufferWGLDrawable)drawable).getPbufferHandle(), WGLExt.WGL_FRONT_LEFT_ARB)) {
-        throw new GLException("Releasing of pbuffer from texture failed: " + wglGetLastError());
-      }
-    }
-  }
-
-  protected void makeCurrentImpl(boolean newCreated) throws GLException {
-    super.makeCurrentImpl(newCreated);
-    if (newCreated) {
-      GLCapabilitiesImmutable capabilities = drawable.getChosenGLCapabilities();
-
-      // Initialize render-to-texture support if requested
-      GL gl = getGL();
-      rtt  = capabilities.getPbufferRenderToTexture();
-      rect = gl.isGL2GL3() && capabilities.getPbufferRenderToTextureRectangle();
-
-      if (rtt) {
-        if (DEBUG) {
-          System.err.println("Initializing render-to-texture support");
-        }
-
-        if (!gl.isExtensionAvailable("WGL_ARB_render_texture")) {
-          System.err.println("WindowsPbufferWGLContext: WARNING: WGL_ARB_render_texture extension not " +
-                             "supported; implementing render_to_texture support using slow texture readback");
-        } else {
-          hasRTT = true;
-
-          if (rect && !gl.isExtensionAvailable("GL_NV_texture_rectangle")) {
-            System.err.println("WindowsPbufferWGLContext: WARNING: GL_NV_texture_rectangle extension not " +
-                               "supported; skipping requested render_to_texture_rectangle support for pbuffer");
-            rect = false;
-          }
-          if (rect) {
-            if (DEBUG) {
-              System.err.println("  Using render-to-texture-rectangle");
-            }
-            textureTarget = GL2.GL_TEXTURE_RECTANGLE_ARB;
-          } else {
-            if (DEBUG) {
-              System.err.println("  Using vanilla render-to-texture");
-            }
-            textureTarget = GL.GL_TEXTURE_2D;
-          }
-          int[] tmp = new int[1];
-          gl.glGenTextures(1, tmp, 0);
-          texture = tmp[0];
-          gl.glBindTexture(textureTarget, texture);
-          gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
-          gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
-          gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP_TO_EDGE);
-          gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP_TO_EDGE);
-          gl.glCopyTexImage2D(textureTarget, 0, GL.GL_RGB, 0, 0, drawable.getWidth(), drawable.getHeight(), 0);
-        }
-      }
-    }
-  }
-
-  public int getFloatingPointMode() {
-    return ((WindowsPbufferWGLDrawable)drawable).getFloatingPointMode();
-  }
-
-  private static String wglGetLastError() {
-    return WindowsWGLDrawableFactory.wglGetLastError();
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
deleted file mode 100644
index 47b33dd..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.SurfaceChangeable;
-import javax.media.opengl.GL;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLPbuffer;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.nativewindow.impl.windows.GDI;
-import com.jogamp.nativewindow.impl.windows.PIXELFORMATDESCRIPTOR;
-import javax.media.opengl.GLCapabilitiesImmutable;
-
-public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
-  private WGLExt cachedWGLExt; // cached WGLExt instance from parent GLCanvas,
-                               // needed to destroy pbuffer
-  private long buffer; // pbuffer handle
-
-  private int floatMode;
-
-  public WindowsPbufferWGLDrawable(GLDrawableFactory factory, NativeSurface target,
-                                   WindowsWGLDrawable dummyDrawable,
-                                   WindowsWGLContext sharedCtx) {
-    super(factory, target, true);
-
-    if (DEBUG) {
-        System.out.println("Pbuffer config: " + getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration());
-    }
-
-    createPbuffer(dummyDrawable.getNativeSurface().getSurfaceHandle(), sharedCtx);
-
-    if (DEBUG) {
-        System.err.println("Created pbuffer " + this);
-    }
-  }
-
-  protected void setRealizedImpl() {
-    if(realized) {
-        throw new GLException("Recreation via setRealized not supported.");
-    } else {
-        destroyImpl();
-    }
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    return new WindowsPbufferWGLContext(this, shareWith);
-  }
-
-  protected void destroyImpl() {
-    NativeSurface ns = getNativeSurface();
-    if(0!=buffer) {
-        WGLExt wglExt = cachedWGLExt;
-        if (ns.getSurfaceHandle() != 0) {
-          // Must release DC and pbuffer
-          // NOTE that since the context is not current, glGetError() can
-          // not be called here, so we skip the use of any composable
-          // pipelines (see WindowsOnscreenWGLContext.makeCurrentImpl)
-          if (wglExt.wglReleasePbufferDCARB(buffer, ns.getSurfaceHandle()) == 0) {
-            throw new GLException("Error releasing pbuffer device context: error code " + GDI.GetLastError());
-          }
-          ((SurfaceChangeable)ns).setSurfaceHandle(0);
-        }
-        if (!wglExt.wglDestroyPbufferARB(buffer)) {
-            throw new GLException("Error destroying pbuffer: error code " + GDI.GetLastError());
-        }
-        buffer = 0;
-    }
-  }
-
-  public long getPbufferHandle() {
-    // The actual to-be-used handle for makeCurrent etc,
-    // is the derived DC, set in the NativeSurface surfaceHandle
-    // returned by getHandle().
-    return buffer;
-  }
-
-  public int getFloatingPointMode() {
-    return floatMode;
-  }
-
-  protected void swapBuffersImpl() {
-    if(DEBUG) {
-        System.err.println("unhandled swapBuffersImpl() called for: "+this);
-    }
-  }
-
-  private void createPbuffer(long parentHdc, WindowsWGLContext sharedCtx) {
-    int[]   iattributes = new int  [2*WindowsWGLGraphicsConfiguration.MAX_ATTRIBS];
-    float[] fattributes = new float[1];
-    int[]   floatModeTmp = new int[1];
-    int     niattribs   = 0;
-    int     width, height;
-    WGLExt wglExt = sharedCtx.getWGLExt();
-
-    WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getRequestedCapabilities();
-    GLProfile glProfile = capabilities.getGLProfile();
-
-    if (DEBUG) {
-      System.out.println("Pbuffer parentHdc = " + toHexString(parentHdc));
-      System.out.println("Pbuffer caps: " + capabilities);
-    }
-
-    if(!WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(capabilities,
-                                    iattributes, sharedCtx, -1, true, floatModeTmp)){
-      throw new GLException("Pbuffer-related extensions not supported");
-    }
-
-    floatMode = floatModeTmp[0];
-    boolean rtt      = capabilities.getPbufferRenderToTexture();
-    boolean rect     = capabilities.getPbufferRenderToTextureRectangle();
-    boolean useFloat = capabilities.getPbufferFloatingPointBuffers();
-    boolean ati      = false;
-
-    if (useFloat) {
-      ati = (floatMode == GLPbuffer.ATI_FLOAT);
-    }
-
-    int[] pformats = new int[WindowsWGLGraphicsConfiguration.MAX_PFORMATS];
-    int   nformats;
-    int[] nformatsTmp = new int[1];
-    if (!wglExt.wglChoosePixelFormatARB(parentHdc,
-                                        iattributes, 0,
-                                        fattributes, 0,
-                                        WindowsWGLGraphicsConfiguration.MAX_PFORMATS,
-                                        pformats, 0,
-                                        nformatsTmp, 0)) {
-      throw new GLException("pbuffer creation error: wglChoosePixelFormat() failed");
-    }
-    nformats = nformatsTmp[0];
-    if (nformats <= 0) {
-      throw new GLException("pbuffer creation error: Couldn't find a suitable pixel format");
-    }
-
-    boolean haveMultisample = sharedCtx.isExtensionAvailable("WGL_ARB_multisample");
-
-    if (DEBUG) {
-      System.err.println("" + nformats + " suitable pixel formats found");
-      // query pixel format
-      iattributes[0] = WGLExt.WGL_RED_BITS_ARB;
-      iattributes[1] = WGLExt.WGL_GREEN_BITS_ARB;
-      iattributes[2] = WGLExt.WGL_BLUE_BITS_ARB;
-      iattributes[3] = WGLExt.WGL_ALPHA_BITS_ARB;
-      iattributes[4] = WGLExt.WGL_DEPTH_BITS_ARB;
-      iattributes[5] = (useFloat ? (ati ? WGLExt.WGL_PIXEL_TYPE_ARB : WGLExt.WGL_FLOAT_COMPONENTS_NV) : WGLExt.WGL_RED_BITS_ARB);
-      iattributes[6] = (haveMultisample ? WGLExt.WGL_SAMPLE_BUFFERS_ARB : WGLExt.WGL_RED_BITS_ARB);
-      iattributes[7] = (haveMultisample ? WGLExt.WGL_SAMPLES_ARB : WGLExt.WGL_RED_BITS_ARB);
-      iattributes[8] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB;
-      int[] ivalues = new int[9];
-      for (int i = 0; i < nformats; i++) {
-        if (!wglExt.wglGetPixelFormatAttribivARB(parentHdc, pformats[i], 0, 9, iattributes, 0, ivalues, 0)) {
-          throw new GLException("Error while querying pixel format " + pformats[i] +
-                                "'s (index " + i + "'s) capabilities for debugging");
-        }
-        System.err.print("pixel format " + pformats[i] + " (index " + i + "): ");
-        System.err.print( "r: " + ivalues[0]);
-        System.err.print(" g: " + ivalues[1]);
-        System.err.print(" b: " + ivalues[2]);
-        System.err.print(" a: " + ivalues[3]);
-        System.err.print(" depth: " + ivalues[4]);
-        if (haveMultisample) {
-          System.err.print(" multisample: " + ivalues[6]);
-        }
-        System.err.print(" samples: " + ivalues[7]);
-        if (useFloat) {
-          if (ati) {
-            if (ivalues[5] == WGLExt.WGL_TYPE_RGBA_FLOAT_ARB) {
-              System.err.print(" [ati float]");
-            } else if (ivalues[5] != WGLExt.WGL_TYPE_RGBA_ARB) {
-              System.err.print(" [unknown pixel type " + ivalues[5] + "]");
-            }
-          } else {
-            if (ivalues[5] != 0) {
-              System.err.print(" [float]");
-            }
-          }
-        }
-
-        if (ivalues[8] != 0) {
-          System.err.print(" [pbuffer]");
-        }
-        System.err.println();
-      }
-    }
-
-    long tmpBuffer = 0;
-    int whichFormat = -1;
-    // Loop is a workaround for bugs in NVidia's recent drivers
-    for (whichFormat = 0; whichFormat < nformats; whichFormat++) {
-      int format = pformats[whichFormat];
-
-      // Create the p-buffer.
-      niattribs = 0;
-
-      if (rtt) {
-        iattributes[niattribs++]   = WGLExt.WGL_TEXTURE_FORMAT_ARB;
-        if (useFloat) {
-          iattributes[niattribs++] = WGLExt.WGL_TEXTURE_FLOAT_RGB_NV;
-        } else {
-          iattributes[niattribs++] = WGLExt.WGL_TEXTURE_RGBA_ARB;
-        }
-
-        iattributes[niattribs++] = WGLExt.WGL_TEXTURE_TARGET_ARB;
-        iattributes[niattribs++] = rect ? WGLExt.WGL_TEXTURE_RECTANGLE_NV : WGLExt.WGL_TEXTURE_2D_ARB;
-
-        iattributes[niattribs++] = WGLExt.WGL_MIPMAP_TEXTURE_ARB;
-        iattributes[niattribs++] = GL.GL_FALSE;
-
-        iattributes[niattribs++] = WGLExt.WGL_PBUFFER_LARGEST_ARB;
-        iattributes[niattribs++] = GL.GL_FALSE;
-      }
-
-      iattributes[niattribs++] = 0;
-
-      tmpBuffer = wglExt.wglCreatePbufferARB(parentHdc, format, getWidth(), getHeight(), iattributes, 0);
-      if (tmpBuffer != 0) {
-        // Done
-        break;
-      }
-    }
-
-    if (tmpBuffer == 0) {
-      throw new GLException("pbuffer creation error: wglCreatePbuffer() failed: tried " + nformats +
-                            " pixel formats, last error was: " + wglGetLastError());
-    }
-
-    // Get the device context.
-    long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer);
-    if (tmpHdc == 0) {
-      throw new GLException("pbuffer creation error: wglGetPbufferDC() failed");
-    }
-
-    NativeSurface ns = getNativeSurface();
-    // Set up instance variables
-    buffer = tmpBuffer;
-    ((SurfaceChangeable)ns).setSurfaceHandle(tmpHdc);
-    cachedWGLExt = wglExt;   
-
-    // Re-query chosen pixel format
-    {
-      niattribs = 0;
-      iattributes[niattribs++] = WGLExt.WGL_ACCELERATION_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_RED_BITS_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_STEREO_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB;
-      iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB;
-      iattributes[niattribs++] = (useFloat ? (ati ? WGLExt.WGL_PIXEL_TYPE_ARB : WGLExt.WGL_FLOAT_COMPONENTS_NV) : WGLExt.WGL_RED_BITS_ARB);
-      iattributes[niattribs++] = (haveMultisample ? WGLExt.WGL_SAMPLE_BUFFERS_ARB : WGLExt.WGL_RED_BITS_ARB);
-      iattributes[niattribs++] = (haveMultisample ? WGLExt.WGL_SAMPLES_ARB : WGLExt.WGL_RED_BITS_ARB);
-      iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB;
-      int[] ivalues = new int[niattribs];
-      if (wglExt.wglGetPixelFormatAttribivARB(parentHdc, pformats[whichFormat], 0, niattribs, iattributes, 0, ivalues, 0)) {
-        GLCapabilitiesImmutable newCaps = WindowsWGLGraphicsConfiguration.AttribList2GLCapabilities(glProfile, iattributes, niattribs, ivalues, false, true);
-        if(null == newCaps|| newCaps.isOnscreen() || !newCaps.isPBuffer()) {
-            throw new GLException("Error: Selected Onscreen Caps for PBuffer: "+newCaps);
-        }
-        PIXELFORMATDESCRIPTOR pfd = WindowsWGLGraphicsConfiguration.createPixelFormatDescriptor();
-        if (GDI.DescribePixelFormat(parentHdc, pformats[whichFormat], pfd.size(), pfd) == 0) {
-          if (DEBUG) {
-              System.err.println("Unable to describe pixel format (Continue: true) " + whichFormat + "/" + nformats + " pfdID " + pformats[whichFormat]+":\n\t"+newCaps);
-          }
-        }
-        config.setCapsPFD(newCaps, pfd, pformats[whichFormat], true);
-      } else {
-        PIXELFORMATDESCRIPTOR pfd = WindowsWGLGraphicsConfiguration.createPixelFormatDescriptor();
-        if (GDI.DescribePixelFormat(parentHdc, pformats[whichFormat], pfd.size(), pfd) == 0) {
-          throw new GLException("Unable to describe pixel format " + pformats[whichFormat]);
-        }
-        GLCapabilitiesImmutable newCaps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(glProfile, pfd, false, true);
-        if(newCaps.isOnscreen()) {
-          throw new GLException("Error: Selected Onscreen Caps for PBuffer: "+newCaps+"\n\t"+newCaps);
-        }
-        config.setCapsPFD(newCaps, pfd, pformats[whichFormat], false);
-      }
-    }
-
-    // Determine the actual width and height we were able to create.
-    int[] tmp = new int[1];
-    wglExt.wglQueryPbufferARB( buffer, WGLExt.WGL_PBUFFER_WIDTH_ARB,  tmp, 0 );
-    width = tmp[0];
-    wglExt.wglQueryPbufferARB( buffer, WGLExt.WGL_PBUFFER_HEIGHT_ARB, tmp, 0 );
-    height = tmp[0];
-    ((SurfaceChangeable)ns).setSize(width, height);
-  }
-
-  private static String wglGetLastError() {
-    return WindowsWGLDrawableFactory.wglGetLastError();
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java
deleted file mode 100644
index c0bab78..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLException;
-
-import com.jogamp.gluegen.runtime.ProcAddressTable;
-import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
-import com.jogamp.nativewindow.impl.windows.GDI;
-import com.jogamp.opengl.impl.GLContextImpl;
-import com.jogamp.opengl.impl.GLContextShareSet;
-import com.jogamp.opengl.impl.GLDrawableImpl;
-import javax.media.opengl.GLCapabilitiesImmutable;
-
-
-public class WindowsWGLContext extends GLContextImpl {
-  private static final Map/*<String, String>*/ functionNameMap;
-  private static final Map/*<String, String>*/ extensionNameMap;
-  private boolean wglGetExtensionsStringEXTInitialized;
-  private boolean wglGetExtensionsStringEXTAvailable;
-  private boolean wglMakeContextCurrentInitialized;
-  private boolean wglMakeContextCurrentAvailable;
-  private WGLExt wglExt;
-  // Table that holds the addresses of the native C-language entry points for
-  // WGL extension functions.
-  private WGLExtProcAddressTable wglExtProcAddressTable;
-
-  static {
-    functionNameMap = new HashMap();
-    functionNameMap.put("glAllocateMemoryNV", "wglAllocateMemoryNV");
-    functionNameMap.put("glFreeMemoryNV", "wglFreeMemoryNV");
-
-    extensionNameMap = new HashMap();
-    extensionNameMap.put("GL_ARB_pbuffer", "WGL_ARB_pbuffer");
-    extensionNameMap.put("GL_ARB_pixel_format", "WGL_ARB_pixel_format");
-  }
-
-  // FIXME: figure out how to hook back in the Java 2D / JOGL bridge
-  public WindowsWGLContext(GLDrawableImpl drawable, GLDrawableImpl drawableRead,
-                           GLContext shareWith) {
-    super(drawable, drawableRead, shareWith);
-  }
-
-  public WindowsWGLContext(GLDrawableImpl drawable,
-                           GLContext shareWith) {
-    this(drawable, null, shareWith);
-  }
-
-  protected void resetState() {
-    wglGetExtensionsStringEXTInitialized=false;
-    wglGetExtensionsStringEXTAvailable=false;
-    wglMakeContextCurrentInitialized=false;
-    wglMakeContextCurrentAvailable=false;
-    // no inner state _wglExt=null;
-    wglExtProcAddressTable=null;
-  }
-  
-  public Object getPlatformGLExtensions() {
-    return getWGLExt();
-  }
-
-  public WGLExt getWGLExt() {
-    if (wglExt == null) {
-      wglExt = new WGLExtImpl(this);
-    }
-    return wglExt;
-  }
-
-  public boolean wglMakeContextCurrent(long hDrawDC, long hReadDC, long ctx) {
-    WGLExt _wglExt = getWGLExt();
-    if (!wglMakeContextCurrentInitialized) {
-      wglMakeContextCurrentAvailable = isFunctionAvailable("wglMakeContextCurrent");
-      wglMakeContextCurrentInitialized = true;
-      if(DEBUG) {
-          System.err.println("WindowsWGLContext.wglMakeContextCurrent: "+wglMakeContextCurrentAvailable);
-      }
-    }
-    if(wglMakeContextCurrentAvailable) {
-        return _wglExt.wglMakeContextCurrent(hDrawDC, hReadDC, ctx);
-    }
-    return WGL.wglMakeCurrent(hDrawDC, ctx);
-  }
-
-  public final ProcAddressTable getPlatformExtProcAddressTable() {
-    return getWGLExtProcAddressTable();
-  }
-
-  public final WGLExtProcAddressTable getWGLExtProcAddressTable() {
-    return wglExtProcAddressTable;
-  }
-
-  protected Map/*<String, String>*/ getFunctionNameMap() { return functionNameMap; }
-
-  protected Map/*<String, String>*/ getExtensionNameMap() { return extensionNameMap; }
-
-  protected void destroyContextARBImpl(long context) {
-    wglMakeContextCurrent(0, 0, 0);
-    WGL.wglDeleteContext(context);
-  }
-
-  protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
-    WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl();
-    AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    AbstractGraphicsDevice device = config.getScreen().getDevice();
-    WindowsWGLContext sharedContext = (WindowsWGLContext) factory.getOrCreateSharedContextImpl(device);
-    WGLExt wglExt;
-    if(null==sharedContext) {
-        wglExt = getWGLExt();
-    } else {
-        wglExt = sharedContext.getWGLExt();
-    }
-
-    boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
-    boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
-    boolean ctDebug     = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
-
-    long ctx=0;
-
-    final int idx_flags = 4;
-    final int idx_profile = 6;
-
-    /*  WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB,   WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB, */
-
-    int attribs[] = {
-        /*  0 */ WGLExt.WGL_CONTEXT_MAJOR_VERSION_ARB, major,
-        /*  2 */ WGLExt.WGL_CONTEXT_MINOR_VERSION_ARB, minor,
-        /*  4 */ WGLExt.WGL_CONTEXT_FLAGS_ARB,         0,
-        /*  6 */ 0,                                    0,
-        /*  8 */ 0
-    };
-
-    if ( major > 3 || major == 3 && minor >= 2  ) {
-        // FIXME: Verify with a None drawable binding (default framebuffer)
-        attribs[idx_profile+0]  = WGLExt.WGL_CONTEXT_PROFILE_MASK_ARB;
-        if( ctBwdCompat ) {
-            attribs[idx_profile+1]  = WGLExt.WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
-        } else {
-            attribs[idx_profile+1]  = WGLExt.WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
-        } 
-    } 
-
-    if ( major >= 3 ) {
-        if( !ctBwdCompat && ctFwdCompat ) {
-            attribs[idx_flags+1] |= WGLExt.WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
-        }
-        if( ctDebug) {
-            attribs[idx_flags+1] |= WGLExt.WGL_CONTEXT_DEBUG_BIT_ARB;
-        }
-    }
-
-    try {
-        ctx = wglExt.wglCreateContextAttribsARB(drawable.getHandle(), share, attribs, 0);
-    } catch (RuntimeException re) {
-        if(DEBUG) {
-          Throwable t = new Throwable("Info: WindowWGLContext.createContextARBImpl wglCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
-          t.printStackTrace();
-        }
-    }
-
-    if(0!=ctx) {
-        if (!wglMakeContextCurrent(drawable.getHandle(), drawableRead.getHandle(), ctx)) {
-            if(DEBUG) {
-              System.err.println("WindowsWGLContext.createContextARB couldn't make current "+getGLVersion(major, minor, ctp, "@creation"));
-            }
-            WGL.wglMakeCurrent(0, 0);
-            WGL.wglDeleteContext(ctx);
-            ctx = 0;
-        } else {
-            if (DEBUG) {
-                System.err.println(getThreadName() + ": createContextARBImpl: OK "+getGLVersion(major, minor, ctp, "@creation")+", share "+share+", direct "+direct+", hasSharedContext "+(null!=sharedContext));
-            }
-            // the following is issued by the caller 'GLContextImpl.createContextARB()'
-            // setGLFunctionAvailability(true, major, minor, ctp);
-        }
-    } else if (DEBUG) {
-        System.err.println(getThreadName() + ": createContextARBImpl: NO "+getGLVersion(major, minor, ctp, "@creation"));
-    }
-    return ctx;
-  }
-
-  /**
-   * Creates and initializes an appropriate OpenGL context. Should only be
-   * called by {@link #makeCurrentImpl()}.
-   */
-  protected boolean createImpl() {
-    WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl();
-    AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    AbstractGraphicsDevice device = config.getScreen().getDevice();
-    WindowsWGLContext sharedContext = (WindowsWGLContext) factory.getOrCreateSharedContextImpl(device);
-    GLCapabilitiesImmutable glCaps = drawable.getChosenGLCapabilities();
-
-    // Windows can set up sharing of display lists after creation time
-    WindowsWGLContext other = (WindowsWGLContext) GLContextShareSet.getShareContext(this);
-    long share = 0;
-    if (other != null) {
-      share = other.getHandle();
-      if (share == 0) {
-        throw new GLException("GLContextShareSet returned an invalid OpenGL context");
-      }
-    }
-
-    int minor[] = new int[1];
-    int major[] = new int[1];
-    int ctp[] = new int[1];
-    boolean createContextARBTried = false;
-
-    // utilize the shared context's GLXExt in case it was using the ARB method and it already exists
-    if( null!=sharedContext && sharedContext.isCreatedWithARBMethod() ) {
-        contextHandle = createContextARB(share, true, major, minor, ctp);
-        createContextARBTried = true;
-        if (DEBUG && 0!=contextHandle) {
-            System.err.println(getThreadName() + ": createImpl: OK (ARB, using sharedContext) share "+share);
-        }
-    }
-
-    long temp_ctx = 0;
-    if(0==contextHandle) {
-        // To use WGL_ARB_create_context, we have to make a temp context current,
-        // so we are able to use GetProcAddress
-        temp_ctx = WGL.wglCreateContext(drawable.getHandle());
-        if (temp_ctx == 0) {
-          throw new GLException("Unable to create temp OpenGL context for device context " + toHexString(drawable.getHandle()));
-        }
-        if (!WGL.wglMakeCurrent(drawable.getHandle(), temp_ctx)) {
-            throw new GLException("Error making temp context current: 0x" + toHexString(temp_ctx) + ", werr: 0x"+Integer.toHexString(GDI.GetLastError()));
-        }
-        setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);  // use GL_VERSION
-        boolean isCreateContextAttribsARBAvailable = isFunctionAvailable("wglCreateContextAttribsARB");
-        WGL.wglMakeCurrent(0, 0); // release temp context
-
-        if( !createContextARBTried) {
-            if(isCreateContextAttribsARBAvailable &&
-               isExtensionAvailable("WGL_ARB_create_context") ) {
-                // initial ARB context creation
-                contextHandle = createContextARB(share, true, major, minor, ctp);
-                createContextARBTried=true;
-                if (DEBUG) {
-                    if(0!=contextHandle) {
-                        System.err.println(getThreadName() + ": createContextImpl: OK (ARB, initial) share "+share);
-                    } else {
-                        System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - creation failed - share "+share);
-                    }
-                }
-            } else if (DEBUG) {
-                System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - extension not available - share "+share);
-            }
-        }
-    }
-    
-    if(0!=contextHandle) {
-        share = 0; // mark as shared thx to the ARB create method
-        if(0!=temp_ctx) {
-            WGL.wglMakeCurrent(0, 0);
-            WGL.wglDeleteContext(temp_ctx);
-            if (!wglMakeContextCurrent(drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
-                throw new GLException("Cannot make previous verified context current: 0x" + toHexString(contextHandle) + ", werr: 0x" + Integer.toHexString(GDI.GetLastError()));
-            }
-        }
-    } else {
-        if(glCaps.getGLProfile().isGL3()) {
-          WGL.wglMakeCurrent(0, 0);
-          WGL.wglDeleteContext(temp_ctx);
-          throw new GLException("WindowsWGLContext.createContext failed, but context > GL2 requested "+getGLVersion(major[0], minor[0], ctp[0], "@creation")+", ");
-        }
-        if(DEBUG) {
-          System.err.println("WindowsWGLContext.createContext failed, fall back to !ARB context "+getGLVersion(major[0], minor[0], ctp[0], "@creation"));
-        }
-
-        // continue with temp context for GL < 3.0
-        contextHandle = temp_ctx;
-        if (!wglMakeContextCurrent(drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
-            WGL.wglMakeCurrent(0, 0);
-            WGL.wglDeleteContext(contextHandle);
-            throw new GLException("Error making old context current: 0x" + toHexString(contextHandle) + ", werr: 0x" + Integer.toHexString(GDI.GetLastError()));
-        }
-        if (DEBUG) {
-            System.err.println(getThreadName() + ": createImpl: OK (old) share "+share);
-        }
-    }
-
-    if(0!=share) {
-        if (!WGL.wglShareLists(share, contextHandle)) {
-            throw new GLException("wglShareLists(" + toHexString(share) +
-                                  ", " + toHexString(contextHandle) + ") failed: werr 0x" +
-                                  Integer.toHexString(GDI.GetLastError()));
-        }
-    }
-    return true;
-  }
-  
-  protected void  makeCurrentImpl(boolean newCreated) throws GLException {
-    if (WGL.wglGetCurrentContext() != contextHandle) {
-      if (!wglMakeContextCurrent(drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
-        throw new GLException("Error making context current: 0x" + toHexString(contextHandle) + ", werr: 0x" + Integer.toHexString(GDI.GetLastError()) + ", " + this);
-      } else {
-        if (DEBUG && (VERBOSE || newCreated)) {
-          System.err.println(getThreadName() + ": wglMakeCurrent(hdc " + toHexString(drawable.getHandle()) +
-                             ", contextHandle " + toHexString(contextHandle) + ") succeeded");
-        }
-      }
-    }
-  }
-
-  protected void releaseImpl() throws GLException {
-    if (!wglMakeContextCurrent(0, 0, 0)) {
-        throw new GLException("Error freeing OpenGL context, werr: 0x" + Integer.toHexString(GDI.GetLastError()));
-    }
-  }
-
-  protected void destroyImpl() throws GLException {
-      WGL.wglMakeCurrent(0, 0);
-      if (!WGL.wglDeleteContext(contextHandle)) {
-        throw new GLException("Unable to delete OpenGL context");
-      }
-  }
-
-  protected void copyImpl(GLContext source, int mask) throws GLException {
-    if (!WGL.wglCopyContext(source.getHandle(), getHandle(), mask)) {
-      throw new GLException("wglCopyContext failed");
-    }
-  }
-
-  protected final void updateGLXProcAddressTable(int major, int minor, int ctp) {
-    if (DEBUG) {
-      System.err.println(getThreadName() + ": !!! Initializing WGL extension address table for " + this);
-    }
-    wglGetExtensionsStringEXTInitialized=false;
-    wglGetExtensionsStringEXTAvailable=false;
-    wglMakeContextCurrentInitialized=false;
-    wglMakeContextCurrentAvailable=false;
-
-    WGLExtProcAddressTable table = null;
-    synchronized(mappedContextTypeObjectLock) {
-        table = (WGLExtProcAddressTable) mappedGLXProcAddress.get( contextFQN );
-    }
-    if(null != table) {
-        wglExtProcAddressTable = table;
-        if(DEBUG) {
-            System.err.println(getThreadName() + ": !!! GLContext WGL ProcAddressTable reusing key("+contextFQN+") -> "+table.hashCode());
-        }
-    } else {
-        if (wglExtProcAddressTable == null) {
-          // FIXME: cache ProcAddressTables by OpenGL context type bits so we can
-          // share them among contexts classes (GL4, GL4bc, GL3, GL3bc, ..)
-          wglExtProcAddressTable = new WGLExtProcAddressTable(new GLProcAddressResolver());
-        }
-        resetProcAddressTable(getWGLExtProcAddressTable());
-        synchronized(mappedContextTypeObjectLock) {
-            mappedGLXProcAddress.put(contextFQN, getWGLExtProcAddressTable());
-            if(DEBUG) {
-                System.err.println(getThreadName() + ": !!! GLContext WGL ProcAddressTable mapping key("+contextFQN+") -> "+getWGLExtProcAddressTable().hashCode());
-            }
-        }
-    }
-  }
-  
-  public String getPlatformExtensionsString() {
-    if (!wglGetExtensionsStringEXTInitialized) {
-      wglGetExtensionsStringEXTAvailable = (WGL.wglGetProcAddress("wglGetExtensionsStringEXT") != 0);
-      wglGetExtensionsStringEXTInitialized = true;
-    }
-    if (wglGetExtensionsStringEXTAvailable) {
-      return getWGLExt().wglGetExtensionsStringEXT();
-    } else {
-      return "";
-    }
-  }
-
-  protected void setSwapIntervalImpl(int interval) {
-    WGLExt wglExt = getWGLExt();
-    if (wglExt.isExtensionAvailable("WGL_EXT_swap_control")) {
-      if ( wglExt.wglSwapIntervalEXT(interval) ) {
-        currentSwapInterval = interval ;
-      }
-    }
-  }
-
-  public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
-    return getWGLExt().wglAllocateMemoryNV(arg0, arg1, arg2, arg3);
-  }
-
-  public int getOffscreenContextPixelDataType() {
-    throw new GLException("Should not call this");
-  }
-
-  public int getOffscreenContextReadBuffer() {
-    throw new GLException("Should not call this");
-  }
-
-  public boolean offscreenImageNeedsVerticalFlip() {
-    throw new GLException("Should not call this");
-  }
-
-  public void bindPbufferToTexture() {
-    throw new GLException("Should not call this");
-  }
-
-  public void releasePbufferFromTexture() {
-    throw new GLException("Should not call this");
-  }
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java
deleted file mode 100644
index bbbd934..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import java.security.AccessController;
-import javax.media.nativewindow.NativeSurface;
-import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLException;
-
-import com.jogamp.nativewindow.impl.windows.GDI;
-import com.jogamp.opengl.impl.Debug;
-import com.jogamp.opengl.impl.GLDrawableImpl;
-import com.jogamp.opengl.impl.GLDynamicLookupHelper;
-
-
-public abstract class WindowsWGLDrawable extends GLDrawableImpl {
-  private static final boolean PROFILING = Debug.isPropertyDefined("jogl.debug.GLDrawable.profiling", true, AccessController.getContext());
-  private static final int PROFILING_TICKS = 200;
-  private int  profilingSwapBuffersTicks;
-  private long profilingSwapBuffersTime;
-
-  public WindowsWGLDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
-    super(factory, comp, realized);
-  }
-
-  protected void setRealizedImpl() {
-    if(!realized) {
-        return; // nothing todo ..
-    }
-
-    NativeSurface ns = getNativeSurface();
-    WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    config.updateGraphicsConfiguration(getFactory(), ns);
-    if (DEBUG) {
-      System.err.println("!!! WindowsWGLDrawable.setRealized(true): "+config);
-    }
-  }
-
-  protected void swapBuffersImpl() {
-    long startTime = 0;
-    if (PROFILING) {
-      startTime = System.currentTimeMillis();
-    }
-
-    if (!GDI.SwapBuffers(getHandle()) && (GDI.GetLastError() != 0)) {
-      throw new GLException("Error swapping buffers");
-    }
-
-    if (PROFILING) {
-      long endTime = System.currentTimeMillis();
-      profilingSwapBuffersTime += (endTime - startTime);
-      int ticks = PROFILING_TICKS;
-      if (++profilingSwapBuffersTicks == ticks) {
-        System.err.println("SwapBuffers calls: " + profilingSwapBuffersTime + " ms / " + ticks + "  calls (" +
-                           ((float) profilingSwapBuffersTime / (float) ticks) + " ms/call)");
-        profilingSwapBuffersTime = 0;
-        profilingSwapBuffersTicks = 0;
-      }
-    }
-  }
-
-  public GLDynamicLookupHelper getGLDynamicLookupHelper() {
-    return getFactoryImpl().getGLDynamicLookupHelper(0);
-  }
-
-  protected static String getThreadName() {
-    return Thread.currentThread().getName();
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
deleted file mode 100644
index 8026111..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import java.nio.Buffer;
-import java.nio.ShortBuffer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.DefaultGraphicsScreen;
-import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.nativewindow.windows.WindowsGraphicsDevice;
-import javax.media.opengl.GLCapabilitiesChooser;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLDrawable;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.common.JogampRuntimeException;
-import com.jogamp.common.util.ReflectionUtil;
-import com.jogamp.nativewindow.impl.ProxySurface;
-import com.jogamp.nativewindow.impl.windows.GDI;
-import com.jogamp.opengl.impl.DesktopGLDynamicLookupHelper;
-import com.jogamp.opengl.impl.GLDrawableFactoryImpl;
-import com.jogamp.opengl.impl.GLDrawableImpl;
-import com.jogamp.opengl.impl.GLDynamicLookupHelper;
-import javax.media.opengl.GLCapabilitiesImmutable;
-
-public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
-  private static final DesktopGLDynamicLookupHelper windowsWGLDynamicLookupHelper;
-
-  static {
-    DesktopGLDynamicLookupHelper tmp = null;
-    try {
-        tmp = new DesktopGLDynamicLookupHelper(new WindowsWGLDynamicLibraryBundleInfo());
-    } catch (GLException gle) {
-        if(DEBUG) {
-            gle.printStackTrace();
-        }
-    }
-    windowsWGLDynamicLookupHelper = tmp;
-    if(null!=windowsWGLDynamicLookupHelper) {
-        WGL.getWGLProcAddressTable().reset(windowsWGLDynamicLookupHelper);
-    }
-  }
-
-  public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
-      return windowsWGLDynamicLookupHelper;
-  }
-
-  public WindowsWGLDrawableFactory() {
-    super();
-
-    // Register our GraphicsConfigurationFactory implementations
-    // The act of constructing them causes them to be registered
-    new WindowsWGLGraphicsConfigurationFactory();
-    if(GLProfile.isAWTAvailable()) {
-        try {
-          ReflectionUtil.createInstance("com.jogamp.opengl.impl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory",
-                                        null, getClass().getClassLoader());
-        } catch (JogampRuntimeException jre) { /* n/a .. */ }
-    }
-
-    defaultDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
-  }
-
-  static class SharedResource {
-      private WindowsDummyWGLDrawable drawable;
-      private WindowsWGLContext context;
-      private boolean canCreateGLPbuffer;
-
-      SharedResource(WindowsDummyWGLDrawable draw, WindowsWGLContext ctx, boolean canPbuffer) {
-          drawable = draw;
-          context = ctx;
-          canCreateGLPbuffer = canPbuffer;
-      }
-  }
-  HashMap/*<connection, SharedResource>*/ sharedMap = new HashMap();
-  WindowsGraphicsDevice defaultDevice;
-
-  public final AbstractGraphicsDevice getDefaultDevice() {
-      return defaultDevice;
-  }
-
-  public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
-      if(device instanceof WindowsGraphicsDevice) {
-          return true;
-      }
-      return false;
-  }
-
-  HashSet devicesTried = new HashSet();
-  private final boolean getDeviceTried(String connection) {
-      synchronized(devicesTried) {
-          return devicesTried.contains(connection);
-      }
-  }
-  private final void addDeviceTried(String connection) {
-      synchronized(devicesTried) {
-          devicesTried.add(connection);
-      }
-  }
-
-  private final SharedResource getOrCreateShared(AbstractGraphicsDevice device) {
-    String connection = device.getConnection();
-    SharedResource sr;
-    synchronized(sharedMap) {
-        sr = (SharedResource) sharedMap.get(connection);
-    }
-    if(null==sr && !getDeviceTried(connection)) {
-        addDeviceTried(connection);
-        NativeWindowFactory.getDefaultToolkitLock().lock(); // OK
-        try {
-            WindowsDummyWGLDrawable sharedDrawable = WindowsDummyWGLDrawable.create(this, null);
-            WindowsWGLContext ctx  = (WindowsWGLContext) sharedDrawable.createContext(null);
-            ctx.makeCurrent();
-            boolean canCreateGLPbuffer = ctx.getGL().isExtensionAvailable("GL_ARB_pbuffer");
-            ctx.release();
-            sr = new SharedResource(sharedDrawable, ctx, canCreateGLPbuffer);
-            synchronized(sharedMap) {
-                sharedMap.put(device.getConnection(), sr);
-            }
-            if (DEBUG) {
-              System.err.println("!!! SharedContext: "+ctx+", pbuffer supported "+canCreateGLPbuffer);
-            }
-
-        } catch (Throwable t) {
-            throw new GLException("WindowsWGLDrawableFactory - Could not initialize shared resources", t);
-        } finally {
-            NativeWindowFactory.getDefaultToolkitLock().unlock(); // OK
-        }
-    }
-    return sr;
-  }
-
-  protected final GLContext getOrCreateSharedContextImpl(AbstractGraphicsDevice device) {
-    SharedResource sr = getOrCreateShared(device);
-    if(null!=sr) {
-      return sr.context;
-    }
-    return null;
-  }
-
-  protected final void shutdownInstance() {
-    if (DEBUG) {
-        Exception e = new Exception("Debug");
-        e.printStackTrace();
-    }
-    Collection/*<SharedResource>*/ sharedResources = sharedMap.values();
-    for(Iterator iter=sharedResources.iterator(); iter.hasNext(); ) {
-        SharedResource sr = (SharedResource) iter.next();
-
-        if (DEBUG) {
-          System.err.println("!!! Shutdown Shared:");
-          System.err.println("!!!          Drawable: "+sr.drawable);
-          System.err.println("!!!          CTX     : "+sr.context);
-        }
-
-        if (null != sr.context) {
-          // may cause JVM SIGSEGV: sharedContext.destroy();
-          sr.context = null;
-        }
-
-        if (null != sr.drawable) {
-          // may cause JVM SIGSEGV: sharedDrawable.destroy();
-          sr.drawable = null;
-        }
-
-    }
-    sharedMap.clear();
-    if (DEBUG) {
-      System.err.println("!!! Shutdown Shared Finished");
-    }
-  }
-
-  protected final GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
-    if (target == null) {
-      throw new IllegalArgumentException("Null target");
-    }
-    return new WindowsOnscreenWGLDrawable(this, target);
-  }
-
-  protected final GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
-    if (target == null) {
-      throw new IllegalArgumentException("Null target");
-    }
-    return new WindowsOffscreenWGLDrawable(this, target);
-  }
-
-  public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device) {
-    SharedResource sr = getOrCreateShared((null!=device)?device:defaultDevice);
-    if(null!=sr) {
-        return sr.canCreateGLPbuffer;
-    }
-    return false;
-  }
-
-  protected final GLDrawableImpl createGLPbufferDrawableImpl(final NativeSurface target) {
-    if (target == null) {
-      throw new IllegalArgumentException("Null target");
-    }
-    final AbstractGraphicsDevice device = target.getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice();
-
-    final SharedResource sr = getOrCreateShared(device);
-    if(null==sr) {
-        return null;
-    }
-    final List returnList = new ArrayList();
-    Runnable r = new Runnable() {
-        public void run() {
-          GLContext lastContext = GLContext.getCurrent();
-          if (lastContext != null) {
-            lastContext.release();
-          }
-          synchronized(sr.context) {
-              sr.context.makeCurrent();
-              try {
-                GLDrawableImpl pbufferDrawable = new WindowsPbufferWGLDrawable(WindowsWGLDrawableFactory.this, target,
-                                                                               sr.drawable,
-                                                                               sr.context);
-                returnList.add(pbufferDrawable);
-              } finally {
-                sr.context.release();
-                if (lastContext != null) {
-                  lastContext.makeCurrent();
-                }
-              }
-          }
-        }
-      };
-    maybeDoSingleThreadedWorkaround(r);
-    return (GLDrawableImpl) returnList.get(0);
-  }
-
-  protected final NativeSurface createOffscreenSurfaceImpl(GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, int width, int height) {
-    AbstractGraphicsScreen screen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
-    ProxySurface ns = new ProxySurface(WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(
-                                     capsChosen, capsRequested, chooser, screen) );
-    ns.setSize(width, height);
-    return ns;
-  }
- 
-  protected final GLContext createExternalGLContextImpl() {
-    return WindowsExternalWGLContext.create(this, null);
-  }
-
-  public final boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
-    return true;
-  }
-
-  protected final GLDrawable createExternalGLDrawableImpl() {
-    return WindowsExternalWGLDrawable.create(this, null);
-  }
-
-  static String wglGetLastError() {
-    long err = GDI.GetLastError();
-    String detail = null;
-    switch ((int) err) {
-      case GDI.ERROR_INVALID_PIXEL_FORMAT: detail = "ERROR_INVALID_PIXEL_FORMAT";       break;
-      case GDI.ERROR_NO_SYSTEM_RESOURCES:  detail = "ERROR_NO_SYSTEM_RESOURCES";        break;
-      case GDI.ERROR_INVALID_DATA:         detail = "ERROR_INVALID_DATA";               break;
-      case GDI.ERROR_PROC_NOT_FOUND:       detail = "ERROR_PROC_NOT_FOUND";             break;
-      case GDI.ERROR_INVALID_WINDOW_HANDLE:detail = "ERROR_INVALID_WINDOW_HANDLE";      break;
-      default:                             detail = "(Unknown error code " + err + ")"; break;
-    }
-    return detail;
-  }
-
-  public final boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) {
-    return false;
-  }
-
-  public final GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
-    throws GLException {
-    throw new GLException("Unimplemented on this platform");
-  }
-
-  //------------------------------------------------------
-  // Gamma-related functionality
-  //
-
-  private static final int GAMMA_RAMP_LENGTH = 256;
-
-  protected final int getGammaRampLength() {
-    return GAMMA_RAMP_LENGTH;
-  }
-
-  protected final boolean setGammaRamp(float[] ramp) {
-    short[] rampData = new short[3 * GAMMA_RAMP_LENGTH];
-    for (int i = 0; i < GAMMA_RAMP_LENGTH; i++) {
-      short scaledValue = (short) (ramp[i] * 65535);
-      rampData[i] = scaledValue;
-      rampData[i +     GAMMA_RAMP_LENGTH] = scaledValue;
-      rampData[i + 2 * GAMMA_RAMP_LENGTH] = scaledValue;
-    }
-
-    long screenDC = GDI.GetDC(0);
-    boolean res = GDI.SetDeviceGammaRamp(screenDC, ShortBuffer.wrap(rampData));
-    GDI.ReleaseDC(0, screenDC);
-    return res;
-  }
-
-  protected final Buffer getGammaRamp() {
-    ShortBuffer rampData = ShortBuffer.wrap(new short[3 * GAMMA_RAMP_LENGTH]);
-    long screenDC = GDI.GetDC(0);
-    boolean res = GDI.GetDeviceGammaRamp(screenDC, rampData);
-    GDI.ReleaseDC(0, screenDC);
-    if (!res) {
-      return null;
-    }
-    return rampData;
-  }
-
-  protected final void resetGammaRamp(Buffer originalGammaRamp) {
-    if (originalGammaRamp == null) {
-      // getGammaRamp failed earlier
-      return;
-    }
-    long screenDC = GDI.GetDC(0);
-    GDI.SetDeviceGammaRamp(screenDC, originalGammaRamp);
-    GDI.ReleaseDC(0, screenDC);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
deleted file mode 100644
index 153680f..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl.windows.wgl;
-
-import com.jogamp.opengl.impl.*;
-import java.util.*;
-
-public class WindowsWGLDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo  {
-    protected WindowsWGLDynamicLibraryBundleInfo() {
-        super();
-    }
-
-    public List getToolLibNames() {
-        List/*<String>*/ libNamesList = new ArrayList();
-
-        libNamesList.add("OpenGL32");
-
-        return libNamesList;
-    }
-
-
-    public final List getToolGetProcAddressFuncNameList() {
-        List res = new ArrayList();
-        res.add("wglGetProcAddress");
-        return res;
-    }
-
-    public final long toolDynamicLookupFunction(long toolGetProcAddressHandle, String funcName) {
-        return WGL.wglGetProcAddress(toolGetProcAddressHandle, funcName);
-    }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java
deleted file mode 100644
index 13df54d..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ /dev/null
@@ -1,748 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.DefaultGraphicsConfiguration;
-import javax.media.nativewindow.NativeSurface;
-import javax.media.opengl.DefaultGLCapabilitiesChooser;
-import javax.media.opengl.GL;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLCapabilitiesChooser;
-import javax.media.opengl.GLDrawable;
-import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLPbuffer;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.nativewindow.impl.windows.GDI;
-import com.jogamp.nativewindow.impl.windows.PIXELFORMATDESCRIPTOR;
-import com.jogamp.opengl.impl.GLContextImpl;
-import javax.media.opengl.GLCapabilitiesImmutable;
-
-public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
-    // Keep this under the same debug flag as the drawable factory for convenience
-    protected static final boolean DEBUG = com.jogamp.opengl.impl.Debug.debug("GraphicsConfiguration");
-    
-    protected static final int MAX_PFORMATS = 256;
-    protected static final int MAX_ATTRIBS  = 256;
-
-    private PIXELFORMATDESCRIPTOR pixelfmt;
-    private int pixelfmtID;
-    private boolean isChosen = false;
-    private GLCapabilitiesChooser chooser;
-    private boolean choosenByWGLPixelFormat=false;
-
-    public WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen, 
-                                           GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
-                                           PIXELFORMATDESCRIPTOR pixelfmt, int pixelfmtID, GLCapabilitiesChooser chooser) {
-        super(screen, capsChosen, capsRequested);
-        this.chooser=chooser;
-        this.pixelfmt = pixelfmt;
-        this.pixelfmtID = pixelfmtID;
-    }
-
-    public static WindowsWGLGraphicsConfiguration create(long hdc, int pfdID, 
-                                                         GLProfile glp, AbstractGraphicsScreen screen, boolean onscreen, boolean usePBuffer)
-    {
-        if(pfdID<=0) {
-            throw new GLException("Invalid pixelformat id "+pfdID);
-        }
-        if(null==glp) {
-          glp = GLProfile.getDefault(screen.getDevice());
-        }
-        PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
-        if (GDI.DescribePixelFormat(hdc, pfdID, pfd.size(), pfd) == 0) {
-            throw new GLException("Unable to describe pixel format " + pfdID);
-        }
-
-        GLCapabilitiesImmutable caps = PFD2GLCapabilities(glp, pfd, onscreen, usePBuffer);
-        if(null==caps) {
-            throw new GLException("Couldn't choose Capabilities by: HDC 0x"+Long.toHexString(hdc)+", pfdID "+pfdID);
-        }
-        WindowsWGLGraphicsConfiguration cfg = new WindowsWGLGraphicsConfiguration(screen, caps, caps, pfd, pfdID, new DefaultGLCapabilitiesChooser());
-        cfg.setCapsPFD(caps, pfd, pfdID, false);
-
-        return cfg;
-    }
-
-    public Object clone() {
-        return super.clone();
-    }
-
-    protected void updateGraphicsConfiguration(GLDrawableFactory factory, NativeSurface ns) {
-        WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfiguration(chooser, factory, ns);
-    }
-
-    protected void setCapsPFD(GLCapabilitiesImmutable caps, PIXELFORMATDESCRIPTOR pfd, int pfdID, boolean choosenByWGLPixelFormat) {
-        this.pixelfmt = pfd;
-        this.pixelfmtID = pfdID;
-        setChosenCapabilities(caps);
-        this.isChosen=true;
-        this.choosenByWGLPixelFormat=choosenByWGLPixelFormat;
-        if (DEBUG) {
-            System.err.println("*** setCapsPFD: WGL-Choosen "+choosenByWGLPixelFormat+", pfdID "+pfdID+", "+caps);
-        }
-    }
-
-    public boolean getCapabilitiesChosen() {
-        return isChosen;
-    }
-
-    public PIXELFORMATDESCRIPTOR getPixelFormat()   { return pixelfmt; }
-    public int getPixelFormatID() { return pixelfmtID; }
-    public boolean isChoosenByWGL() { return choosenByWGLPixelFormat; }
-
-    private static int fillAttribsForGeneralWGLARBQuery(boolean haveWGLARBMultisample, int[] iattributes) {
-        int niattribs = 0;
-        iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_WINDOW_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_ACCELERATION_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_SUPPORT_OPENGL_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_STEREO_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_RED_BITS_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB;
-        iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB;
-        if (haveWGLARBMultisample) {
-            iattributes[niattribs++] = WGLExt.WGL_SAMPLE_BUFFERS_ARB;
-            iattributes[niattribs++] = WGLExt.WGL_SAMPLES_ARB;
-        }
-        return niattribs;
-    }
-
-    public static boolean wglARBPFIDValid(WindowsWGLContext sharedCtx, long hdc, int pfdID) {
-        int[] in = new int[1];
-        int[] out = new int[1];
-        in[0] = WGLExt.WGL_COLOR_BITS_ARB;
-        if (!sharedCtx.getWGLExt().wglGetPixelFormatAttribivARB(hdc, pfdID, 0, 1, in, 0, out, 0)) {
-            // Intel Extreme graphics 'fails' with a zero error code
-            return GDI.GetLastError() == 0 ;
-        }
-        return true;
-    }
-
-    public static GLCapabilitiesImmutable wglARBPFID2GLCapabilities(WindowsWGLContext sharedCtx, long hdc, int pfdID,
-                                                                GLProfile glp, boolean onscreen, boolean usePBuffer) {
-        boolean haveWGLChoosePixelFormatARB = sharedCtx.isExtensionAvailable("WGL_ARB_pixel_format");
-        if (!haveWGLChoosePixelFormatARB) {
-            return null;
-        }
-        boolean haveWGLARBMultisample = sharedCtx.isExtensionAvailable("WGL_ARB_multisample");
-
-        int[] iattributes = new int  [2*MAX_ATTRIBS];
-        int[] iresults    = new int  [2*MAX_ATTRIBS];
-
-        iattributes[0] = WGLExt.WGL_NUMBER_PIXEL_FORMATS_ARB;
-        if (sharedCtx.getWGLExt().wglGetPixelFormatAttribivARB(hdc, 0, 0, 1, iattributes, 0, iresults, 0)) {
-            if(iresults[0] > 0 ) {
-                int niattribs = fillAttribsForGeneralWGLARBQuery(haveWGLARBMultisample, iattributes);
-                if (!sharedCtx.getWGLExt().wglGetPixelFormatAttribivARB(hdc, pfdID, 0, niattribs, iattributes, 0, iresults, 0)) {
-                  throw new GLException("wglARBPFID2GLCapabilities: Error getting pixel format attributes for pixel format " + pfdID + " of device context");
-                }
-                return AttribList2GLCapabilities(glp, iattributes, niattribs, iresults,
-                                                 onscreen, usePBuffer);
-            }
-        }
-        long lastErr = GDI.GetLastError();
-        // Intel Extreme graphics fails with a zero error code
-        if (lastErr != 0) {
-            throw new GLException("wglARBPFID2GLCapabilities: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: error code " + GDI.GetLastError());
-        }
-        return null;
-    }
-
-    protected static int wglChoosePixelFormatARB(long hdc, WindowsWGLContext sharedContext,
-                                                 GLCapabilitiesImmutable capabilities,
-                                                 int[] iattributes, int accelerationMode, float[] fattributes,
-                                                 int[] pformats)
-    {
-      int numFormats = -1;
-
-      if(WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(capabilities,
-                                                                   iattributes,
-                                                                   sharedContext,
-                                                                   accelerationMode,
-                                                                   false,
-                                                                   null)) {
-        int[] numFormatsTmp = new int[1];
-        if (sharedContext.getWGLExt().wglChoosePixelFormatARB(hdc,
-                                           iattributes, 0,
-                                           fattributes, 0,
-                                           WindowsWGLGraphicsConfiguration.MAX_PFORMATS,
-                                           pformats, 0,
-                                           numFormatsTmp, 0)) {
-          numFormats = numFormatsTmp[0];
-          if (DEBUG) {
-            System.err.println("wglChoosePixelFormatARB1: NumFormats (wglChoosePixelFormatARB) accelMode 0x" +
-                    Integer.toHexString(accelerationMode) + ": " + numFormats + " / " + WindowsWGLGraphicsConfiguration.MAX_PFORMATS);
-          }
-        } else {
-          if (DEBUG) {
-            System.err.println("wglChoosePixelFormatARB1: wglChoosePixelFormatARB failed: " + GDI.GetLastError() );
-            Thread.dumpStack();
-          }
-        }
-      } else {
-          if (DEBUG) {
-            System.err.println("wglChoosePixelFormatARB1: GLCapabilities2AttribList failed: " + GDI.GetLastError() );
-            Thread.dumpStack();
-          }
-      }
-      return numFormats;
-    }
-
-    public static GLCapabilitiesImmutable[] wglARBPFIDs2GLCapabilities(WindowsWGLContext sharedCtx, long hdc, int[] pfdIDs, int numFormats,
-                                                                      GLProfile glp, boolean onscreen, boolean usePBuffer) {
-        boolean haveWGLChoosePixelFormatARB = sharedCtx.isExtensionAvailable("WGL_ARB_pixel_format");
-        if (!haveWGLChoosePixelFormatARB) {
-            return null;
-        }
-        boolean haveWGLARBMultisample = sharedCtx.isExtensionAvailable("WGL_ARB_multisample");
-
-        GLCapabilitiesImmutable[] caps = new GLCapabilitiesImmutable[numFormats];
-
-        int[] iattributes = new int  [2*MAX_ATTRIBS];
-        int[] iresults    = new int  [2*MAX_ATTRIBS];
-        int niattribs = fillAttribsForGeneralWGLARBQuery(haveWGLARBMultisample, iattributes);
-
-        for(int i = 0; i<numFormats; i++) {
-            if ( pfdIDs[i] >= 1 &&
-                 sharedCtx.getWGLExt().wglGetPixelFormatAttribivARB(hdc, pfdIDs[i], 0, niattribs, iattributes, 0, iresults, 0) ) {
-                caps[i] = AttribList2GLCapabilities(glp, iattributes, niattribs, iresults, onscreen, usePBuffer);
-            } else {
-                if (DEBUG) {
-                    System.err.println("wglARBPFIDs2GLCapabilities: Cannot get pixel format attributes for pixel format " +
-                                       i + "/" + numFormats + ": " + pfdIDs[i]);
-                }
-                caps[i] = null;
-            }
-        }
-        return caps;
-    }
-
-    /**
-     *
-     * @param sharedCtx
-     * @param hdc
-     * @param glp
-     * @param onscreen
-     * @param usePBuffer
-     * @param pfIDs stores the PIXELFORMAT ID for the GLCapabilitiesImmutable[]
-     * @return the resulting GLCapabilitiesImmutable[]
-     */
-    public static GLCapabilitiesImmutable[] wglARBAllPFIDs2GLCapabilities(WindowsWGLContext sharedCtx, long hdc,
-                                                                          GLProfile glp, boolean onscreen, boolean usePBuffer, int[] pfIDs) {
-        boolean haveWGLChoosePixelFormatARB = sharedCtx.isExtensionAvailable("WGL_ARB_pixel_format");
-        if (!haveWGLChoosePixelFormatARB) {
-            return null;
-        }
-        boolean haveWGLARBMultisample = sharedCtx.isExtensionAvailable("WGL_ARB_multisample");
-
-        // Produce a list of GLCapabilities to give to the
-        // GLCapabilitiesChooser.
-        // Use wglGetPixelFormatAttribivARB instead of
-        // DescribePixelFormat to get higher-precision information
-        // about the pixel format (should make the GLCapabilities
-        // more precise as well...i.e., remove the
-        // "HardwareAccelerated" bit, which is basically
-        // meaningless, and put in whether it can render to a
-        // window, to a pbuffer, or to a pixmap)
-        GLCapabilitiesImmutable[] availableCaps = null;
-        int numFormats = 0;
-        int niattribs = 0;
-        int[] iattributes = new int[2 * MAX_ATTRIBS];
-        int[] iresults = new int[2 * MAX_ATTRIBS];
-
-        WGLExt wglExt = sharedCtx.getWGLExt();
-        iattributes[0] = WGLExt.WGL_NUMBER_PIXEL_FORMATS_ARB;
-        if (wglExt.wglGetPixelFormatAttribivARB(hdc, 0, 0, 1, iattributes, 0, iresults, 0)) {
-            numFormats = iresults[0];
-            if (DEBUG) {
-                System.err.println("wglARBAllPFIDs2GLCapabilities: wglGetPixelFormatAttribivARB reported WGL_NUMBER_PIXEL_FORMATS = " + numFormats + ", pfIDs sz "+pfIDs.length);
-            }
-            if (numFormats > pfIDs.length) {
-                numFormats = pfIDs.length;
-            }
-
-            niattribs = fillAttribsForGeneralWGLARBQuery(haveWGLARBMultisample, iattributes);
-
-            availableCaps = new GLCapabilitiesImmutable[numFormats];
-            for (int i = 0; i < numFormats; i++) {
-                pfIDs[i] = i + 1;
-                if (!wglExt.wglGetPixelFormatAttribivARB(hdc, pfIDs[i], 0, niattribs, iattributes, 0, iresults, 0)) {
-                    throw new GLException("wglARBAllPFIDs2GLCapabilities: Error getting pixel format attributes for pixel format " + pfIDs[i]);
-                }
-                availableCaps[i] = AttribList2GLCapabilities(glp, iattributes, niattribs, iresults, onscreen, usePBuffer);
-            }
-        } else {
-            long lastErr = GDI.GetLastError();
-            // Intel Extreme graphics fails with a zero error code
-            if (lastErr != 0) {
-                throw new GLException("wglARBAllPFIDs2GLCapabilities: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: error code " + GDI.GetLastError());
-            }
-        }
-        return availableCaps;
-    }
-
-    public static boolean GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
-                                                    int[] iattributes,
-                                                    GLContextImpl sharedCtx,
-                                                    int accellerationValue,
-                                                    boolean pbuffer,
-                                                    int[] floatMode) throws GLException {
-        boolean haveWGLChoosePixelFormatARB = sharedCtx.isExtensionAvailable("WGL_ARB_pixel_format");
-        boolean haveWGLARBMultisample = sharedCtx.isExtensionAvailable("WGL_ARB_multisample");
-        if(DEBUG) {
-            System.err.println("HDC2GLCapabilities: ARB_pixel_format: "+haveWGLChoosePixelFormatARB);
-            System.err.println("HDC2GLCapabilities: ARB_multisample : "+haveWGLARBMultisample);
-        }
-
-        if (!haveWGLChoosePixelFormatARB) {
-          return false;
-        }
-
-        int niattribs = 0;
-
-        iattributes[niattribs++] = WGLExt.WGL_SUPPORT_OPENGL_ARB;
-        iattributes[niattribs++] = GL.GL_TRUE;
-        if(accellerationValue>0) {
-            iattributes[niattribs++] = WGLExt.WGL_ACCELERATION_ARB;
-            iattributes[niattribs++] = accellerationValue;
-        }
-        if (pbuffer) {
-          iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB;
-          iattributes[niattribs++] = GL.GL_TRUE;
-        } else {
-          iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_WINDOW_ARB;
-          iattributes[niattribs++] = GL.GL_TRUE;
-        }
-
-        iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER_ARB;
-        if (caps.getDoubleBuffered()) {
-          iattributes[niattribs++] = GL.GL_TRUE;
-        } else {
-          iattributes[niattribs++] = GL.GL_FALSE;
-        }
-
-        iattributes[niattribs++] = WGLExt.WGL_STEREO_ARB;
-        if (caps.getStereo()) {
-          iattributes[niattribs++] = GL.GL_TRUE;
-        } else {
-          iattributes[niattribs++] = GL.GL_FALSE;
-        }
-        
-        iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS_ARB;
-        iattributes[niattribs++] = caps.getDepthBits();
-        iattributes[niattribs++] = WGLExt.WGL_RED_BITS_ARB;
-        iattributes[niattribs++] = caps.getRedBits();
-        iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS_ARB;
-        iattributes[niattribs++] = caps.getGreenBits();
-        iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS_ARB;
-        iattributes[niattribs++] = caps.getBlueBits();
-        iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS_ARB;
-        iattributes[niattribs++] = caps.getAlphaBits();
-        iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS_ARB;
-        iattributes[niattribs++] = caps.getStencilBits();
-        if (caps.getAccumRedBits()   > 0 ||
-            caps.getAccumGreenBits() > 0 ||
-            caps.getAccumBlueBits()  > 0 ||
-            caps.getAccumAlphaBits() > 0) {
-          iattributes[niattribs++] = WGLExt.WGL_ACCUM_BITS_ARB;
-          iattributes[niattribs++] = (caps.getAccumRedBits() +
-                                      caps.getAccumGreenBits() +
-                                      caps.getAccumBlueBits() +
-                                      caps.getAccumAlphaBits());
-          iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS_ARB;
-          iattributes[niattribs++] = caps.getAccumRedBits();
-          iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS_ARB;
-          iattributes[niattribs++] = caps.getAccumGreenBits();
-          iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB;
-          iattributes[niattribs++] = caps.getAccumBlueBits();
-          iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB;
-          iattributes[niattribs++] = caps.getAccumAlphaBits();
-        }
-
-        if (caps.getSampleBuffers() && haveWGLARBMultisample) {
-            iattributes[niattribs++] = WGLExt.WGL_SAMPLE_BUFFERS_ARB;
-            iattributes[niattribs++] = GL.GL_TRUE;
-            iattributes[niattribs++] = WGLExt.WGL_SAMPLES_ARB;
-            iattributes[niattribs++] = caps.getNumSamples();
-        }
-
-        boolean rtt      = caps.getPbufferRenderToTexture();
-        boolean rect     = caps.getPbufferRenderToTextureRectangle();
-        boolean useFloat = caps.getPbufferFloatingPointBuffers();
-        boolean ati      = false;
-        if (pbuffer) {
-          // Check some invariants and set up some state
-          if (rect && !rtt) {
-            throw new GLException("Render-to-texture-rectangle requires render-to-texture to be specified");
-          }
-
-          if (rect) {
-            if (!sharedCtx.isExtensionAvailable("GL_NV_texture_rectangle")) {
-              throw new GLException("Render-to-texture-rectangle requires GL_NV_texture_rectangle extension");
-            }
-          }
-
-          if (useFloat) {
-            if (!sharedCtx.isExtensionAvailable("WGL_ATI_pixel_format_float") &&
-                !sharedCtx.isExtensionAvailable("WGL_NV_float_buffer")) {
-              throw new GLException("Floating-point pbuffers not supported by this hardware");
-            }
-
-            // Prefer NVidia extension over ATI
-            if (sharedCtx.isExtensionAvailable("WGL_NV_float_buffer")) {
-              ati = false;
-              floatMode[0] = GLPbuffer.NV_FLOAT;
-            } else {
-              ati = true;
-              floatMode[0] = GLPbuffer.ATI_FLOAT;
-            }
-            if (DEBUG) {
-              System.err.println("Using " + (ati ? "ATI" : "NVidia") + " floating-point extension");
-            }
-          }
-
-          // See whether we need to change the pixel type to support ATI's
-          // floating-point pbuffers
-          if (useFloat && ati) {
-            if (rtt) {
-              throw new GLException("Render-to-floating-point-texture not supported on ATI hardware");
-            } else {
-              iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
-              iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_FLOAT_ARB;
-            }
-          } else {
-            if (!rtt) {
-              // Currently we don't support non-truecolor visuals in the
-              // GLCapabilities, so we don't offer the option of making
-              // color-index pbuffers.
-              iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
-              iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_ARB;
-            }
-          }
-
-          if (useFloat && !ati) {
-            iattributes[niattribs++] = WGLExt.WGL_FLOAT_COMPONENTS_NV;
-            iattributes[niattribs++] = GL.GL_TRUE;
-          }
-
-          if (rtt) {
-            if (useFloat) {
-              assert(!ati);
-              if (!rect) {
-                throw new GLException("Render-to-floating-point-texture only supported on NVidia hardware with render-to-texture-rectangle");
-              }
-              iattributes[niattribs++] = WGLExt.WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV;
-              iattributes[niattribs++] = GL.GL_TRUE;
-            } else {
-              iattributes[niattribs++] = rect ? WGLExt.WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV : WGLExt.WGL_BIND_TO_TEXTURE_RGB_ARB;
-              iattributes[niattribs++] = GL.GL_TRUE;
-            }
-          }
-        } else {
-          iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
-          iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_ARB;
-        }
-        iattributes[niattribs++] = 0;
-
-        return true;
-    }
-
-    public static final int WINDOW_BIT  = 1 << 0 ;
-    public static final int BITMAP_BIT  = 1 << 1 ;
-    public static final int PBUFFER_BIT = 1 << 2 ;
-
-    public static int WGLConfig2DrawableTypeBits(int[] iattribs,
-                                                 int niattribs,
-                                                 int[] iresults) {
-        int val = 0;
-
-        for (int i = 0; i < niattribs; i++) {
-          int attr = iattribs[i];
-          switch (attr) {
-            case WGLExt.WGL_DRAW_TO_WINDOW_ARB:
-                if(iresults[i] == GL.GL_TRUE) val |= WINDOW_BIT;
-                break;
-            case WGLExt.WGL_DRAW_TO_BITMAP_ARB:
-                if(iresults[i] == GL.GL_TRUE) val |= BITMAP_BIT;
-                break;
-            case WGLExt.WGL_DRAW_TO_PBUFFER_ARB:
-                if(iresults[i] == GL.GL_TRUE) val |= PBUFFER_BIT;
-                break;
-            }
-        }
-        return val;
-    }
-
-    public static boolean WGLConfigDrawableTypeVerify(int val, boolean onscreen, boolean usePBuffer) {
-        boolean res;
-
-        if ( onscreen ) {
-            res = ( 0 != (val & WINDOW_BIT) ) ;
-        } else {
-            if ( usePBuffer ) {
-                res = ( 0 != (val & PBUFFER_BIT) ) ;
-            } else {
-                res = ( 0 != (val & BITMAP_BIT) ) ;
-            }
-        }
-
-        return res;
-    }
-
-    public static GLCapabilitiesImmutable AttribList2GLCapabilities(
-                                                         GLProfile glp, int[] iattribs,
-                                                         int niattribs,
-                                                         int[] iresults,
-                                                         boolean onscreen, boolean usePBuffer) {
-        GLCapabilities res = new GLCapabilities(glp);
-        int drawableTypeBits = WGLConfig2DrawableTypeBits(iattribs, niattribs, iresults);
-        if(WGLConfigDrawableTypeVerify(drawableTypeBits, onscreen, usePBuffer)) {
-            res.setOnscreen(onscreen);
-            res.setPBuffer(usePBuffer);
-        } else {
-            if(DEBUG) {
-              System.err.println("WGL DrawableType does not match: req(onscrn "+onscreen+", pbuffer "+usePBuffer+"), got(onscreen "+( 0 != (drawableTypeBits & WINDOW_BIT) )+", pbuffer "+( 0 != (drawableTypeBits & PBUFFER_BIT) )+", pixmap "+( 0 != (drawableTypeBits & BITMAP_BIT))+")");
-            }
-            return null;
-        }
-
-        for (int i = 0; i < niattribs; i++) {
-          int attr = iattribs[i];
-          switch (attr) {
-            case WGLExt.WGL_DRAW_TO_WINDOW_ARB:
-            case WGLExt.WGL_DRAW_TO_BITMAP_ARB:
-            case WGLExt.WGL_DRAW_TO_PBUFFER_ARB:
-              break;
-
-            case WGLExt.WGL_ACCELERATION_ARB:
-              res.setHardwareAccelerated(iresults[i] == WGLExt.WGL_FULL_ACCELERATION_ARB);
-              break;
-
-            case WGLExt.WGL_SUPPORT_OPENGL_ARB:
-              if (iresults[i] != GL.GL_TRUE) {
-                return null;
-              }
-              break;
-
-            case WGLExt.WGL_DEPTH_BITS_ARB:
-              res.setDepthBits(iresults[i]);
-              break;
-
-            case WGLExt.WGL_STENCIL_BITS_ARB:
-              res.setStencilBits(iresults[i]);
-              break;
-
-            case WGLExt.WGL_DOUBLE_BUFFER_ARB:
-              res.setDoubleBuffered(iresults[i] == GL.GL_TRUE);
-              break;
-
-            case WGLExt.WGL_STEREO_ARB:
-              res.setStereo(iresults[i] == GL.GL_TRUE);
-              break;
-
-            case WGLExt.WGL_PIXEL_TYPE_ARB:
-              // Fail softly with unknown results here
-              if (iresults[i] == WGLExt.WGL_TYPE_RGBA_ARB||
-                  iresults[i] == WGLExt.WGL_TYPE_RGBA_FLOAT_ARB) {
-                res.setPbufferFloatingPointBuffers(true);
-              }
-              break;
-
-            case WGLExt.WGL_FLOAT_COMPONENTS_NV:
-              if (iresults[i] != 0) {
-                res.setPbufferFloatingPointBuffers(true);
-              }
-              break;
-
-            case WGLExt.WGL_RED_BITS_ARB:
-              res.setRedBits(iresults[i]);
-              break;
-              
-            case WGLExt.WGL_GREEN_BITS_ARB:
-              res.setGreenBits(iresults[i]);
-              break;
-
-            case WGLExt.WGL_BLUE_BITS_ARB:
-              res.setBlueBits(iresults[i]);
-              break;
-
-            case WGLExt.WGL_ALPHA_BITS_ARB:
-              res.setAlphaBits(iresults[i]);
-              break;
-
-            case WGLExt.WGL_ACCUM_RED_BITS_ARB:
-              res.setAccumRedBits(iresults[i]);
-              break;
-
-            case WGLExt.WGL_ACCUM_GREEN_BITS_ARB:
-              res.setAccumGreenBits(iresults[i]);
-              break;
-
-            case WGLExt.WGL_ACCUM_BLUE_BITS_ARB:
-              res.setAccumBlueBits(iresults[i]);
-              break;
-
-            case WGLExt.WGL_ACCUM_ALPHA_BITS_ARB:
-              res.setAccumAlphaBits(iresults[i]);
-              break;
-
-            case WGLExt.WGL_SAMPLE_BUFFERS_ARB:
-              res.setSampleBuffers(iresults[i] != 0);
-              break;
-
-            case WGLExt.WGL_SAMPLES_ARB:
-              res.setNumSamples(iresults[i]);
-              break;
-
-            default:
-              throw new GLException("Unknown pixel format attribute " + iattribs[i]);
-          }
-        }
-        return res;
-    }
-
-  // PIXELFORMAT
-
-    public static GLCapabilitiesImmutable PFD2GLCapabilities(GLProfile glp, PIXELFORMATDESCRIPTOR pfd, boolean onscreen, boolean usePBuffer) {
-        if ((pfd.getDwFlags() & GDI.PFD_SUPPORT_OPENGL) == 0) {
-          return null;
-        }
-        GLCapabilities res = new GLCapabilities(glp);
-        res.setRedBits       (pfd.getCRedBits());
-        res.setGreenBits     (pfd.getCGreenBits());
-        res.setBlueBits      (pfd.getCBlueBits());
-        res.setAlphaBits     (pfd.getCAlphaBits());
-        res.setAccumRedBits  (pfd.getCAccumRedBits());
-        res.setAccumGreenBits(pfd.getCAccumGreenBits());
-        res.setAccumBlueBits (pfd.getCAccumBlueBits());
-        res.setAccumAlphaBits(pfd.getCAccumAlphaBits());
-        res.setDepthBits     (pfd.getCDepthBits());
-        res.setStencilBits   (pfd.getCStencilBits());
-        res.setDoubleBuffered((pfd.getDwFlags() & GDI.PFD_DOUBLEBUFFER) != 0);
-        res.setStereo        ((pfd.getDwFlags() & GDI.PFD_STEREO) != 0);
-        res.setHardwareAccelerated( (pfd.getDwFlags() & GDI.PFD_GENERIC_FORMAT) == 0 ||
-                                    (pfd.getDwFlags() & GDI.PFD_GENERIC_ACCELERATED) != 0  );
-        res.setOnscreen      ( onscreen && ((pfd.getDwFlags() & GDI.PFD_DRAW_TO_WINDOW) != 0) );
-        res.setPBuffer       ( usePBuffer );
-        /* FIXME: Missing ??
-        if (GLXUtil.isMultisampleAvailable()) {
-          res.setSampleBuffers(glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLE_BUFFERS, tmp, 0) != 0);
-          res.setNumSamples   (glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLES,        tmp, 0));
-        }
-        res.setBackgroundOpaque(glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_TYPE, tmp, 0) != GLX.GLX_NONE);
-        try { 
-            res.setPbufferFloatingPointBuffers(glXGetFBConfig(display, fbcfg, GLXExt.GLX_FLOAT_COMPONENTS_NV, tmp, 0) != GL.GL_FALSE);
-        } catch (Exception e) {}
-        */
-        return res;
-  }
-
-  public static PIXELFORMATDESCRIPTOR GLCapabilities2PFD(GLCapabilitiesImmutable caps) {
-    int colorDepth = (caps.getRedBits() +
-                      caps.getGreenBits() +
-                      caps.getBlueBits());
-    if (colorDepth < 15) {
-      throw new GLException("Bit depths < 15 (i.e., non-true-color) not supported");
-    }
-    PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
-    int pfdFlags = (GDI.PFD_SUPPORT_OPENGL |
-                    GDI.PFD_GENERIC_ACCELERATED);
-    if (caps.getDoubleBuffered()) {
-      pfdFlags |= GDI.PFD_DOUBLEBUFFER;
-    }
-    if (caps.isOnscreen()) {
-      pfdFlags |= GDI.PFD_DRAW_TO_WINDOW;
-    } else {
-      pfdFlags |= GDI.PFD_DRAW_TO_BITMAP;
-    }
-    if (caps.getStereo()) {
-      pfdFlags |= GDI.PFD_STEREO;
-    }
-    pfd.setDwFlags(pfdFlags);
-    pfd.setIPixelType((byte) GDI.PFD_TYPE_RGBA);
-    pfd.setCColorBits((byte) colorDepth);
-    pfd.setCRedBits  ((byte) caps.getRedBits());
-    pfd.setCGreenBits((byte) caps.getGreenBits());
-    pfd.setCBlueBits ((byte) caps.getBlueBits());
-    pfd.setCAlphaBits((byte) caps.getAlphaBits());
-    int accumDepth = (caps.getAccumRedBits() +
-                      caps.getAccumGreenBits() +
-                      caps.getAccumBlueBits());
-    pfd.setCAccumBits     ((byte) accumDepth);
-    pfd.setCAccumRedBits  ((byte) caps.getAccumRedBits());
-    pfd.setCAccumGreenBits((byte) caps.getAccumGreenBits());
-    pfd.setCAccumBlueBits ((byte) caps.getAccumBlueBits());
-    pfd.setCAccumAlphaBits((byte) caps.getAccumAlphaBits());
-    pfd.setCDepthBits((byte) caps.getDepthBits());
-    pfd.setCStencilBits((byte) caps.getStencilBits());
-    pfd.setILayerType((byte) GDI.PFD_MAIN_PLANE);
-
-    /* FIXME: Missing: 
-      caps.getSampleBuffers()
-      caps.getNumSamples   ()
-    }
-    caps.getBackgroundOpaque()
-    try { 
-        caps.getPbufferFloatingPointBuffers()
-    } catch (Exception e) {}
-    */
-    return pfd;
-  }
-
-  public static PIXELFORMATDESCRIPTOR createPixelFormatDescriptor() {
-    PIXELFORMATDESCRIPTOR pfd = PIXELFORMATDESCRIPTOR.create();
-    pfd.setNSize((short) pfd.size());
-    pfd.setNVersion((short) 1);
-    return pfd;
-  }
-
-  public String toString() {
-    return "WindowsWGLGraphicsConfiguration["+getScreen()+", pfdID " + pixelfmtID + ", wglChoosen "+choosenByWGLPixelFormat+
-                                            ",\n\trequested " + getRequestedCapabilities() +
-                                            ",\n\tchosen    " + getChosenCapabilities() +
-                                            "]";
-  }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
deleted file mode 100644
index 6228a80..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.opengl.impl.windows.wgl;
-
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.CapabilitiesChooser;
-import javax.media.nativewindow.DefaultGraphicsScreen;
-import javax.media.nativewindow.GraphicsConfigurationFactory;
-import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLCapabilitiesChooser;
-import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.nativewindow.impl.windows.GDI;
-import com.jogamp.nativewindow.impl.windows.PIXELFORMATDESCRIPTOR;
-import javax.media.nativewindow.CapabilitiesImmutable;
-import javax.media.opengl.DefaultGLCapabilitiesChooser;
-import javax.media.opengl.GLCapabilitiesImmutable;
-
-/** Subclass of GraphicsConfigurationFactory used when non-AWT tookits
-    are used on Windows platforms. Toolkits will likely need to delegate
-    to this one to change the accepted and returned types of the
-    GraphicsDevice and GraphicsConfiguration abstractions. */
-
-public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
-    protected static final boolean DEBUG = com.jogamp.opengl.impl.Debug.debug("GraphicsConfiguration");
-
-    public WindowsWGLGraphicsConfigurationFactory() {
-        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.windows.WindowsGraphicsDevice.class, this);
-    }
-
-    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
-
-        if (! (capsChosen instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - chosen");
-        }
-
-        if (! (capsRequested instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - requested");
-        }
-
-        return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested, chooser, absScreen);
-    }
-
-    protected static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(GLCapabilitiesImmutable caps,
-                                                                                        AbstractGraphicsScreen absScreen) {
-        if(null==absScreen) {
-            absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
-        }
-        return new WindowsWGLGraphicsConfiguration(absScreen, caps, caps, WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(caps), -1, null);
-    }
-
-    protected static WindowsWGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
-                                                                                       GLCapabilitiesImmutable capsReq,
-                                                                                       CapabilitiesChooser chooser,
-                                                                                       AbstractGraphicsScreen absScreen) {
-        if(null==absScreen) {
-            absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
-        }
-
-        if(!capsChosen.isOnscreen() && capsChosen.getDoubleBuffered()) {
-            // OFFSCREEN !DOUBLE_BUFFER // FIXME DBLBUFOFFSCRN
-            GLCapabilities caps2 = (GLCapabilities) capsChosen.cloneMutable();
-            caps2.setDoubleBuffered(false);
-            capsChosen = caps2;
-        }
-
-        return new WindowsWGLGraphicsConfiguration(absScreen, capsChosen, capsReq,
-                                                   WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(capsChosen), -1,
-                                                   (GLCapabilitiesChooser)chooser);
-    }
-
-    protected static void updateGraphicsConfiguration(CapabilitiesChooser chooser,
-                                                      GLDrawableFactory _factory, NativeSurface ns) {
-        if (ns == null) {
-            throw new IllegalArgumentException("NativeSurface is null");
-        }
-        long hdc = ns.getSurfaceHandle();
-        if (0 == hdc) {
-            throw new GLException("Error: HDC is null");
-        }
-        WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
-        if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
-        }
-
-        if (DEBUG) {
-            System.err.println("updateGraphicsConfiguration: hdc "+toHexString(hdc));
-            System.err.println("!!! user chosen caps " + config.getChosenCapabilities());
-        }
-
-        if( !updateGraphicsConfigurationARB(hdc, config, chooser, (WindowsWGLDrawableFactory) _factory) ) {
-            updateGraphicsConfigurationGDI(hdc, config, chooser, (WindowsWGLDrawableFactory) _factory);
-        }
-    }
-
-    protected static boolean updateGraphicsConfigurationARB(long hdc, WindowsWGLGraphicsConfiguration config,
-                                                            CapabilitiesChooser chooser, WindowsWGLDrawableFactory factory) {
-        AbstractGraphicsDevice device = config.getScreen().getDevice();
-        WindowsWGLContext sharedContext = (WindowsWGLContext) factory.getOrCreateSharedContextImpl(device);
-        if (null == sharedContext) {
-            throw new InternalError("SharedContext is null: " + device);
-        }
-        GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) config.getChosenCapabilities();
-        boolean onscreen = capsChosen.isOnscreen();
-        boolean usePBuffer = capsChosen.isPBuffer();
-        GLProfile glProfile = capsChosen.getGLProfile();
-
-        int pixelFormatSet = -1; // 1-based pixel format
-        GLCapabilitiesImmutable pixelFormatCaps = null;
-
-        GLCapabilitiesImmutable[] availableCaps = null;
-        int[] pformats = null; // if != null, then index matches availableCaps
-        int numFormats = -1;
-        int recommendedIndex = -1;
-
-        if ((pixelFormatSet = GDI.GetPixelFormat(hdc)) != 0) {
-            // Pixelformat already set by either
-            //  - a previous updateGraphicsConfiguration() call on the same HDC,
-            //  - the graphics driver, copying the HDC's pixelformat to the new one,
-            //  - or the Java2D/OpenGL pipeline's configuration
-            if (DEBUG) {
-                System.err.println("updateGraphicsConfigurationARB: Pixel format already chosen for HDC: " + toHexString(hdc)
-                        + ", pixelformat " + pixelFormatSet);
-            }
-        }
-
-        synchronized (sharedContext) {
-            sharedContext.makeCurrent();
-            try {
-                if (!sharedContext.isExtensionAvailable("WGL_ARB_pixel_format")) {
-                    if (DEBUG) {
-                        System.err.println("updateGraphicsConfigurationARB: wglChoosePixelFormatARB not available");
-                    }
-                    return false;
-                }
-                if (pixelFormatSet >= 1) {
-                    // only fetch the specific one ..
-                    pixelFormatCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedContext, hdc, pixelFormatSet,
-                                                                                                glProfile, onscreen, usePBuffer);
-                } else {
-                    int[] iattributes = new int[2 * WindowsWGLGraphicsConfiguration.MAX_ATTRIBS];
-                    float[] fattributes = new float[1];
-                    pformats = new int[WindowsWGLGraphicsConfiguration.MAX_PFORMATS];
-
-                    // 1st choice: get GLCapabilities based on users GLCapabilities setting recommendedIndex as preferred choice
-                    numFormats = WindowsWGLGraphicsConfiguration.wglChoosePixelFormatARB(hdc, sharedContext, capsChosen,
-                                                                                         iattributes, -1, fattributes, pformats);
-                    if (0 < numFormats) {
-                        availableCaps = WindowsWGLGraphicsConfiguration.wglARBPFIDs2GLCapabilities(sharedContext, hdc, pformats, numFormats,
-                                                                                                   glProfile, onscreen, usePBuffer);
-                        if (null != availableCaps) {
-                            recommendedIndex = 0;
-                            pixelFormatCaps = availableCaps[0];
-                            if (DEBUG) {
-                                System.err.println("updateGraphicsConfigurationARB: NumFormats (wglChoosePixelFormatARB) " + numFormats + " / " + WindowsWGLGraphicsConfiguration.MAX_PFORMATS);
-                                System.err.println("updateGraphicsConfigurationARB: Used wglChoosePixelFormatARB to recommend pixel format " + pformats[recommendedIndex] + ", idx " + recommendedIndex);
-                                System.err.println("!!! recommended caps " + pixelFormatCaps);
-                            }
-                        }
-                    }
-
-                    // 2nd choice: get all GLCapabilities available, no preferred recommendedIndex available
-                    if (null == availableCaps) {
-                        if (DEBUG) {
-                            System.err.println("updateGraphicsConfigurationARB: wglChoosePixelFormatARB failed (Query all formats without recommendation): " + GDI.GetLastError());
-                        }
-                        availableCaps = WindowsWGLGraphicsConfiguration.wglARBAllPFIDs2GLCapabilities(sharedContext, hdc,
-                                                                                                      glProfile, onscreen, usePBuffer, pformats);
-                        if (null != availableCaps) {
-                            numFormats = availableCaps.length;
-                        }
-                    }
-                }
-            } finally {
-                sharedContext.release();
-            }
-        } // synchronized(factory.sharedContext)
-
-        if (pixelFormatSet <= 0 && null == availableCaps) {
-            if (DEBUG) {
-                System.err.println("updateGraphicsConfigurationARB: No PixelFormat chosen via ARB ... (LastError: " + GDI.GetLastError() + ")");
-            }
-            return false;
-        }
-
-        int pfdID;
-
-        if (pixelFormatSet <= 0) {
-            if (null == pixelFormatCaps && null == chooser) {
-                chooser = new DefaultGLCapabilitiesChooser();
-            }
-
-            int chosenIndex = recommendedIndex;
-            try {
-                if (null != chooser) {
-                    chosenIndex = chooser.chooseCapabilities(capsChosen, availableCaps, recommendedIndex);
-                    pixelFormatCaps = availableCaps[chosenIndex];
-                    if (DEBUG) {
-                        System.err.println("updateGraphicsConfigurationARB: chooser: idx " + chosenIndex);
-                        System.err.println("!!! chosen   caps " + pixelFormatCaps);
-                    }
-                }
-            } catch (NativeWindowException e) {
-                if (DEBUG) {
-                    e.printStackTrace();
-                }
-            }
-
-            if (chosenIndex < 0) {
-                // keep on going ..
-                // seek first available one ..
-                for (chosenIndex = 0; chosenIndex < availableCaps.length && availableCaps[chosenIndex] == null; chosenIndex++) {
-                    // nop
-                }
-                if (chosenIndex == availableCaps.length) {
-                    // give up ..
-                    if (DEBUG) {
-                        System.err.println("updateGraphicsConfigurationARB: Failed .. nothing available, bail out");
-                    }
-                    return false;
-                }
-                pixelFormatCaps = availableCaps[chosenIndex];
-                if (DEBUG) {
-                    System.err.println("updateGraphicsConfigurationARB: Failed .. unable to choose config, using first available idx: " + chosenIndex);
-                    System.err.println("!!! fallback caps " + pixelFormatCaps);
-                }
-            }
-            pfdID = pformats[chosenIndex];
-        } else {
-            pfdID = pixelFormatSet;
-        }
-        if (DEBUG) {
-            System.err.println("updateGraphicsConfigurationARB: using pfdID "+pfdID);
-        }
-
-        PIXELFORMATDESCRIPTOR pfd = WindowsWGLGraphicsConfiguration.createPixelFormatDescriptor();
-
-        if (GDI.DescribePixelFormat(hdc, pfdID, pfd.size(), pfd) == 0) {
-            throw new GLException("updateGraphicsConfigurationARB: Error describing the chosen pixel format: " + pfdID + ", " + GDI.GetLastError());
-        }
-
-        if (pixelFormatSet <= 0) {
-            if (!GDI.SetPixelFormat(hdc, pfdID, pfd)) {
-                long lastError = GDI.GetLastError();
-                throw new GLException("Unable to set pixel format " + pfdID + " for device context " + toHexString(hdc) + ": error code " + lastError);
-            }
-        }
-
-        config.setCapsPFD(pixelFormatCaps, pfd, pfdID, true);
-        return true;
-    }
-
-    protected static boolean updateGraphicsConfigurationGDI(long hdc, WindowsWGLGraphicsConfiguration config,
-                                                            CapabilitiesChooser chooser, WindowsWGLDrawableFactory factory) {
-        AbstractGraphicsDevice device = config.getScreen().getDevice();
-        WindowsWGLContext sharedContext = (WindowsWGLContext) factory.getOrCreateSharedContextImpl(device);
-        if (null == sharedContext) {
-            throw new InternalError("SharedContext is null: " + device);
-        }
-        GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) config.getChosenCapabilities();
-        boolean onscreen = capsChosen.isOnscreen();
-        boolean usePBuffer = capsChosen.isPBuffer();
-        GLProfile glProfile = capsChosen.getGLProfile();
-
-        int pixelFormatSet = -1; // 1-based pixel format
-        GLCapabilitiesImmutable pixelFormatCaps = null;
-
-        GLCapabilitiesImmutable[] availableCaps = null;
-        int numFormats = -1;
-        int recommendedIndex = -1;
-
-        if ((pixelFormatSet = GDI.GetPixelFormat(hdc)) != 0) {
-            // Pixelformat already set by either
-            //  - a previous updateGraphicsConfiguration() call on the same HDC,
-            //  - the graphics driver, copying the HDC's pixelformat to the new one,
-            //  - or the Java2D/OpenGL pipeline's configuration
-            if (DEBUG) {
-                System.err.println("updateGraphicsConfigurationGDI: NOTE: pixel format already chosen for HDC: " + toHexString(hdc)
-                        + ", pixelformat " + pixelFormatSet);
-            }
-        }
-
-        int recommendedPixelFormat = pixelFormatSet;
-
-        numFormats = GDI.DescribePixelFormat(hdc, 1, 0, null);
-        if (numFormats == 0) {
-            throw new GLException("Unable to enumerate pixel formats of window "
-                    + toHexString(hdc) + " for GLCapabilitiesChooser (LastError: " + GDI.GetLastError() + ")");
-        }
-        if (DEBUG) {
-            System.err.println("updateGraphicsConfigurationGDI: NumFormats (DescribePixelFormat) " + numFormats);
-        }
-        
-        PIXELFORMATDESCRIPTOR pfd = WindowsWGLGraphicsConfiguration.createPixelFormatDescriptor();
-        availableCaps = new GLCapabilitiesImmutable[numFormats];
-        for (int i = 0; i < numFormats; i++) {
-            if (GDI.DescribePixelFormat(hdc, 1 + i, pfd.size(), pfd) == 0) {
-                throw new GLException("Error describing pixel format " + (1 + i) + " of device context");
-            }
-            availableCaps[i] = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(glProfile, pfd, onscreen, usePBuffer);
-        }
-        
-        int pfdID;
-
-        if (pixelFormatSet <= 0) {
-            pfd = WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(capsChosen);
-            recommendedPixelFormat = GDI.ChoosePixelFormat(hdc, pfd);
-            recommendedIndex = recommendedPixelFormat - 1;
-            pixelFormatCaps = availableCaps[recommendedIndex];
-            if (DEBUG) {
-                System.err.println("updateGraphicsConfigurationGDI: ChoosePixelFormat(HDC " + toHexString(hdc) + ") = " + recommendedPixelFormat + " (LastError: " + GDI.GetLastError() + ")");
-                System.err.println("!!! recommended caps " + pixelFormatCaps);
-            }
-
-            int chosenIndex = recommendedIndex;
-            try {
-                if (null != chooser) {
-                    chosenIndex = chooser.chooseCapabilities(capsChosen, availableCaps, recommendedIndex);
-                    pixelFormatCaps = availableCaps[chosenIndex];
-                    if (DEBUG) {
-                        System.err.println("updateGraphicsConfigurationGDI: chooser: idx " + chosenIndex);
-                        System.err.println("!!! chosen   caps " + pixelFormatCaps);
-                    }
-                }
-            } catch (NativeWindowException e) {
-                if (DEBUG) {
-                    e.printStackTrace();
-                }
-            }
-
-            if (chosenIndex < 0) {
-                // keep on going ..
-                // seek first available one ..
-                for (chosenIndex = 0; chosenIndex < availableCaps.length && availableCaps[chosenIndex] == null; chosenIndex++) {
-                    // nop
-                }
-                if (chosenIndex == availableCaps.length) {
-                    // give up ..
-                    if (DEBUG) {
-                        System.err.println("updateGraphicsConfigurationGDI: Failed .. nothing available, bail out");
-                    }
-                    return false;
-                }
-                pixelFormatCaps = availableCaps[chosenIndex];
-                if (DEBUG) {
-                    System.err.println("updateGraphicsConfigurationGDI: Failed .. unable to choose config, using first available idx: " + chosenIndex);
-                    System.err.println("!!! fallback caps " + pixelFormatCaps);
-                }
-            }            
-            pfdID = chosenIndex + 1;
-        } else {
-            pfdID = pixelFormatSet;
-            pixelFormatCaps = availableCaps[pixelFormatSet-1];
-            if (DEBUG) {
-                System.err.println("updateGraphicsConfigurationGDI: Using preset PFID: " + pixelFormatSet);
-                System.err.println("!!! preset caps " + pixelFormatCaps);
-            }
-        }
-        if (DEBUG) {
-            System.err.println("updateGraphicsConfigurationGDI: using pfdID "+pfdID);
-        }
-
-        if (GDI.DescribePixelFormat(hdc, pfdID, pfd.size(), pfd) == 0) {
-            throw new GLException("Error describing the chosen pixel format: " + pfdID + ", " + GDI.GetLastError());
-        }
-
-        if (pixelFormatSet <= 0) {
-            if (!GDI.SetPixelFormat(hdc, pfdID, pfd)) {
-                long lastError = GDI.GetLastError();
-                throw new GLException("Unable to set pixel format " + pfdID + " for device context " + toHexString(hdc) + ": error code " + lastError);
-            }
-        }
-
-        config.setCapsPFD(pixelFormatCaps, pfd, pfdID, true);
-        return true;
-
-    }
-
-    protected static String getThreadName() {
-        return Thread.currentThread().getName();
-    }
-
-    public static String toHexString(long hex) {
-        return "0x" + Long.toHexString(hex);
-    }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
deleted file mode 100644
index da4f211..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.opengl.impl.windows.wgl.awt;
-
-
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.CapabilitiesChooser;
-import javax.media.nativewindow.CapabilitiesImmutable;
-import javax.media.nativewindow.DefaultGraphicsScreen;
-import javax.media.nativewindow.GraphicsConfigurationFactory;
-import javax.media.nativewindow.awt.AWTGraphicsConfiguration;
-import javax.media.nativewindow.awt.AWTGraphicsDevice;
-import javax.media.nativewindow.awt.AWTGraphicsScreen;
-import javax.media.nativewindow.windows.WindowsGraphicsDevice;
-
-import javax.media.opengl.GLCapabilitiesChooser;
-import javax.media.opengl.GLCapabilitiesImmutable;
-import javax.media.opengl.GLException;
-
-import com.jogamp.opengl.impl.windows.wgl.WindowsWGLGraphicsConfiguration;
-
-public class WindowsAWTWGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
-    protected static final boolean DEBUG = com.jogamp.opengl.impl.Debug.debug("GraphicsConfiguration");
-
-    public WindowsAWTWGLGraphicsConfigurationFactory() {
-        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this);
-    }
-
-    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
-        GraphicsDevice device = null;
-        if (absScreen != null &&
-            !(absScreen instanceof AWTGraphicsScreen)) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
-        }
-
-        if(null==absScreen) {
-            absScreen = AWTGraphicsScreen.createScreenDevice(-1, AbstractGraphicsDevice.DEFAULT_UNIT);
-        }
-        AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
-        device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
-
-        if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - chosen");
-        }
-
-        if ( !(capsRequested instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - requested");
-        }
-
-        if (chooser != null &&
-            !(chooser instanceof GLCapabilitiesChooser)) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilitiesChooser objects");
-        }
-
-        if(DEBUG) {
-            System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: got "+absScreen);
-        }
-        GraphicsConfiguration gc = device.getDefaultConfiguration();
-        WindowsGraphicsDevice winDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
-        DefaultGraphicsScreen winScreen = new DefaultGraphicsScreen(winDevice, awtScreen.getIndex());
-        if(DEBUG) {
-            System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: made "+winScreen);
-        }
-
-        WindowsWGLGraphicsConfiguration winConfig = (WindowsWGLGraphicsConfiguration)
-            GraphicsConfigurationFactory.getFactory(winDevice).chooseGraphicsConfiguration(capsChosen,
-                                                                                           capsRequested,
-                                                                                           chooser, winScreen);
-
-        if (winConfig == null) {
-            throw new GLException("Unable to choose a GraphicsConfiguration: "+capsChosen+",\n\t"+chooser+"\n\t"+winScreen);
-        }
-
-        if(DEBUG) {
-            System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: chosen "+winConfig);
-        }
-
-        // We have nothing to match .. so choose the default
-        return new AWTGraphicsConfiguration(awtScreen, winConfig.getChosenCapabilities(), winConfig.getRequestedCapabilities(),
-                                            gc, winConfig);
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/GLXUtil.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/GLXUtil.java
deleted file mode 100644
index 46bc946..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/GLXUtil.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.opengl.*;
-
-
-public class GLXUtil {
-    public static String getExtension(long display) {
-        return GLX.glXGetClientString(display, GLX.GLX_EXTENSIONS);
-    }
-
-    public static boolean isMultisampleAvailable(String extensions) {
-        if (extensions != null) {
-            return (extensions.indexOf("GLX_ARB_multisample") >= 0);
-        }
-        return false;
-    }
-
-    public static boolean isMultisampleAvailable(long display) {
-        return isMultisampleAvailable(getExtension(display));
-    }
-
-    /** Workaround for apparent issue with ATI's proprietary drivers
-        where direct contexts still send GLX tokens for GL calls */
-    public static String getVendorName(long display) {
-        return GLX.glXGetClientString(display, GLX.GLX_VENDOR);
-    }
-
-    public static boolean isVendorNVIDIA(String vendor) {
-        return vendor != null && vendor.startsWith("NVIDIA") ;
-    }
-
-    public static boolean isVendorATI(String vendor) {
-        return vendor != null && vendor.startsWith("ATI") ;
-    }
-
-    public static boolean isVendorATI(long display) {
-        return isVendorATI(getVendorName(display));
-    }
-
-    public static boolean isVendorNVIDIA(long display) {
-        return isVendorNVIDIA(getVendorName(display));
-    }
-
-    public static void getGLXVersion(long display, int major[], int minor[]) { 
-        if(0 == display) {
-            throw new GLException("null display handle");
-        }
-        if(major.length<1||minor.length<1) {
-            throw new GLException("passed int arrays size is not >= 1");
-        }
-
-        if (!GLX.glXQueryVersion(display, major, 0, minor, 0)) {
-          throw new GLException("glXQueryVersion failed");
-        }
-
-        // Work around bugs in ATI's Linux drivers where they report they
-        // only implement GLX version 1.2 on the server side
-        if (major[0] == 1 && minor[0] == 2) {
-          String str = GLX.glXGetClientString(display, GLX.GLX_VERSION);
-          try {
-              // e.g. "1.3"
-              major[0] = Integer.valueOf(str.substring(0, 1)).intValue();
-              minor[0] = Integer.valueOf(str.substring(2, 3)).intValue();
-          } catch (Exception e) {
-              major[0] = 1;
-              minor[0] = 2;
-          }
-        }
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java
deleted file mode 100644
index 6c8d1fc..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.opengl.*;
-
-import javax.media.nativewindow.x11.*;
-import com.jogamp.nativewindow.impl.*;
-import com.jogamp.nativewindow.impl.x11.*;
-
-public class X11DummyGLXDrawable extends X11OnscreenGLXDrawable {
-
-  private long dummyWindow = 0;
-
-  /** 
-   * Due to the ATI Bug https://bugzilla.mozilla.org/show_bug.cgi?id=486277,
-   * we cannot switch the Display as we please, 
-   * hence we reuse the target's screen configuration. 
-   */
-  public X11DummyGLXDrawable(X11GraphicsScreen screen, GLDrawableFactory factory, GLCapabilitiesImmutable caps) {
-    super(factory, 
-          new ProxySurface(X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(
-            caps, caps, null, screen)));
-    this.realized = true;
-
-    ProxySurface ns = (ProxySurface) getNativeSurface();
-    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
-
-    X11GraphicsDevice device = (X11GraphicsDevice) screen.getDevice();
-    long dpy = device.getHandle();
-    int scrn = screen.getIndex();
-    long visualID = config.getVisualID();
-
-    dummyWindow = X11Util.CreateDummyWindow(dpy, scrn, visualID);
-    ns.setSurfaceHandle( dummyWindow );
-
-    updateHandle();
-  }
-
-  public static X11DummyGLXDrawable create(X11GraphicsScreen screen, GLDrawableFactory factory, GLProfile glp) {
-      GLCapabilities caps = new GLCapabilities(glp);
-      return new X11DummyGLXDrawable(screen, factory, caps);
-  }
-
-  public void setSize(int width, int height) {
-  }
-
-  public int getWidth() {
-    return 1;
-  }
-
-  public int getHeight() {
-    return 1;
-  }
-
-  protected void destroyImpl() {
-    if(0!=dummyWindow) {
-        destroyHandle();
-        X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-        X11Util.DestroyDummyWindow(config.getScreen().getDevice().getHandle(), dummyWindow);
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXContext.java
deleted file mode 100644
index 76f7f65..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXContext.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.x11.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.nativewindow.impl.ProxySurface;
-
-public class X11ExternalGLXContext extends X11GLXContext {
-  private boolean firstMakeCurrent = true;
-  private GLContext lastContext;
-
-  private X11ExternalGLXContext(Drawable drawable, long ctx) {
-    super(drawable, null);
-    this.contextHandle = ctx;
-    GLContextShareSet.contextCreated(this);
-    setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);
-    getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
-  }
-
-  protected static X11ExternalGLXContext create(GLDrawableFactory factory, GLProfile glp) {
-    long ctx = GLX.glXGetCurrentContext();
-    if (ctx == 0) {
-      throw new GLException("Error: current context null");
-    }
-    long display = GLX.glXGetCurrentDisplay();
-    if (display == 0) {
-      throw new GLException("Error: current display null");
-    }
-    long drawable = GLX.glXGetCurrentDrawable();
-    if (drawable == 0) {
-      throw new GLException("Error: attempted to make an external GLDrawable without a drawable/context current");
-    }
-    int[] val = new int[1];
-    GLX.glXQueryContext(display, ctx, GLX.GLX_SCREEN, val, 0);
-    X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val[0]);
-
-    GLX.glXQueryContext(display, ctx, GLX.GLX_FBCONFIG_ID, val, 0);
-    X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val[0]);
-
-    ProxySurface ns = new ProxySurface(cfg);
-    ns.setSurfaceHandle(drawable);
-    return new X11ExternalGLXContext(new Drawable(factory, ns), ctx);
-  }
-
-  protected boolean createImpl() {
-      return true;
-  }
-
-  public int makeCurrent() throws GLException {
-    // Save last context if necessary to allow external GLContexts to
-    // talk to other GLContexts created by this library
-    GLContext cur = getCurrent();
-    if (cur != null && cur != this) {
-      lastContext = cur;
-      setCurrent(null);
-    }
-    return super.makeCurrent();
-  }  
-
-  public void release() throws GLException {
-    super.release();
-    setCurrent(lastContext);
-    lastContext = null;
-  }
-
-  protected void makeCurrentImpl(boolean newCreated) throws GLException {
-    if (firstMakeCurrent) {
-      firstMakeCurrent = false;
-    }
-  }
-
-  protected void releaseImpl() throws GLException {
-  }
-
-  protected void destroyImpl() throws GLException {
-  }
-
-  // Need to provide the display connection to extension querying APIs
-  static class Drawable extends X11GLXDrawable {
-    Drawable(GLDrawableFactory factory, NativeSurface comp) {
-      super(factory, comp, true);
-    }
-
-    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");
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java
deleted file mode 100644
index f0270fd..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.x11.*;
-import javax.media.opengl.*;
-import com.jogamp.nativewindow.impl.ProxySurface;
-
-
-public class X11ExternalGLXDrawable extends X11GLXDrawable {
-
-  private X11ExternalGLXDrawable(GLDrawableFactory factory, NativeSurface surface) {
-    super(factory, surface, true);
-  }
-
-  protected static X11ExternalGLXDrawable create(GLDrawableFactory factory, GLProfile glp) {
-    long context = GLX.glXGetCurrentContext();
-    if (context == 0) {
-      throw new GLException("Error: current context null");
-    }
-    long display = GLX.glXGetCurrentDisplay();
-    if (display == 0) {
-      throw new GLException("Error: current display null");
-    }
-    long drawable = GLX.glXGetCurrentDrawable();
-    if (drawable == 0) {
-      throw new GLException("Error: attempted to make an external GLDrawable without a drawable current");
-    }
-    int[] val = new int[1];
-    GLX.glXQueryContext(display, context, GLX.GLX_SCREEN, val, 0);
-    X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val[0]);
-
-    GLX.glXQueryContext(display, context, GLX.GLX_FBCONFIG_ID, val, 0);
-    X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val[0]);
-
-    int w, h;
-    GLX.glXQueryDrawable(display, drawable, GLX.GLX_WIDTH, val, 0);
-    w=val[0];
-    GLX.glXQueryDrawable(display, drawable, GLX.GLX_HEIGHT, val, 0);
-    h=val[0];
-
-    GLX.glXQueryContext(display, context, GLX.GLX_RENDER_TYPE, val, 0);
-    if ((val[0] & GLX.GLX_RGBA_TYPE) == 0) {
-      if (DEBUG) {
-        System.err.println("X11ExternalGLXDrawable: WARNING: forcing GLX_RGBA_TYPE for newly created contexts (current 0x"+Integer.toHexString(val[0])+")");
-      }
-    }
-    ProxySurface ns = new ProxySurface(cfg);
-    ns.setSurfaceHandle(drawable);
-    ns.setSize(w, h);
-    return new X11ExternalGLXDrawable(factory, ns);
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    return new Context(this, shareWith);
-  }
-
-  public void setSize(int newWidth, int newHeight) {
-    throw new GLException("Should not call this");
-  }
-
-  class Context extends X11GLXContext {
-    Context(X11GLXDrawable drawable, GLContext shareWith) {
-      super(drawable, shareWith);
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java
deleted file mode 100644
index 1dadc2e..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import java.nio.*;
-import java.util.*;
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.gluegen.runtime.ProcAddressTable;
-import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
-import com.jogamp.nativewindow.impl.x11.X11Util;
-import javax.media.nativewindow.x11.X11GraphicsDevice;
-
-public abstract class X11GLXContext extends GLContextImpl {
-  protected static final boolean TRACE_CONTEXT_CURRENT = false; // true;
-
-  private static final Map/*<String, String>*/ functionNameMap;
-  private static final Map/*<String, String>*/ extensionNameMap;
-  private boolean glXQueryExtensionsStringInitialized;
-  private boolean glXQueryExtensionsStringAvailable;
-  private GLXExt glXExt;
-  // Table that holds the addresses of the native C-language entry points for
-  // GLX extension functions.
-  private GLXExtProcAddressTable glXExtProcAddressTable;
-  private int hasSwapIntervalSGI = 0;
-
-  // This indicates whether the context we have created is indirect
-  // and therefore requires the toolkit to be locked around all GL
-  // calls rather than just all GLX calls
-  protected boolean isDirect;
-
-  static {
-    functionNameMap = new HashMap();
-    functionNameMap.put("glAllocateMemoryNV", "glXAllocateMemoryNV");
-    functionNameMap.put("glFreeMemoryNV", "glXFreeMemoryNV");
-
-    extensionNameMap = new HashMap();
-    extensionNameMap.put("GL_ARB_pbuffer",      "GLX_SGIX_pbuffer");
-    extensionNameMap.put("GL_ARB_pixel_format", "GLX_SGIX_pbuffer"); // good enough
-  }
-
-  public X11GLXContext(GLDrawableImpl drawable, GLDrawableImpl drawableRead,
-                      GLContext shareWith) {
-    super(drawable, drawableRead, shareWith);
-  }
-
-  public X11GLXContext(GLDrawableImpl drawable,
-                      GLContext shareWith) {
-    this(drawable, null, shareWith);
-  }
-  
-  protected void resetState() {
-    glXQueryExtensionsStringInitialized=false;
-    glXQueryExtensionsStringAvailable=false;
-    // no inner state glXExt=null;
-    glXExtProcAddressTable = null;
-    hasSwapIntervalSGI = 0;
-    isDirect = false;
-  }
-
-  public final ProcAddressTable getPlatformExtProcAddressTable() {
-    return getGLXExtProcAddressTable();
-  }
-
-  public final GLXExtProcAddressTable getGLXExtProcAddressTable() {
-    return glXExtProcAddressTable;
-  }
-
-  public Object getPlatformGLExtensions() {
-    return getGLXExt();
-  }
-
-  public GLXExt getGLXExt() {
-    if (glXExt == null) {
-      glXExt = new GLXExtImpl(this);
-    }
-    return glXExt;
-  }
-
-  protected Map/*<String, String>*/ getFunctionNameMap() { return functionNameMap; }
-
-  protected Map/*<String, String>*/ getExtensionNameMap() { return extensionNameMap; }
-
-  protected boolean glXMakeContextCurrent(long dpy, long writeDrawable, long readDrawable, long ctx) {
-    boolean res = false;
-
-    try {
-        if(TRACE_CONTEXT_CURRENT) {
-            Throwable t = new Throwable(Thread.currentThread()+" - glXMakeContextCurrent("+toHexString(dpy)+", "+
-                    toHexString(writeDrawable)+", "+toHexString(readDrawable)+", "+toHexString(ctx)+")");
-            t.printStackTrace();
-        }
-        res = GLX.glXMakeContextCurrent(dpy, writeDrawable, readDrawable, ctx);
-    } catch (RuntimeException re) {
-        if(DEBUG) {
-          System.err.println("Warning: X11GLXContext.glXMakeContextCurrent failed: "+re+", with "+
-            "dpy "+toHexString(dpy)+
-            ", write "+toHexString(writeDrawable)+
-            ", read "+toHexString(readDrawable)+
-            ", ctx "+toHexString(ctx));
-          re.printStackTrace();
-        }
-    }
-    return res;
-  }
-
-  protected void destroyContextARBImpl(long ctx) {
-    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    long display = config.getScreen().getDevice().getHandle();
-
-    glXMakeContextCurrent(display, 0, 0, 0);
-    GLX.glXDestroyContext(display, ctx);
-  }
-
-  protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
-    X11GLXDrawableFactory factory = (X11GLXDrawableFactory)drawable.getFactoryImpl();
-
-    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    AbstractGraphicsDevice device = config.getScreen().getDevice();
-    X11GLXContext sharedContext = (X11GLXContext) factory.getOrCreateSharedContextImpl(device);
-    long display = device.getHandle();
-
-    GLXExt glXExt;
-    if(null==sharedContext) {
-        glXExt = getGLXExt();
-    } else {
-        glXExt = sharedContext.getGLXExt();
-    }
-
-    boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
-    boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
-    boolean ctDebug     = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
-
-    long ctx=0;
-
-    final int idx_flags = 6;
-    final int idx_profile = 8;
-
-    int attribs[] = {
-        /*  0 */ GLX.GLX_CONTEXT_MAJOR_VERSION_ARB, major,
-        /*  2 */ GLX.GLX_CONTEXT_MINOR_VERSION_ARB, minor,
-        /*  4 */ GLX.GLX_RENDER_TYPE,               GLX.GLX_RGBA_TYPE, // default
-        /*  6 */ GLX.GLX_CONTEXT_FLAGS_ARB,         0,
-        /*  8 */ 0,                                 0,
-        /* 10 */ 0
-    };
-
-    if ( major > 3 || major == 3 && minor >= 2  ) {
-        // FIXME: Verify with a None drawable binding (default framebuffer)
-        attribs[idx_profile+0]  = GLX.GLX_CONTEXT_PROFILE_MASK_ARB;
-        if( ctBwdCompat ) {
-            attribs[idx_profile+1]  = GLX.GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
-        } else {
-            attribs[idx_profile+1]  = GLX.GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
-        } 
-    } 
-
-    if ( major >= 3 ) {
-        if( !ctBwdCompat && ctFwdCompat ) {
-            attribs[idx_flags+1] |= GLX.GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
-        }
-        if( ctDebug) {
-            attribs[idx_flags+1] |= GLX.GLX_CONTEXT_DEBUG_BIT_ARB;
-        }
-    }
-
-    try {
-        // critical path, a remote display might not support this command,
-        // hence we need to catch the X11 Error within this block.
-        X11Util.XSync(display, false);
-        ctx = glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs, 0);
-        X11Util.XSync(display, false);
-    } catch (RuntimeException re) {
-        if(DEBUG) {
-          Throwable t = new Throwable("Info: X11GLXContext.createContextARBImpl glXCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
-          t.printStackTrace();
-        }
-    }
-    if(0!=ctx) {
-        if (!glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), ctx)) {
-            if(DEBUG) {
-              System.err.println("X11GLXContext.createContextARBImpl couldn't make current "+getGLVersion(major, minor, ctp, "@creation"));
-            }
-            // release & destroy
-            glXMakeContextCurrent(display, 0, 0, 0);
-            GLX.glXDestroyContext(display, ctx);
-            ctx = 0;
-        } else {
-            if (DEBUG) {
-                System.err.println(getThreadName() + ": createContextARBImpl: OK "+getGLVersion(major, minor, ctp, "@creation")+", share "+share+", direct "+direct+", hasSharedContext "+(null!=sharedContext));
-            }
-            // the following is issued by the caller 'GLContextImpl.createContextARB()'
-            // setGLFunctionAvailability(true, major, minor, ctp);
-        }
-    } else if (DEBUG) {
-        System.err.println(getThreadName() + ": createContextARBImpl: NO "+getGLVersion(major, minor, ctp, "@creation"));
-    }
-
-    return ctx;
-  }
-
-  protected boolean createImpl() {
-      // covers the whole context creation loop incl createContextARBImpl and destroyContextARBImpl
-      X11Util.setX11ErrorHandler(true, true);
-      try {
-          return createImplRaw();
-      } finally {
-          X11Util.setX11ErrorHandler(false, false);
-      }
-  }
-
-  private boolean createImplRaw() {
-    boolean direct = true; // try direct always
-    isDirect = false; // fall back
-
-    X11GLXDrawableFactory factory = (X11GLXDrawableFactory)drawable.getFactoryImpl();
-    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    AbstractGraphicsDevice device = config.getScreen().getDevice();
-    X11GLXContext sharedContext = (X11GLXContext) factory.getOrCreateSharedContextImpl(device);
-    long display = device.getHandle();
-
-    X11GLXContext other = (X11GLXContext) GLContextShareSet.getShareContext(this);
-    long share = 0;
-    if (other != null) {
-      share = other.getHandle();
-      if (share == 0) {
-        throw new GLException("GLContextShareSet returned an invalid OpenGL context");
-      }
-      direct = GLX.glXIsDirect(display, share);
-    }
-
-    GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
-    GLProfile glp = glCaps.getGLProfile();
-    isVendorATI = factory.isVendorATI(device);
-
-    if(config.getFBConfigID()<0) {
-        // not able to use FBConfig
-        if(glp.isGL3()) {
-          throw new GLException("Unable to create OpenGL >= 3.1 context");
-        }
-        contextHandle = GLX.glXCreateContext(display, config.getXVisualInfo(), share, direct);
-        if (contextHandle == 0) {
-          throw new GLException("Unable to create context(0)");
-        }
-        if (!glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
-          throw new GLException("Error making temp context(0) current: display "+toHexString(display)+", context "+toHexString(contextHandle)+", drawable "+drawable);
-        }
-        setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); // use GL_VERSION
-        isDirect = GLX.glXIsDirect(display, contextHandle);
-        if (DEBUG) {
-            System.err.println(getThreadName() + ": createContextImpl: OK (old-1) share "+share+", direct "+isDirect+"/"+direct);
-        }
-        return true;
-    }
-
-    int minor[] = new int[1];
-    int major[] = new int[1];
-    int ctp[] = new int[1];
-    boolean createContextARBTried = false;
-
-    // utilize the shared context's GLXExt in case it was using the ARB method and it already exists
-    if(null!=sharedContext && sharedContext.isCreatedWithARBMethod()) {
-        contextHandle = createContextARB(share, direct, major, minor, ctp);
-        createContextARBTried = true;
-        if (DEBUG && 0!=contextHandle) {
-            System.err.println(getThreadName() + ": createContextImpl: OK (ARB, using sharedContext) share "+share);
-        }
-    }
-
-    long temp_ctx = 0;
-    if(0==contextHandle) {
-        // To use GLX_ARB_create_context, we have to make a temp context current,
-        // so we are able to use GetProcAddress
-        temp_ctx = GLX.glXCreateNewContext(display, config.getFBConfig(), GLX.GLX_RGBA_TYPE, share, direct);
-        if (temp_ctx == 0) {
-            throw new GLException("Unable to create temp OpenGL context(1)");
-        }
-        if (!glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), temp_ctx)) {
-          throw new GLException("Error making temp context(1) current: display "+toHexString(display)+", context "+toHexString(temp_ctx)+", drawable "+drawable);
-        }
-        setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); // use GL_VERSION
-        boolean isCreateContextAttribsARBAvailable = isFunctionAvailable("glXCreateContextAttribsARB");
-        glXMakeContextCurrent(display, 0, 0, 0); // release temp context
-
-        if( !createContextARBTried ) {
-            if ( isCreateContextAttribsARBAvailable &&
-                 isExtensionAvailable("GLX_ARB_create_context") ) {
-                // initial ARB context creation
-                contextHandle = createContextARB(share, direct, major, minor, ctp);
-                createContextARBTried=true;
-                if (DEBUG) {
-                    if(0!=contextHandle) {
-                        System.err.println(getThreadName() + ": createContextImpl: OK (ARB, initial) share "+share);                        
-                    } else {
-                        System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - creation failed - share "+share);
-                    }
-                }
-            } else if (DEBUG) {
-                System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - extension not available - share "+share);
-            }
-        }
-    }
-
-    if(0!=contextHandle) {
-        if(0!=temp_ctx) {
-            glXMakeContextCurrent(display, 0, 0, 0);
-            GLX.glXDestroyContext(display, temp_ctx);
-            if (!glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
-                throw new GLException("Cannot make previous verified context current");
-            }
-        }
-    } else {
-        if(glp.isGL3()) {
-          glXMakeContextCurrent(display, 0, 0, 0);
-          GLX.glXDestroyContext(display, temp_ctx);
-          throw new GLException("X11GLXContext.createContextImpl failed, but context > GL2 requested "+getGLVersion(major[0], minor[0], ctp[0], "@creation")+", ");
-        }
-        if(DEBUG) {
-          System.err.println("X11GLXContext.createContextImpl failed, fall back to !ARB context "+getGLVersion(major[0], minor[0], ctp[0], "@creation"));
-        }
-
-        // continue with temp context for GL <= 3.0
-        contextHandle = temp_ctx;
-        if (!glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
-          glXMakeContextCurrent(display, 0, 0, 0);
-          GLX.glXDestroyContext(display, temp_ctx);
-          throw new GLException("Error making context(1) current: display "+toHexString(display)+", context "+toHexString(contextHandle)+", drawable "+drawable);
-        }
-        if (DEBUG) {
-            System.err.println(getThreadName() + ": createContextImpl: OK (old-2) share "+share);
-        }
-    }
-    isDirect = GLX.glXIsDirect(display, contextHandle);
-    if (DEBUG) {
-        System.err.println(getThreadName() + ": createContextImpl: OK direct "+isDirect+"/"+direct);
-    }
-    return true;
-  }
-
-  protected void makeCurrentImpl(boolean newCreated) throws GLException {
-    long dpy = drawable.getNativeSurface().getDisplayHandle();
-
-    if (GLX.glXGetCurrentContext() != contextHandle) {
-        X11Util.setX11ErrorHandler(true, true);
-        try {
-            if (!glXMakeContextCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
-                throw new GLException("Error making context current: "+this);
-            }
-        } finally {
-            X11Util.setX11ErrorHandler(false, false);
-        }
-        if (DEBUG && (VERBOSE || newCreated)) {
-            System.err.println(getThreadName() + ": glXMakeCurrent(display " + 
-                               toHexString(dpy)+
-                               ", drawable " + toHexString(drawable.getHandle()) +
-                               ", drawableRead " + toHexString(drawableRead.getHandle()) +
-                               ", context " + toHexString(contextHandle) + ") succeeded");
-        }
-    }
-  }
-
-  protected void releaseImpl() throws GLException {
-    long display = drawable.getNativeSurface().getDisplayHandle();
-    X11Util.setX11ErrorHandler(true, true);
-    try {
-        if (!glXMakeContextCurrent(display, 0, 0, 0)) {
-            throw new GLException("Error freeing OpenGL context");
-        }
-    } finally {
-        X11Util.setX11ErrorHandler(false, false);
-    }
-  }
-
-  protected void destroyImpl() throws GLException {
-    long display = drawable.getNativeSurface().getDisplayHandle();
-    if (DEBUG) {
-      System.err.println("glXDestroyContext(dpy " +
-                         toHexString(display)+
-                         ", ctx " +
-                         toHexString(contextHandle) + ")");
-    }
-    GLX.glXDestroyContext(display, contextHandle);
-    if (DEBUG) {
-      System.err.println("!!! Destroyed OpenGL context " + contextHandle);
-    }
-  }
-
-  protected void copyImpl(GLContext source, int mask) throws GLException {
-    long dst = getHandle();
-    long src = source.getHandle();
-    long display = drawable.getNativeSurface().getDisplayHandle();
-    if (0 == display) {
-      throw new GLException("Connection to X display not yet set up");
-    }
-    GLX.glXCopyContext(display, src, dst, mask);
-    // Should check for X errors and raise GLException
-  }
-
-  protected final void updateGLXProcAddressTable(int major, int minor, int ctp) {
-    if (DEBUG) {
-      System.err.println(getThreadName() + ": !!! Initializing GLX extension address table");
-    }
-    glXQueryExtensionsStringInitialized = false;
-    glXQueryExtensionsStringAvailable = false;
-
-    GLXExtProcAddressTable table = null;
-    synchronized(mappedContextTypeObjectLock) {
-        table = (GLXExtProcAddressTable) mappedGLXProcAddress.get( contextFQN );
-    }
-    if(null != table) {
-        glXExtProcAddressTable = table;
-        if(DEBUG) {
-            System.err.println(getThreadName() + ": !!! GLContext GLX ProcAddressTable reusing key("+contextFQN+") -> "+table.hashCode());
-        }
-    } else {
-        if (glXExtProcAddressTable == null) {
-          glXExtProcAddressTable = new GLXExtProcAddressTable(new GLProcAddressResolver());
-        }
-        resetProcAddressTable(getGLXExtProcAddressTable());
-        synchronized(mappedContextTypeObjectLock) {
-            mappedGLXProcAddress.put(contextFQN, getGLXExtProcAddressTable());
-            if(DEBUG) {
-                System.err.println(getThreadName() + ": !!! GLContext GLX ProcAddressTable mapping key("+contextFQN+") -> "+getGLXExtProcAddressTable().hashCode());
-            }
-        }
-    }
-  }
-
-  public synchronized String getPlatformExtensionsString() {
-    if (!glXQueryExtensionsStringInitialized) {
-      glXQueryExtensionsStringAvailable =
-        getDrawableImpl().getGLDynamicLookupHelper().dynamicLookupFunction("glXQueryExtensionsString") != 0;
-      glXQueryExtensionsStringInitialized = true;
-    }
-    if (glXQueryExtensionsStringAvailable) {
-        NativeSurface ns = drawable.getNativeSurface();
-        String ret = GLX.glXQueryExtensionsString(ns.getDisplayHandle(), ns.getScreenIndex());
-        if (DEBUG) {
-          System.err.println("!!! GLX extensions: " + ret);
-        }
-        return ret;
-    } else {
-      return "";
-    }
-  }
-
-  public boolean isExtensionAvailable(String glExtensionName) {
-    if (glExtensionName.equals("GL_ARB_pbuffer") ||
-        glExtensionName.equals("GL_ARB_pixel_format")) {
-      return getGLDrawable().getFactory().canCreateGLPbuffer(
-          drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice() );
-    }
-    return super.isExtensionAvailable(glExtensionName);
-  }
-
-  protected void setSwapIntervalImpl(int interval) {
-    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
-    if(!glCaps.isOnscreen()) return;
-
-    GLXExt glXExt = getGLXExt();
-    if(0==hasSwapIntervalSGI) {
-        try {
-            hasSwapIntervalSGI = glXExt.isExtensionAvailable("GLX_SGI_swap_control")?1:-1;
-        } catch (Throwable t) { hasSwapIntervalSGI=1; }
-    }
-    if (hasSwapIntervalSGI>0) {
-        try {
-            if( 0 == glXExt.glXSwapIntervalSGI(interval) ) {
-                currentSwapInterval = interval;
-            }
-        } catch (Throwable t) { hasSwapIntervalSGI=-1; }
-    }
-  }
-
-  public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
-    return getGLXExt().glXAllocateMemoryNV(arg0, arg1, arg2, arg3);
-  }
-
-  public int getOffscreenContextPixelDataType() {
-    throw new GLException("Should not call this");
-  }
-
-  public int getOffscreenContextReadBuffer() {
-    throw new GLException("Should not call this");
-  }
-
-  public boolean offscreenImageNeedsVerticalFlip() {
-    throw new GLException("Should not call this");
-  }
-
-  public void bindPbufferToTexture() {
-    throw new GLException("Should not call this");
-  }
-
-  public void releasePbufferFromTexture() {
-    throw new GLException("Should not call this");
-  }
-
-  public String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.append(getClass().getName());
-    sb.append(" [");
-    super.append(sb);
-    sb.append(", direct ");
-    sb.append(isDirect);
-    sb.append("] ");
-    return sb.toString();
-  }
-
-  //----------------------------------------------------------------------
-  // Internals only below this point
-  //
-
-  private boolean isVendorATI = false;
-
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java
deleted file mode 100644
index 9c3737d..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-
-public abstract class X11GLXDrawable extends GLDrawableImpl {
-  protected X11GLXDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
-    super(factory, comp, realized);
-  }
-
-  public GLDynamicLookupHelper getGLDynamicLookupHelper() {
-    return getFactoryImpl().getGLDynamicLookupHelper(0);
-  }
-
-  protected void setRealizedImpl() {
-    if(realized) {
-        X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-        config.updateGraphicsConfiguration();
-
-        if (DEBUG) {
-          System.err.println("!!! X11GLXDrawable.setRealized(true): "+config);
-        }
-    }
-  }
-
-    protected void swapBuffersImpl() {
-        GLX.glXSwapBuffers(getNativeSurface().getDisplayHandle(), getHandle());
-    }
-
-  //---------------------------------------------------------------------------
-  // Internals only below this point
-  //
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java
deleted file mode 100644
index 4412a7a..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java
+++ /dev/null
@@ -1,639 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import java.nio.*;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.x11.*;
-import javax.media.opengl.*;
-
-import com.jogamp.opengl.impl.*;
-import com.jogamp.common.JogampRuntimeException;
-import com.jogamp.common.util.*;
-import com.jogamp.nativewindow.impl.ProxySurface;
-import com.jogamp.nativewindow.impl.x11.*;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-
-public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
-  
-  private static final DesktopGLDynamicLookupHelper x11GLXDynamicLookupHelper;
-
-  static {
-    DesktopGLDynamicLookupHelper tmp = null;
-    try {
-        tmp = new DesktopGLDynamicLookupHelper(new X11GLXDynamicLibraryBundleInfo());
-    } catch (GLException gle) {
-        if(DEBUG) {
-            gle.printStackTrace();
-        }
-    }
-    x11GLXDynamicLookupHelper = tmp;
-    if(null!=x11GLXDynamicLookupHelper) {
-        GLX.getGLXProcAddressTable().reset(x11GLXDynamicLookupHelper);
-    }
-  }
-
-  public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
-      return x11GLXDynamicLookupHelper;
-  }
-
-  public X11GLXDrawableFactory() {
-    super();
-    // Register our GraphicsConfigurationFactory implementations
-    // The act of constructing them causes them to be registered
-    new X11GLXGraphicsConfigurationFactory();
-    if(GLProfile.isAWTAvailable()) {
-        try {
-          ReflectionUtil.createInstance("com.jogamp.opengl.impl.x11.glx.awt.X11AWTGLXGraphicsConfigurationFactory",
-                                        null, getClass().getClassLoader());
-        } catch (JogampRuntimeException jre) { /* n/a .. */ }
-    }
-
-    defaultDevice = new X11GraphicsDevice(X11Util.getNullDisplayName(), AbstractGraphicsDevice.DEFAULT_UNIT);
-
-    // Init shared resources via own thread
-    // Will be released via ShutdownHook
-    sharedResourcesRunner = new SharedResourcesRunner();    
-    sharedResourcesThread = new Thread(sharedResourcesRunner, Thread.currentThread().getName()+"-SharedResourcesRunner");
-    sharedResourcesThread.setDaemon(true); // Allow JVM to exit, even if this one is running
-    sharedResourcesThread.start();
-  }
-
-  class SharedResourcesRunner implements Runnable {
-      boolean ready = false;
-      boolean released = false;
-      boolean shouldRelease = false;
-      String initConnection = null;
-      SharedResource result = null;
-
-      public final void initializeAndWait(String connection) {
-          // wait until thread becomes ready to init new device,
-          // pass the device and release the sync
-          String threadName = Thread.currentThread().getName();
-          if (DEBUG) {
-              System.err.println(threadName+ " initializeAndWait START: "+connection);
-          }
-          synchronized (this) {
-              while (!ready) {
-                  try {
-                      this.wait();
-                  } catch (InterruptedException ex) { }
-              }
-              if (DEBUG) {
-                  System.err.println(threadName+ " initializeAndWait set command: "+connection);
-              }
-              initConnection = connection;
-              this.notifyAll();
-
-              // wait until thread has initialized the device
-              while (!ready || null != initConnection) {
-                  try {
-                      this.wait();
-                  } catch (InterruptedException ex) { }
-              }
-              if (DEBUG) {
-                  System.err.println(threadName+ " initializeAndWait done: "+connection);
-              }
-          }
-          // done
-      }
-
-      public final void releaseAndWait() {
-          synchronized (this) {
-              shouldRelease = true;
-              this.notifyAll();
-
-              while (!released) {
-                  try {
-                      this.wait();
-                  } catch (InterruptedException ex) {
-                  }
-              }
-          }
-      }
-
-      public final void run() {
-          String threadName = Thread.currentThread().getName();
-
-          synchronized (this) {
-              if (DEBUG) {
-                  System.err.println(threadName+ " STARTED -> ready");
-              }
-
-              while (!shouldRelease) {
-                  try {
-                      // wait for stop or init
-                      ready = true;
-                      this.wait();
-                  } catch (InterruptedException ex) { }
-                  ready = false;
-
-                  if(!shouldRelease && null!=initConnection) {
-                      if (DEBUG) {
-                          System.err.println(threadName+ " create Shared for: "+initConnection);
-                      }
-                      SharedResource sr = createSharedResource(initConnection);
-                      if(null!=sr) {
-                        synchronized(sharedMap) {
-                            sharedMap.put(initConnection, sr);
-                        }
-                      }
-                      if (DEBUG) {
-                          String msg = "Info: (" + threadName + ") initializedSharedResource for device connection: "+initConnection+" -> ready";
-                          System.err.println(msg);
-                          Throwable t = new Throwable(msg);
-                          t.printStackTrace();
-                      }
-                  }
-                  initConnection = null;
-                  notifyAll();
-              }
-
-              if (DEBUG) {
-                  System.err.println(threadName+ " release START");
-              }
-
-              releaseSharedResources();
-
-              if (DEBUG) {
-                  System.err.println(threadName+ " release END");
-              }
-
-              released = true;
-              ready = false;
-              notifyAll();
-          }
-      }
-          
-      private final SharedResource createSharedResource(String connection) {
-          X11GraphicsDevice sharedDevice = new X11GraphicsDevice(X11Util.createDisplay(connection), AbstractGraphicsDevice.DEFAULT_UNIT);
-          sharedDevice.setCloseDisplay(true);
-          X11Util.lockDefaultToolkit(sharedDevice.getHandle()); // OK
-          try {
-              String vendorName = GLXUtil.getVendorName(sharedDevice.getHandle());
-              X11GraphicsScreen sharedScreen = new X11GraphicsScreen(sharedDevice, 0);
-              X11DummyGLXDrawable sharedDrawable = X11DummyGLXDrawable.create(sharedScreen, X11GLXDrawableFactory.this,
-                                                                              GLProfile.getDefault(sharedDevice));
-              if (null == sharedScreen || null == sharedDrawable) {
-                  throw new GLException("Couldn't init shared screen(" + sharedScreen + ")/drawable(" + sharedDrawable + ")");
-              }
-              X11GLXContext sharedContext;
-              try {
-                  X11GLXContext ctx = (X11GLXContext) sharedDrawable.createContext(null);
-                  ctx.makeCurrent();
-                  ctx.release();
-                  sharedContext = ctx;
-              } catch (Throwable t) {
-                  throw new GLException("X11GLXDrawableFactory - Could not initialize shared resources", t);
-              }
-              if (null == sharedContext) {
-                  throw new GLException("X11GLXDrawableFactory - Shared Context is null");
-              }
-              if (DEBUG) {
-                  System.err.println("!!! SharedDevice: "+sharedDevice);
-                  System.err.println("!!! SharedScreen: "+sharedScreen);
-                  System.err.println("!!! SharedContext: "+sharedContext);
-                  System.err.println("!!! Vendor: "+vendorName);
-              }
-              return new SharedResource(sharedDevice, sharedScreen, sharedDrawable, sharedContext, vendorName);
-          } finally {
-              X11Util.unlockDefaultToolkit(sharedDevice.getHandle()); // OK
-          }
-      }
-
-      private final void releaseSharedResources() {
-          Collection/*<SharedResource>*/ sharedResources = sharedMap.values();
-          for(Iterator iter=sharedResources.iterator(); iter.hasNext(); ) {
-              SharedResource sr = (SharedResource) iter.next();
-
-              if (DEBUG) {
-                  System.err.println("!!! Shutdown Shared:");
-                  System.err.println("!!!          Device  : "+sr.device);
-                  System.err.println("!!!          Screen  : "+sr.screen);
-                  System.err.println("!!!          Drawable: "+sr.drawable);
-                  System.err.println("!!!          CTX     : "+sr.context);
-              }
-
-              if (null != sr.context) {
-                  // may cause JVM SIGSEGV: sharedContext.destroy();
-                  sr.context = null;
-              }
-
-              if (null != sr.drawable) {
-                  // may cause JVM SIGSEGV: sharedDrawable.destroy();
-                  sr.drawable = null;
-              }
-
-              if (null != sr.screen) {
-                  sr.screen = null;
-              }
-
-              if (null != sr.device) {
-                  sr.device.close();
-                  sr.device=null;
-              }
-          }
-          sharedMap.clear();
-      }
-  }
-  Thread sharedResourcesThread = null;
-  SharedResourcesRunner sharedResourcesRunner=null;
-
-  static class SharedResource {
-      private X11GraphicsDevice device;
-      private X11GraphicsScreen screen;
-      private X11DummyGLXDrawable drawable;
-      private X11GLXContext context;
-      private String vendorName;
-      private boolean isVendorATI;
-      private boolean isVendorNVIDIA;
-      
-      SharedResource(X11GraphicsDevice dev, X11GraphicsScreen scrn, X11DummyGLXDrawable draw, X11GLXContext ctx, String vendor) {
-          device = dev;
-          screen = scrn;
-          drawable = draw;
-          context = ctx;
-          vendorName = vendor;
-          isVendorATI = GLXUtil.isVendorATI(vendorName);
-          isVendorNVIDIA = GLXUtil.isVendorNVIDIA(vendorName);          
-      }
-  }
-  HashMap/*<connection, SharedResource>*/ sharedMap = new HashMap();
-  X11GraphicsDevice defaultDevice;
-
-  public final AbstractGraphicsDevice getDefaultDevice() {
-      return defaultDevice;
-  }
-
-  public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
-      if(device instanceof X11GraphicsDevice) {
-          return true;
-      }
-      return false;
-  }
-
-  HashSet devicesTried = new HashSet();
-  private final boolean getDeviceTried(String connection) {
-      synchronized(devicesTried) {
-          return devicesTried.contains(connection);
-      }
-  }
-  private final void addDeviceTried(String connection) {
-      synchronized(devicesTried) {
-          devicesTried.add(connection);
-      }
-  }
-
-  protected final SharedResource getOrCreateShared(AbstractGraphicsDevice device) {
-    String connection = device.getConnection();
-    boolean deviceTried = getDeviceTried(connection);
-    SharedResource sr;
-    synchronized(sharedMap) {
-      sr = (SharedResource) sharedMap.get(connection);
-    }
-
-    if (DEBUG) {
-      System.err.println("getOrCreateShared() "+connection+": has shared "+(null!=sr)+", already tried "+deviceTried);
-    }
-
-    if(null==sr && !deviceTried) {
-        if (DEBUG) {
-          System.err.println("getOrCreateShared() "+connection+": trying");
-        }
-        addDeviceTried(connection);
-        sharedResourcesRunner.initializeAndWait(connection);
-        synchronized(sharedMap) {
-            sr = (SharedResource) sharedMap.get(connection);
-        }
-        if(DEBUG) {
-            Throwable t = new Throwable("getOrCreateSharedl() "+connection+": done");
-            t.printStackTrace();
-        }
-    }
-    return sr;
-  }
-
-  protected final GLContext getOrCreateSharedContextImpl(AbstractGraphicsDevice device) {
-    SharedResource sr = getOrCreateShared(device);
-    if(null!=sr) {
-      return sr.context;
-    }
-    return null;
-  }
-
-  protected final long getOrCreateSharedDpy(AbstractGraphicsDevice device) {
-    SharedResource sr = getOrCreateShared(device);
-    if(null!=sr) {
-        return sr.device.getHandle();
-    }
-    return 0;
-  }
-
-  protected final String getVendorName(AbstractGraphicsDevice device) {
-    SharedResource sr = getOrCreateShared(device);
-    if(null!=sr) {
-      return sr.vendorName;
-    }
-    return GLXUtil.getVendorName(device.getHandle());
-  }
-
-  protected final boolean isVendorATI(AbstractGraphicsDevice device) {
-    SharedResource sr = getOrCreateShared(device);
-    if(null!=sr) {
-      return sr.isVendorATI;
-    }
-    return GLXUtil.isVendorATI(device.getHandle());
-  }
-
-  protected final boolean isVendorNVIDIA(AbstractGraphicsDevice device) {
-    SharedResource sr = getOrCreateShared(device);
-    if(null!=sr) {
-      return sr.isVendorNVIDIA;
-    }
-    return GLXUtil.isVendorNVIDIA(device.getHandle());
-  }
-
-  protected final void shutdownInstance() {
-    sharedResourcesRunner.releaseAndWait();
-
-    // Don't really close pending Display connections,
-    // since this may trigger a JVM exception
-    X11Util.shutdown( false, DEBUG );
-  }
-
-  protected final GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
-    if (target == null) {
-      throw new IllegalArgumentException("Null target");
-    }
-    return new X11OnscreenGLXDrawable(this, target);
-  }
-
-  protected final GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
-    if (target == null) {
-      throw new IllegalArgumentException("Null target");
-    }
-    return new X11OffscreenGLXDrawable(this, target);
-  }
-
-  public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device) {
-      return glxVersionGreaterEqualThan(device, 1, 3); 
-  }
-
-  private boolean glxVersionsQueried = false;
-  private int     glxVersionMajor=0, glxVersionMinor=0;
-  protected final boolean glxVersionGreaterEqualThan(AbstractGraphicsDevice device, int majorReq, int minorReq) {
-    if (!glxVersionsQueried) {
-        if(null == device) {
-            SharedResource sr = getOrCreateShared(defaultDevice);
-            if(null!=sr) {
-                device = sr.device;
-            }
-        }
-        if(null == device) {
-            throw new GLException("FIXME: No AbstractGraphicsDevice (passed or shared-device");
-        }
-        device.lock(); // OK
-        try {
-            long display = device.getHandle();
-            int[] major = new int[1];
-            int[] minor = new int[1];
-
-            GLXUtil.getGLXVersion(display, major, minor);
-            if (DEBUG) {
-              System.err.println("!!! GLX version: major " + major[0] +
-                                 ", minor " + minor[0]);
-            }
-
-            glxVersionMajor = major[0];
-            glxVersionMinor = minor[0];
-            glxVersionsQueried = true;
-        } finally {
-            device.unlock(); // OK
-        }
-    }
-    return ( glxVersionMajor > majorReq ) || ( glxVersionMajor == majorReq && glxVersionMinor >= minorReq ) ;
-  }
-
-  protected final GLDrawableImpl createGLPbufferDrawableImpl(final NativeSurface target) {
-    if (target == null) {
-      throw new IllegalArgumentException("Null target");
-    }
-
-    GLDrawableImpl pbufferDrawable;
-
-    AbstractGraphicsConfiguration config = target.getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    AbstractGraphicsDevice device = config.getScreen().getDevice();
-
-    /** 
-     * Due to the ATI Bug https://bugzilla.mozilla.org/show_bug.cgi?id=486277,
-     * we need to have a context current on the same Display to create a PBuffer.
-     * The dummy context shall also use the same Display,
-     * since switching Display in this regard is another ATI bug.
-     */
-    SharedResource sr = getOrCreateShared(device);
-    if( null!=sr && sr.isVendorATI && null == GLContext.getCurrent() ) {
-        synchronized(sr.context) {
-            sr.context.makeCurrent();
-            try {
-                pbufferDrawable = new X11PbufferGLXDrawable(this, target);
-            } finally {
-                sr.context.release();
-            }
-        }
-    } else {
-        pbufferDrawable = new X11PbufferGLXDrawable(this, target);
-    }
-    return pbufferDrawable;
-  }
-
-
-  protected final NativeSurface createOffscreenSurfaceImpl(GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser,
-                                                           int width, int height) {
-    X11GraphicsScreen screen = null;
-    SharedResource sr = getOrCreateShared(defaultDevice);
-    if(null!=sr) {
-        screen = sr.screen;
-    }
-    if(null==screen) {
-        return null;
-    }
-
-    ProxySurface ns = new ProxySurface(
-               X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, screen) );
-    if(ns != null) {
-        ns.setSize(width, height);
-    }
-    return ns;
-  }
-
-  protected final GLContext createExternalGLContextImpl() {
-    return X11ExternalGLXContext.create(this, null);
-  }
-
-  public final boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
-    return canCreateGLPbuffer(device);
-  }
-
-  protected final GLDrawable createExternalGLDrawableImpl() {
-    return X11ExternalGLXDrawable.create(this, null);
-  }
-
-  public final boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) {
-    return false;
-  }
-
-  public final GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
-    throws GLException {
-    throw new GLException("Unimplemented on this platform");
-  }
-
-  //----------------------------------------------------------------------
-  // Gamma-related functionality
-  //
-
-  private boolean gotGammaRampLength;
-  private int gammaRampLength;
-  protected final synchronized int getGammaRampLength() {
-    if (gotGammaRampLength) {
-      return gammaRampLength;
-    }
-
-    long display = getOrCreateSharedDpy(defaultDevice);
-    if(0 == display) {
-        return 0;
-    }
-
-    int[] size = new int[1];
-    boolean res = X11Util.XF86VidModeGetGammaRampSize(display,
-                                                      X11Util.DefaultScreen(display),
-                                                      size, 0);
-    if (!res) {
-      return 0;
-    }
-    gotGammaRampLength = true;
-    gammaRampLength = size[0];
-    return gammaRampLength;
-  }
-
-  protected final boolean setGammaRamp(float[] ramp) {
-    long display = getOrCreateSharedDpy(defaultDevice);
-    if(0 == display) {
-        return false;
-    }
-
-    int len = ramp.length;
-    short[] rampData = new short[len];
-    for (int i = 0; i < len; i++) {
-      rampData[i] = (short) (ramp[i] * 65535);
-    }
-
-    boolean res = X11Util.XF86VidModeSetGammaRamp(display,
-                                              X11Util.DefaultScreen(display),
-                                              rampData.length,
-                                              rampData, 0,
-                                              rampData, 0,
-                                              rampData, 0);
-    return res;
-  }
-
-  protected final Buffer getGammaRamp() {
-    long display = getOrCreateSharedDpy(defaultDevice);
-    if(0 == display) {
-        return null;
-    }
-
-    int size = getGammaRampLength();
-    ShortBuffer rampData = ShortBuffer.wrap(new short[3 * size]);
-    rampData.position(0);
-    rampData.limit(size);
-    ShortBuffer redRampData = rampData.slice();
-    rampData.position(size);
-    rampData.limit(2 * size);
-    ShortBuffer greenRampData = rampData.slice();
-    rampData.position(2 * size);
-    rampData.limit(3 * size);
-    ShortBuffer blueRampData = rampData.slice();
-
-    boolean res = X11Util.XF86VidModeGetGammaRamp(display,
-                                              X11Util.DefaultScreen(display),
-                                              size,
-                                              redRampData,
-                                              greenRampData,
-                                              blueRampData);
-    if (!res) {
-      return null;
-    }
-    return rampData;
-  }
-
-  protected final void resetGammaRamp(Buffer originalGammaRamp) {
-    if (originalGammaRamp == null) {
-        return; // getGammaRamp failed originally
-    }
-    long display = getOrCreateSharedDpy(defaultDevice);
-    if(0 == display) {
-        return;
-    }
-
-    ShortBuffer rampData = (ShortBuffer) originalGammaRamp;
-    int capacity = rampData.capacity();
-    if ((capacity % 3) != 0) {
-      throw new IllegalArgumentException("Must not be the original gamma ramp");
-    }
-    int size = capacity / 3;
-    rampData.position(0);
-    rampData.limit(size);
-    ShortBuffer redRampData = rampData.slice();
-    rampData.position(size);
-    rampData.limit(2 * size);
-    ShortBuffer greenRampData = rampData.slice();
-    rampData.position(2 * size);
-    rampData.limit(3 * size);
-    ShortBuffer blueRampData = rampData.slice();
-
-    X11Util.XF86VidModeSetGammaRamp(display,
-                                X11Util.DefaultScreen(display),
-                                size,
-                                redRampData,
-                                greenRampData,
-                                blueRampData);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
deleted file mode 100644
index d7905aa..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.impl.x11.glx;
-
-import com.jogamp.opengl.impl.*;
-import java.util.*;
-
-public class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo  {
-    protected X11GLXDynamicLibraryBundleInfo() {
-        super();
-    }
-
-    public List getToolLibNames() {
-        List/*<List>*/ libNamesList = new ArrayList();
-
-        List/*<String>*/ glesLibNames = new ArrayList();
-
-        // Be aware that on DRI systems, eg ATI fglrx, etc, 
-        // you have to set LIBGL_DRIVERS_PATH env variable.
-        // Eg on Ubuntu 64bit systems this is:
-        //    export LIBGL_DRIVERS_PATH=/usr/lib/fglrx/dri:/usr/lib32/fglrx/dri
-        //
-
-        // this is the default GL lib name, according to the spec
-        glesLibNames.add("libGL.so.1");
-
-        // try this one as well, if spec fails
-        glesLibNames.add("libGL.so");
-
-        // last but not least .. the generic one
-        glesLibNames.add("GL");
-
-        libNamesList.add(glesLibNames);
-
-        return libNamesList;
-    }
-
-    /** 
-     * This respects old DRI requirements:<br>
-     * <pre>
-     * http://dri.sourceforge.net/doc/DRIuserguide.html
-     * </pre>
-     */
-    public boolean shallLinkGlobal() { return true; }
-
-    public final List getToolGetProcAddressFuncNameList() {
-        List res = new ArrayList();
-        res.add("glXGetProcAddressARB");
-        res.add("glXGetProcAddress");
-        return res;
-    }
-
-    public final long toolDynamicLookupFunction(long toolGetProcAddressHandle, String funcName) {
-        return GLX.glXGetProcAddress(toolGetProcAddressHandle, funcName);
-    }
-}
-
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java
deleted file mode 100644
index 746be6c..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import com.jogamp.common.nio.PointerBuffer;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.x11.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.nativewindow.impl.x11.*;
-
-public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implements Cloneable {
-    protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
-    
-    public static final int MAX_ATTRIBS = 128;
-    private long fbConfig;
-    private int  fbConfigID;
-    private GLCapabilitiesChooser chooser; 
-
-    public X11GLXGraphicsConfiguration(X11GraphicsScreen screen, 
-                                       GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser,
-                                       XVisualInfo info, long fbcfg, int fbcfgID) {
-        super(screen, capsChosen, capsRequested, info);
-        this.chooser=chooser;
-        fbConfig = fbcfg;
-        fbConfigID = fbcfgID;
-    }
-
-    public static X11GLXGraphicsConfiguration create(GLProfile glp, X11GraphicsScreen x11Screen, int fbcfgID) {
-      long display = x11Screen.getDevice().getHandle();
-      if(0==display) {
-          throw new GLException("Display null of "+x11Screen);
-      }
-      int screen = x11Screen.getIndex();
-      long fbcfg = glXFBConfigID2FBConfig(display, screen, fbcfgID);
-      if(0==fbcfg) {
-          throw new GLException("FBConfig null of "+toHexString(fbcfgID));
-      }
-      if(null==glp) {
-        glp = GLProfile.getDefault(x11Screen.getDevice());
-      }
-      GLCapabilitiesImmutable caps = GLXFBConfig2GLCapabilities(glp, display, fbcfg, true, true, true, GLXUtil.isMultisampleAvailable(display));
-      if(null==caps) {
-          throw new GLException("GLCapabilities null of "+toHexString(fbcfg));
-      }
-      XVisualInfo xvi = GLX.glXGetVisualFromFBConfig(display, fbcfg);
-      if(null==xvi) {
-          throw new GLException("XVisualInfo null of "+toHexString(fbcfg));
-      }
-      return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser(), xvi, fbcfg, fbcfgID);
-    }
-
-    public Object clone() {
-        return super.clone();
-    }
-
-    public long getFBConfig()   { return fbConfig; }
-    public int  getFBConfigID() { return fbConfigID; }
-
-    protected void updateGraphicsConfiguration() {
-        X11GLXGraphicsConfiguration newConfig = (X11GLXGraphicsConfiguration)
-            GraphicsConfigurationFactory.getFactory(getScreen().getDevice()).chooseGraphicsConfiguration(
-                getChosenCapabilities(), getRequestedCapabilities(), chooser, getScreen());
-        if(null!=newConfig) {
-            // FIXME: setScreen( ... );
-            setXVisualInfo(newConfig.getXVisualInfo());
-            setChosenCapabilities(newConfig.getChosenCapabilities());
-            fbConfig = newConfig.getFBConfig();
-            fbConfigID = newConfig.getFBConfigID();
-            if(DEBUG) {
-                System.err.println("!!! updateGraphicsConfiguration: "+this);
-            }
-        }
-    }
-
-    private static int nonZeroOrDontCare(int value) {
-        return value != 0 ? value : (int)GLX.GLX_DONT_CARE ;
-    }
-
-    public static int[] GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
-                                                  boolean forFBAttr,
-                                                  boolean isMultisampleAvailable,
-                                                  long display,
-                                                  int screen) 
-    {
-        int colorDepth = (caps.getRedBits() +
-                          caps.getGreenBits() +
-                          caps.getBlueBits());
-        if (colorDepth < 15) {
-          throw new GLException("Bit depths < 15 (i.e., non-true-color) not supported");
-        }
-        int[] res = new int[MAX_ATTRIBS];
-        int idx = 0;
-
-        if (forFBAttr) {
-          res[idx++] = GLX.GLX_DRAWABLE_TYPE;
-          res[idx++] = caps.isOnscreen() ? ( GLX.GLX_WINDOW_BIT ) : ( caps.isPBuffer() ? GLX.GLX_PBUFFER_BIT : GLX.GLX_PIXMAP_BIT ) ;
-        }
-
-        if (forFBAttr) {
-          res[idx++] = GLX.GLX_RENDER_TYPE;
-          res[idx++] = GLX.GLX_RGBA_BIT;
-        } else {
-          res[idx++] = GLX.GLX_RGBA;
-        }
-
-        // FIXME: Still a bug is Mesa: PBUFFER && GLX_STEREO==GL_FALSE ?
-        if (forFBAttr) {
-            res[idx++] = GLX.GLX_DOUBLEBUFFER;
-            res[idx++] = caps.getDoubleBuffered()?GL.GL_TRUE:GL.GL_FALSE;
-            res[idx++] = GLX.GLX_STEREO;
-            res[idx++] = caps.getStereo()?GL.GL_TRUE:GL.GL_FALSE;
-            res[idx++] = GLX.GLX_TRANSPARENT_TYPE;
-            res[idx++] = caps.isBackgroundOpaque()?GLX.GLX_NONE:GLX.GLX_TRANSPARENT_RGB;
-            if(!caps.isBackgroundOpaque()) {
-                res[idx++] = GLX.GLX_TRANSPARENT_RED_VALUE;
-                res[idx++] = caps.getTransparentRedValue()>=0?caps.getTransparentRedValue():(int)GLX.GLX_DONT_CARE;
-                res[idx++] = GLX.GLX_TRANSPARENT_GREEN_VALUE;
-                res[idx++] = caps.getTransparentGreenValue()>=0?caps.getTransparentGreenValue():(int)GLX.GLX_DONT_CARE;
-                res[idx++] = GLX.GLX_TRANSPARENT_BLUE_VALUE;
-                res[idx++] = caps.getTransparentBlueValue()>=0?caps.getTransparentBlueValue():(int)GLX.GLX_DONT_CARE;
-                res[idx++] = GLX.GLX_TRANSPARENT_ALPHA_VALUE;
-                res[idx++] = caps.getTransparentAlphaValue()>=0?caps.getTransparentAlphaValue():(int)GLX.GLX_DONT_CARE;
-            }
-        } else {
-            if (caps.getDoubleBuffered()) {
-              res[idx++] = GLX.GLX_DOUBLEBUFFER;
-            }
-            if (caps.getStereo()) {
-              res[idx++] = GLX.GLX_STEREO;
-            }
-        }
-
-        res[idx++] = GLX.GLX_RED_SIZE;
-        res[idx++] = caps.getRedBits();
-        res[idx++] = GLX.GLX_GREEN_SIZE;
-        res[idx++] = caps.getGreenBits();
-        res[idx++] = GLX.GLX_BLUE_SIZE;
-        res[idx++] = caps.getBlueBits();
-        res[idx++] = GLX.GLX_ALPHA_SIZE;
-        res[idx++] = caps.getAlphaBits();
-        res[idx++] = GLX.GLX_DEPTH_SIZE;
-        res[idx++] = caps.getDepthBits();
-        if (caps.getStencilBits() > 0) {
-          res[idx++] = GLX.GLX_STENCIL_SIZE;
-          res[idx++] = caps.getStencilBits();
-        }
-        if (caps.getAccumRedBits()   > 0 ||
-            caps.getAccumGreenBits() > 0 ||
-            caps.getAccumBlueBits()  > 0 ||
-            caps.getAccumAlphaBits() > 0) {
-          res[idx++] = GLX.GLX_ACCUM_RED_SIZE;
-          res[idx++] = caps.getAccumRedBits();
-          res[idx++] = GLX.GLX_ACCUM_GREEN_SIZE;
-          res[idx++] = caps.getAccumGreenBits();
-          res[idx++] = GLX.GLX_ACCUM_BLUE_SIZE;
-          res[idx++] = caps.getAccumBlueBits();
-          res[idx++] = GLX.GLX_ACCUM_ALPHA_SIZE;
-          res[idx++] = caps.getAccumAlphaBits();
-        }
-        if (isMultisampleAvailable && caps.getSampleBuffers()) {
-          res[idx++] = GLX.GLX_SAMPLE_BUFFERS;
-          res[idx++] = GL.GL_TRUE;
-          res[idx++] = GLX.GLX_SAMPLES;
-          res[idx++] = caps.getNumSamples();
-        }
-        if (caps.isPBuffer()) {
-          if (caps.getPbufferFloatingPointBuffers()) {
-            String glXExtensions = GLX.glXQueryExtensionsString(display, screen);
-            if (glXExtensions == null ||
-                glXExtensions.indexOf("GLX_NV_float_buffer") < 0) {
-              throw new GLException("Floating-point pbuffers on X11 currently require NVidia hardware: "+glXExtensions);
-            }
-            res[idx++] = GLXExt.GLX_FLOAT_COMPONENTS_NV;
-            res[idx++] = GL.GL_TRUE;
-          }
-        }
-        res[idx++] = 0;
-        return res;
-  }
-
-  // FBConfig
-
-  public static boolean GLXFBConfigValid(long display, long fbcfg) {
-    int[] tmp = new int[1];
-    if(GLX.GLX_BAD_ATTRIBUTE == GLX.glXGetFBConfigAttrib(display, fbcfg, GLX.GLX_RENDER_TYPE, tmp, 0)) {
-      return false;
-    }
-    return true;
-  }
-
-  public static boolean GLXFBConfigDrawableTypeVerify(int val, boolean onscreen, boolean usePBuffer) {
-    boolean res;
-
-    if ( onscreen ) {
-        res = ( 0 != (val & GLX.GLX_WINDOW_BIT) ) ;
-    } else {
-        if ( usePBuffer ) {
-            res = ( 0 != (val & GLX.GLX_PBUFFER_BIT) ) ;
-        } else {
-            res = ( 0 != (val & GLX.GLX_PIXMAP_BIT) ) ;
-        }
-    }
-
-    return res;
-  }
-
-  public static GLCapabilitiesImmutable GLXFBConfig2GLCapabilities(GLProfile glp, long display, long fbcfg,
-                                                                   boolean relaxed, boolean onscreen, boolean usePBuffer,
-                                                                   boolean isMultisampleAvailable) {
-    int[] tmp = new int[1];
-    int val;
-    val = glXGetFBConfig(display, fbcfg, GLX.GLX_RENDER_TYPE, tmp, 0);
-    if (val != GLX.GLX_RGBA_BIT) {
-      if(DEBUG) {
-        System.err.println("FBConfig ("+toHexString(fbcfg)+") does not support RGBA: "+toHexString(val));
-      }
-      return null;
-    }
-    GLCapabilities res = new GLCapabilities(glp);
-
-    val = glXGetFBConfig(display, fbcfg, GLX.GLX_DRAWABLE_TYPE, tmp, 0);
-    if(GLXFBConfigDrawableTypeVerify(val, onscreen, usePBuffer)) {
-        res.setOnscreen(onscreen);
-        res.setPBuffer(usePBuffer);
-    } else if(relaxed) {
-        res.setOnscreen( 0 != (val & GLX.GLX_WINDOW_BIT) );
-        res.setPBuffer ( 0 != (val & GLX.GLX_PBUFFER_BIT) );
-    } else {
-        if(DEBUG) {
-          System.err.println("FBConfig ("+toHexString(fbcfg)+") GLX_DRAWABLE_TYPE does not match: req(onscrn "+onscreen+", pbuffer "+usePBuffer+"), got(onscreen "+( 0 != (val & GLX.GLX_WINDOW_BIT) )+", pbuffer "+( 0 != (val & GLX.GLX_PBUFFER_BIT) )+", pixmap "+( 0 != (val & GLX.GLX_PIXMAP_BIT) )+")");
-        }
-        return null;
-    }
-    res.setDoubleBuffered(glXGetFBConfig(display, fbcfg, GLX.GLX_DOUBLEBUFFER,     tmp, 0) != 0);
-    res.setStereo        (glXGetFBConfig(display, fbcfg, GLX.GLX_STEREO,           tmp, 0) != 0);
-    res.setHardwareAccelerated(glXGetFBConfig(display, fbcfg, GLX.GLX_CONFIG_CAVEAT, tmp, 0) != GLX.GLX_SLOW_CONFIG);
-    res.setDepthBits     (glXGetFBConfig(display, fbcfg, GLX.GLX_DEPTH_SIZE,       tmp, 0));
-    res.setStencilBits   (glXGetFBConfig(display, fbcfg, GLX.GLX_STENCIL_SIZE,     tmp, 0));
-    res.setRedBits       (glXGetFBConfig(display, fbcfg, GLX.GLX_RED_SIZE,         tmp, 0));
-    res.setGreenBits     (glXGetFBConfig(display, fbcfg, GLX.GLX_GREEN_SIZE,       tmp, 0));
-    res.setBlueBits      (glXGetFBConfig(display, fbcfg, GLX.GLX_BLUE_SIZE,        tmp, 0));
-    res.setAlphaBits     (glXGetFBConfig(display, fbcfg, GLX.GLX_ALPHA_SIZE,       tmp, 0));
-    res.setAccumRedBits  (glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_RED_SIZE,   tmp, 0));
-    res.setAccumGreenBits(glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_GREEN_SIZE, tmp, 0));
-    res.setAccumBlueBits (glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_BLUE_SIZE,  tmp, 0));
-    res.setAccumAlphaBits(glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_ALPHA_SIZE, tmp, 0));
-    if (isMultisampleAvailable) {
-      res.setSampleBuffers(glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLE_BUFFERS, tmp, 0) != 0);
-      res.setNumSamples   (glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLES,        tmp, 0));
-    }
-    res.setBackgroundOpaque(glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_TYPE, tmp, 0) == GLX.GLX_NONE);
-    if(!res.isBackgroundOpaque()) {
-        glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_RED_VALUE,  tmp, 0);
-        res.setTransparentRedValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
-
-        glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_GREEN_VALUE,  tmp, 0);
-        res.setTransparentGreenValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
-
-        glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_BLUE_VALUE,  tmp, 0);
-        res.setTransparentBlueValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
-
-        glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_ALPHA_VALUE,  tmp, 0);
-        res.setTransparentAlphaValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
-    }
-    try { 
-        res.setPbufferFloatingPointBuffers(glXGetFBConfig(display, fbcfg, GLXExt.GLX_FLOAT_COMPONENTS_NV, tmp, 0) != GL.GL_FALSE);
-    } catch (Exception e) {}
-    return res;
-  }
-
-  private static String glXGetFBConfigErrorCode(int err) {
-    switch (err) {
-      case GLX.GLX_NO_EXTENSION:  return "GLX_NO_EXTENSION";
-      case GLX.GLX_BAD_ATTRIBUTE: return "GLX_BAD_ATTRIBUTE";
-      default:                return "Unknown error code " + err;
-    }
-  }
-
-  public static int glXGetFBConfig(long display, long cfg, int attrib, int[] tmp, int tmp_offset) {
-    if (display == 0) {
-      throw new GLException("No display connection");
-    }
-    int res = GLX.glXGetFBConfigAttrib(display, cfg, attrib, tmp, tmp_offset);
-    if (res != 0) {
-      throw new GLException("glXGetFBConfig("+toHexString(attrib)+") failed: error code " + glXGetFBConfigErrorCode(res));
-    }
-    return tmp[tmp_offset];
-  }
-
-  public static int glXFBConfig2FBConfigID(long display, long cfg) {
-      int[] tmpID = new int[1];
-      return glXGetFBConfig(display, cfg, GLX.GLX_FBCONFIG_ID, tmpID, 0);
-  }
-
-  public static long glXFBConfigID2FBConfig(long display, int screen, int id) {
-      int[] attribs = new int[] { GLX.GLX_FBCONFIG_ID, id, 0 };
-      int[] count = { -1 };
-      PointerBuffer fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, 0, count, 0);
-      if (fbcfgsL == null || fbcfgsL.limit()<1) {
-          return 0;
-      }
-      return fbcfgsL.get(0);
-  }
-
-  // Visual Info
-
-  public static XVisualInfo XVisualID2XVisualInfo(long display, long visualID) {
-      int[] count = new int[1];
-      XVisualInfo template = XVisualInfo.create();
-      template.setVisualid(visualID);
-      XVisualInfo[] infos = X11Util.XGetVisualInfo(display, X11Lib.VisualIDMask, template, count, 0);
-      if (infos == null || infos.length == 0) {
-            return null;
-      }  
-      XVisualInfo res = XVisualInfo.create(infos[0]);
-      if (DEBUG) {
-        System.err.println("!!! Fetched XVisualInfo for visual ID " + toHexString(visualID));
-        System.err.println("!!! Resulting XVisualInfo: visualid = " + toHexString(res.getVisualid()));
-      }
-      return res;
-  }
-
-  public static GLCapabilitiesImmutable XVisualInfo2GLCapabilities(GLProfile glp, long display, XVisualInfo info,
-                                                                   boolean onscreen, boolean usePBuffer, boolean isMultisampleEnabled) {
-    int[] tmp = new int[1];
-    int val = glXGetConfig(display, info, GLX.GLX_USE_GL, tmp, 0);
-    if (val == 0) {
-      if(DEBUG) {
-        System.err.println("Visual ("+toHexString(info.getVisualid())+") does not support OpenGL");
-      }
-      return null;
-    }
-    val = glXGetConfig(display, info, GLX.GLX_RGBA, tmp, 0);
-    if (val == 0) {
-      if(DEBUG) {
-        System.err.println("Visual ("+toHexString(info.getVisualid())+") does not support RGBA");
-      }
-      return null;
-    }
-    GLCapabilities res = new GLCapabilities(glp);
-    res.setOnscreen      (onscreen);
-    res.setPBuffer       (usePBuffer);
-    res.setDoubleBuffered(glXGetConfig(display, info, GLX.GLX_DOUBLEBUFFER,     tmp, 0) != 0);
-    res.setStereo        (glXGetConfig(display, info, GLX.GLX_STEREO,           tmp, 0) != 0);
-    // Note: use of hardware acceleration is determined by
-    // glXCreateContext, not by the XVisualInfo. Optimistically claim
-    // that all GLCapabilities have the capability to be hardware
-    // accelerated.
-    res.setHardwareAccelerated(true);
-    res.setDepthBits     (glXGetConfig(display, info, GLX.GLX_DEPTH_SIZE,       tmp, 0));
-    res.setStencilBits   (glXGetConfig(display, info, GLX.GLX_STENCIL_SIZE,     tmp, 0));
-    res.setRedBits       (glXGetConfig(display, info, GLX.GLX_RED_SIZE,         tmp, 0));
-    res.setGreenBits     (glXGetConfig(display, info, GLX.GLX_GREEN_SIZE,       tmp, 0));
-    res.setBlueBits      (glXGetConfig(display, info, GLX.GLX_BLUE_SIZE,        tmp, 0));
-    res.setAlphaBits     (glXGetConfig(display, info, GLX.GLX_ALPHA_SIZE,       tmp, 0));
-    res.setAccumRedBits  (glXGetConfig(display, info, GLX.GLX_ACCUM_RED_SIZE,   tmp, 0));
-    res.setAccumGreenBits(glXGetConfig(display, info, GLX.GLX_ACCUM_GREEN_SIZE, tmp, 0));
-    res.setAccumBlueBits (glXGetConfig(display, info, GLX.GLX_ACCUM_BLUE_SIZE,  tmp, 0));
-    res.setAccumAlphaBits(glXGetConfig(display, info, GLX.GLX_ACCUM_ALPHA_SIZE, tmp, 0));
-    if (isMultisampleEnabled) {
-      res.setSampleBuffers(glXGetConfig(display, info, GLX.GLX_SAMPLE_BUFFERS, tmp, 0) != 0);
-      res.setNumSamples   (glXGetConfig(display, info, GLX.GLX_SAMPLES,        tmp, 0));
-    }
-    return res;
-  }
-
-  private static String glXGetConfigErrorCode(int err) {
-    switch (err) {
-      case GLX.GLX_NO_EXTENSION:  return "GLX_NO_EXTENSION";
-      case GLX.GLX_BAD_SCREEN:    return "GLX_BAD_SCREEN";
-      case GLX.GLX_BAD_ATTRIBUTE: return "GLX_BAD_ATTRIBUTE";
-      case GLX.GLX_BAD_VISUAL:    return "GLX_BAD_VISUAL";
-      default:                return "Unknown error code " + err;
-    }
-  }
-
-  public static int glXGetConfig(long display, XVisualInfo info, int attrib, int[] tmp, int tmp_offset) {
-    if (display == 0) {
-      throw new GLException("No display connection");
-    }
-    int res = GLX.glXGetConfig(display, info, attrib, tmp, tmp_offset);
-    if (res != 0) {
-      throw new GLException("glXGetConfig("+toHexString(attrib)+") failed: error code " + glXGetConfigErrorCode(res));
-    }
-    return tmp[tmp_offset];
-  }
-
-  public static String toHexString(int val) {
-    return "0x"+Integer.toHexString(val);
-  }
-
-  public static String toHexString(long val) {
-    return "0x"+Long.toHexString(val);
-  }
-
-  public String toString() {
-    return "X11GLXGraphicsConfiguration["+getScreen()+", visualID " + toHexString(getVisualID()) + ", fbConfigID " + toHexString(fbConfigID) + 
-                                        ",\n\trequested " + getRequestedCapabilities()+
-                                        ",\n\tchosen    " + getChosenCapabilities()+
-                                        "]";
-  }
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java
deleted file mode 100644
index b2f4939..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.CapabilitiesChooser;
-import javax.media.nativewindow.CapabilitiesImmutable;
-import javax.media.nativewindow.GraphicsConfigurationFactory;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.x11.X11GraphicsScreen;
-import javax.media.opengl.DefaultGLCapabilitiesChooser;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLCapabilitiesChooser;
-import javax.media.opengl.GLCapabilitiesImmutable;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.common.nio.PointerBuffer;
-import com.jogamp.nativewindow.impl.x11.X11Lib;
-import com.jogamp.nativewindow.impl.x11.X11Util;
-import com.jogamp.nativewindow.impl.x11.XVisualInfo;
-import com.jogamp.opengl.impl.Debug;
-
-
-/** Subclass of GraphicsConfigurationFactory used when non-AWT toolkits
-    are used on X11 platforms. Toolkits will likely need to delegate
-    to this one to change the accepted and returned types of the
-    GraphicsDevice and GraphicsConfiguration abstractions. */
-
-public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
-    protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
-
-    public X11GLXGraphicsConfigurationFactory() {
-        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.x11.X11GraphicsDevice.class, this);
-    }
-
-    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
-        if (!(absScreen instanceof X11GraphicsScreen)) {
-            throw new IllegalArgumentException("Only X11GraphicsScreen are allowed here");
-        }
-
-        if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - chosen");
-        }
-
-        if ( !(capsRequested instanceof GLCapabilitiesImmutable)) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - requested");
-        }
-
-        if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
-            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
-        }
-        return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested,
-                                                 (GLCapabilitiesChooser)chooser, (X11GraphicsScreen)absScreen);
-    }
-
-    /**
-    protected static X11GLXGraphicsConfiguration createDefaultGraphicsConfigurationFBConfig(AbstractGraphicsScreen absScreen, boolean onscreen, boolean usePBuffer) {
-      if (absScreen == null) {
-        throw new IllegalArgumentException("AbstractGraphicsScreen is null");
-      }
-      if (!(absScreen instanceof X11GraphicsScreen)) {
-        throw new IllegalArgumentException("Only X11GraphicsScreen are allowed here");
-      }
-      X11GraphicsScreen x11Screen = (X11GraphicsScreen)absScreen;
-
-      GLProfile glProfile = GLProfile.getDefault();
-      GLCapabilities availableCaps=null;
-      XVisualInfo xvis=null;
-      long fbcfg = 0;
-      int fbid = -1;
-
-      // Utilizing FBConfig
-      //
-      GLCapabilities capsFB = null;
-      long display = x11Screen.getDevice().getHandle();
-
-      try {
-          int screen = x11Screen.getIndex();
-          boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display);
-
-          long visID = X11Util.DefaultVisualID(display, x11Screen.getIndex());
-          xvis = X11GLXGraphicsConfiguration.XVisualID2XVisualInfo(display, visID);
-          availableCaps = X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(glProfile, display, xvis, onscreen, usePBuffer, isMultisampleAvailable);
-
-          int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(availableCaps, true, isMultisampleAvailable, display, screen);
-          int[] count = { -1 };
-          PointerBuffer fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, 0, count, 0);
-          if (fbcfgsL == null || fbcfgsL.limit()<1) {
-              throw new Exception("Could not fetch FBConfig for "+availableCaps);
-          }
-          fbcfg = fbcfgsL.get(0);
-          capsFB = X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(glProfile, display, fbcfg, true, onscreen, usePBuffer, isMultisampleAvailable);
-
-          fbid = X11GLXGraphicsConfiguration.glXFBConfig2FBConfigID(display, fbcfg);
-
-          xvis = GLX.glXGetVisualFromFBConfig(display, fbcfg);
-          if (xvis==null) {
-            throw new GLException("Error: Choosen FBConfig has no visual");
-          }
-      } catch (Throwable t) {
-      }
-
-      return new X11GLXGraphicsConfiguration(x11Screen, (null!=capsFB)?capsFB:availableCaps, availableCaps, null, xvis, fbcfg, fbid);
-    } */
-
-    protected static X11GLXGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
-                                                                                   GLCapabilitiesImmutable capsReq,
-                                                                                   GLCapabilitiesChooser chooser,
-                                                                                   X11GraphicsScreen x11Screen) {
-        if (x11Screen == null) {
-            throw new IllegalArgumentException("AbstractGraphicsScreen is null");
-        }
-
-        if (capsChosen == null) {
-            capsChosen = new GLCapabilities(null);
-        }
-
-        if(!capsChosen.isOnscreen() && capsChosen.getDoubleBuffered()) {
-            // OFFSCREEN !DOUBLE_BUFFER // FIXME DBLBUFOFFSCRN
-            GLCapabilities caps2 = (GLCapabilities) capsChosen.cloneMutable();
-            caps2.setDoubleBuffered(false);
-            capsChosen = caps2;
-        }
-
-        boolean usePBuffer = capsChosen.isPBuffer();
-    
-        X11GLXGraphicsConfiguration res;
-        res = chooseGraphicsConfigurationFBConfig(capsChosen, capsReq, chooser, x11Screen);
-        if(null==res) {
-            if(usePBuffer) {
-                throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig for "+capsChosen);
-            }
-            res = chooseGraphicsConfigurationXVisual(capsChosen, capsReq, chooser, x11Screen);
-        }
-        if(null==res) {
-            throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig and XVisual for "+capsChosen);
-        }
-        if(DEBUG) {
-            System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationStatic("+x11Screen+","+capsChosen+"): "+res);
-        }
-        return res;
-    }
-
-    protected static X11GLXGraphicsConfiguration fetchGraphicsConfigurationFBConfig(X11GraphicsScreen x11Screen, int fbID, GLProfile glp) {
-        AbstractGraphicsDevice absDevice = x11Screen.getDevice();
-        long display = absDevice.getHandle();
-        int screen = x11Screen.getIndex();
-
-        long fbcfg = X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, screen, fbID);
-        if( !X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfg ) ) {
-            if(DEBUG) {
-                System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed - GLX FBConfig invalid: ("+x11Screen+","+toHexString(fbID)+"): fbcfg: "+toHexString(fbcfg));
-            }
-            return null;
-        }
-        XVisualInfo visualInfo = GLX.glXGetVisualFromFBConfig(display, fbcfg);
-        if (visualInfo==null) {
-            System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed glXGetVisualFromFBConfig ("+x11Screen+", "+toHexString(fbcfg)+")");
-            return null;
-        }
-        GLCapabilitiesImmutable caps = X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(glp, display, fbcfg, true, true, true, GLXUtil.isMultisampleAvailable(display));
-        return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser(), visualInfo, fbcfg, fbID);
-
-    }
-
-    private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(GLCapabilitiesImmutable capsChosen,
-                                                                                   GLCapabilitiesImmutable capsReq,
-                                                                                   GLCapabilitiesChooser chooser,
-                                                                                   X11GraphicsScreen x11Screen) {
-        long recommendedFBConfig = -1;
-        int recommendedIndex = -1;
-        int retFBID=-1;
-        GLCapabilitiesImmutable[] availableCaps = null;
-        PointerBuffer fbcfgsL = null;
-        XVisualInfo retXVisualInfo = null;
-        GLProfile glProfile = capsChosen.getGLProfile();
-        boolean onscreen = capsChosen.isOnscreen();
-        boolean usePBuffer = capsChosen.isPBuffer();
-
-        // Utilizing FBConfig
-        //
-        AbstractGraphicsDevice absDevice = x11Screen.getDevice();
-        long display = absDevice.getHandle();
-
-        int screen = x11Screen.getIndex();
-        boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display);
-        int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capsChosen, true, isMultisampleAvailable, display, screen);
-        int[] count = { -1 };
-
-        // 1st choice: get GLCapabilities based on users GLCapabilities setting recommendedIndex as preferred choice
-        fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, 0, count, 0);
-        if (fbcfgsL != null && fbcfgsL.limit()>0) {
-            availableCaps = new GLCapabilitiesImmutable[fbcfgsL.limit()];
-            for (int i = 0; i < fbcfgsL.limit(); i++) {
-                if( !X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfgsL.get(i) ) ) {
-                    if(DEBUG) {
-                        System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: FBConfig invalid (1): ("+x11Screen+","+capsChosen+"): fbcfg: "+toHexString(fbcfgsL.get(i)));
-                    }
-                } else {
-                    availableCaps[i] = X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(glProfile, display, fbcfgsL.get(i),
-                                                                                     false, onscreen, usePBuffer, isMultisampleAvailable);
-                }
-            }
-            if(availableCaps[0]!=null) {
-                recommendedFBConfig = fbcfgsL.get(0);
-                recommendedIndex=0;
-                if (DEBUG) {
-                    System.err.println("!!! glXChooseFBConfig recommended fbcfg " + toHexString(recommendedFBConfig) + ", idx " + recommendedIndex);
-                    System.err.println("!!! user  caps " + capsChosen);
-                    System.err.println("!!! fbcfg caps " + availableCaps[recommendedIndex]);
-                }
-            } else {
-                if (DEBUG) {
-                    System.err.println("!!! glXChooseFBConfig no caps for recommended fbcfg " + toHexString(recommendedFBConfig));
-                    System.err.println("!!! user  caps " + capsChosen);
-                }
-            }
-        }
-
-        // 2nd choice: get all GLCapabilities available, no preferred recommendedIndex available
-        if(null == availableCaps) {
-            fbcfgsL = GLX.glXChooseFBConfig(display, screen, null, 0, count, 0);
-            if (fbcfgsL == null || fbcfgsL.limit()<=0) {
-                if(DEBUG) {
-                    System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed glXChooseFBConfig ("+x11Screen+","+capsChosen+"): "+fbcfgsL+", "+count[0]);
-                }
-                return null;
-            }
-
-            availableCaps = new GLCapabilitiesImmutable[fbcfgsL.limit()];
-            for (int i = 0; i < fbcfgsL.limit(); i++) {
-                if( !X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfgsL.get(i) ) ) {
-                    if(DEBUG) {
-                        System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: FBConfig invalid (2): ("+x11Screen+"): fbcfg: "+toHexString(fbcfgsL.get(i)));
-                    }
-                } else {
-                    availableCaps[i] = X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(glProfile, display, fbcfgsL.get(i),
-                                                                                     false, onscreen, usePBuffer, isMultisampleAvailable);
-                }
-            }
-        }
-
-        if( recommendedIndex < 1 && null==chooser) {
-            chooser = new DefaultGLCapabilitiesChooser();
-        }
-
-        int chosenIndex = recommendedIndex;
-        try {
-          if(null != chooser) {
-            chosenIndex = chooser.chooseCapabilities(capsChosen, availableCaps, recommendedIndex);
-            if(DEBUG) {
-              System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig chooser: idx "+chosenIndex);
-              System.err.println("!!! user     caps " + capsChosen);
-              System.err.println("!!! chosen   caps " + availableCaps[chosenIndex]);
-            }
-          }
-        } catch (NativeWindowException e) {
-          if(DEBUG) {
-              e.printStackTrace();
-          }
-        }
-
-        if (chosenIndex < 0) {
-          // keep on going ..
-          // seek first available one ..
-          for(chosenIndex = 0; chosenIndex < availableCaps.length && availableCaps[chosenIndex]==null; chosenIndex++) {
-              // nop
-          }
-          if(chosenIndex==availableCaps.length) {
-            // give up ..
-            if(DEBUG) {
-              System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig Failed .. nothing available, bail out");
-            }
-            return null;
-          }
-          if(DEBUG) {
-              System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig Failed .. unable to choose config, using first available idx: "+chosenIndex);
-              System.err.println("!!! user     caps " + capsChosen);
-              System.err.println("!!! fallback caps " + availableCaps[chosenIndex]);
-          }
-        } else if (chosenIndex >= availableCaps.length) {
-            if(DEBUG) {
-              System.err.println("GLCapabilitiesChooser specified invalid index (expected 0.." + (availableCaps.length - 1) + ", got "+chosenIndex+")");
-            }
-            return null;
-        }
-
-        retFBID = X11GLXGraphicsConfiguration.glXFBConfig2FBConfigID(display, fbcfgsL.get(chosenIndex));
-
-        retXVisualInfo = GLX.glXGetVisualFromFBConfig(display, fbcfgsL.get(chosenIndex));
-        if (retXVisualInfo==null) {
-            if(DEBUG) {
-                System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed glXGetVisualFromFBConfig ("+x11Screen+", "+fbcfgsL.get(chosenIndex) +" (Continue: "+(false==availableCaps[chosenIndex].isOnscreen())+"):\n\t"+availableCaps[chosenIndex]);
-            }
-            if(availableCaps[chosenIndex].isOnscreen()) {
-                // Onscreen drawables shall have a XVisual ..
-                return null;
-            }
-        }
-
-        return new X11GLXGraphicsConfiguration(x11Screen, availableCaps[chosenIndex], capsReq, chooser, retXVisualInfo, fbcfgsL.get(chosenIndex), retFBID);
-    }
-
-    private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationXVisual(GLCapabilitiesImmutable capsChosen,
-                                                                                  GLCapabilitiesImmutable capsReq,
-                                                                                  GLCapabilitiesChooser chooser,
-                                                                                  X11GraphicsScreen x11Screen) {
-        if (chooser == null) {
-            chooser = new DefaultGLCapabilitiesChooser();
-        }
-
-        // Until we have a rock-solid visual selection algorithm written
-        // in pure Java, we're going to provide the underlying window
-        // system's selection to the chooser as a hint
-
-        GLProfile glProfile = capsChosen.getGLProfile();
-        boolean onscreen = capsChosen.isOnscreen();
-        GLCapabilitiesImmutable[] caps = null;
-        int recommendedIndex = -1;
-        XVisualInfo retXVisualInfo = null;
-        int chosen=-1;
-
-        AbstractGraphicsDevice absDevice = x11Screen.getDevice();
-        long display = absDevice.getHandle();
-
-        int screen = x11Screen.getIndex();
-        boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display);
-        int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capsChosen, false, isMultisampleAvailable, display, screen);
-        XVisualInfo[] infos = null;
-
-        XVisualInfo recommendedVis = GLX.glXChooseVisual(display, screen, attribs, 0);
-        if (DEBUG) {
-            System.err.print("!!! glXChooseVisual recommended ");
-            if (recommendedVis == null) {
-                System.err.println("null visual");
-            } else {
-                System.err.println("visual id " + toHexString(recommendedVis.getVisualid()));
-            }
-        }
-        int[] count = new int[1];
-        XVisualInfo template = XVisualInfo.create();
-        template.setScreen(screen);
-        infos = X11Util.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
-        if (infos == null || infos.length<1) {
-            throw new GLException("Error while enumerating available XVisualInfos");
-        }
-        caps = new GLCapabilitiesImmutable[infos.length];
-        for (int i = 0; i < infos.length; i++) {
-            caps[i] = X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(glProfile, display, infos[i], onscreen, false, isMultisampleAvailable);
-            // Attempt to find the visual chosenIndex by glXChooseVisual
-            if (recommendedVis != null && recommendedVis.getVisualid() == infos[i].getVisualid()) {
-                recommendedIndex = i;
-            }
-        }
-        try {
-          chosen = chooser.chooseCapabilities(capsChosen, caps, recommendedIndex);
-        } catch (NativeWindowException e) {
-          if(DEBUG) {
-              e.printStackTrace();
-          }
-          chosen = -1;
-        }
-        if (chosen < 0) {
-          // keep on going ..
-          if(DEBUG) {
-              System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationXVisual Failed .. unable to choose config, using first");
-          }
-          chosen = 0; // default ..
-        } else if (chosen >= caps.length) {
-            throw new GLException("GLCapabilitiesChooser specified invalid index (expected 0.." + (caps.length - 1) + ")");
-        }
-        if (infos[chosen] == null) {
-            throw new GLException("GLCapabilitiesChooser chose an invalid visual for "+caps[chosen]);
-        }
-        retXVisualInfo = XVisualInfo.create(infos[chosen]);
-        return new X11GLXGraphicsConfiguration(x11Screen, caps[chosen], capsReq, chooser, retXVisualInfo, 0, -1);
-    }
-
-    public static String toHexString(int val) {
-        return "0x"+Integer.toHexString(val);
-    }
-
-    public static String toHexString(long val) {
-        return "0x"+Long.toHexString(val);
-    }
-
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java
deleted file mode 100644
index 5ae6412..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.opengl.*;
-
-public class X11OffscreenGLXContext extends X11GLXContext {
-
-  public X11OffscreenGLXContext(X11OffscreenGLXDrawable drawable,
-                               GLContext shareWith) {
-    super(drawable, shareWith);
-  }
-
-  public int getOffscreenContextPixelDataType() {
-    GL gl = getGL();
-    return gl.isGL2GL3()?GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:GL.GL_UNSIGNED_SHORT_5_5_5_1;
-  }
-  
-  public int getOffscreenContextReadBuffer() {
-    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
-    if (caps.getDoubleBuffered()) {
-      return GL.GL_BACK;
-    }
-    return GL.GL_FRONT;
-  }
-
-  public boolean offscreenImageNeedsVerticalFlip() {
-    // There doesn't seem to be a way to do this in the construction
-    // of the Pixmap or GLXPixmap
-    return true;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java
deleted file mode 100644
index f46bdbb..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.nativewindow.impl.x11.*;
-
-public class X11OffscreenGLXDrawable extends X11GLXDrawable {
-  private long pixmap;
-
-  protected X11OffscreenGLXDrawable(GLDrawableFactory factory, NativeSurface target) {
-    super(factory, target, true);
-    create();
-  }
-
-  protected void setRealizedImpl() {
-    if(realized) {
-        create();
-    } else {
-        destroyImpl();
-    }
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    return new X11OffscreenGLXContext(this, shareWith);
-  }
-  
-  private void create() {
-    NativeSurface ns = getNativeSurface();
-    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
-    XVisualInfo vis = config.getXVisualInfo();
-    int bitsPerPixel = vis.getDepth();
-    AbstractGraphicsScreen aScreen = config.getScreen();
-    AbstractGraphicsDevice aDevice = aScreen.getDevice();
-    long dpy = aDevice.getHandle();
-    int screen = aScreen.getIndex();
-
-    pixmap = X11Util.XCreatePixmap(dpy, X11Util.RootWindow(dpy, screen),
-                                  surface.getWidth(), surface.getHeight(), bitsPerPixel);
-    if (pixmap == 0) {
-        throw new GLException("XCreatePixmap failed");
-    }
-    long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap);
-    if (drawable == 0) {
-        X11Util.XFreePixmap(dpy, pixmap);
-        pixmap = 0;
-        throw new GLException("glXCreateGLXPixmap failed");
-    }
-    ((SurfaceChangeable)ns).setSurfaceHandle(drawable);
-    if (DEBUG) {
-        System.err.println("Created pixmap " + toHexString(pixmap) +
-                           ", GLXPixmap " + toHexString(drawable) +
-                           ", display " + toHexString(dpy));
-    }
-  }
-
-  protected void destroyImpl() {
-    if (pixmap == 0) return;
-
-    NativeSurface ns = getNativeSurface();
-    long display = ns.getDisplayHandle();
-
-    long drawable = ns.getSurfaceHandle();
-    if (DEBUG) {
-        System.err.println("Destroying pixmap " + toHexString(pixmap) +
-                           ", GLXPixmap " + toHexString(drawable) +
-                           ", display " + toHexString(display));
-    }
-
-    // Must destroy pixmap and GLXPixmap
-
-    if (DEBUG) {
-        long cur = GLX.glXGetCurrentContext();
-        if (cur != 0) {
-          System.err.println("WARNING: found context " + toHexString(cur) + " current during pixmap destruction");
-        }
-    }
-
-    // FIXME: workaround for crashes on NVidia hardware when
-    // destroying pixmap (no context is current at the point of the
-    // crash, at least from the point of view of
-    // glXGetCurrentContext)
-    GLX.glXMakeCurrent(display, 0, 0);
-
-    GLX.glXDestroyGLXPixmap(display, drawable);
-    X11Util.XFreePixmap(display, pixmap);
-    drawable = 0;
-    pixmap = 0;
-    ((SurfaceChangeable)ns).setSurfaceHandle(0);
-    display = 0;
-  }
-
-  protected void swapBuffersImpl() {
-    if(DEBUG) {
-        System.err.println("unhandled swapBuffersImpl() called for: "+this);
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXContext.java
deleted file mode 100644
index ba6a566..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXContext.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.opengl.*;
-
-public class X11OnscreenGLXContext extends X11GLXContext {
-
-    public X11OnscreenGLXContext(X11OnscreenGLXDrawable drawable, GLContext shareWith) {
-        super(drawable, shareWith);
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
deleted file mode 100644
index 5243e8c..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-
-public class X11OnscreenGLXDrawable extends X11GLXDrawable {
-  /** GLXWindow can't be made current on AWT with NVidia driver, hence disabled for now */
-  public static final boolean USE_GLXWINDOW = false;
-  long glXWindow; // GLXWindow, a GLXDrawable representation
-  boolean useGLXWindow;
-
-  protected X11OnscreenGLXDrawable(GLDrawableFactory factory, NativeSurface component) {
-    super(factory, component, false);
-    glXWindow=0;
-    useGLXWindow=false;
-  }
-
-  public long getHandle() {
-    if(useGLXWindow) {
-        return glXWindow; 
-    } 
-    return getNativeSurface().getSurfaceHandle();
-  }
-
-  protected void destroyHandle() {
-    if(0!=glXWindow) {
-        GLX.glXDestroyWindow(getNativeSurface().getDisplayHandle(), glXWindow);
-        glXWindow = 0;
-        useGLXWindow=false;
-    }
-  }
-
-  /** must be locked already */
-  protected void updateHandle() {
-    if(USE_GLXWINDOW) {
-        X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-        if(config.getFBConfig()>=0) {
-            useGLXWindow=true;
-            long dpy = getNativeSurface().getDisplayHandle();
-            if(0!=glXWindow) {
-                GLX.glXDestroyWindow(dpy, glXWindow);
-            }
-            glXWindow = GLX.glXCreateWindow(dpy, config.getFBConfig(), getNativeSurface().getSurfaceHandle(), null, 0);
-            if (DEBUG) {
-              System.err.println("!!! X11OnscreenGLXDrawable.setRealized(true): glXWindow: "+toHexString(getNativeSurface().getSurfaceHandle())+" -> "+toHexString(glXWindow));
-            }
-            if(0==glXWindow) {
-                throw new GLException("X11OnscreenGLXDrawable.setRealized(true): GLX.glXCreateWindow() failed: "+this);
-            }
-        }
-    }
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    return new X11OnscreenGLXContext(this, shareWith);
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java
deleted file mode 100644
index 7ee5d51..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.opengl.*;
-
-public class X11PbufferGLXContext extends X11GLXContext {
-
-  public X11PbufferGLXContext(X11PbufferGLXDrawable drawable, GLContext shareWith) {
-    super(drawable, shareWith);
-  }
-
-  public void bindPbufferToTexture() {
-    // FIXME: figure out how to implement this
-    throw new GLException("Not yet implemented");
-  }
-
-  public void releasePbufferFromTexture() {
-    // FIXME: figure out how to implement this
-    throw new GLException("Not yet implemented");
-  }
-
-
-  public int getFloatingPointMode() {
-    return ((X11PbufferGLXDrawable)drawable).getFloatingPointMode();
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
deleted file mode 100644
index 41cd543..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.impl.x11.glx;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-
-public class X11PbufferGLXDrawable extends X11GLXDrawable {
-  protected X11PbufferGLXDrawable(GLDrawableFactory factory, NativeSurface target) {
-                                  /* GLCapabilities caps, 
-                                  GLCapabilitiesChooser chooser,
-                                  int width, int height */
-    super(factory, target, true);
-
-    if (DEBUG) {
-        System.out.println("Pbuffer config: " + getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration());
-    }
-
-    createPbuffer();
-
-    if (DEBUG) {
-        System.err.println("Created pbuffer " + this);
-    }
-  }
-
-  protected void setRealizedImpl() {
-    if(realized) {
-        createPbuffer();
-    } else {
-        destroyImpl();
-    }
-  }
-
-  public GLContext createContext(GLContext shareWith) {
-    return new X11PbufferGLXContext(this, shareWith);
-  }
-
-  protected void destroyImpl() {
-    NativeSurface ns = getNativeSurface();
-    if (ns.getSurfaceHandle() != 0) {
-      GLX.glXDestroyPbuffer(ns.getDisplayHandle(), ns.getSurfaceHandle());
-    }
-    ((SurfaceChangeable)ns).setSurfaceHandle(0);
-  }
-
-  private void createPbuffer() {
-      X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-      AbstractGraphicsScreen aScreen = config.getScreen();
-      AbstractGraphicsDevice aDevice = aScreen.getDevice();
-      long display = aDevice.getHandle();
-      int screen = aScreen.getIndex();
-
-      if (display==0) {
-        throw new GLException("Null display");
-      }
-
-      NativeSurface ns = getNativeSurface();
-    
-      GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
-
-      if (capabilities.getPbufferRenderToTexture()) {
-        throw new GLException("Render-to-texture pbuffers not supported yet on X11");
-      }
-
-      if (capabilities.getPbufferRenderToTextureRectangle()) {
-        throw new GLException("Render-to-texture-rectangle pbuffers not supported yet on X11");
-      }
-
-      // Create the p-buffer.
-      int niattribs = 0;
-      int[] iattributes = new int[5];
-
-      iattributes[niattribs++] = GLX.GLX_PBUFFER_WIDTH;
-      iattributes[niattribs++] = ns.getWidth();
-      iattributes[niattribs++] = GLX.GLX_PBUFFER_HEIGHT;
-      iattributes[niattribs++] = ns.getHeight();
-      iattributes[niattribs++] = 0;
-
-      long pbuffer = GLX.glXCreatePbuffer(display, config.getFBConfig(), iattributes, 0);
-      if (pbuffer == 0) {
-        // FIXME: query X error code for detail error message
-        throw new GLException("pbuffer creation error: glXCreatePbuffer() failed");
-      }
-
-      // Set up instance variables
-      ((SurfaceChangeable)ns).setSurfaceHandle(pbuffer);
-      
-      // Determine the actual width and height we were able to create.
-      int[] tmp = new int[1];
-      GLX.glXQueryDrawable(display, pbuffer, GLX.GLX_WIDTH, tmp, 0);
-      int width = tmp[0];
-      GLX.glXQueryDrawable(display, pbuffer, GLX.GLX_HEIGHT, tmp, 0);
-      int height = tmp[0];
-      ((SurfaceChangeable)ns).setSize(width, height);
-  }
-
-  public int getFloatingPointMode() {
-    // Floating-point pbuffers currently require NVidia hardware on X11
-    return GLPbuffer.NV_FLOAT;
-  }
-
-  protected void swapBuffersImpl() {
-    if(DEBUG) {
-        System.err.println("unhandled swapBuffersImpl() called for: "+this);
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java
deleted file mode 100644
index 0fbe7a1..0000000
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.opengl.impl.x11.glx.awt;
-
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.x11.*;
-import javax.media.nativewindow.awt.*;
-import javax.media.opengl.*;
-
-import com.jogamp.opengl.impl.*;
-import com.jogamp.nativewindow.impl.jawt.x11.*;
-import com.jogamp.nativewindow.impl.x11.*;
-import com.jogamp.opengl.impl.x11.glx.X11GLXGraphicsConfigurationFactory;
-import java.awt.image.ColorModel;
-
-public class X11AWTGLXGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
-    protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
-
-    public X11AWTGLXGraphicsConfigurationFactory() {
-        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this);
-    }
-
-    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
-        GraphicsDevice device = null;
-        if (absScreen != null &&
-            !(absScreen instanceof AWTGraphicsScreen)) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
-        }
-
-        if(null==absScreen) {
-            absScreen = AWTGraphicsScreen.createScreenDevice(-1, AbstractGraphicsDevice.DEFAULT_UNIT);
-        }
-        AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
-        device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
-
-        if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - chosen");
-        }
-
-        if ( !(capsRequested instanceof GLCapabilitiesImmutable) ) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - requested");
-        }
-
-        if (chooser != null &&
-            !(chooser instanceof GLCapabilitiesChooser)) {
-            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilitiesChooser objects");
-        }
-
-        if(DEBUG) {
-            System.err.println("X11AWTGLXGraphicsConfigurationFactory: got "+absScreen);
-        }
-        
-        long displayHandle = X11SunJDKReflection.graphicsDeviceGetDisplay(device);
-        boolean owner = false;
-        if(0==displayHandle) {
-            displayHandle = X11Util.createDisplay(null);
-            owner = true;
-            if(DEBUG) {
-                System.err.println("X11AWTGLXGraphicsConfigurationFactory: using a thread local X11 display");
-            }
-        } else {
-            if(DEBUG) {
-                System.err.println("X11AWTGLXGraphicsConfigurationFactory: using AWT X11 display 0x"+Long.toHexString(displayHandle));
-            }
-            /**
-             * May cause an exception on NVidia X11 Display destruction,
-             * when destruction happen immediately after construction, around 10ms.
-             * However, the own Display handle is required for AMD gpus.
-             */
-            String name = X11Util.XDisplayString(displayHandle);
-            displayHandle = X11Util.createDisplay(name);
-            owner = true;
-        }
-        ((AWTGraphicsDevice)awtScreen.getDevice()).setSubType(NativeWindowFactory.TYPE_X11, displayHandle);
-        X11GraphicsDevice x11Device = new X11GraphicsDevice(displayHandle, AbstractGraphicsDevice.DEFAULT_UNIT);
-        x11Device.setCloseDisplay(owner);
-        X11GraphicsScreen x11Screen = new X11GraphicsScreen(x11Device, awtScreen.getIndex());
-        if(DEBUG) {
-            System.err.println("X11AWTGLXGraphicsConfigurationFactory: made "+x11Screen);
-        }
-        GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(x11Device);
-        GraphicsConfiguration[] configs = device.getConfigurations();
-
-        //
-        // Match the X11/GL Visual with AWT:
-        //   - choose a config AWT agnostic and then
-        //   - try to find the visual within the GraphicsConfiguration
-        //
-        // The resulting GraphicsConfiguration has to be 'forced' on the AWT native peer,
-        // ie. returned by GLCanvas's getGraphicsConfiguration() befor call by super.addNotify().
-        //
-        X11GraphicsConfiguration x11Config = (X11GraphicsConfiguration) factory.chooseGraphicsConfiguration(capsChosen, capsRequested, chooser, x11Screen);
-        if (x11Config == null) {
-            throw new GLException("Unable to choose a GraphicsConfiguration (1): "+capsChosen+",\n\t"+chooser+"\n\t"+x11Screen);
-        }
-        long visualID = x11Config.getVisualID();
-        for (int i = 0; i < configs.length; i++) {
-            GraphicsConfiguration gc = configs[i];
-            if (gc != null) {
-                if (X11SunJDKReflection.graphicsConfigurationGetVisualID(gc) == visualID) {
-                    if(DEBUG) {
-                        System.err.println("Found matching AWT visual: 0x"+Long.toHexString(visualID) +" -> "+x11Config);
-                    }
-                    return new AWTGraphicsConfiguration(awtScreen,
-                                                        x11Config.getChosenCapabilities(), x11Config.getRequestedCapabilities(),
-                                                        gc, x11Config);
-                }
-            }
-        }
-
-        // try again using an AWT Colormodel compatible configuration
-        GraphicsConfiguration gc = device.getDefaultConfiguration();
-        capsChosen = AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capsChosen, gc);
-        x11Config = (X11GraphicsConfiguration) factory.chooseGraphicsConfiguration(capsChosen, capsRequested, chooser, x11Screen);
-        if (x11Config == null) {
-            throw new GLException("Unable to choose a GraphicsConfiguration (2): "+capsChosen+",\n\t"+chooser+"\n\t"+x11Screen);
-        }
-        visualID = x11Config.getVisualID();
-        for (int i = 0; i < configs.length; i++) {
-            gc = configs[i];
-            if (gc != null) {
-                if (X11SunJDKReflection.graphicsConfigurationGetVisualID(gc) == visualID) {
-                    if(DEBUG) {
-                        System.err.println("Found matching default AWT visual: 0x"+Long.toHexString(visualID) +" -> "+x11Config);
-                    }
-                    return new AWTGraphicsConfiguration(awtScreen,
-                                                        x11Config.getChosenCapabilities(), x11Config.getRequestedCapabilities(),
-                                                        gc, x11Config);
-                }
-            }
-        }
-
-        // Either we weren't able to reflectively introspect on the
-        // X11GraphicsConfig or something went wrong in the steps above;
-        // Let's take the default configuration as used on Windows and MacOSX then ..
-        if(DEBUG) {
-            System.err.println("!!! Using default configuration");
-        }
-
-        gc = device.getDefaultConfiguration();
-        return new AWTGraphicsConfiguration(awtScreen, x11Config.getChosenCapabilities(), x11Config.getRequestedCapabilities(), gc, x11Config);
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
index 2240063..9c77a05 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
@@ -68,14 +68,10 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
                 // scheme than simply forcing repainting of each one in
                 // turn since drawing one can force another one to be
                 // drawn in turn
-                if(drawable.isRealized()) {
-                    lightweights.add(drawable);
-                }
+                lightweights.add(drawable);
             } else {
                 try {
-                    if(drawable.isRealized()) {
-                        drawable.display();
-                    }
+                    drawable.display();
                 } catch (RuntimeException e) {
                     if (ignoreExceptions) {
                         if (printExceptions) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
index 31abe09..4fbd0e4 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Animator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
@@ -41,7 +41,6 @@
 package com.jogamp.opengl.util;
 
 import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLException;
 
 
 /** <P> An Animator can be attached to one or more {@link
@@ -51,6 +50,12 @@ import javax.media.opengl.GLException;
     calls to <code>display()</code> are performed. After each drawable
     has been redrawn, a brief pause is performed to avoid swamping the
     CPU, unless {@link #setRunAsFastAsPossible} has been called.  </P>
+
+ * <p>
+ * The Animator execution thread does not run as a daemon thread,
+ * so it is able to keep an application from terminating.<br>
+ * Call {@link #stop() } to terminate the animation and it's execution thread.
+ * </p>
 */
 
 public class Animator extends AnimatorBase {
@@ -119,11 +124,15 @@ public class Animator extends AnimatorBase {
     }
 
     class MainLoop implements Runnable {
+        public String toString() {
+            return "[started "+isStartedImpl()+", animating "+isAnimatingImpl()+", paused "+isPausedImpl()+", frames "+getTotalFrames()+", drawable "+drawables.size()+"]";
+        }
+
         public void run() {
             try {
                 synchronized (Animator.this) {
                     if(DEBUG) {
-                        System.err.println("Animator started: "+Thread.currentThread());
+                        System.err.println("Animator start:" + Thread.currentThread() + ": " + toString());
                     }
 
                     startTime = System.currentTimeMillis();
@@ -141,7 +150,7 @@ public class Animator extends AnimatorBase {
                         while (!stopIssued && (pauseIssued || drawablesEmpty)) {
                             boolean wasPaused = pauseIssued;
                             if (DEBUG) {
-                                System.err.println("Animator paused: " + Thread.currentThread());
+                                System.err.println("Animator pause:" + Thread.currentThread() + ": " + toString());
                             }
                             setIsAnimatingSynced(false); // barrier
                             Animator.this.notifyAll();
@@ -156,7 +165,7 @@ public class Animator extends AnimatorBase {
                                 curTime = startTime;
                                 totalFrames = 0;
                                 if (DEBUG) {
-                                    System.err.println("Animator resume: " + Thread.currentThread());
+                                    System.err.println("Animator resume:" + Thread.currentThread() + ": " + toString());
                                 }
                             }
                         }
@@ -178,7 +187,7 @@ public class Animator extends AnimatorBase {
             } finally {
                 synchronized (Animator.this) {
                     if(DEBUG) {
-                        System.err.println("Animator stopped: "+Thread.currentThread());
+                        System.err.println("Animator stop " + Thread.currentThread() + ": " + toString());
                     }
                     stopIssued = false;
                     pauseIssued = false;
@@ -253,9 +262,9 @@ public class Animator extends AnimatorBase {
         }
     }
 
-    public synchronized void start() {
+    public synchronized boolean start() {
         if ( isStartedImpl() ) {
-            throw new GLException("Start: Already running (started "+isStartedImpl()+" (false))");
+            return false;
         }
         if (runnable == null) {
             runnable = new MainLoop();
@@ -268,10 +277,11 @@ public class Animator extends AnimatorBase {
         } else {
             thread = new Thread(threadGroup, runnable, threadName);
         }
-        thread.setDaemon(true); // don't stop JVM from shutdown ..
         thread.start();
         finishLifecycleAction(waitForStartedCondition);
+        return true;
     }
+
     private class WaitForStartedCondition implements Condition {
         public boolean result() {
             return !isStartedImpl() || (!drawablesEmpty && !isAnimating) ;
@@ -279,13 +289,14 @@ public class Animator extends AnimatorBase {
     }
     Condition waitForStartedCondition = new WaitForStartedCondition();
 
-    public synchronized void stop() {
+    public synchronized boolean stop() {
         if ( !isStartedImpl() ) {
-            throw new GLException("Stop: Not running (started "+isStartedImpl()+" (true))");
+            return false;
         }
         stopIssued = true;
         notifyAll();
         finishLifecycleAction(waitForStoppedCondition);
+        return true;
     }
     private class WaitForStoppedCondition implements Condition {
         public boolean result() {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
index 96cfe65..01c2ea6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
@@ -29,7 +29,7 @@
 package com.jogamp.opengl.util;
 
 import com.jogamp.common.util.locks.RecursiveLock;
-import com.jogamp.opengl.impl.Debug;
+import jogamp.opengl.Debug;
 import java.util.ArrayList;
 import javax.media.opengl.GLAnimatorControl;
 import javax.media.opengl.GLAutoDrawable;
@@ -111,7 +111,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
 
     public synchronized void remove(GLAutoDrawable drawable) {
         if(DEBUG) {
-            System.err.println("Animator remove: "+drawable.hashCode()+" - "+Thread.currentThread());
+            System.err.println("Animator remove: "+drawable.hashCode()+" - "+Thread.currentThread() + ": "+toString());
         }
 
         boolean paused = pause();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
index f98c4b4..d3f9cde 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
@@ -47,9 +47,7 @@ class DefaultAnimatorImpl implements AnimatorBase.AnimatorImpl {
         for (int i=0; i<drawables.size(); i++) {
             GLAutoDrawable drawable = (GLAutoDrawable) drawables.get(i);
             try {
-                if(drawable.isRealized()) {
-                    drawable.display();
-                }
+                drawable.display();
             } catch (RuntimeException e) {
                 if (ignoreExceptions) {
                     if (printExceptions) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
index 6bac164..741d446 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
@@ -137,9 +137,9 @@ public class FPSAnimator extends AnimatorBase {
         }
     }
 
-    public synchronized void start() {
+    public synchronized boolean  start() {
         if (timer != null) {
-            throw new GLException("Already started");
+            return false;
         }
         stateSync.lock();
         try {
@@ -148,14 +148,15 @@ public class FPSAnimator extends AnimatorBase {
         } finally {
             stateSync.unlock();
         }
+        return true;
     }
 
     /** Stops this FPSAnimator. Due to the implementation of the
     FPSAnimator it is not guaranteed that the FPSAnimator will be
     completely stopped by the time this method returns. */
-    public synchronized void stop() {
+    public synchronized boolean stop() {
         if (timer == null) {
-            throw new GLException("Already stopped");
+            return false;
         }
         stateSync.lock();
         try {
@@ -168,6 +169,7 @@ public class FPSAnimator extends AnimatorBase {
         } finally {
             stateSync.unlock();
         }
+        return true;
     }
 
     public synchronized boolean pause() {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
index 1141f66..4586d1d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
@@ -8,7 +8,7 @@ import javax.media.opengl.*;
 
 import com.jogamp.opengl.util.glsl.*;
 
-import com.jogamp.opengl.impl.SystemUtil;
+import jogamp.opengl.SystemUtil;
 
 import java.nio.*;
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
index 2ab77fa..88a8603 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
@@ -3,7 +3,7 @@ package com.jogamp.opengl.util;
 
 import javax.media.opengl.*;
 
-import com.jogamp.opengl.util.glsl.fixedfunc.impl.*;
+import jogamp.opengl.util.glsl.fixedfunc.*;
 
 import java.nio.*;
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Gamma.java b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
index 672325c..c649d1c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
@@ -40,7 +40,7 @@
 package com.jogamp.opengl.util;
 
 import javax.media.opengl.*;
-import com.jogamp.opengl.impl.*;
+import jogamp.opengl.*;
 
 /** Provides control over the primary display's gamma, brightness and
     contrast controls via the hardware gamma ramp tables. Not
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
index 47de8ce..0e1b792 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
@@ -34,7 +34,7 @@
 package com.jogamp.opengl.util;
 
 import com.jogamp.common.nio.Buffers;
-import com.jogamp.opengl.impl.ProjectFloat;
+import jogamp.opengl.ProjectFloat;
 
 import java.nio.*;
 import java.util.ArrayList;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
index f22e11c..8688217 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -39,15 +40,13 @@
 package com.jogamp.opengl.util.awt;
 
 import com.jogamp.common.nio.Buffers;
-import com.jogamp.opengl.impl.Debug;
+import jogamp.opengl.Debug;
 import com.jogamp.opengl.util.*;
 import com.jogamp.opengl.util.packrect.*;
 import com.jogamp.opengl.util.texture.*;
-import com.jogamp.opengl.util.texture.awt.*;
 
 import java.awt.AlphaComposite;
 import java.awt.Color;
-import java.awt.Composite;
 
 // For debugging purposes
 import java.awt.EventQueue;
@@ -71,7 +70,6 @@ import java.security.*;
 
 import javax.media.opengl.*;
 import javax.media.opengl.glu.*;
-import javax.media.opengl.glu.gl2.*;
 import javax.media.opengl.awt.*;
 
 
@@ -720,7 +718,7 @@ public class TextRenderer {
         // The OpenGL spec is unclear about whether this changes the
         // buffer bindings, so preemptively zero out the GL_ARRAY_BUFFER
         // binding
-        if (is15Available(gl)) {
+        if (getUseVertexArrays() && is15Available(gl)) {
             try {
                 gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
             } catch (Exception e) {
@@ -1236,7 +1234,7 @@ public class TextRenderer {
                 // The OpenGL spec is unclear about whether this changes the
                 // buffer bindings, so preemptively zero out the GL_ARRAY_BUFFER
                 // binding
-                if (is15Available(gl)) {
+                if (getUseVertexArrays() && is15Available(gl)) {
                     try {
                         gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
                     } catch (Exception e) {
@@ -1558,6 +1556,8 @@ public class TextRenderer {
         final int undefined = -2;
         FontRenderContext fontRenderContext;
         List/*<Glyph>*/ glyphsOutput = new ArrayList/*<Glyph>*/();
+        HashMap/*<String, GlyphVector>*/fullGlyphVectorCache = new HashMap/*<String, GlyphVector>*/();
+        HashMap/*<Character, GlyphMetrics>*/glyphMetricsCache = new HashMap/*<Character, GlyphMetrics>*/();
         // The mapping from unicode character to font-specific glyph ID
         int[] unicodes2Glyphs;
         // The mapping from glyph ID to Glyph
@@ -1573,8 +1573,13 @@ public class TextRenderer {
 
         public List/*<Glyph>*/ getGlyphs(CharSequence inString) {
             glyphsOutput.clear();
-            iter.initFromCharSequence(inString);
-            GlyphVector fullRunGlyphVector = font.createGlyphVector(getFontRenderContext(), iter);
+            GlyphVector fullRunGlyphVector;
+            fullRunGlyphVector = (GlyphVector) fullGlyphVectorCache.get(inString.toString());
+            if (fullRunGlyphVector == null) {
+                iter.initFromCharSequence(inString);
+                fullRunGlyphVector = font.createGlyphVector(getFontRenderContext(), iter);
+                fullGlyphVectorCache.put(inString.toString(), fullRunGlyphVector);
+            }
             boolean complex = (fullRunGlyphVector.getLayoutFlags() != 0);
             if (complex || DISABLE_GLYPH_CACHE) {
                 // Punt to the robust version of the renderer
@@ -1585,7 +1590,13 @@ public class TextRenderer {
             int lengthInGlyphs = fullRunGlyphVector.getNumGlyphs();
             int i = 0;
             while (i < lengthInGlyphs) {
-                Glyph glyph = getGlyph(inString, fullRunGlyphVector, i);
+            	Character letter = CharacterCache.valueOf(inString.charAt(i));
+                GlyphMetrics metrics = (GlyphMetrics) glyphMetricsCache.get(letter);
+                if (metrics == null) {
+                    metrics = fullRunGlyphVector.getGlyphMetrics(i);
+                    glyphMetricsCache.put(letter, metrics);
+                }
+                Glyph glyph = getGlyph(inString, metrics, i);
                 if (glyph != null) {
                     glyphsOutput.add(glyph);
                     i++;
@@ -1594,7 +1605,7 @@ public class TextRenderer {
                     // the cache
                     StringBuffer buf = new StringBuffer();
                     while (i < lengthInGlyphs &&
-                           getGlyph(inString, fullRunGlyphVector, i) == null) {
+                           getGlyph(inString, fullRunGlyphVector.getGlyphMetrics(i), i) == null) {
                         buf.append(inString.charAt(i++));
                     }
                     glyphsOutput.add(new Glyph(buf.toString(),
@@ -1645,7 +1656,7 @@ public class TextRenderer {
         // if the unicode or glyph ID would be out of bounds of the
         // glyph cache.
         private Glyph getGlyph(CharSequence inString,
-                               GlyphVector fullRunGlyphVector,
+        		               GlyphMetrics glyphMetrics,
                                int index) {
             char unicodeID = inString.charAt(index);
 
@@ -1661,7 +1672,7 @@ public class TextRenderer {
             // Must fabricate the glyph
             singleUnicode[0] = unicodeID;
             GlyphVector gv = font.createGlyphVector(getFontRenderContext(), singleUnicode);
-            return getGlyph(unicodeID, gv, fullRunGlyphVector.getGlyphMetrics(index));
+            return getGlyph(unicodeID, gv, glyphMetrics);
         }
 
         // It's unclear whether this variant might produce less
@@ -1698,6 +1709,26 @@ public class TextRenderer {
             return glyph;
         }
     }
+    
+    private static class CharacterCache {
+        private CharacterCache() {
+        }
+
+        static final Character cache[] = new Character[127 + 1];
+
+        static {
+            for (int i = 0; i < cache.length; i++) {
+                cache[i] = new Character((char) i);
+            }
+        }
+
+        public static Character valueOf(char c) {
+            if (c <= 127) { // must cache
+                return CharacterCache.cache[c];
+            }
+            return new Character(c);
+        }
+    }
 
     class Pipelined_QuadRenderer {
         int mOutstandingGlyphsVerticesPipeline = 0;
@@ -1712,7 +1743,7 @@ public class TextRenderer {
             mVertCoords = Buffers.newDirectFloatBuffer(kTotalBufferSizeCoordsVerts);
             mTexCoords = Buffers.newDirectFloatBuffer(kTotalBufferSizeCoordsTex);
 
-            usingVBOs = is15Available(gl);
+            usingVBOs = getUseVertexArrays() && is15Available(gl);
 
             if (usingVBOs) {
                 try {
@@ -1918,7 +1949,7 @@ public class TextRenderer {
      * rendering, or whether text is rendered using the OpenGL
      * immediate mode commands. Defaults to true.
      */
-    public boolean getUseVertexArrays() {
+    public final boolean getUseVertexArrays() {
         return useVertexArrays;
     }
 
@@ -1943,7 +1974,7 @@ public class TextRenderer {
         return smoothing;
     }
 
-    private boolean is15Available(GL gl) {
+    private final boolean is15Available(GL gl) {
         if (!checkFor_isExtensionAvailable_GL_VERSION_1_5) {
             isExtensionAvailable_GL_VERSION_1_5 = gl.isExtensionAvailable("GL_VERSION_1_5");
             checkFor_isExtensionAvailable_GL_VERSION_1_5 = true;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
index bc5aa51..86dca59 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -47,10 +48,8 @@ import java.awt.Rectangle;
 import java.awt.image.*;
 
 import javax.media.opengl.*;
-import javax.media.opengl.glu.*;
 import javax.media.opengl.glu.gl2.*;
 import com.jogamp.opengl.util.texture.*;
-import com.jogamp.opengl.util.texture.spi.*;
 import com.jogamp.opengl.util.texture.awt.*;
 
 /** Provides the ability to render into an OpenGL {@link
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
index 1d7f38a..5dd1b5a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
@@ -31,7 +31,7 @@ package com.jogamp.opengl.util.glsl;
 import com.jogamp.common.nio.Buffers;
 import javax.media.opengl.*;
 import com.jogamp.opengl.util.*;
-import com.jogamp.opengl.impl.Debug;
+import jogamp.opengl.Debug;
 
 import java.util.*;
 import java.nio.*;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
index 42bf91e..57ae6cf 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
@@ -29,7 +29,7 @@
 package com.jogamp.opengl.util.glsl;
 
 import javax.media.opengl.*;
-import com.jogamp.opengl.impl.Debug;
+import jogamp.opengl.Debug;
 
 import java.util.HashMap;
 import java.util.HashSet;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
index 7ec4ac5..9d7eecb 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
@@ -7,7 +7,7 @@ package com.jogamp.opengl.util.glsl.fixedfunc;
 import javax.media.opengl.*;
 import javax.media.opengl.fixedfunc.*;
 
-import com.jogamp.opengl.util.glsl.fixedfunc.impl.*;
+import jogamp.opengl.util.glsl.fixedfunc.*;
 
 /**
  * Tool to pipeline GL2ES2 into a fixed function emulation implementing GL2ES1.
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java
deleted file mode 100644
index b8e3922..0000000
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
- */
-
-package com.jogamp.opengl.util.glsl.fixedfunc.impl;
-
-import javax.media.opengl.*;
-import javax.media.opengl.fixedfunc.*;
-import javax.media.opengl.glu.*;
-import com.jogamp.common.nio.Buffers;
-import com.jogamp.opengl.util.*;
-import com.jogamp.opengl.util.glsl.*;
-import java.nio.*;
-
-public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFunc {
-    public static final int MAX_TEXTURE_UNITS = 8;
-
-    protected FixedFuncPipeline fixedFunction=null;
-    protected PMVMatrix pmvMatrix=null;
-    protected GL2ES2 gl=null;
-
-    public FixedFuncHook (GL2ES2 gl) {
-        this(gl, null);
-    }
-
-    public FixedFuncHook (GL2ES2 gl, PMVMatrix matrix) {
-        this.gl = gl;
-        pmvMatrix = (null!=matrix)?matrix:new PMVMatrix();
-
-        fixedFunction = new FixedFuncPipeline(gl, pmvMatrix);
-    }
-
-    public FixedFuncHook(GL2ES2 gl, PMVMatrix matrix, 
-                       Class shaderRootClass, String shaderSrcRoot, String shaderBinRoot, 
-                       String vertexColorFile,
-                       String vertexColorLightFile,
-                       String fragmentColorFile,
-                       String fragmentColorTextureFile) {
-        this.gl = gl;
-        pmvMatrix = matrix;
-
-        fixedFunction = new FixedFuncPipeline(gl, pmvMatrix,
-                                              shaderRootClass, shaderSrcRoot, shaderBinRoot, 
-                                              vertexColorFile, vertexColorLightFile, fragmentColorFile, fragmentColorTextureFile);
-    }
-
-    public void destroy() {
-        fixedFunction.destroy(gl);
-        fixedFunction = null;
-    }
-
-    public PMVMatrix getMatrix() { return pmvMatrix; }
-
-    //
-    // FixedFuncHookIf - hooks 
-    //
-    public void glDrawArrays(int mode, int first, int count) {
-        fixedFunction.validate(gl); 
-        gl.glDrawArrays(mode, first, count);
-    }
-    public void glDrawElements(int mode, int count, int type, java.nio.Buffer indices) {
-        fixedFunction.validate(gl); 
-        gl.glDrawElements(mode, count, type, indices);
-    }
-    public void glDrawElements(int mode, int count, int type, long indices_buffer_offset) {
-        fixedFunction.validate(gl); 
-        gl.glDrawElements(mode, count, type, indices_buffer_offset);
-    }
-
-    public void glActiveTexture(int texture) {
-        fixedFunction.glActiveTexture(gl, texture);
-        gl.glActiveTexture(texture);
-    }
-    public void glEnable(int cap) {
-        if(fixedFunction.glEnable(gl, cap, true)) {
-            gl.glEnable(cap);
-        }
-    }
-    public void glDisable(int cap) {
-        if(fixedFunction.glEnable(gl, cap, false)) {
-            gl.glDisable(cap);
-        }
-    }
-    public void glCullFace(int faceName) {
-        fixedFunction.glCullFace(gl, faceName);
-        gl.glCullFace(faceName);
-    }
-
-    public void glGetFloatv(int pname, java.nio.FloatBuffer params) {
-        if(pmvMatrix.isMatrixGetName(pname)) {
-            pmvMatrix.glGetFloatv(pname, params);
-            return;
-        }
-        gl.glGetFloatv(pname, params);
-    }
-    public void glGetFloatv(int pname, float[] params, int params_offset) {
-        if(pmvMatrix.isMatrixGetName(pname)) {
-            pmvMatrix.glGetFloatv(pname, params, params_offset);
-            return;
-        }
-        gl.glGetFloatv(pname, params, params_offset);
-    }
-    public void glGetIntegerv(int pname, IntBuffer params) {
-        if(pmvMatrix.isMatrixGetName(pname)) {
-            pmvMatrix.glGetIntegerv(pname, params);
-            return;
-        }
-        gl.glGetIntegerv(pname, params);
-    }
-    public void glGetIntegerv(int pname, int[] params, int params_offset) {
-        if(pmvMatrix.isMatrixGetName(pname)) {
-            pmvMatrix.glGetIntegerv(pname, params, params_offset);
-            return;
-        }
-        gl.glGetIntegerv(pname, params, params_offset);
-    }
-
-    // 
-    // MatrixIf
-    //
-    public int  glGetMatrixMode() {
-        return pmvMatrix.glGetMatrixMode();
-    }
-    public void glMatrixMode(int mode) {
-        pmvMatrix.glMatrixMode(mode);
-    }
-    public void glLoadMatrixf(java.nio.FloatBuffer m) {
-        pmvMatrix.glLoadMatrixf(m);
-    }
-    public void glLoadMatrixf(float[] m, int m_offset) {
-        glLoadMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset));
-    }
-    public void glPopMatrix() {
-        pmvMatrix.glPopMatrix();
-    }
-    public void glPushMatrix() {
-        pmvMatrix.glPushMatrix();
-    }
-    public void glLoadIdentity() {
-        pmvMatrix.glLoadIdentity();
-    }
-    public void glMultMatrixf(java.nio.FloatBuffer m) {
-        pmvMatrix.glMultMatrixf(m);
-    }
-    public void glMultMatrixf(float[] m, int m_offset) {
-        glMultMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset));
-    }
-    public void glTranslatef(float x, float y, float z) {
-        pmvMatrix.glTranslatef(x, y, z);
-    }
-    public void glRotatef(float angdeg, float x, float y, float z) {
-        pmvMatrix.glRotatef(angdeg, x, y, z);
-    }
-    public void glScalef(float x, float y, float z) {
-        pmvMatrix.glScalef(x, y, z);
-    }
-    public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
-        pmvMatrix.glOrthof(left, right, bottom, top, zNear, zFar);
-    }
-    public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
-        pmvMatrix.glFrustumf(left, right, bottom, top, zNear, zFar);
-    }
-
-    // 
-    // LightingIf
-    //
-    public void glColor4f(float red, float green, float blue, float alpha) {
-      fixedFunction.glColor4fv(gl, GLBuffers.newDirectFloatBuffer(new float[] { red, green, blue, alpha }));
-    }
-
-    public void glLightfv(int light, int pname, java.nio.FloatBuffer params) {
-      fixedFunction.glLightfv(gl, light, pname, params);
-    }
-    public void glLightfv(int light, int pname, float[] params, int params_offset) {
-        glLightfv(light, pname, GLBuffers.newDirectFloatBuffer(params, params_offset));
-    }
-    public void glMaterialfv(int face, int pname, java.nio.FloatBuffer params) {
-      fixedFunction.glMaterialfv(gl, face, pname, params);
-    }
-    public void glMaterialfv(int face, int pname, float[] params, int params_offset) {
-        glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(params, params_offset));
-    }
-    public void glMaterialf(int face, int pname, float param) {
-        glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(new float[] { param }));
-    }
-    public void glShadeModel(int mode) {
-      fixedFunction.glShadeModel(gl, mode);
-    }
-
-    //
-    // PointerIf
-    //
-    public void glEnableClientState(int glArrayIndex) {
-      fixedFunction.glEnableClientState(gl, glArrayIndex);
-    }
-    public void glDisableClientState(int glArrayIndex) {
-      fixedFunction.glDisableClientState(gl, glArrayIndex);
-    }
-
-    public void glVertexPointer(GLArrayData array) {
-      if(array.isVBO()) {
-          if(!gl.glIsVBOArrayEnabled()) {
-            throw new GLException("VBO array is not enabled: "+array);
-          }
-      } else {
-          if(gl.glIsVBOArrayEnabled()) {
-            throw new GLException("VBO array is not disabled: "+array);
-          }
-          Buffers.rangeCheck(array.getBuffer(), 1);
-          if (!Buffers.isDirect(array.getBuffer())) {
-            throw new GLException("Argument \"pointer\" was not a direct buffer"); }
-      }
-      fixedFunction.glVertexPointer(gl, array);
-    }
-
-    public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer) {
-      glVertexPointer(GLArrayDataWrapper.createFixed(gl, GL_VERTEX_ARRAY, size, type, false, stride, pointer, 0, 0));
-    }
-    public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) {
-      int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
-      if(vboName==0) {
-        throw new GLException("no GL_ARRAY_BUFFER VBO bound");
-      }
-      glVertexPointer(GLArrayDataWrapper.createFixed(gl, GL_VERTEX_ARRAY, size, type, false, 
-                                                     stride, null, vboName, pointer_buffer_offset));
-    }
-
-    public void glColorPointer(GLArrayData array) {
-      if(array.isVBO()) {
-          if(!gl.glIsVBOArrayEnabled()) {
-            throw new GLException("VBO array is not enabled: "+array);
-          }
-      } else {
-          if(gl.glIsVBOArrayEnabled()) {
-            throw new GLException("VBO array is not disabled: "+array);
-          }
-          Buffers.rangeCheck(array.getBuffer(), 1);
-          if (!Buffers.isDirect(array.getBuffer())) {
-            throw new GLException("Argument \"pointer\" was not a direct buffer"); }
-      }
-      fixedFunction.glColorPointer(gl, array);
-    }
-    public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer) {
-      glColorPointer(GLArrayDataWrapper.createFixed(gl, GL_COLOR_ARRAY, size, type, false, 
-                                                    stride, pointer, 0, 0));
-    }
-    public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) {
-      int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
-      if(vboName==0) {
-        throw new GLException("no GL_ARRAY_BUFFER VBO bound");
-      }
-      glColorPointer(GLArrayDataWrapper.createFixed(gl, GL_COLOR_ARRAY, size, type, false, 
-                                                   stride, null, vboName, pointer_buffer_offset));
-    }
-
-    public void glNormalPointer(GLArrayData array) {
-      if(array.getComponentNumber()!=3) {
-        throw new GLException("Only 3 components per normal allowed");
-      }
-      if(array.isVBO()) {
-          if(!gl.glIsVBOArrayEnabled()) {
-            throw new GLException("VBO array is not enabled: "+array);
-          }
-      } else {
-          if(gl.glIsVBOArrayEnabled()) {
-            throw new GLException("VBO array is not disabled: "+array);
-          }
-          Buffers.rangeCheck(array.getBuffer(), 1);
-          if (!Buffers.isDirect(array.getBuffer())) {
-            throw new GLException("Argument \"pointer\" was not a direct buffer"); }
-      }
-      fixedFunction.glNormalPointer(gl, array);
-    }
-    public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) {
-      glNormalPointer(GLArrayDataWrapper.createFixed(gl, GL_NORMAL_ARRAY, 3, type, false, 
-                                                     stride, pointer, 0, 0));
-    }
-    public void glNormalPointer(int type, int stride, long pointer_buffer_offset) {
-      int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
-      if(vboName==0) {
-        throw new GLException("no GL_ARRAY_BUFFER VBO bound");
-      }
-      glNormalPointer(GLArrayDataWrapper.createFixed(gl, GL_NORMAL_ARRAY, 3, type, false, 
-                                                     stride, null, vboName, pointer_buffer_offset));
-    }
-
-    public void glTexCoordPointer(GLArrayData array) {
-      if(array.isVBO()) {
-          if(!gl.glIsVBOArrayEnabled()) {
-            throw new GLException("VBO array is not enabled: "+array);
-          }
-      } else {
-          if(gl.glIsVBOArrayEnabled()) {
-            throw new GLException("VBO array is not disabled: "+array);
-          }
-          Buffers.rangeCheck(array.getBuffer(), 1);
-          if (!Buffers.isDirect(array.getBuffer())) {
-            throw new GLException("Argument \"pointer\" was not a direct buffer"); }
-      }
-      fixedFunction.glTexCoordPointer(gl, array);
-    }
-    public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer) {
-      glTexCoordPointer(
-        GLArrayDataWrapper.createFixed(gl, GL_TEXTURE_COORD_ARRAY, size, type, false, stride, pointer, 0,0));
-    }
-    public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) {
-      int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
-      if(vboName==0) {
-        throw new GLException("no GL_ARRAY_BUFFER VBO bound");
-      }
-      glTexCoordPointer(
-        GLArrayDataWrapper.createFixed(gl, GL_TEXTURE_COORD_ARRAY, size, type, false, 
-                                       stride, null, vboName, pointer_buffer_offset) );
-    }
-
-    public final String toString() {
-          StringBuffer buf = new StringBuffer();
-          buf.append(getClass().getName()+" (");
-          if(null!=pmvMatrix) {
-              buf.append(", matrixDirty: "+pmvMatrix.isDirty());
-          }
-          buf.append("\n\t, FixedFunction: "+fixedFunction);
-          buf.append(gl);
-          buf.append(" )");
-
-          return buf.toString();
-    }
-
-}
-
-
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java
deleted file mode 100644
index 529e456..0000000
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java
+++ /dev/null
@@ -1,554 +0,0 @@
-
-package com.jogamp.opengl.util.glsl.fixedfunc.impl;
-
-import com.jogamp.common.nio.Buffers;
-import javax.media.opengl.*;
-import javax.media.opengl.fixedfunc.*;
-import com.jogamp.opengl.util.*;
-import com.jogamp.opengl.util.glsl.*;
-import java.nio.*;
-
-public class FixedFuncPipeline {
-    public static final int MAX_TEXTURE_UNITS = 8;
-    public static final int MAX_LIGHTS        = 8;
-
-    // We can't have any dependencies on the FixedFuncUtil class for build bootstrapping reasons
-    public static final String mgl_Vertex = "mgl_Vertex";
-    public static final String mgl_Normal = "mgl_Normal";
-    public static final String mgl_Color = "mgl_Color";
-    public static final String mgl_MultiTexCoord = "mgl_MultiTexCoord" ;
-
-    public static String getPredefinedArrayIndexName(int glArrayIndex) {
-        switch(glArrayIndex) {
-            case GLPointerFunc.GL_VERTEX_ARRAY:
-                return mgl_Vertex;
-            case GLPointerFunc.GL_NORMAL_ARRAY:
-                return mgl_Normal;
-            case GLPointerFunc.GL_COLOR_ARRAY:
-                return mgl_Color;
-            case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
-                return mgl_MultiTexCoord;
-        }
-        return null;
-    }
-
-    public FixedFuncPipeline(GL2ES2 gl, PMVMatrix pmvMatrix) {
-        init(gl, pmvMatrix, FixedFuncPipeline.class, shaderSrcRootDef, shaderBinRootDef, 
-             vertexColorFileDef, vertexColorLightFileDef, fragmentColorFileDef, fragmentColorTextureFileDef);
-    }
-    public FixedFuncPipeline(GL2ES2 gl, PMVMatrix pmvMatrix, Class shaderRootClass, String shaderSrcRoot, String shaderBinRoot, 
-                       String vertexColorFile,
-                       String vertexColorLightFile,
-                       String fragmentColorFile,
-                       String fragmentColorTextureFile) {
-        init(gl, pmvMatrix, shaderRootClass, shaderSrcRoot, shaderBinRoot, 
-             vertexColorFile, vertexColorLightFile, fragmentColorFile, fragmentColorTextureFile);
-    }
-
-    public boolean verbose() { return verbose; }
-
-    public void setVerbose(boolean v) { verbose=v; }
-
-    public boolean isValid() {
-        return shaderState.linked();
-    }
-
-    public ShaderState getShaderState() {
-        return shaderState;
-    }
-
-    public int getActiveTextureUnit() {
-        return activeTextureUnit;
-    }
-
-    public String getArrayIndexName(int glArrayIndex) {
-      String name = getPredefinedArrayIndexName(glArrayIndex); 
-      switch(glArrayIndex) {
-          case GLPointerFunc.GL_VERTEX_ARRAY:
-          case GLPointerFunc.GL_NORMAL_ARRAY:
-          case GLPointerFunc.GL_COLOR_ARRAY:
-              break;
-          case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
-              name = name + activeTextureUnit;
-      }
-      return name;
-    }
-
-    public void destroy(GL2ES2 gl) {
-        shaderProgramColor.release(gl, true);
-        shaderProgramColorLight.release(gl, true);
-        shaderProgramColorTexture.release(gl, true);
-        shaderProgramColorTextureLight.release(gl, true);
-        shaderState.destroy(gl);
-    }
-
-    public void glEnableClientState(GL2ES2 gl, int glArrayIndex) {
-        shaderState.glUseProgram(gl, true);
-
-        shaderState.glEnableVertexAttribArray(gl, getArrayIndexName(glArrayIndex));
-        // textureCoordsEnabled |=  (1 << activeTextureUnit);
-        if ( textureCoordsEnabled.get(activeTextureUnit) != 1 ) {
-            textureCoordsEnabled.put(activeTextureUnit, 1);
-            textureCoordsEnabledDirty = true;
-        }
-    }
-
-    public void glDisableClientState(GL2ES2 gl, int glArrayIndex) {
-        shaderState.glUseProgram(gl, true);
-
-        shaderState.glDisableVertexAttribArray(gl, getArrayIndexName(glArrayIndex));
-        // textureCoordsEnabled &= ~(1 << activeTextureUnit);
-        if ( textureCoordsEnabled.get(activeTextureUnit) != 0 ) {
-            textureCoordsEnabled.put(activeTextureUnit, 0);
-            textureCoordsEnabledDirty = true;
-        }
-    }
-
-    public void glVertexPointer(GL2ES2 gl, GLArrayData data) {
-        shaderState.glUseProgram(gl, true);
-        shaderState.glVertexAttribPointer(gl, data);
-    }
-
-    public void glColorPointer(GL2ES2 gl, GLArrayData data) {
-        shaderState.glUseProgram(gl, true);
-        shaderState.glVertexAttribPointer(gl, data);
-    }
-
-    public void glColor4fv(GL2ES2 gl, FloatBuffer data ) {
-        shaderState.glUseProgram(gl, true);
-        GLUniformData ud = shaderState.getUniform(mgl_ColorStatic);
-        if(null!=ud) {
-            ud.setData(data);
-            shaderState.glUniform(gl, ud);
-        }
-    }
-
-    public void glNormalPointer(GL2ES2 gl, GLArrayData data) {
-        shaderState.glUseProgram(gl, true);
-        shaderState.glVertexAttribPointer(gl, data);
-    }
-
-    public void glTexCoordPointer(GL2ES2 gl, GLArrayData data) {
-        shaderState.glUseProgram(gl, true);
-        data.setName( getArrayIndexName(data.getIndex()) );
-        shaderState.glVertexAttribPointer(gl, data);
-    }
-
-    public void glLightfv(GL2ES2 gl, int light, int pname, java.nio.FloatBuffer params) {
-        shaderState.glUseProgram(gl, true);
-        light -=GLLightingFunc.GL_LIGHT0;
-        if(0 <= light && light < MAX_LIGHTS) {
-            GLUniformData ud = null;
-            switch(pname) {
-                case  GLLightingFunc.GL_AMBIENT:
-                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].ambient");
-                    break;
-                case  GLLightingFunc.GL_DIFFUSE:
-                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].diffuse");
-                    break;
-                case  GLLightingFunc.GL_SPECULAR:
-                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].specular");
-                    break;
-                case GLLightingFunc.GL_POSITION:
-                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].position");
-                    break;
-                case GLLightingFunc.GL_SPOT_DIRECTION:
-                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotDirection");
-                    break;
-                case GLLightingFunc.GL_SPOT_EXPONENT:
-                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotExponent");
-                    break;
-                case GLLightingFunc.GL_SPOT_CUTOFF:
-                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotCutoff");
-                    break;
-                case GLLightingFunc.GL_CONSTANT_ATTENUATION:
-                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].constantAttenuation");
-                    break;
-                case GLLightingFunc.GL_LINEAR_ATTENUATION:
-                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].linearAttenuation");
-                    break;
-                case GLLightingFunc.GL_QUADRATIC_ATTENUATION:
-                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].quadraticAttenuation");
-                    break;
-                default:
-                    if(verbose) {
-                        System.err.println("glLightfv pname not within [GL_AMBIENT GL_DIFFUSE GL_SPECULAR GL_POSITION GL_SPOT_DIRECTION]: "+pname);
-                    }
-                    return;
-            }
-            if(null!=ud) {
-                ud.setData(params);
-                shaderState.glUniform(gl, ud);
-            }
-        } else if(verbose) {
-            System.err.println("glLightfv light not within [0.."+MAX_LIGHTS+"]: "+light);
-        }
-    }
-
-    public void glMaterialfv(GL2ES2 gl, int face, int pname, java.nio.FloatBuffer params) {
-        shaderState.glUseProgram(gl, true);
-
-        switch (face) {
-            case GL.GL_FRONT:
-            case GL.GL_FRONT_AND_BACK:
-                break;
-            case GL.GL_BACK:
-                if(verbose) {
-                    System.err.println("glMaterialfv face GL_BACK currently not supported");
-                }
-                break;
-            default:
-        }
-
-        GLUniformData ud = null;
-        switch(pname) {
-            case  GLLightingFunc.GL_AMBIENT:
-                ud = shaderState.getUniform(mgl_FrontMaterial+".ambient");
-                break;
-            case  GLLightingFunc.GL_AMBIENT_AND_DIFFUSE:
-                glMaterialfv(gl, face, GLLightingFunc.GL_AMBIENT, params);
-                // fall through intended ..
-            case  GLLightingFunc.GL_DIFFUSE:
-                ud = shaderState.getUniform(mgl_FrontMaterial+".diffuse");
-                break;
-            case  GLLightingFunc.GL_SPECULAR:
-                ud = shaderState.getUniform(mgl_FrontMaterial+".specular");
-                break;
-            case  GLLightingFunc.GL_EMISSION:
-                ud = shaderState.getUniform(mgl_FrontMaterial+".emission");
-                break;
-            case  GLLightingFunc.GL_SHININESS:
-                ud = shaderState.getUniform(mgl_FrontMaterial+".shininess");
-                break;
-            default:
-                if(verbose) {
-                    System.err.println("glMaterialfv pname not within [GL_AMBIENT GL_DIFFUSE GL_SPECULAR GL_EMISSION GL_SHININESS]: "+pname);
-                }
-                return;
-        }
-        if(null!=ud) {
-            ud.setData(params);
-            shaderState.glUniform(gl, ud);
-        }
-    }
-
-    public void glShadeModel(GL2ES2 gl, int mode) {
-        shaderState.glUseProgram(gl, true);
-        GLUniformData ud = shaderState.getUniform(mgl_ShadeModel);
-        if(null!=ud) {
-            ud.setData(mode);
-            shaderState.glUniform(gl, ud);
-        }
-    }
-
-    public void glActiveTexture(GL2ES2 gl, int textureUnit) {
-        textureUnit -= GL.GL_TEXTURE0;
-        if(0 <= textureUnit && textureUnit<MAX_TEXTURE_UNITS) {
-            shaderState.glUseProgram(gl, true);
-            GLUniformData ud;
-            ud = shaderState.getUniform(mgl_ActiveTexture);
-            if(null!=ud) {
-                ud.setData(textureUnit);
-                shaderState.glUniform(gl, ud);
-            }
-            ud = shaderState.getUniform(mgl_ActiveTextureIdx);
-            if(null!=ud) {
-                ud.setData(textureUnit);
-                shaderState.glUniform(gl, ud);
-            }
-            activeTextureUnit = textureUnit;
-        } else {
-            throw new GLException("glActivateTexture textureUnit not within GL_TEXTURE0 + [0.."+MAX_TEXTURE_UNITS+"]: "+textureUnit);
-        }
-    }
-
-    /**
-     * @return false if digested in regard to GL2ES2 spec, 
-     *         eg this call must not be passed to an underlying ES2 implementation.
-     *         true if this call shall be passed to an underlying GL2ES2/ES2 implementation as well.
-     */
-    public boolean glEnable(GL2ES2 gl, int cap, boolean enable) {
-        switch(cap) {
-            case GL.GL_TEXTURE_2D:
-                textureEnabled=enable;
-                return true;
-            case GLLightingFunc.GL_LIGHTING:
-                lightingEnabled=enable;
-                return false;
-            case GL.GL_CULL_FACE:
-                cullFace=Math.abs(cullFace);
-                if(!enable) {
-                    cullFace*=-1;
-                }
-                return true;
-        }
-
-        int light = cap - GLLightingFunc.GL_LIGHT0;
-        if(0 <= light && light < MAX_LIGHTS) {
-            if ( (lightsEnabled.get(light)==1) != enable ) {
-                lightsEnabled.put(light, enable?1:0);
-                lightsEnabledDirty = true;
-                return false;
-            }
-        }
-        return true; // pass it on ..
-    }
-
-    public void glCullFace(GL2ES2 gl, int faceName) {
-        switch(faceName) {
-            case GL.GL_FRONT:
-                faceName = 1; break;
-            case GL.GL_BACK:
-                faceName = 2; break;
-            case GL.GL_FRONT_AND_BACK:
-                faceName = 3; break;
-        }
-        if(0>cullFace) {
-            faceName *= -1;
-        }
-        cullFace = faceName;
-    }
-
-    public void validate(GL2ES2 gl) {
-        shaderState.glUseProgram(gl, true);
-        GLUniformData ud;
-        if(pmvMatrix.update()) {
-            ud = shaderState.getUniform(mgl_PMVMatrix);
-            if(null!=ud) {
-                // same data object ..
-                shaderState.glUniform(gl, ud);
-            } else {
-                throw new GLException("Failed to update: mgl_PMVMatrix");
-            }
-            ud = shaderState.getUniform(mgl_NormalMatrix);
-            if(null!=ud) {
-                // same data object ..
-                shaderState.glUniform(gl, ud);
-            }
-        }
-        ud = shaderState.getUniform(mgl_ColorEnabled);
-        if(null!=ud) {
-            int ca = (shaderState.isVertexAttribArrayEnabled(mgl_Color)==true)?1:0;
-            if(ca!=ud.intValue()) {
-                ud.setData(ca);
-                shaderState.glUniform(gl, ud);
-            }
-        }
-        ud = shaderState.getUniform(mgl_CullFace);
-        if(null!=ud) {
-            if(cullFace!=ud.intValue()) {
-                ud.setData(cullFace);
-                shaderState.glUniform(gl, ud);
-            }
-        }
-
-        if(lightsEnabledDirty) {
-            ud = shaderState.getUniform(mgl_LightsEnabled);
-            if(null!=ud) {
-                // same data object 
-                shaderState.glUniform(gl, ud);
-            }
-            lightsEnabledDirty=false;
-        }
-
-        if(textureCoordsEnabledDirty) {
-            ud = shaderState.getUniform(mgl_TexCoordEnabled);
-            if(null!=ud) {
-                // same data object 
-                shaderState.glUniform(gl, ud);
-            }
-            textureCoordsEnabledDirty=false;
-        }
-
-        if(textureEnabled) {
-            if(lightingEnabled) {
-                shaderState.attachShaderProgram(gl, shaderProgramColorTextureLight);
-            } else {
-                shaderState.attachShaderProgram(gl, shaderProgramColorTexture);
-            }
-        } else {
-            if(lightingEnabled) {
-                shaderState.attachShaderProgram(gl, shaderProgramColorLight);
-            } else {
-                shaderState.attachShaderProgram(gl, shaderProgramColor);
-            }
-        }
-        if(DEBUG) {
-            System.err.println("validate: "+this);
-        }
-    }
-
-    public String toString() {
-        return "FixedFuncPipeline[pmv: "+pmvMatrix+
-               ", textureEnabled: "+textureEnabled+
-               ", textureCoordsEnabled: "+textureCoordsEnabled+
-               ", lightingEnabled: "+lightingEnabled+
-               ", lightsEnabled: "+lightsEnabled+
-               "\n\t, shaderProgramColor: "+shaderProgramColor+
-               "\n\t, shaderProgramColorTexture: "+shaderProgramColorTexture+
-               "\n\t, shaderProgramColorLight: "+shaderProgramColorLight+
-               "\n\t, shaderProgramColorTextureLight: "+shaderProgramColorTextureLight+
-               "\n\t, ShaderState: "+shaderState+
-               "]";
-    }
-
-    protected void init(GL2ES2 gl, PMVMatrix pmvMatrix, Class shaderRootClass, String shaderSrcRoot, String shaderBinRoot, 
-                       String vertexColorFile,
-                       String vertexColorLightFile,
-                       String fragmentColorFile,
-                       String fragmentColorTextureFile) 
-   {
-        if(null==pmvMatrix) {
-            throw new GLException("PMVMatrix is null");
-        }
-        this.pmvMatrix=pmvMatrix;
-        this.shaderState=new ShaderState();
-        this.shaderState.setVerbose(verbose);
-        ShaderCode vertexColor, vertexColorLight, fragmentColor, fragmentColorTexture;
-
-        vertexColor = ShaderCode.create( gl, gl.GL_VERTEX_SHADER, 1, shaderRootClass,
-                                         shaderSrcRoot, shaderBinRoot, vertexColorFile);
-
-        vertexColorLight = ShaderCode.create( gl, gl.GL_VERTEX_SHADER, 1, shaderRootClass,
-                                           shaderSrcRoot, shaderBinRoot, vertexColorLightFile);
-
-        fragmentColor = ShaderCode.create( gl, gl.GL_FRAGMENT_SHADER, 1, shaderRootClass,
-                                           shaderSrcRoot, shaderBinRoot, fragmentColorFile);
-
-        fragmentColorTexture = ShaderCode.create( gl, gl.GL_FRAGMENT_SHADER, 1, shaderRootClass,
-                                                  shaderSrcRoot, shaderBinRoot, fragmentColorTextureFile);
-
-        shaderProgramColor = new ShaderProgram();
-        shaderProgramColor.add(vertexColor);
-        shaderProgramColor.add(fragmentColor);
-        if(!shaderProgramColor.link(gl, System.err)) {
-            throw new GLException("Couldn't link VertexColor program: "+shaderProgramColor);
-        }
-
-        shaderProgramColorTexture = new ShaderProgram();
-        shaderProgramColorTexture.add(vertexColor);
-        shaderProgramColorTexture.add(fragmentColorTexture);
-        if(!shaderProgramColorTexture.link(gl, System.err)) {
-            throw new GLException("Couldn't link VertexColorTexture program: "+shaderProgramColorTexture);
-        }
-
-        shaderProgramColorLight = new ShaderProgram();
-        shaderProgramColorLight.add(vertexColorLight);
-        shaderProgramColorLight.add(fragmentColor);
-        if(!shaderProgramColorLight.link(gl, System.err)) {
-            throw new GLException("Couldn't link VertexColorLight program: "+shaderProgramColorLight);
-        }
-
-        shaderProgramColorTextureLight = new ShaderProgram();
-        shaderProgramColorTextureLight.add(vertexColorLight);
-        shaderProgramColorTextureLight.add(fragmentColorTexture);
-        if(!shaderProgramColorTextureLight.link(gl, System.err)) {
-            throw new GLException("Couldn't link VertexColorLight program: "+shaderProgramColorTextureLight);
-        }
-
-        shaderState.attachShaderProgram(gl, shaderProgramColor);
-        shaderState.glUseProgram(gl, true);
-
-        // mandatory ..
-        if(!shaderState.glUniform(gl, new GLUniformData(mgl_PMVMatrix, 4, 4, pmvMatrix.glGetPMvMviMatrixf()))) {
-            throw new GLException("Error setting PMVMatrix in shader: "+this);
-        }
-
-        // optional parameter ..
-        shaderState.glUniform(gl, new GLUniformData(mgl_NormalMatrix, 3, 3, pmvMatrix.glGetNormalMatrixf()));
-
-        shaderState.glUniform(gl, new GLUniformData(mgl_ColorEnabled,  0));
-        shaderState.glUniform(gl, new GLUniformData(mgl_ColorStatic, 4, zero4f));
-        shaderState.glUniform(gl, new GLUniformData(mgl_TexCoordEnabled,  1, textureCoordsEnabled));
-        shaderState.glUniform(gl, new GLUniformData(mgl_ActiveTexture, activeTextureUnit));
-        shaderState.glUniform(gl, new GLUniformData(mgl_ActiveTextureIdx, activeTextureUnit));
-        shaderState.glUniform(gl, new GLUniformData(mgl_ShadeModel, 0));
-        shaderState.glUniform(gl, new GLUniformData(mgl_CullFace, cullFace));
-        for(int i=0; i<MAX_LIGHTS; i++) {
-            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].ambient", 4, defAmbient));
-            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].diffuse", 4, defDiffuse));
-            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].specular", 4, defSpecular));
-            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].position", 4, defPosition));
-            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotDirection", 3, defSpotDir));
-            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotExponent", defSpotExponent));
-            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotCutoff", defSpotCutoff));
-            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].constantAttenuation", defConstantAtten));
-            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].linearAttenuation", defLinearAtten));
-            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].quadraticAttenuation", defQuadraticAtten));
-        }
-        shaderState.glUniform(gl, new GLUniformData(mgl_LightsEnabled,  1, lightsEnabled));
-        shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".ambient", 4, defMatAmbient));
-        shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".diffuse", 4, defMatDiffuse));
-        shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".specular", 4, defMatSpecular));
-        shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".emission", 4, defMatEmission));
-        shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".shininess", defMatShininess));
-
-        shaderState.glUseProgram(gl, false);
-    }
-
-    protected static final boolean DEBUG=false;
-    protected boolean verbose=false;
-
-    protected boolean textureEnabled=false;
-    protected IntBuffer textureCoordsEnabled = Buffers.newDirectIntBuffer(new int[] { 0, 0, 0, 0, 0, 0, 0, 0 });
-    protected boolean textureCoordsEnabledDirty = false;
-    protected int     activeTextureUnit=0;
-
-    protected int cullFace=-2; // <=0 disabled, 1: front, 2: back (default, but disabled), 3: front & back
-
-    protected boolean lightingEnabled=false;
-    protected IntBuffer lightsEnabled = Buffers.newDirectIntBuffer(new int[] { 0, 0, 0, 0, 0, 0, 0, 0 });
-    protected boolean   lightsEnabledDirty = false;
-
-    protected PMVMatrix pmvMatrix;
-    protected ShaderState shaderState;
-    protected ShaderProgram shaderProgramColor;
-    protected ShaderProgram shaderProgramColorTexture;
-    protected ShaderProgram shaderProgramColorLight;
-    protected ShaderProgram shaderProgramColorTextureLight;
-
-    // uniforms ..
-    protected static final String mgl_PMVMatrix        = "mgl_PMVMatrix";       // m4fv[3]
-    protected static final String mgl_NormalMatrix     = "mgl_NormalMatrix";    // m4fv
-    protected static final String mgl_ColorEnabled     = "mgl_ColorEnabled";    //  1i
-    protected static final String mgl_ColorStatic      = "mgl_ColorStatic";     //  4fv
-
-    protected static final String mgl_LightSource      = "mgl_LightSource";     //  struct mgl_LightSourceParameters[MAX_LIGHTS]
-    protected static final String mgl_FrontMaterial    = "mgl_FrontMaterial";   //  struct mgl_MaterialParameters
-    protected static final String mgl_LightsEnabled    = "mgl_LightsEnabled";   //  int mgl_LightsEnabled[MAX_LIGHTS];
-
-    protected static final String mgl_ShadeModel       = "mgl_ShadeModel";      //  1i
-
-    protected static final String mgl_TexCoordEnabled  = "mgl_TexCoordEnabled"; //  int mgl_TexCoordEnabled[MAX_TEXTURE_UNITS];
-    protected static final String mgl_ActiveTexture    = "mgl_ActiveTexture";   //  1i
-    protected static final String mgl_ActiveTextureIdx = "mgl_ActiveTextureIdx";//  1i
-
-    protected static final String mgl_CullFace         = "mgl_CullFace";   //  1i
-
-    protected static final FloatBuffer zero4f     = Buffers.newDirectFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f, 0.0f });
-
-    public static final FloatBuffer defAmbient = Buffers.newDirectFloatBuffer(new float[] { 0f, 0f, 0f, 1f });
-    public static final FloatBuffer defDiffuse = zero4f;
-    public static final FloatBuffer defSpecular= zero4f;
-    public static final FloatBuffer defPosition= Buffers.newDirectFloatBuffer(new float[] { 0f, 0f, 1f, 0f });
-    public static final FloatBuffer defSpotDir = Buffers.newDirectFloatBuffer(new float[] { 0f, 0f, -1f });
-    public static final float defSpotExponent  = 0f;
-    public static final float defSpotCutoff    = 180f;
-    public static final float defConstantAtten = 1f;
-    public static final float defLinearAtten   = 0f;
-    public static final float defQuadraticAtten= 0f;
-
-    public static final FloatBuffer defMatAmbient = Buffers.newDirectFloatBuffer(new float[] { 0.2f, 0.2f, 0.2f, 1.0f });
-    public static final FloatBuffer defMatDiffuse = Buffers.newDirectFloatBuffer(new float[] { 0.8f, 0.8f, 0.8f, 1.0f });
-    public static final FloatBuffer defMatSpecular= Buffers.newDirectFloatBuffer(new float[] { 0f, 0f, 0f, 1f});
-    public static final FloatBuffer defMatEmission= Buffers.newDirectFloatBuffer(new float[] { 0f, 0f, 0f, 1f});
-    public static final float       defMatShininess = 0f;
-
-    protected static final String vertexColorFileDef          = "FixedFuncColor";
-    protected static final String vertexColorLightFileDef    = "FixedFuncColorLight";
-    protected static final String fragmentColorFileDef        = "FixedFuncColor";
-    protected static final String fragmentColorTextureFileDef = "FixedFuncColorTexture";
-    protected static final String shaderSrcRootDef = "shaders" ;
-    protected static final String shaderBinRootDef = "shaders/bin" ;
-}
-
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
index 57ac0d4..38f8ff9 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
@@ -42,7 +42,7 @@ import java.security.*;
 import javax.media.opengl.*;
 import javax.media.opengl.glu.*;
 import javax.media.nativewindow.NativeWindowFactory;
-import com.jogamp.opengl.impl.*;
+import jogamp.opengl.*;
 import com.jogamp.opengl.util.texture.*;
 import com.jogamp.opengl.util.texture.spi.*;
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
new file mode 100644
index 0000000..e86ff16
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
@@ -0,0 +1,1258 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.jogamp.opengl.util.texture;
+
+import java.io.*;
+import java.net.*;
+import java.nio.*;
+import java.util.*;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import jogamp.opengl.Debug;
+import com.jogamp.opengl.util.*;
+import com.jogamp.opengl.util.texture.spi.*;
+
+/** <P> Provides input and output facilities for both loading OpenGL
+    textures from disk and streams as well as writing textures already
+    in memory back to disk. </P>
+
+    <P> The TextureIO class supports an arbitrary number of plug-in
+    readers and writers via TextureProviders and TextureWriters.
+    TextureProviders know how to produce TextureData objects from
+    files, InputStreams and URLs. TextureWriters know how to write
+    TextureData objects to disk in various file formats. The
+    TextureData class represents the raw data of the texture before it
+    has been converted to an OpenGL texture object. The Texture class
+    represents the OpenGL texture object and provides easy facilities
+    for using the texture. </P>
+
+    <P> There are several built-in TextureProviders and TextureWriters
+    supplied with the TextureIO implementation. The most basic
+    provider uses the platform's Image I/O facilities to read in a
+    BufferedImage and convert it to a texture. This is the baseline
+    provider and is registered so that it is the last one consulted.
+    All others are asked first to open a given file. </P>
+
+    <P> There are three other providers registered by default as of
+    the time of this writing. One handles SGI RGB (".sgi", ".rgb")
+    images from both files and streams. One handles DirectDraw Surface
+    (".dds") images read from files, though can not read these images
+    from streams. One handles Targa (".tga") images read from both
+    files and streams. These providers are executed in an arbitrary
+    order. Some of these providers require the file's suffix to either
+    be specified via the newTextureData methods or for the file to be
+    named with the appropriate suffix. In general a file suffix should
+    be provided to the newTexture and newTextureData methods if at all
+    possible. </P>
+
+    <P> Note that additional TextureProviders, if reading images from
+    InputStreams, must use the mark()/reset() methods on InputStream
+    when probing for e.g. magic numbers at the head of the file to
+    make sure not to disturb the state of the InputStream for
+    downstream TextureProviders. </P>
+
+    <P> There are analogous TextureWriters provided for writing
+    textures back to disk if desired. As of this writing, there are
+    four TextureWriters registered by default: one for Targa files,
+    one for SGI RGB files, one for DirectDraw surface (.dds) files,
+    and one for ImageIO-supplied formats such as .jpg and .png.  Some
+    of these writers have certain limitations such as only being able
+    to write out textures stored in GL_RGB or GL_RGBA format. The DDS
+    writer supports fetching and writing to disk of texture data in
+    DXTn compressed format. Whether this will occur is dependent on
+    whether the texture's internal format is one of the DXTn
+    compressed formats and whether the target file is .dds format.
+*/
+
+public class TextureIO {
+    /** Constant which can be used as a file suffix to indicate a
+        DirectDraw Surface file. */
+    public static final String DDS     = "dds";
+
+    /** Constant which can be used as a file suffix to indicate an SGI
+        RGB file. */
+    public static final String SGI     = "sgi";
+
+    /** Constant which can be used as a file suffix to indicate an SGI
+        RGB file. */
+    public static final String SGI_RGB = "rgb";
+
+    /** Constant which can be used as a file suffix to indicate a GIF
+        file. */
+    public static final String GIF     = "gif";
+
+    /** Constant which can be used as a file suffix to indicate a JPEG
+        file. */
+    public static final String JPG     = "jpg";
+
+    /** Constant which can be used as a file suffix to indicate a PNG
+        file. */
+    public static final String PNG     = "png";
+
+    /** Constant which can be used as a file suffix to indicate a Targa
+        file. */
+    public static final String TGA     = "tga";
+
+    /** Constant which can be used as a file suffix to indicate a TIFF
+        file. */
+    public static final String TIFF    = "tiff";
+
+    private static final boolean DEBUG = Debug.debug("TextureIO");
+
+    // For manually disabling the use of the texture rectangle
+    // extensions so you know the texture target is GL_TEXTURE_2D; this
+    // is useful for shader writers (thanks to Chris Campbell for this
+    // observation)
+    private static boolean texRectEnabled = true;
+
+    //----------------------------------------------------------------------
+    // methods that *do not* require a current context
+    // These methods assume RGB or RGBA textures.
+    // Some texture providers may not recognize the file format unless
+    // the fileSuffix is specified, so it is strongly recommended to
+    // specify it wherever it is known.
+    // Some texture providers may also only support one kind of input,
+    // i.e., reading from a file as opposed to a stream.
+
+    /**
+     * Creates a TextureData from the given file. Does no OpenGL work.
+     *
+     * @param glp the OpenGL Profile this texture data should be
+     *                  created for.
+     * @param file the file from which to read the texture data
+     * @param mipmap     whether mipmaps should be produced for this
+     *                   texture either by autogenerating them or
+     *                   reading them from the file. Some file formats
+     *                   support multiple mipmaps in a single file in
+     *                   which case those mipmaps will be used rather
+     *                   than generating them.
+     * @param fileSuffix the suffix of the file name to be used as a
+     *                   hint of the file format to the underlying
+     *                   texture provider, or null if none and should be
+     *                   auto-detected (some texture providers do not
+     *                   support this)
+     * @return the texture data from the file, or null if none of the
+     *         registered texture providers could read the file
+     * @throws IOException if an error occurred while reading the file
+     */
+    public static TextureData newTextureData(GLProfile glp, File file,
+                                             boolean mipmap,
+                                             String fileSuffix) throws IOException {
+        if (fileSuffix == null) {
+            fileSuffix = FileUtil.getFileSuffix(file);
+        }
+        return newTextureDataImpl(glp, file, 0, 0, mipmap, fileSuffix);
+    }
+
+    /**
+     * Creates a TextureData from the given stream. Does no OpenGL work.
+     *
+     * @param glp the OpenGL Profile this texture data should be
+     *                  created for.
+     * @param stream the stream from which to read the texture data
+     * @param mipmap     whether mipmaps should be produced for this
+     *                   texture either by autogenerating them or
+     *                   reading them from the file. Some file formats
+     *                   support multiple mipmaps in a single file in
+     *                   which case those mipmaps will be used rather
+     *                   than generating them.
+     * @param fileSuffix the suffix of the file name to be used as a
+     *                   hint of the file format to the underlying
+     *                   texture provider, or null if none and should be
+     *                   auto-detected (some texture providers do not
+     *                   support this)
+     * @return the texture data from the stream, or null if none of the
+     *         registered texture providers could read the stream
+     * @throws IOException if an error occurred while reading the stream
+     */
+    public static TextureData newTextureData(GLProfile glp, InputStream stream,
+                                             boolean mipmap,
+                                             String fileSuffix) throws IOException {
+        return newTextureDataImpl(glp, stream, 0, 0, mipmap, fileSuffix);
+    }
+
+    /**
+     * Creates a TextureData from the given URL. Does no OpenGL work.
+     *
+     * @param glp the OpenGL Profile this texture data should be
+     *                  created for.
+     * @param url the URL from which to read the texture data
+     * @param mipmap     whether mipmaps should be produced for this
+     *                   texture either by autogenerating them or
+     *                   reading them from the file. Some file formats
+     *                   support multiple mipmaps in a single file in
+     *                   which case those mipmaps will be used rather
+     *                   than generating them.
+     * @param fileSuffix the suffix of the file name to be used as a
+     *                   hint of the file format to the underlying
+     *                   texture provider, or null if none and should be
+     *                   auto-detected (some texture providers do not
+     *                   support this)
+     * @return the texture data from the URL, or null if none of the
+     *         registered texture providers could read the URL
+     * @throws IOException if an error occurred while reading the URL
+     */
+    public static TextureData newTextureData(GLProfile glp, URL url,
+                                             boolean mipmap,
+                                             String fileSuffix) throws IOException {
+        if (fileSuffix == null) {
+            fileSuffix = FileUtil.getFileSuffix(url.getPath());
+        }
+        return newTextureDataImpl(glp, url, 0, 0, mipmap, fileSuffix);
+    }
+
+    //----------------------------------------------------------------------
+    // These methods make no assumption about the OpenGL internal format
+    // or pixel format of the texture; they must be specified by the
+    // user. It is not allowed to supply 0 (indicating no preference)
+    // for either the internalFormat or the pixelFormat;
+    // IllegalArgumentException will be thrown in this case.
+
+    /**
+     * Creates a TextureData from the given file, using the specified
+     * OpenGL internal format and pixel format for the texture which
+     * will eventually result. The internalFormat and pixelFormat must
+     * be specified and may not be zero; to use default values, use the
+     * variant of this method which does not take these arguments. Does
+     * no OpenGL work.
+     *
+     * @param glp the OpenGL Profile this texture data should be
+     *                  created for.
+     * @param file the file from which to read the texture data
+     * @param internalFormat the OpenGL internal format of the texture
+     *                   which will eventually result from the TextureData
+     * @param pixelFormat the OpenGL pixel format of the texture
+     *                    which will eventually result from the TextureData
+     * @param mipmap     whether mipmaps should be produced for this
+     *                   texture either by autogenerating them or
+     *                   reading them from the file. Some file formats
+     *                   support multiple mipmaps in a single file in
+     *                   which case those mipmaps will be used rather
+     *                   than generating them.
+     * @param fileSuffix the suffix of the file name to be used as a
+     *                   hint of the file format to the underlying
+     *                   texture provider, or null if none and should be
+     *                   auto-detected (some texture providers do not
+     *                   support this)
+     * @return the texture data from the file, or null if none of the
+     *         registered texture providers could read the file
+     * @throws IllegalArgumentException if either internalFormat or
+     *                                  pixelFormat was 0
+     * @throws IOException if an error occurred while reading the file
+     */
+    public static TextureData newTextureData(GLProfile glp, File file,
+                                             int internalFormat,
+                                             int pixelFormat,
+                                             boolean mipmap,
+                                             String fileSuffix) throws IOException, IllegalArgumentException {
+        if ((internalFormat == 0) || (pixelFormat == 0)) {
+            throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
+        }
+
+        if (fileSuffix == null) {
+            fileSuffix = FileUtil.getFileSuffix(file);
+        }
+
+        return newTextureDataImpl(glp, file, internalFormat, pixelFormat, mipmap, fileSuffix);
+    }
+
+    /**
+     * Creates a TextureData from the given stream, using the specified
+     * OpenGL internal format and pixel format for the texture which
+     * will eventually result. The internalFormat and pixelFormat must
+     * be specified and may not be zero; to use default values, use the
+     * variant of this method which does not take these arguments. Does
+     * no OpenGL work.
+     *
+     * @param glp the OpenGL Profile this texture data should be
+     *                  created for.
+     * @param stream the stream from which to read the texture data
+     * @param internalFormat the OpenGL internal format of the texture
+     *                   which will eventually result from the TextureData
+     * @param pixelFormat the OpenGL pixel format of the texture
+     *                    which will eventually result from the TextureData
+     * @param mipmap     whether mipmaps should be produced for this
+     *                   texture either by autogenerating them or
+     *                   reading them from the file. Some file formats
+     *                   support multiple mipmaps in a single file in
+     *                   which case those mipmaps will be used rather
+     *                   than generating them.
+     * @param fileSuffix the suffix of the file name to be used as a
+     *                   hint of the file format to the underlying
+     *                   texture provider, or null if none and should be
+     *                   auto-detected (some texture providers do not
+     *                   support this)
+     * @return the texture data from the stream, or null if none of the
+     *         registered texture providers could read the stream
+     * @throws IllegalArgumentException if either internalFormat or
+     *                                  pixelFormat was 0
+     * @throws IOException if an error occurred while reading the stream
+     */
+    public static TextureData newTextureData(GLProfile glp, InputStream stream,
+                                             int internalFormat,
+                                             int pixelFormat,
+                                             boolean mipmap,
+                                             String fileSuffix) throws IOException, IllegalArgumentException {
+        if ((internalFormat == 0) || (pixelFormat == 0)) {
+            throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
+        }
+
+        return newTextureDataImpl(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
+    }
+
+    /**
+     * Creates a TextureData from the given URL, using the specified
+     * OpenGL internal format and pixel format for the texture which
+     * will eventually result. The internalFormat and pixelFormat must
+     * be specified and may not be zero; to use default values, use the
+     * variant of this method which does not take these arguments. Does
+     * no OpenGL work.
+     *
+     * @param glp the OpenGL Profile this texture data should be
+     *                  created for.
+     * @param url the URL from which to read the texture data
+     * @param internalFormat the OpenGL internal format of the texture
+     *                   which will eventually result from the TextureData
+     * @param pixelFormat the OpenGL pixel format of the texture
+     *                    which will eventually result from the TextureData
+     * @param mipmap     whether mipmaps should be produced for this
+     *                   texture either by autogenerating them or
+     *                   reading them from the file. Some file formats
+     *                   support multiple mipmaps in a single file in
+     *                   which case those mipmaps will be used rather
+     *                   than generating them.
+     * @param fileSuffix the suffix of the file name to be used as a
+     *                   hint of the file format to the underlying
+     *                   texture provider, or null if none and should be
+     *                   auto-detected (some texture providers do not
+     *                   support this)
+     * @return the texture data from the URL, or null if none of the
+     *         registered texture providers could read the URL
+     * @throws IllegalArgumentException if either internalFormat or
+     *                                  pixelFormat was 0
+     * @throws IOException if an error occurred while reading the URL
+     */
+    public static TextureData newTextureData(GLProfile glp, URL url,
+                                             int internalFormat,
+                                             int pixelFormat,
+                                             boolean mipmap,
+                                             String fileSuffix) throws IOException, IllegalArgumentException {
+        if ((internalFormat == 0) || (pixelFormat == 0)) {
+            throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
+        }
+
+        if (fileSuffix == null) {
+            fileSuffix = FileUtil.getFileSuffix(url.getPath());
+        }
+
+        return newTextureDataImpl(glp, url, internalFormat, pixelFormat, mipmap, fileSuffix);
+    }
+
+    //----------------------------------------------------------------------
+    // methods that *do* require a current context
+    //
+
+    /** 
+     * Creates an OpenGL texture object from the specified TextureData
+     * using the current OpenGL context.
+     *
+     * @param data the texture data to turn into an OpenGL texture
+     * @throws GLException if no OpenGL context is current or if an
+     *                     OpenGL error occurred
+     * @throws IllegalArgumentException if the passed TextureData was null
+     */
+    public static Texture newTexture(TextureData data) throws GLException, IllegalArgumentException {
+        if (data == null) {
+            throw new IllegalArgumentException("Null TextureData");
+        }
+        return new Texture(data);
+    }
+
+    /** 
+     * Creates an OpenGL texture object from the specified file using
+     * the current OpenGL context.
+     *
+     * @param file the file from which to read the texture data
+     * @param mipmap     whether mipmaps should be produced for this
+     *                   texture either by autogenerating them or
+     *                   reading them from the file. Some file formats
+     *                   support multiple mipmaps in a single file in
+     *                   which case those mipmaps will be used rather
+     *                   than generating them.
+     * @throws IOException if an error occurred while reading the file
+     * @throws GLException if no OpenGL context is current or if an
+     *                     OpenGL error occurred
+     */
+    public static Texture newTexture(File file, boolean mipmap) throws IOException, GLException {
+        GLProfile glp = GLContext.getCurrentGL().getGLProfile();
+        TextureData data = newTextureData(glp, file, mipmap, FileUtil.getFileSuffix(file));
+        Texture texture = newTexture(data);
+        data.flush();
+        return texture;
+    }
+
+    /** 
+     * Creates an OpenGL texture object from the specified stream using
+     * the current OpenGL context.
+     *
+     * @param stream the stream from which to read the texture data
+     * @param mipmap     whether mipmaps should be produced for this
+     *                   texture either by autogenerating them or
+     *                   reading them from the file. Some file formats
+     *                   support multiple mipmaps in a single file in
+     *                   which case those mipmaps will be used rather
+     *                   than generating them.
+     * @param fileSuffix the suffix of the file name to be used as a
+     *                   hint of the file format to the underlying
+     *                   texture provider, or null if none and should be
+     *                   auto-detected (some texture providers do not
+     *                   support this)
+     * @throws IOException if an error occurred while reading the stream
+     * @throws GLException if no OpenGL context is current or if an
+     *                     OpenGL error occurred
+     */
+    public static Texture newTexture(InputStream stream, boolean mipmap, String fileSuffix) throws IOException, GLException {
+        GLProfile glp = GLContext.getCurrentGL().getGLProfile();
+        TextureData data = newTextureData(glp, stream, mipmap, fileSuffix);
+        Texture texture = newTexture(data);
+        data.flush();
+        return texture;
+    }
+
+    /** 
+     * Creates an OpenGL texture object from the specified URL using the
+     * current OpenGL context.
+     *
+     * @param url the URL from which to read the texture data
+     * @param mipmap     whether mipmaps should be produced for this
+     *                   texture either by autogenerating them or
+     *                   reading them from the file. Some file formats
+     *                   support multiple mipmaps in a single file in
+     *                   which case those mipmaps will be used rather
+     *                   than generating them.
+     * @param fileSuffix the suffix of the file name to be used as a
+     *                   hint of the file format to the underlying
+     *                   texture provider, or null if none and should be
+     *                   auto-detected (some texture providers do not
+     *                   support this)
+     * @throws IOException if an error occurred while reading the URL
+     * @throws GLException if no OpenGL context is current or if an
+     *                     OpenGL error occurred
+     */
+    public static Texture newTexture(URL url, boolean mipmap, String fileSuffix) throws IOException, GLException {
+        if (fileSuffix == null) {
+            fileSuffix = FileUtil.getFileSuffix(url.getPath());
+        }
+        GLProfile glp = GLContext.getCurrentGL().getGLProfile();
+        TextureData data = newTextureData(glp, url, mipmap, fileSuffix);
+        Texture texture = newTexture(data);
+        data.flush();
+        return texture;
+    }
+
+    /** 
+     * Creates an OpenGL texture object associated with the given OpenGL
+     * texture target using the current OpenGL context. The texture has
+     * no initial data. This is used, for example, to construct cube
+     * maps out of multiple TextureData objects.
+     *
+     * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D, 
+     *               GL.GL_TEXTURE_RECTANGLE_ARB
+     *
+     * @throws GLException if no OpenGL context is current or if an
+     *                     OpenGL error occurred
+     */
+    public static Texture newTexture(int target) throws GLException {
+        return new Texture(target);
+    }
+
+    /**
+     * Wraps an OpenGL texture ID from an external library and allows
+     * some of the base methods from the Texture class, such as
+     * binding and querying of texture coordinates, to be used with
+     * it. Attempts to update such textures' contents will yield
+     * undefined results.
+     *
+     * @param textureID the OpenGL texture object to wrap
+     * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D, 
+     *               GL2.GL_TEXTURE_RECTANGLE
+     * @param texWidth the width of the texture in pixels
+     * @param texHeight the height of the texture in pixels
+     * @param imgWidth the width of the image within the texture in
+     *          pixels (if the content is a sub-rectangle in the upper
+     *          left corner); otherwise, pass in texWidth
+     * @param imgHeight the height of the image within the texture in
+     *          pixels (if the content is a sub-rectangle in the upper
+     *          left corner); otherwise, pass in texHeight
+     * @param mustFlipVertically indicates whether the texture
+     *                           coordinates must be flipped vertically
+     *                           in order to properly display the
+     *                           texture
+     */
+    public static Texture newTexture(int textureID,
+				     int target,
+				     int texWidth,
+				     int texHeight,
+				     int imgWidth,
+				     int imgHeight,
+				     boolean mustFlipVertically) {
+	return new Texture(textureID,
+			   target,
+			   texWidth,
+			   texHeight,
+			   imgWidth,
+			   imgHeight,
+			   mustFlipVertically);
+    }
+
+    /**
+     * Writes the given texture to a file. The type of the file is
+     * inferred from its suffix. An OpenGL context must be current in
+     * order to fetch the texture data back from the OpenGL pipeline.
+     * This method causes the specified Texture to be bound to the
+     * GL_TEXTURE_2D state. If no suitable writer for the requested file
+     * format was found, throws an IOException. <P>
+     *
+     * Reasonable attempts are made to produce good results in the
+     * resulting images. The Targa, SGI and ImageIO writers produce
+     * results in the correct vertical orientation for those file
+     * formats. The DDS writer performs no vertical flip of the data,
+     * even in uncompressed mode. (It is impossible to perform such a
+     * vertical flip with compressed data.) Applications should keep
+     * this in mind when using this routine to save textures to disk for
+     * later re-loading. <P>
+     *
+     * Any mipmaps for the specified texture are currently discarded
+     * when it is written to disk, regardless of whether the underlying
+     * file format supports multiple mipmaps in a given file.
+     *
+     * @throws IOException if an error occurred during writing or no
+     *   suitable writer was found
+     * @throws GLException if no OpenGL context was current or an
+     *   OpenGL-related error occurred
+     */
+    public static void write(Texture texture, File file) throws IOException, GLException {
+        if (texture.getTarget() != GL.GL_TEXTURE_2D) {
+            throw new GLException("Only GL_TEXTURE_2D textures are supported");
+        }
+
+        // First fetch the texture data
+        GL _gl = GLContext.getCurrentGL();
+        if (!_gl.isGL2()) {
+            throw new GLException("Only GL2 supports fetching compressed images, GL: " + _gl);
+        }
+        GL2 gl = _gl.getGL2();
+
+        texture.bind();
+        int internalFormat = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_INTERNAL_FORMAT);
+        int width  = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_WIDTH);
+        int height = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_HEIGHT);
+        int border = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_BORDER);
+        TextureData data = null;
+        if (internalFormat == GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
+            internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ||
+            internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT ||
+            internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) {
+            // Fetch using glGetCompressedTexImage
+            int size   = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_COMPRESSED_IMAGE_SIZE);
+            ByteBuffer res = ByteBuffer.allocate(size);
+            gl.glGetCompressedTexImage(GL.GL_TEXTURE_2D, 0, res);
+            data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, internalFormat, GL.GL_UNSIGNED_BYTE,
+                                   false, true, true, res, null);
+        } else {
+            int bytesPerPixel = 0;
+            int fetchedFormat = 0;
+            switch (internalFormat) {
+            case GL.GL_RGB:
+            case GL2.GL_BGR:
+            case GL.GL_RGB8:
+                bytesPerPixel = 3;
+                fetchedFormat = GL.GL_RGB;
+                break;
+            case GL.GL_RGBA:
+            case GL2.GL_BGRA:
+            case GL2.GL_ABGR_EXT:
+            case GL.GL_RGBA8:
+                bytesPerPixel = 4;
+                fetchedFormat = GL.GL_RGBA;
+                break;
+            default:
+                throw new IOException("Unsupported texture internal format 0x" + Integer.toHexString(internalFormat));
+            }
+
+            // Fetch using glGetTexImage
+            int packAlignment  = glGetInteger(GL.GL_PACK_ALIGNMENT);
+            int packRowLength  = glGetInteger(GL2.GL_PACK_ROW_LENGTH);
+            int packSkipRows   = glGetInteger(GL2.GL_PACK_SKIP_ROWS);
+            int packSkipPixels = glGetInteger(GL2.GL_PACK_SKIP_PIXELS);
+            int packSwapBytes  = glGetInteger(GL2.GL_PACK_SWAP_BYTES);
+
+            gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1);
+            gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, 0);
+            gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, 0);
+            gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, 0);
+            gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, 0);
+
+            ByteBuffer res = ByteBuffer.allocate((width + (2 * border)) *
+                                                 (height + (2 * border)) *
+                                                 bytesPerPixel);
+            if (DEBUG) {
+                System.out.println("Allocated buffer of size " + res.remaining() + " for fetched image (" +
+                                   ((fetchedFormat == GL.GL_RGB) ? "GL_RGB" : "GL_RGBA") + ")");
+            }
+            gl.glGetTexImage(GL.GL_TEXTURE_2D, 0, fetchedFormat, GL.GL_UNSIGNED_BYTE, res);
+
+            gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);
+            gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, packRowLength);
+            gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, packSkipRows);
+            gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels);
+            gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes);
+      
+            data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE,
+                                   false, false, false, res, null);
+
+            if (DEBUG) {
+                System.out.println("data.getPixelFormat() = " +
+                                   ((data.getPixelFormat() == GL.GL_RGB) ? "GL_RGB" : "GL_RGBA"));
+            }
+        }
+
+        write(data, file);
+    }
+  
+    public static void write(TextureData data, File file) throws IOException, GLException {
+        for (Iterator iter = textureWriters.iterator(); iter.hasNext(); ) {
+            TextureWriter writer = (TextureWriter) iter.next();
+            if (writer.write(file, data)) {
+                return;
+            }
+        }
+
+        throw new IOException("No suitable texture writer found for "+file.getAbsolutePath());
+    }
+  
+    //----------------------------------------------------------------------
+    // SPI support
+    //
+
+    /** Adds a TextureProvider to support reading of a new file
+        format. */
+    public static void addTextureProvider(TextureProvider provider) {
+        // Must always add at the front so the ImageIO provider is last,
+        // so we don't accidentally use it instead of a user's possibly
+        // more optimal provider
+        textureProviders.add(0, provider);
+    }
+
+    /** Adds a TextureWriter to support writing of a new file
+        format. */
+    public static void addTextureWriter(TextureWriter writer) {
+        // Must always add at the front so the ImageIO writer is last,
+        // so we don't accidentally use it instead of a user's possibly
+        // more optimal writer
+        textureWriters.add(0, writer);
+    }
+
+    //---------------------------------------------------------------------------
+    // Global disabling of texture rectangle extension
+    //
+
+    /** Toggles the use of the GL_ARB_texture_rectangle extension by the
+        TextureIO classes. By default, on hardware supporting this
+        extension, the TextureIO classes may use the
+        GL_ARB_texture_rectangle extension for non-power-of-two
+        textures. (If the hardware supports the
+        GL_ARB_texture_non_power_of_two extension, that one is
+        preferred.) In some situations, for example when writing
+        shaders, it is advantageous to force the texture target to
+        always be GL_TEXTURE_2D in order to have one version of the
+        shader, even at the expense of texture memory in the case where
+        NPOT textures are not supported. This method allows the use of
+        the GL_ARB_texture_rectangle extension to be turned off globally
+        for this purpose. The default is that the use of the extension
+        is enabled. */
+    public static void setTexRectEnabled(boolean enabled) {
+        texRectEnabled = enabled;
+    }
+
+    /** Indicates whether the GL_ARB_texture_rectangle extension is
+        allowed to be used for non-power-of-two textures; see {@link
+        #setTexRectEnabled setTexRectEnabled}. */
+    public static boolean isTexRectEnabled() {
+        return texRectEnabled;
+    }
+
+    //----------------------------------------------------------------------
+    // Internals only below this point
+    //
+
+    private static List/*<TextureProvider>*/ textureProviders = new ArrayList/*<TextureProvider>*/();
+    private static List/*<TextureWriter>*/   textureWriters   = new ArrayList/*<TextureWriter>*/();
+
+    static {
+        // ImageIO provider, the fall-back, must be the first one added
+        if(GLProfile.isAWTAvailable()) {
+            try {
+                // Use reflection to avoid compile-time dependencies on AWT-related classes
+                TextureProvider provider = (TextureProvider)
+                    Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureProvider").newInstance();
+                addTextureProvider(provider);
+            } catch (Exception e) {
+                if (DEBUG) {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        // Other special-case providers
+        addTextureProvider(new DDSTextureProvider());
+        addTextureProvider(new SGITextureProvider());
+        addTextureProvider(new TGATextureProvider());
+
+        // ImageIO writer, the fall-back, must be the first one added
+        if(GLProfile.isAWTAvailable()) {
+            try {
+                // Use reflection to avoid compile-time dependencies on AWT-related classes
+                TextureWriter writer = (TextureWriter)
+                    Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureWriter").newInstance();
+                addTextureWriter(writer);
+            } catch (Exception e) {
+                if (DEBUG) {
+                    e.printStackTrace();
+                }
+            } catch (Error e) {
+                if (DEBUG) {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        // Other special-case writers
+        addTextureWriter(new DDSTextureWriter());
+        addTextureWriter(new SGITextureWriter());
+        addTextureWriter(new TGATextureWriter());
+        addTextureWriter(new NetPbmTextureWriter());
+    }
+
+    // Implementation methods
+    private static TextureData newTextureDataImpl(GLProfile glp, File file,
+                                                  int internalFormat,
+                                                  int pixelFormat,
+                                                  boolean mipmap,
+                                                  String fileSuffix) throws IOException {
+        if (file == null) {
+            throw new IOException("File was null");
+        }
+
+        fileSuffix = toLowerCase(fileSuffix);
+
+        for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
+            TextureProvider provider = (TextureProvider) iter.next();
+            TextureData data = provider.newTextureData(glp, file,
+                                                       internalFormat,
+                                                       pixelFormat,
+                                                       mipmap,
+                                                       fileSuffix);
+            if (data != null) {
+                return data;
+            }
+        }
+
+        throw new IOException("No suitable reader for given file "+file.getAbsolutePath());
+    }
+
+    private static TextureData newTextureDataImpl(GLProfile glp, InputStream stream,
+                                                  int internalFormat,
+                                                  int pixelFormat,
+                                                  boolean mipmap,
+                                                  String fileSuffix) throws IOException {
+        if (stream == null) {
+            throw new IOException("Stream was null");
+        }
+
+        fileSuffix = toLowerCase(fileSuffix);
+
+        // Note: use of BufferedInputStream works around 4764639/4892246
+        if (!(stream instanceof BufferedInputStream)) {
+            stream = new BufferedInputStream(stream);
+        }
+
+        for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
+            TextureProvider provider = (TextureProvider) iter.next();
+            TextureData data = provider.newTextureData(glp, stream,
+                                                       internalFormat,
+                                                       pixelFormat,
+                                                       mipmap,
+                                                       fileSuffix);
+            if (data != null) {
+                return data;
+            }
+        }
+
+        throw new IOException("No suitable reader for given stream");
+    }
+
+    private static TextureData newTextureDataImpl(GLProfile glp, URL url,
+                                                  int internalFormat,
+                                                  int pixelFormat,
+                                                  boolean mipmap,
+                                                  String fileSuffix) throws IOException {
+        if (url == null) {
+            throw new IOException("URL was null");
+        }
+
+        fileSuffix = toLowerCase(fileSuffix);
+
+        for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
+            TextureProvider provider = (TextureProvider) iter.next();
+            TextureData data = provider.newTextureData(glp, url,
+                                                       internalFormat,
+                                                       pixelFormat,
+                                                       mipmap,
+                                                       fileSuffix);
+            if (data != null) {
+                return data;
+            }
+        }
+
+        throw new IOException("No suitable reader for given URL "+url);
+    }
+
+    //----------------------------------------------------------------------
+    // DDS provider -- supports files only for now
+    static class DDSTextureProvider implements TextureProvider {
+        public TextureData newTextureData(GLProfile glp, File file,
+                                          int internalFormat,
+                                          int pixelFormat,
+                                          boolean mipmap,
+                                          String fileSuffix) throws IOException {
+            if (DDS.equals(fileSuffix) ||
+                DDS.equals(FileUtil.getFileSuffix(file))) {
+                DDSImage image = DDSImage.read(file);
+                return newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
+            }
+
+            return null;
+        }
+
+        public TextureData newTextureData(GLProfile glp, InputStream stream,
+                                          int internalFormat,
+                                          int pixelFormat,
+                                          boolean mipmap,
+                                          String fileSuffix) throws IOException {
+            if (DDS.equals(fileSuffix) ||
+                DDSImage.isDDSImage(stream)) {
+                byte[] data = StreamUtil.readAll2Array(stream);
+                ByteBuffer buf = ByteBuffer.wrap(data);
+                DDSImage image = DDSImage.read(buf);
+                return newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
+            }
+
+            return null;
+        }
+
+        public TextureData newTextureData(GLProfile glp, URL url,
+                                          int internalFormat,
+                                          int pixelFormat,
+                                          boolean mipmap,
+                                          String fileSuffix) throws IOException {
+            InputStream stream = new BufferedInputStream(url.openStream());
+            try {
+                return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
+            } finally {
+                stream.close();
+            }
+        }
+
+        private TextureData newTextureData(GLProfile glp, final DDSImage image,
+                                           int internalFormat,
+                                           int pixelFormat,
+                                           boolean mipmap) {
+            DDSImage.ImageInfo info = image.getMipMap(0);
+            if (pixelFormat == 0) {
+                switch (image.getPixelFormat()) {
+                case DDSImage.D3DFMT_R8G8B8:
+                    pixelFormat = GL.GL_RGB;
+                    break;
+                default:
+                    pixelFormat = GL.GL_RGBA;
+                    break;
+                }
+            }
+            if (info.isCompressed()) {
+                switch (info.getCompressionFormat()) {
+                case DDSImage.D3DFMT_DXT1:
+                    internalFormat = GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
+                    break;
+                case DDSImage.D3DFMT_DXT3:
+                    internalFormat = GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
+                    break;
+                case DDSImage.D3DFMT_DXT5:
+                    internalFormat = GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
+                    break;
+                default:
+                    throw new RuntimeException("Unsupported DDS compression format \"" +
+                                               DDSImage.getCompressionFormatName(info.getCompressionFormat()) + "\"");
+                }
+            }
+            if (internalFormat == 0) {
+                switch (image.getPixelFormat()) {
+                case DDSImage.D3DFMT_R8G8B8:
+                    pixelFormat = GL.GL_RGB;
+                    break;
+                default:
+                    pixelFormat = GL.GL_RGBA;
+                    break;
+                }
+            }
+            TextureData.Flusher flusher = new TextureData.Flusher() {
+                    public void flush() {
+                        image.close();
+                    }
+                };
+            TextureData data;
+            if (mipmap && image.getNumMipMaps() > 0) {
+                Buffer[] mipmapData = new Buffer[image.getNumMipMaps()];
+                for (int i = 0; i < image.getNumMipMaps(); i++) {
+                    mipmapData[i] = image.getMipMap(i).getData();
+                }
+                data = new TextureData(glp, internalFormat,
+                                       info.getWidth(),
+                                       info.getHeight(),
+                                       0,
+                                       pixelFormat,
+                                       GL.GL_UNSIGNED_BYTE,
+                                       info.isCompressed(),
+                                       true,
+                                       mipmapData,
+                                       flusher);
+            } else {
+                // Fix this up for the end user because we can't generate
+                // mipmaps for compressed textures
+                mipmap = false;
+                data = new TextureData(glp, internalFormat,
+                                       info.getWidth(),
+                                       info.getHeight(),
+                                       0,
+                                       pixelFormat,
+                                       GL.GL_UNSIGNED_BYTE,
+                                       mipmap,
+                                       info.isCompressed(),
+                                       true,
+                                       info.getData(),
+                                       flusher);
+            }
+            return data;
+        }
+    }
+
+    //----------------------------------------------------------------------
+    // Base class for SGI RGB and TGA image providers
+    static abstract class StreamBasedTextureProvider implements TextureProvider {
+        public TextureData newTextureData(GLProfile glp, File file,
+                                          int internalFormat,
+                                          int pixelFormat,
+                                          boolean mipmap,
+                                          String fileSuffix) throws IOException {
+            InputStream inStream = new BufferedInputStream(new FileInputStream(file));
+            try {
+                // The SGIImage and TGAImage implementations use InputStreams
+                // anyway so there isn't much point in having a separate code
+                // path for files
+                return newTextureData(glp, inStream,
+                                      internalFormat,
+                                      pixelFormat,
+                                      mipmap,
+                                      ((fileSuffix != null) ? fileSuffix : FileUtil.getFileSuffix(file)));
+            } finally {
+                inStream.close();
+            }
+        }
+
+        public TextureData newTextureData(GLProfile glp, URL url,
+                                          int internalFormat,
+                                          int pixelFormat,
+                                          boolean mipmap,
+                                          String fileSuffix) throws IOException {
+            InputStream stream = new BufferedInputStream(url.openStream());
+            try {
+                return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
+            } finally {
+                stream.close();
+            }
+        }
+    }
+
+    //----------------------------------------------------------------------
+    // SGI RGB image provider
+    static class SGITextureProvider extends StreamBasedTextureProvider {
+        public TextureData newTextureData(GLProfile glp, InputStream stream,
+                                          int internalFormat,
+                                          int pixelFormat,
+                                          boolean mipmap,
+                                          String fileSuffix) throws IOException {
+            if (SGI.equals(fileSuffix) ||
+                SGI_RGB.equals(fileSuffix) ||
+                SGIImage.isSGIImage(stream)) {
+                SGIImage image = SGIImage.read(stream);
+                if (pixelFormat == 0) {
+                    pixelFormat = image.getFormat();
+                }
+                if (internalFormat == 0) {
+                    internalFormat = image.getFormat();
+                }
+                return new TextureData(glp, internalFormat,
+                                       image.getWidth(),
+                                       image.getHeight(),
+                                       0,
+                                       pixelFormat,
+                                       GL.GL_UNSIGNED_BYTE,
+                                       mipmap,
+                                       false,
+                                       false,
+                                       ByteBuffer.wrap(image.getData()),
+                                       null);
+            }
+
+            return null;
+        }
+    }
+
+    //----------------------------------------------------------------------
+    // TGA (Targa) image provider
+    static class TGATextureProvider extends StreamBasedTextureProvider {
+        public TextureData newTextureData(GLProfile glp, InputStream stream,
+                                          int internalFormat,
+                                          int pixelFormat,
+                                          boolean mipmap,
+                                          String fileSuffix) throws IOException {
+            if (TGA.equals(fileSuffix)) {
+                TGAImage image = TGAImage.read(stream);
+                if (pixelFormat == 0) {
+                    pixelFormat = image.getGLFormat();
+                }
+                if (internalFormat == 0) {
+                    GL gl = GLContext.getCurrentGL();
+                    if(gl.isGL2()) {
+                        internalFormat = GL.GL_RGBA8;
+                    } else {
+                        internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB;
+                    }
+                }
+                return new TextureData(glp, internalFormat,
+                                       image.getWidth(),
+                                       image.getHeight(),
+                                       0,
+                                       pixelFormat,
+                                       GL.GL_UNSIGNED_BYTE,
+                                       mipmap,
+                                       false,
+                                       false,
+                                       image.getData(),
+                                       null);
+            }
+
+            return null;
+        }
+    }
+
+    //----------------------------------------------------------------------
+    // DDS texture writer
+    //
+    static class DDSTextureWriter implements TextureWriter {
+        public boolean write(File file,
+                             TextureData data) throws IOException {
+            if (DDS.equals(FileUtil.getFileSuffix(file))) {
+                // See whether the DDS writer can handle this TextureData
+                int pixelFormat = data.getPixelFormat();
+                int pixelType   = data.getPixelType();
+                if (pixelType != GL.GL_BYTE &&
+                    pixelType != GL.GL_UNSIGNED_BYTE) {
+                    throw new IOException("DDS writer only supports byte / unsigned byte textures");
+                }
+
+                int d3dFormat = 0;
+                // FIXME: some of these are probably not completely correct and would require swizzling
+                switch (pixelFormat) {
+                case GL.GL_RGB:                        d3dFormat = DDSImage.D3DFMT_R8G8B8; break;
+                case GL.GL_RGBA:                       d3dFormat = DDSImage.D3DFMT_A8R8G8B8; break;
+                case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT:  d3dFormat = DDSImage.D3DFMT_DXT1; break;
+                case GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: throw new IOException("RGBA DXT1 not yet supported");
+                case GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: d3dFormat = DDSImage.D3DFMT_DXT3; break;
+                case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: d3dFormat = DDSImage.D3DFMT_DXT5; break;
+                default: throw new IOException("Unsupported pixel format 0x" + Integer.toHexString(pixelFormat) + " by DDS writer");
+                }
+        
+                ByteBuffer[] mipmaps = null;
+                if (data.getMipmapData() != null) {
+                    mipmaps = new ByteBuffer[data.getMipmapData().length];
+                    for (int i = 0; i < mipmaps.length; i++) {
+                        mipmaps[i] = (ByteBuffer) data.getMipmapData()[i];
+                    }
+                } else {
+                    mipmaps = new ByteBuffer[] { (ByteBuffer) data.getBuffer() };
+                }
+
+                DDSImage image = DDSImage.createFromData(d3dFormat,
+                                                         data.getWidth(),
+                                                         data.getHeight(),
+                                                         mipmaps);
+                image.write(file);
+                return true;
+            }
+
+            return false;
+        }
+    }
+
+    //----------------------------------------------------------------------
+    // SGI (rgb) texture writer
+    //
+    static class SGITextureWriter implements TextureWriter {
+        public boolean write(File file,
+                             TextureData data) throws IOException {
+            String fileSuffix = FileUtil.getFileSuffix(file);
+            if (SGI.equals(fileSuffix) ||
+                SGI_RGB.equals(fileSuffix)) {
+                // See whether the SGI writer can handle this TextureData
+                int pixelFormat = data.getPixelFormat();
+                int pixelType   = data.getPixelType();
+                if ((pixelFormat == GL.GL_RGB ||
+                     pixelFormat == GL.GL_RGBA) &&
+                    (pixelType == GL.GL_BYTE ||
+                     pixelType == GL.GL_UNSIGNED_BYTE)) {
+                    ByteBuffer buf = ((data.getBuffer() != null) ?
+                                      (ByteBuffer) data.getBuffer() :
+                                      (ByteBuffer) data.getMipmapData()[0]);
+                    byte[] bytes;
+                    if (buf.hasArray()) {
+                        bytes = buf.array();
+                    } else {
+                        buf.rewind();
+                        bytes = new byte[buf.remaining()];
+                        buf.get(bytes);
+                        buf.rewind();
+                    }
+
+                    SGIImage image = SGIImage.createFromData(data.getWidth(),
+                                                             data.getHeight(),
+                                                             (pixelFormat == GL.GL_RGBA),
+                                                             bytes);
+                    image.write(file, false);
+                    return true;
+                }
+
+                throw new IOException("SGI writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
+            }
+
+            return false;
+        }
+    }
+
+    //----------------------------------------------------------------------
+    // TGA (Targa) texture writer
+  
+    static class TGATextureWriter implements TextureWriter {
+        public boolean write(File file,
+                             TextureData data) throws IOException {
+            if (TGA.equals(FileUtil.getFileSuffix(file))) {
+                // See whether the TGA writer can handle this TextureData
+                int pixelFormat = data.getPixelFormat();
+                int pixelType   = data.getPixelType();
+                if ((pixelFormat == GL.GL_RGB ||
+                     pixelFormat == GL.GL_RGBA) &&
+                    (pixelType == GL.GL_BYTE ||
+                     pixelType == GL.GL_UNSIGNED_BYTE)) {
+                    ByteBuffer buf = ((data.getBuffer() != null) ?
+                                      (ByteBuffer) data.getBuffer() :
+                                      (ByteBuffer) data.getMipmapData()[0]);
+                    // Must reverse order of red and blue channels to get correct results
+                    int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
+                    for (int i = 0; i < buf.remaining(); i += skip) {
+                        byte red  = buf.get(i + 0);
+                        byte blue = buf.get(i + 2);
+                        buf.put(i + 0, blue);
+                        buf.put(i + 2, red);
+                    }
+
+                    TGAImage image = TGAImage.createFromData(data.getWidth(),
+                                                             data.getHeight(),
+                                                             (pixelFormat == GL.GL_RGBA),
+                                                             false,
+                                                             ((data.getBuffer() != null) ?
+                                                              (ByteBuffer) data.getBuffer() :
+                                                              (ByteBuffer) data.getMipmapData()[0]));
+                    image.write(file);
+                    return true;
+                }
+
+                throw new IOException("TGA writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
+            }
+
+            return false;
+        }    
+    }
+
+    //----------------------------------------------------------------------
+    // Helper routines
+    //
+
+    private static int glGetInteger(int pname) {
+        int[] tmp = new int[1];
+        GL gl = GLContext.getCurrentGL();
+        gl.glGetIntegerv(pname, tmp, 0);
+        return tmp[0];
+    }
+
+    private static int glGetTexLevelParameteri(GL2 gl, int target, int level, int pname) {
+        int[] tmp = new int[1];
+        gl.glGetTexLevelParameteriv(target, 0, pname, tmp, 0);
+        return tmp[0];
+    }
+
+    private static String toLowerCase(String arg) {
+        if (arg == null) {
+            return null;
+        }
+
+        return arg.toLowerCase();
+    }
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javame_cdc_fp b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javame_cdc_fp
deleted file mode 100644
index 3b694be..0000000
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javame_cdc_fp
+++ /dev/null
@@ -1,1256 +0,0 @@
-/*
- * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.util.texture;
-
-import java.io.*;
-import java.net.*;
-import java.nio.*;
-import java.util.*;
-
-import javax.media.opengl.*;
-import javax.media.opengl.glu.*;
-import com.jogamp.opengl.impl.Debug;
-import com.jogamp.opengl.util.*;
-import com.jogamp.opengl.util.texture.spi.*;
-
-/** <P> Provides input and output facilities for both loading OpenGL
-    textures from disk and streams as well as writing textures already
-    in memory back to disk. </P>
-
-    <P> The TextureIO class supports an arbitrary number of plug-in
-    readers and writers via TextureProviders and TextureWriters.
-    TextureProviders know how to produce TextureData objects from
-    files, InputStreams and URLs. TextureWriters know how to write
-    TextureData objects to disk in various file formats. The
-    TextureData class represents the raw data of the texture before it
-    has been converted to an OpenGL texture object. The Texture class
-    represents the OpenGL texture object and provides easy facilities
-    for using the texture. </P>
-
-    <P> There are several built-in TextureProviders and TextureWriters
-    supplied with the TextureIO implementation. The most basic
-    provider uses the platform's Image I/O facilities to read in a
-    BufferedImage and convert it to a texture. This is the baseline
-    provider and is registered so that it is the last one consulted.
-    All others are asked first to open a given file. </P>
-
-    <P> There are three other providers registered by default as of
-    the time of this writing. One handles SGI RGB (".sgi", ".rgb")
-    images from both files and streams. One handles DirectDraw Surface
-    (".dds") images read from files, though can not read these images
-    from streams. One handles Targa (".tga") images read from both
-    files and streams. These providers are executed in an arbitrary
-    order. Some of these providers require the file's suffix to either
-    be specified via the newTextureData methods or for the file to be
-    named with the appropriate suffix. In general a file suffix should
-    be provided to the newTexture and newTextureData methods if at all
-    possible. </P>
-
-    <P> Note that additional TextureProviders, if reading images from
-    InputStreams, must use the mark()/reset() methods on InputStream
-    when probing for e.g. magic numbers at the head of the file to
-    make sure not to disturb the state of the InputStream for
-    downstream TextureProviders. </P>
-
-    <P> There are analogous TextureWriters provided for writing
-    textures back to disk if desired. As of this writing, there are
-    four TextureWriters registered by default: one for Targa files,
-    one for SGI RGB files, one for DirectDraw surface (.dds) files,
-    and one for ImageIO-supplied formats such as .jpg and .png.  Some
-    of these writers have certain limitations such as only being able
-    to write out textures stored in GL_RGB or GL_RGBA format. The DDS
-    writer supports fetching and writing to disk of texture data in
-    DXTn compressed format. Whether this will occur is dependent on
-    whether the texture's internal format is one of the DXTn
-    compressed formats and whether the target file is .dds format.
-*/
-
-public class TextureIO {
-    /** Constant which can be used as a file suffix to indicate a
-        DirectDraw Surface file. */
-    public static final String DDS     = "dds";
-
-    /** Constant which can be used as a file suffix to indicate an SGI
-        RGB file. */
-    public static final String SGI     = "sgi";
-
-    /** Constant which can be used as a file suffix to indicate an SGI
-        RGB file. */
-    public static final String SGI_RGB = "rgb";
-
-    /** Constant which can be used as a file suffix to indicate a GIF
-        file. */
-    public static final String GIF     = "gif";
-
-    /** Constant which can be used as a file suffix to indicate a JPEG
-        file. */
-    public static final String JPG     = "jpg";
-
-    /** Constant which can be used as a file suffix to indicate a PNG
-        file. */
-    public static final String PNG     = "png";
-
-    /** Constant which can be used as a file suffix to indicate a Targa
-        file. */
-    public static final String TGA     = "tga";
-
-    /** Constant which can be used as a file suffix to indicate a TIFF
-        file. */
-    public static final String TIFF    = "tiff";
-
-    private static final boolean DEBUG = Debug.debug("TextureIO");
-
-    // For manually disabling the use of the texture rectangle
-    // extensions so you know the texture target is GL_TEXTURE_2D; this
-    // is useful for shader writers (thanks to Chris Campbell for this
-    // observation)
-    private static boolean texRectEnabled = true;
-
-    //----------------------------------------------------------------------
-    // methods that *do not* require a current context
-    // These methods assume RGB or RGBA textures.
-    // Some texture providers may not recognize the file format unless
-    // the fileSuffix is specified, so it is strongly recommended to
-    // specify it wherever it is known.
-    // Some texture providers may also only support one kind of input,
-    // i.e., reading from a file as opposed to a stream.
-
-    /**
-     * Creates a TextureData from the given file. Does no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param file the file from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the file, or null if none of the
-     *         registered texture providers could read the file
-     * @throws IOException if an error occurred while reading the file
-     */
-    public static TextureData newTextureData(GLProfile glp, File file,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException {
-        if (fileSuffix == null) {
-            fileSuffix = FileUtil.getFileSuffix(file);
-        }
-        return newTextureDataImpl(glp, file, 0, 0, mipmap, fileSuffix);
-    }
-
-    /**
-     * Creates a TextureData from the given stream. Does no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param stream the stream from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the stream, or null if none of the
-     *         registered texture providers could read the stream
-     * @throws IOException if an error occurred while reading the stream
-     */
-    public static TextureData newTextureData(GLProfile glp, InputStream stream,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException {
-        return newTextureDataImpl(glp, stream, 0, 0, mipmap, fileSuffix);
-    }
-
-    /**
-     * Creates a TextureData from the given URL. Does no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param url the URL from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the URL, or null if none of the
-     *         registered texture providers could read the URL
-     * @throws IOException if an error occurred while reading the URL
-     */
-    public static TextureData newTextureData(GLProfile glp, URL url,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException {
-        if (fileSuffix == null) {
-            fileSuffix = FileUtil.getFileSuffix(url.getPath());
-        }
-        return newTextureDataImpl(glp, url, 0, 0, mipmap, fileSuffix);
-    }
-
-    //----------------------------------------------------------------------
-    // These methods make no assumption about the OpenGL internal format
-    // or pixel format of the texture; they must be specified by the
-    // user. It is not allowed to supply 0 (indicating no preference)
-    // for either the internalFormat or the pixelFormat;
-    // IllegalArgumentException will be thrown in this case.
-
-    /**
-     * Creates a TextureData from the given file, using the specified
-     * OpenGL internal format and pixel format for the texture which
-     * will eventually result. The internalFormat and pixelFormat must
-     * be specified and may not be zero; to use default values, use the
-     * variant of this method which does not take these arguments. Does
-     * no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param file the file from which to read the texture data
-     * @param internalFormat the OpenGL internal format of the texture
-     *                   which will eventually result from the TextureData
-     * @param pixelFormat the OpenGL pixel format of the texture
-     *                    which will eventually result from the TextureData
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the file, or null if none of the
-     *         registered texture providers could read the file
-     * @throws IllegalArgumentException if either internalFormat or
-     *                                  pixelFormat was 0
-     * @throws IOException if an error occurred while reading the file
-     */
-    public static TextureData newTextureData(GLProfile glp, File file,
-                                             int internalFormat,
-                                             int pixelFormat,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException, IllegalArgumentException {
-        if ((internalFormat == 0) || (pixelFormat == 0)) {
-            throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
-        }
-
-        if (fileSuffix == null) {
-            fileSuffix = FileUtil.getFileSuffix(file);
-        }
-
-        return newTextureDataImpl(glp, file, internalFormat, pixelFormat, mipmap, fileSuffix);
-    }
-
-    /**
-     * Creates a TextureData from the given stream, using the specified
-     * OpenGL internal format and pixel format for the texture which
-     * will eventually result. The internalFormat and pixelFormat must
-     * be specified and may not be zero; to use default values, use the
-     * variant of this method which does not take these arguments. Does
-     * no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param stream the stream from which to read the texture data
-     * @param internalFormat the OpenGL internal format of the texture
-     *                   which will eventually result from the TextureData
-     * @param pixelFormat the OpenGL pixel format of the texture
-     *                    which will eventually result from the TextureData
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the stream, or null if none of the
-     *         registered texture providers could read the stream
-     * @throws IllegalArgumentException if either internalFormat or
-     *                                  pixelFormat was 0
-     * @throws IOException if an error occurred while reading the stream
-     */
-    public static TextureData newTextureData(GLProfile glp, InputStream stream,
-                                             int internalFormat,
-                                             int pixelFormat,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException, IllegalArgumentException {
-        if ((internalFormat == 0) || (pixelFormat == 0)) {
-            throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
-        }
-
-        return newTextureDataImpl(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
-    }
-
-    /**
-     * Creates a TextureData from the given URL, using the specified
-     * OpenGL internal format and pixel format for the texture which
-     * will eventually result. The internalFormat and pixelFormat must
-     * be specified and may not be zero; to use default values, use the
-     * variant of this method which does not take these arguments. Does
-     * no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param url the URL from which to read the texture data
-     * @param internalFormat the OpenGL internal format of the texture
-     *                   which will eventually result from the TextureData
-     * @param pixelFormat the OpenGL pixel format of the texture
-     *                    which will eventually result from the TextureData
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the URL, or null if none of the
-     *         registered texture providers could read the URL
-     * @throws IllegalArgumentException if either internalFormat or
-     *                                  pixelFormat was 0
-     * @throws IOException if an error occurred while reading the URL
-     */
-    public static TextureData newTextureData(GLProfile glp, URL url,
-                                             int internalFormat,
-                                             int pixelFormat,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException, IllegalArgumentException {
-        if ((internalFormat == 0) || (pixelFormat == 0)) {
-            throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
-        }
-
-        if (fileSuffix == null) {
-            fileSuffix = FileUtil.getFileSuffix(url.getPath());
-        }
-
-        return newTextureDataImpl(glp, url, internalFormat, pixelFormat, mipmap, fileSuffix);
-    }
-
-    //----------------------------------------------------------------------
-    // methods that *do* require a current context
-    //
-
-    /** 
-     * Creates an OpenGL texture object from the specified TextureData
-     * using the current OpenGL context.
-     *
-     * @param data the texture data to turn into an OpenGL texture
-     * @throws GLException if no OpenGL context is current or if an
-     *                     OpenGL error occurred
-     * @throws IllegalArgumentException if the passed TextureData was null
-     */
-    public static Texture newTexture(TextureData data) throws GLException, IllegalArgumentException {
-        if (data == null) {
-            throw new IllegalArgumentException("Null TextureData");
-        }
-        return new Texture(data);
-    }
-
-    /** 
-     * Creates an OpenGL texture object from the specified file using
-     * the current OpenGL context.
-     *
-     * @param file the file from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @throws IOException if an error occurred while reading the file
-     * @throws GLException if no OpenGL context is current or if an
-     *                     OpenGL error occurred
-     */
-    public static Texture newTexture(File file, boolean mipmap) throws IOException, GLException {
-        GLProfile glp = GLContext.getCurrentGL().getGLProfile();
-        TextureData data = newTextureData(glp, file, mipmap, FileUtil.getFileSuffix(file));
-        Texture texture = newTexture(data);
-        data.flush();
-        return texture;
-    }
-
-    /** 
-     * Creates an OpenGL texture object from the specified stream using
-     * the current OpenGL context.
-     *
-     * @param stream the stream from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @throws IOException if an error occurred while reading the stream
-     * @throws GLException if no OpenGL context is current or if an
-     *                     OpenGL error occurred
-     */
-    public static Texture newTexture(InputStream stream, boolean mipmap, String fileSuffix) throws IOException, GLException {
-        GLProfile glp = GLContext.getCurrentGL().getGLProfile();
-        TextureData data = newTextureData(glp, stream, mipmap, fileSuffix);
-        Texture texture = newTexture(data);
-        data.flush();
-        return texture;
-    }
-
-    /** 
-     * Creates an OpenGL texture object from the specified URL using the
-     * current OpenGL context.
-     *
-     * @param url the URL from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @throws IOException if an error occurred while reading the URL
-     * @throws GLException if no OpenGL context is current or if an
-     *                     OpenGL error occurred
-     */
-    public static Texture newTexture(URL url, boolean mipmap, String fileSuffix) throws IOException, GLException {
-        if (fileSuffix == null) {
-            fileSuffix = FileUtil.getFileSuffix(url.getPath());
-        }
-        GLProfile glp = GLContext.getCurrentGL().getGLProfile();
-        TextureData data = newTextureData(glp, url, mipmap, fileSuffix);
-        Texture texture = newTexture(data);
-        data.flush();
-        return texture;
-    }
-
-    /** 
-     * Creates an OpenGL texture object associated with the given OpenGL
-     * texture target using the current OpenGL context. The texture has
-     * no initial data. This is used, for example, to construct cube
-     * maps out of multiple TextureData objects.
-     *
-     * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D, 
-     *               GL.GL_TEXTURE_RECTANGLE_ARB
-     *
-     * @throws GLException if no OpenGL context is current or if an
-     *                     OpenGL error occurred
-     */
-    public static Texture newTexture(int target) throws GLException {
-        return new Texture(target);
-    }
-
-    /**
-     * Wraps an OpenGL texture ID from an external library and allows
-     * some of the base methods from the Texture class, such as
-     * binding and querying of texture coordinates, to be used with
-     * it. Attempts to update such textures' contents will yield
-     * undefined results.
-     *
-     * @param textureID the OpenGL texture object to wrap
-     * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D, 
-     *               GL2.GL_TEXTURE_RECTANGLE
-     * @param texWidth the width of the texture in pixels
-     * @param texHeight the height of the texture in pixels
-     * @param imgWidth the width of the image within the texture in
-     *          pixels (if the content is a sub-rectangle in the upper
-     *          left corner); otherwise, pass in texWidth
-     * @param imgHeight the height of the image within the texture in
-     *          pixels (if the content is a sub-rectangle in the upper
-     *          left corner); otherwise, pass in texHeight
-     * @param mustFlipVertically indicates whether the texture
-     *                           coordinates must be flipped vertically
-     *                           in order to properly display the
-     *                           texture
-     */
-    public static Texture newTexture(int textureID,
-				     int target,
-				     int texWidth,
-				     int texHeight,
-				     int imgWidth,
-				     int imgHeight,
-				     boolean mustFlipVertically) {
-	return new Texture(textureID,
-			   target,
-			   texWidth,
-			   texHeight,
-			   imgWidth,
-			   imgHeight,
-			   mustFlipVertically);
-    }
-
-    /**
-     * Writes the given texture to a file. The type of the file is
-     * inferred from its suffix. An OpenGL context must be current in
-     * order to fetch the texture data back from the OpenGL pipeline.
-     * This method causes the specified Texture to be bound to the
-     * GL_TEXTURE_2D state. If no suitable writer for the requested file
-     * format was found, throws an IOException. <P>
-     *
-     * Reasonable attempts are made to produce good results in the
-     * resulting images. The Targa, SGI and ImageIO writers produce
-     * results in the correct vertical orientation for those file
-     * formats. The DDS writer performs no vertical flip of the data,
-     * even in uncompressed mode. (It is impossible to perform such a
-     * vertical flip with compressed data.) Applications should keep
-     * this in mind when using this routine to save textures to disk for
-     * later re-loading. <P>
-     *
-     * Any mipmaps for the specified texture are currently discarded
-     * when it is written to disk, regardless of whether the underlying
-     * file format supports multiple mipmaps in a given file.
-     *
-     * @throws IOException if an error occurred during writing or no
-     *   suitable writer was found
-     * @throws GLException if no OpenGL context was current or an
-     *   OpenGL-related error occurred
-     */
-    public static void write(Texture texture, File file) throws IOException, GLException {
-        if (texture.getTarget() != GL.GL_TEXTURE_2D) {
-            throw new GLException("Only GL_TEXTURE_2D textures are supported");
-        }
-
-        // First fetch the texture data
-        GL _gl = GLContext.getCurrentGL();
-        if (!_gl.isGL2()) {
-            throw new GLException("Only GL2 supports fetching compressed images, GL: " + _gl);
-        }
-        GL2 gl = _gl.getGL2();
-
-        texture.bind();
-        int internalFormat = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_INTERNAL_FORMAT);
-        int width  = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_WIDTH);
-        int height = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_HEIGHT);
-        int border = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_BORDER);
-        TextureData data = null;
-        if (internalFormat == GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
-            internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ||
-            internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT ||
-            internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) {
-            // Fetch using glGetCompressedTexImage
-            int size   = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_COMPRESSED_IMAGE_SIZE);
-            ByteBuffer res = ByteBuffer.wrap(new byte[size]);
-            gl.glGetCompressedTexImage(GL.GL_TEXTURE_2D, 0, res);
-            data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, internalFormat, GL.GL_UNSIGNED_BYTE,
-                                   false, true, true, res, null);
-        } else {
-            int bytesPerPixel = 0;
-            int fetchedFormat = 0;
-            switch (internalFormat) {
-            case GL.GL_RGB:
-            case GL2.GL_BGR:
-            case GL.GL_RGB8:
-                bytesPerPixel = 3;
-                fetchedFormat = GL.GL_RGB;
-                break;
-            case GL.GL_RGBA:
-            case GL2.GL_BGRA:
-            case GL2.GL_ABGR_EXT:
-            case GL.GL_RGBA8:
-                bytesPerPixel = 4;
-                fetchedFormat = GL.GL_RGBA;
-                break;
-            default:
-                throw new IOException("Unsupported texture internal format 0x" + Integer.toHexString(internalFormat));
-            }
-
-            // Fetch using glGetTexImage
-            int packAlignment  = glGetInteger(GL.GL_PACK_ALIGNMENT);
-            int packRowLength  = glGetInteger(GL2.GL_PACK_ROW_LENGTH);
-            int packSkipRows   = glGetInteger(GL2.GL_PACK_SKIP_ROWS);
-            int packSkipPixels = glGetInteger(GL2.GL_PACK_SKIP_PIXELS);
-            int packSwapBytes  = glGetInteger(GL2.GL_PACK_SWAP_BYTES);
-
-            gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1);
-            gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, 0);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, 0);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, 0);
-            gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, 0);
-
-            ByteBuffer res = ByteBuffer.wrap(new byte[(width + (2 * border)) *
-                                                      (height + (2 * border)) *
-                                                      bytesPerPixel]);
-            if (DEBUG) {
-                System.out.println("Allocated buffer of size " + res.remaining() + " for fetched image (" +
-                                   ((fetchedFormat == GL.GL_RGB) ? "GL_RGB" : "GL_RGBA") + ")");
-            }
-            gl.glGetTexImage(GL.GL_TEXTURE_2D, 0, fetchedFormat, GL.GL_UNSIGNED_BYTE, res);
-
-            gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);
-            gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, packRowLength);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, packSkipRows);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels);
-            gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes);
-      
-            data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE,
-                                   false, false, false, res, null);
-
-            if (DEBUG) {
-                System.out.println("data.getPixelFormat() = " +
-                                   ((data.getPixelFormat() == GL.GL_RGB) ? "GL_RGB" : "GL_RGBA"));
-            }
-        }
-
-        write(data, file);
-    }
-  
-    public static void write(TextureData data, File file) throws IOException, GLException {
-        for (Iterator iter = textureWriters.iterator(); iter.hasNext(); ) {
-            TextureWriter writer = (TextureWriter) iter.next();
-            if (writer.write(file, data)) {
-                return;
-            }
-        }
-
-        throw new IOException("No suitable texture writer found for "+file.getAbsolutePath());
-    }
-
-    //----------------------------------------------------------------------
-    // SPI support
-    //
-
-    /** Adds a TextureProvider to support reading of a new file
-        format. */
-    public static void addTextureProvider(TextureProvider provider) {
-        // Must always add at the front so the ImageIO provider is last,
-        // so we don't accidentally use it instead of a user's possibly
-        // more optimal provider
-        textureProviders.add(0, provider);
-    }
-
-    /** Adds a TextureWriter to support writing of a new file
-        format. */
-    public static void addTextureWriter(TextureWriter writer) {
-        // Must always add at the front so the ImageIO writer is last,
-        // so we don't accidentally use it instead of a user's possibly
-        // more optimal writer
-        textureWriters.add(0, writer);
-    }
-
-    //---------------------------------------------------------------------------
-    // Global disabling of texture rectangle extension
-    //
-
-    /** Toggles the use of the GL_ARB_texture_rectangle extension by the
-        TextureIO classes. By default, on hardware supporting this
-        extension, the TextureIO classes may use the
-        GL_ARB_texture_rectangle extension for non-power-of-two
-        textures. (If the hardware supports the
-        GL_ARB_texture_non_power_of_two extension, that one is
-        preferred.) In some situations, for example when writing
-        shaders, it is advantageous to force the texture target to
-        always be GL_TEXTURE_2D in order to have one version of the
-        shader, even at the expense of texture memory in the case where
-        NPOT textures are not supported. This method allows the use of
-        the GL_ARB_texture_rectangle extension to be turned off globally
-        for this purpose. The default is that the use of the extension
-        is enabled. */
-    public static void setTexRectEnabled(boolean enabled) {
-        texRectEnabled = enabled;
-    }
-
-    /** Indicates whether the GL_ARB_texture_rectangle extension is
-        allowed to be used for non-power-of-two textures; see {@link
-        #setTexRectEnabled setTexRectEnabled}. */
-    public static boolean isTexRectEnabled() {
-        return texRectEnabled;
-    }
-
-    //----------------------------------------------------------------------
-    // Internals only below this point
-    //
-
-    private static List/*<TextureProvider>*/ textureProviders = new ArrayList/*<TextureProvider>*/();
-    private static List/*<TextureWriter>*/   textureWriters   = new ArrayList/*<TextureWriter>*/();
-
-    static {
-        /*
-        if(GLProfile.isAWTAvailable()) {
-            // ImageIO provider, the fall-back, must be the first one added
-            try {
-                // Use reflection to avoid compile-time dependencies on AWT-related classes
-                TextureProvider provider = (TextureProvider)
-                    Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureProvider").newInstance();
-                addTextureProvider(provider);
-            } catch (Exception e) {
-                if (DEBUG) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        */
-
-        // Other special-case providers
-        addTextureProvider(new DDSTextureProvider());
-        addTextureProvider(new SGITextureProvider());
-        addTextureProvider(new TGATextureProvider());
-
-        /*
-        // ImageIO writer, the fall-back, must be the first one added
-        if(GLProfile.isAWTAvailable()) {
-            try {
-                // Use reflection to avoid compile-time dependencies on AWT-related classes
-                TextureWriter writer = (TextureWriter)
-                    Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureWriter").newInstance();
-                addTextureWriter(writer);
-            } catch (Exception e) {
-                if (DEBUG) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        */
-
-        // Other special-case writers
-        addTextureWriter(new DDSTextureWriter());
-        addTextureWriter(new SGITextureWriter());
-        addTextureWriter(new TGATextureWriter());
-        addTextureWriter(new NetPbmTextureWriter());
-    }
-
-    // Implementation methods
-    private static TextureData newTextureDataImpl(GLProfile glp, File file,
-                                                  int internalFormat,
-                                                  int pixelFormat,
-                                                  boolean mipmap,
-                                                  String fileSuffix) throws IOException {
-        if (file == null) {
-            throw new IOException("File was null");
-        }
-
-        fileSuffix = toLowerCase(fileSuffix);
-
-        for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
-            TextureProvider provider = (TextureProvider) iter.next();
-            TextureData data = provider.newTextureData(glp, file,
-                                                       internalFormat,
-                                                       pixelFormat,
-                                                       mipmap,
-                                                       fileSuffix);
-            if (data != null) {
-                return data;
-            }
-        }
-
-        throw new IOException("No suitable reader for given file "+file.getAbsolutePath());
-    }
-
-    private static TextureData newTextureDataImpl(GLProfile glp, InputStream stream,
-                                                  int internalFormat,
-                                                  int pixelFormat,
-                                                  boolean mipmap,
-                                                  String fileSuffix) throws IOException {
-        if (stream == null) {
-            throw new IOException("Stream was null");
-        }
-
-        fileSuffix = toLowerCase(fileSuffix);
-
-        // Note: use of BufferedInputStream works around 4764639/4892246
-        if (!(stream instanceof BufferedInputStream)) {
-            stream = new BufferedInputStream(stream);
-        }
-
-        for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
-            TextureProvider provider = (TextureProvider) iter.next();
-            TextureData data = provider.newTextureData(glp, stream,
-                                                       internalFormat,
-                                                       pixelFormat,
-                                                       mipmap,
-                                                       fileSuffix);
-            if (data != null) {
-                return data;
-            }
-        }
-
-        throw new IOException("No suitable reader for given stream");
-    }
-
-    private static TextureData newTextureDataImpl(GLProfile glp, URL url,
-                                                  int internalFormat,
-                                                  int pixelFormat,
-                                                  boolean mipmap,
-                                                  String fileSuffix) throws IOException {
-        if (url == null) {
-            throw new IOException("URL was null");
-        }
-
-        fileSuffix = toLowerCase(fileSuffix);
-
-        for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
-            TextureProvider provider = (TextureProvider) iter.next();
-            TextureData data = provider.newTextureData(glp, url,
-                                                       internalFormat,
-                                                       pixelFormat,
-                                                       mipmap,
-                                                       fileSuffix);
-            if (data != null) {
-                return data;
-            }
-        }
-
-        throw new IOException("No suitable reader for given URL "+url);
-    }
-
-    //----------------------------------------------------------------------
-    // DDS provider -- supports files only for now
-    static class DDSTextureProvider implements TextureProvider {
-        public TextureData newTextureData(GLProfile glp, File file,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            if (DDS.equals(fileSuffix) ||
-                DDS.equals(FileUtil.getFileSuffix(file))) {
-                DDSImage image = DDSImage.read(file);
-                return newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
-            }
-
-            return null;
-        }
-
-        public TextureData newTextureData(GLProfile glp, InputStream stream,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            if (DDS.equals(fileSuffix) ||
-                DDSImage.isDDSImage(stream)) {
-                DDSImage image = DDSImage.read(stream);
-                return newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
-            }
-
-            return null;
-        }
-
-        public TextureData newTextureData(GLProfile glp, URL url,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            InputStream stream = new BufferedInputStream(url.openStream());
-            try {
-                return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
-            } finally {
-                stream.close();
-            }
-        }
-
-        private TextureData newTextureData(GLProfile glp, final DDSImage image,
-                                           int internalFormat,
-                                           int pixelFormat,
-                                           boolean mipmap) {
-            DDSImage.ImageInfo info = image.getMipMap(0);
-            if (pixelFormat == 0) {
-                switch (image.getPixelFormat()) {
-                case DDSImage.D3DFMT_R8G8B8:
-                    pixelFormat = GL.GL_RGB;
-                    break;
-                default:
-                    pixelFormat = GL.GL_RGBA;
-                    break;
-                }
-            }
-            if (info.isCompressed()) {
-                switch (info.getCompressionFormat()) {
-                case DDSImage.D3DFMT_DXT1:
-                    internalFormat = GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
-                    break;
-                case DDSImage.D3DFMT_DXT3:
-                    internalFormat = GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
-                    break;
-                case DDSImage.D3DFMT_DXT5:
-                    internalFormat = GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
-                    break;
-                default:
-                    throw new RuntimeException("Unsupported DDS compression format \"" +
-                                               DDSImage.getCompressionFormatName(info.getCompressionFormat()) + "\"");
-                }
-            }
-            if (internalFormat == 0) {
-                switch (image.getPixelFormat()) {
-                case DDSImage.D3DFMT_R8G8B8:
-                    pixelFormat = GL.GL_RGB;
-                    break;
-                default:
-                    pixelFormat = GL.GL_RGBA;
-                    break;
-                }
-            }
-            TextureData.Flusher flusher = new TextureData.Flusher() {
-                    public void flush() {
-                        image.close();
-                    }
-                };
-            TextureData data;
-            if (mipmap && image.getNumMipMaps() > 0) {
-                Buffer[] mipmapData = new Buffer[image.getNumMipMaps()];
-                for (int i = 0; i < image.getNumMipMaps(); i++) {
-                    mipmapData[i] = image.getMipMap(i).getData();
-                }
-                data = new TextureData(glp, internalFormat,
-                                       info.getWidth(),
-                                       info.getHeight(),
-                                       0,
-                                       pixelFormat,
-                                       GL.GL_UNSIGNED_BYTE,
-                                       info.isCompressed(),
-                                       true,
-                                       mipmapData,
-                                       flusher);
-            } else {
-                // Fix this up for the end user because we can't generate
-                // mipmaps for compressed textures
-                mipmap = false;
-                data = new TextureData(glp, internalFormat,
-                                       info.getWidth(),
-                                       info.getHeight(),
-                                       0,
-                                       pixelFormat,
-                                       GL.GL_UNSIGNED_BYTE,
-                                       mipmap,
-                                       info.isCompressed(),
-                                       true,
-                                       info.getData(),
-                                       flusher);
-            }
-            return data;
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // Base class for SGI RGB and TGA image providers
-    static abstract class StreamBasedTextureProvider implements TextureProvider {
-        public TextureData newTextureData(GLProfile glp, File file,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            InputStream inStream = new BufferedInputStream(new FileInputStream(file));
-            try {
-                // The SGIImage and TGAImage implementations use InputStreams
-                // anyway so there isn't much point in having a separate code
-                // path for files
-                return newTextureData(glp, inStream,
-                                      internalFormat,
-                                      pixelFormat,
-                                      mipmap,
-                                      ((fileSuffix != null) ? fileSuffix : FileUtil.getFileSuffix(file)));
-            } finally {
-                inStream.close();
-            }
-        }
-
-        public TextureData newTextureData(GLProfile glp, URL url,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            InputStream stream = new BufferedInputStream(url.openStream());
-            try {
-                return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
-            } finally {
-                stream.close();
-            }
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // SGI RGB image provider
-    static class SGITextureProvider extends StreamBasedTextureProvider {
-        public TextureData newTextureData(GLProfile glp, InputStream stream,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            if (SGI.equals(fileSuffix) ||
-                SGI_RGB.equals(fileSuffix) ||
-                SGIImage.isSGIImage(stream)) {
-                SGIImage image = SGIImage.read(stream);
-                if (pixelFormat == 0) {
-                    pixelFormat = image.getFormat();
-                }
-                if (internalFormat == 0) {
-                    internalFormat = image.getFormat();
-                }
-                return new TextureData(glp, internalFormat,
-                                       image.getWidth(),
-                                       image.getHeight(),
-                                       0,
-                                       pixelFormat,
-                                       GL.GL_UNSIGNED_BYTE,
-                                       mipmap,
-                                       false,
-                                       false,
-                                       ByteBuffer.wrap(image.getData()),
-                                       null);
-            }
-
-            return null;
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // TGA (Targa) image provider
-    static class TGATextureProvider extends StreamBasedTextureProvider {
-        public TextureData newTextureData(GLProfile glp, InputStream stream,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            if (TGA.equals(fileSuffix)) {
-                TGAImage image = TGAImage.read(stream);
-                if (pixelFormat == 0) {
-                    pixelFormat = image.getGLFormat();
-                }
-                if (internalFormat == 0) {
-                    GL gl = GLContext.getCurrentGL();
-                    if(gl.isGL2()) {
-                        internalFormat = GL.GL_RGBA8;
-                    } else {
-                        internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB;
-                    }
-                }
-                return new TextureData(glp, internalFormat,
-                                       image.getWidth(),
-                                       image.getHeight(),
-                                       0,
-                                       pixelFormat,
-                                       GL.GL_UNSIGNED_BYTE,
-                                       mipmap,
-                                       false,
-                                       false,
-                                       image.getData(),
-                                       null);
-            }
-
-            return null;
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // DDS texture writer
-    //
-    static class DDSTextureWriter implements TextureWriter {
-        public boolean write(File file,
-                             TextureData data) throws IOException {
-            if (DDS.equals(FileUtil.getFileSuffix(file))) {
-                // See whether the DDS writer can handle this TextureData
-                int pixelFormat = data.getPixelFormat();
-                int pixelType   = data.getPixelType();
-                if (pixelType != GL.GL_BYTE &&
-                    pixelType != GL.GL_UNSIGNED_BYTE) {
-                    throw new IOException("DDS writer only supports byte / unsigned byte textures");
-                }
-
-                int d3dFormat = 0;
-                // FIXME: some of these are probably not completely correct and would require swizzling
-                switch (pixelFormat) {
-                case GL.GL_RGB:                        d3dFormat = DDSImage.D3DFMT_R8G8B8; break;
-                case GL.GL_RGBA:                       d3dFormat = DDSImage.D3DFMT_A8R8G8B8; break;
-                case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT:  d3dFormat = DDSImage.D3DFMT_DXT1; break;
-                case GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: throw new IOException("RGBA DXT1 not yet supported");
-                case GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: d3dFormat = DDSImage.D3DFMT_DXT3; break;
-                case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: d3dFormat = DDSImage.D3DFMT_DXT5; break;
-                default: throw new IOException("Unsupported pixel format 0x" + Integer.toHexString(pixelFormat) + " by DDS writer");
-                }
-        
-                ByteBuffer[] mipmaps = null;
-                if (data.getMipmapData() != null) {
-                    mipmaps = new ByteBuffer[data.getMipmapData().length];
-                    for (int i = 0; i < mipmaps.length; i++) {
-                        mipmaps[i] = (ByteBuffer) data.getMipmapData()[i];
-                    }
-                } else {
-                    mipmaps = new ByteBuffer[] { (ByteBuffer) data.getBuffer() };
-                }
-
-                DDSImage image = DDSImage.createFromData(d3dFormat,
-                                                         data.getWidth(),
-                                                         data.getHeight(),
-                                                         mipmaps);
-                image.write(file);
-                return true;
-            }
-
-            return false;
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // SGI (rgb) texture writer
-    //
-    static class SGITextureWriter implements TextureWriter {
-        public boolean write(File file,
-                             TextureData data) throws IOException {
-            String fileSuffix = FileUtil.getFileSuffix(file);
-            if (SGI.equals(fileSuffix) ||
-                SGI_RGB.equals(fileSuffix)) {
-                // See whether the SGI writer can handle this TextureData
-                int pixelFormat = data.getPixelFormat();
-                int pixelType   = data.getPixelType();
-                if ((pixelFormat == GL.GL_RGB ||
-                     pixelFormat == GL.GL_RGBA) &&
-                    (pixelType == GL.GL_BYTE ||
-                     pixelType == GL.GL_UNSIGNED_BYTE)) {
-                    ByteBuffer buf = ((data.getBuffer() != null) ?
-                                      (ByteBuffer) data.getBuffer() :
-                                      (ByteBuffer) data.getMipmapData()[0]);
-                    byte[] bytes;
-                    if (buf.hasArray()) {
-                        bytes = buf.array();
-                    } else {
-                        buf.rewind();
-                        bytes = new byte[buf.remaining()];
-                        buf.get(bytes);
-                        buf.rewind();
-                    }
-
-                    SGIImage image = SGIImage.createFromData(data.getWidth(),
-                                                             data.getHeight(),
-                                                             (pixelFormat == GL.GL_RGBA),
-                                                             bytes);
-                    image.write(file, false);
-                    return true;
-                }
-
-                throw new IOException("SGI writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
-            }
-
-            return false;
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // TGA (Targa) texture writer
-  
-    static class TGATextureWriter implements TextureWriter {
-        public boolean write(File file,
-                             TextureData data) throws IOException {
-            if (TGA.equals(FileUtil.getFileSuffix(file))) {
-                // See whether the TGA writer can handle this TextureData
-                int pixelFormat = data.getPixelFormat();
-                int pixelType   = data.getPixelType();
-                if ((pixelFormat == GL.GL_RGB ||
-                     pixelFormat == GL.GL_RGBA) &&
-                    (pixelType == GL.GL_BYTE ||
-                     pixelType == GL.GL_UNSIGNED_BYTE)) {
-                    ByteBuffer buf = ((data.getBuffer() != null) ?
-                                      (ByteBuffer) data.getBuffer() :
-                                      (ByteBuffer) data.getMipmapData()[0]);
-                    // Must reverse order of red and blue channels to get correct results
-                    int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
-                    for (int i = 0; i < buf.remaining(); i += skip) {
-                        byte red  = buf.get(i + 0);
-                        byte blue = buf.get(i + 2);
-                        buf.put(i + 0, blue);
-                        buf.put(i + 2, red);
-                    }
-
-                    TGAImage image = TGAImage.createFromData(data.getWidth(),
-                                                             data.getHeight(),
-                                                             (pixelFormat == GL.GL_RGBA),
-                                                             false,
-                                                             ((data.getBuffer() != null) ?
-                                                              (ByteBuffer) data.getBuffer() :
-                                                              (ByteBuffer) data.getMipmapData()[0]));
-                    image.write(file);
-                    return true;
-                }
-
-                throw new IOException("TGA writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
-            }
-
-            return false;
-        }    
-    }
-
-    //----------------------------------------------------------------------
-    // Helper routines
-    //
-
-    private static int glGetInteger(int pname) {
-        int[] tmp = new int[1];
-        GL gl = GLContext.getCurrentGL();
-        gl.glGetIntegerv(pname, tmp, 0);
-        return tmp[0];
-    }
-
-    private static int glGetTexLevelParameteri(GL2 gl, int target, int level, int pname) {
-        int[] tmp = new int[1];
-        gl.glGetTexLevelParameteriv(target, 0, pname, tmp, 0);
-        return tmp[0];
-    }
-
-    private static String toLowerCase(String arg) {
-        if (arg == null) {
-            return null;
-        }
-
-        return arg.toLowerCase();
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javase b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javase
deleted file mode 100644
index 819a6ac..0000000
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javase
+++ /dev/null
@@ -1,1258 +0,0 @@
-/*
- * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.util.texture;
-
-import java.io.*;
-import java.net.*;
-import java.nio.*;
-import java.util.*;
-
-import javax.media.opengl.*;
-import javax.media.opengl.glu.*;
-import com.jogamp.opengl.impl.Debug;
-import com.jogamp.opengl.util.*;
-import com.jogamp.opengl.util.texture.spi.*;
-
-/** <P> Provides input and output facilities for both loading OpenGL
-    textures from disk and streams as well as writing textures already
-    in memory back to disk. </P>
-
-    <P> The TextureIO class supports an arbitrary number of plug-in
-    readers and writers via TextureProviders and TextureWriters.
-    TextureProviders know how to produce TextureData objects from
-    files, InputStreams and URLs. TextureWriters know how to write
-    TextureData objects to disk in various file formats. The
-    TextureData class represents the raw data of the texture before it
-    has been converted to an OpenGL texture object. The Texture class
-    represents the OpenGL texture object and provides easy facilities
-    for using the texture. </P>
-
-    <P> There are several built-in TextureProviders and TextureWriters
-    supplied with the TextureIO implementation. The most basic
-    provider uses the platform's Image I/O facilities to read in a
-    BufferedImage and convert it to a texture. This is the baseline
-    provider and is registered so that it is the last one consulted.
-    All others are asked first to open a given file. </P>
-
-    <P> There are three other providers registered by default as of
-    the time of this writing. One handles SGI RGB (".sgi", ".rgb")
-    images from both files and streams. One handles DirectDraw Surface
-    (".dds") images read from files, though can not read these images
-    from streams. One handles Targa (".tga") images read from both
-    files and streams. These providers are executed in an arbitrary
-    order. Some of these providers require the file's suffix to either
-    be specified via the newTextureData methods or for the file to be
-    named with the appropriate suffix. In general a file suffix should
-    be provided to the newTexture and newTextureData methods if at all
-    possible. </P>
-
-    <P> Note that additional TextureProviders, if reading images from
-    InputStreams, must use the mark()/reset() methods on InputStream
-    when probing for e.g. magic numbers at the head of the file to
-    make sure not to disturb the state of the InputStream for
-    downstream TextureProviders. </P>
-
-    <P> There are analogous TextureWriters provided for writing
-    textures back to disk if desired. As of this writing, there are
-    four TextureWriters registered by default: one for Targa files,
-    one for SGI RGB files, one for DirectDraw surface (.dds) files,
-    and one for ImageIO-supplied formats such as .jpg and .png.  Some
-    of these writers have certain limitations such as only being able
-    to write out textures stored in GL_RGB or GL_RGBA format. The DDS
-    writer supports fetching and writing to disk of texture data in
-    DXTn compressed format. Whether this will occur is dependent on
-    whether the texture's internal format is one of the DXTn
-    compressed formats and whether the target file is .dds format.
-*/
-
-public class TextureIO {
-    /** Constant which can be used as a file suffix to indicate a
-        DirectDraw Surface file. */
-    public static final String DDS     = "dds";
-
-    /** Constant which can be used as a file suffix to indicate an SGI
-        RGB file. */
-    public static final String SGI     = "sgi";
-
-    /** Constant which can be used as a file suffix to indicate an SGI
-        RGB file. */
-    public static final String SGI_RGB = "rgb";
-
-    /** Constant which can be used as a file suffix to indicate a GIF
-        file. */
-    public static final String GIF     = "gif";
-
-    /** Constant which can be used as a file suffix to indicate a JPEG
-        file. */
-    public static final String JPG     = "jpg";
-
-    /** Constant which can be used as a file suffix to indicate a PNG
-        file. */
-    public static final String PNG     = "png";
-
-    /** Constant which can be used as a file suffix to indicate a Targa
-        file. */
-    public static final String TGA     = "tga";
-
-    /** Constant which can be used as a file suffix to indicate a TIFF
-        file. */
-    public static final String TIFF    = "tiff";
-
-    private static final boolean DEBUG = Debug.debug("TextureIO");
-
-    // For manually disabling the use of the texture rectangle
-    // extensions so you know the texture target is GL_TEXTURE_2D; this
-    // is useful for shader writers (thanks to Chris Campbell for this
-    // observation)
-    private static boolean texRectEnabled = true;
-
-    //----------------------------------------------------------------------
-    // methods that *do not* require a current context
-    // These methods assume RGB or RGBA textures.
-    // Some texture providers may not recognize the file format unless
-    // the fileSuffix is specified, so it is strongly recommended to
-    // specify it wherever it is known.
-    // Some texture providers may also only support one kind of input,
-    // i.e., reading from a file as opposed to a stream.
-
-    /**
-     * Creates a TextureData from the given file. Does no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param file the file from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the file, or null if none of the
-     *         registered texture providers could read the file
-     * @throws IOException if an error occurred while reading the file
-     */
-    public static TextureData newTextureData(GLProfile glp, File file,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException {
-        if (fileSuffix == null) {
-            fileSuffix = FileUtil.getFileSuffix(file);
-        }
-        return newTextureDataImpl(glp, file, 0, 0, mipmap, fileSuffix);
-    }
-
-    /**
-     * Creates a TextureData from the given stream. Does no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param stream the stream from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the stream, or null if none of the
-     *         registered texture providers could read the stream
-     * @throws IOException if an error occurred while reading the stream
-     */
-    public static TextureData newTextureData(GLProfile glp, InputStream stream,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException {
-        return newTextureDataImpl(glp, stream, 0, 0, mipmap, fileSuffix);
-    }
-
-    /**
-     * Creates a TextureData from the given URL. Does no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param url the URL from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the URL, or null if none of the
-     *         registered texture providers could read the URL
-     * @throws IOException if an error occurred while reading the URL
-     */
-    public static TextureData newTextureData(GLProfile glp, URL url,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException {
-        if (fileSuffix == null) {
-            fileSuffix = FileUtil.getFileSuffix(url.getPath());
-        }
-        return newTextureDataImpl(glp, url, 0, 0, mipmap, fileSuffix);
-    }
-
-    //----------------------------------------------------------------------
-    // These methods make no assumption about the OpenGL internal format
-    // or pixel format of the texture; they must be specified by the
-    // user. It is not allowed to supply 0 (indicating no preference)
-    // for either the internalFormat or the pixelFormat;
-    // IllegalArgumentException will be thrown in this case.
-
-    /**
-     * Creates a TextureData from the given file, using the specified
-     * OpenGL internal format and pixel format for the texture which
-     * will eventually result. The internalFormat and pixelFormat must
-     * be specified and may not be zero; to use default values, use the
-     * variant of this method which does not take these arguments. Does
-     * no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param file the file from which to read the texture data
-     * @param internalFormat the OpenGL internal format of the texture
-     *                   which will eventually result from the TextureData
-     * @param pixelFormat the OpenGL pixel format of the texture
-     *                    which will eventually result from the TextureData
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the file, or null if none of the
-     *         registered texture providers could read the file
-     * @throws IllegalArgumentException if either internalFormat or
-     *                                  pixelFormat was 0
-     * @throws IOException if an error occurred while reading the file
-     */
-    public static TextureData newTextureData(GLProfile glp, File file,
-                                             int internalFormat,
-                                             int pixelFormat,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException, IllegalArgumentException {
-        if ((internalFormat == 0) || (pixelFormat == 0)) {
-            throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
-        }
-
-        if (fileSuffix == null) {
-            fileSuffix = FileUtil.getFileSuffix(file);
-        }
-
-        return newTextureDataImpl(glp, file, internalFormat, pixelFormat, mipmap, fileSuffix);
-    }
-
-    /**
-     * Creates a TextureData from the given stream, using the specified
-     * OpenGL internal format and pixel format for the texture which
-     * will eventually result. The internalFormat and pixelFormat must
-     * be specified and may not be zero; to use default values, use the
-     * variant of this method which does not take these arguments. Does
-     * no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param stream the stream from which to read the texture data
-     * @param internalFormat the OpenGL internal format of the texture
-     *                   which will eventually result from the TextureData
-     * @param pixelFormat the OpenGL pixel format of the texture
-     *                    which will eventually result from the TextureData
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the stream, or null if none of the
-     *         registered texture providers could read the stream
-     * @throws IllegalArgumentException if either internalFormat or
-     *                                  pixelFormat was 0
-     * @throws IOException if an error occurred while reading the stream
-     */
-    public static TextureData newTextureData(GLProfile glp, InputStream stream,
-                                             int internalFormat,
-                                             int pixelFormat,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException, IllegalArgumentException {
-        if ((internalFormat == 0) || (pixelFormat == 0)) {
-            throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
-        }
-
-        return newTextureDataImpl(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
-    }
-
-    /**
-     * Creates a TextureData from the given URL, using the specified
-     * OpenGL internal format and pixel format for the texture which
-     * will eventually result. The internalFormat and pixelFormat must
-     * be specified and may not be zero; to use default values, use the
-     * variant of this method which does not take these arguments. Does
-     * no OpenGL work.
-     *
-     * @param glp the OpenGL Profile this texture data should be
-     *                  created for.
-     * @param url the URL from which to read the texture data
-     * @param internalFormat the OpenGL internal format of the texture
-     *                   which will eventually result from the TextureData
-     * @param pixelFormat the OpenGL pixel format of the texture
-     *                    which will eventually result from the TextureData
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @return the texture data from the URL, or null if none of the
-     *         registered texture providers could read the URL
-     * @throws IllegalArgumentException if either internalFormat or
-     *                                  pixelFormat was 0
-     * @throws IOException if an error occurred while reading the URL
-     */
-    public static TextureData newTextureData(GLProfile glp, URL url,
-                                             int internalFormat,
-                                             int pixelFormat,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException, IllegalArgumentException {
-        if ((internalFormat == 0) || (pixelFormat == 0)) {
-            throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
-        }
-
-        if (fileSuffix == null) {
-            fileSuffix = FileUtil.getFileSuffix(url.getPath());
-        }
-
-        return newTextureDataImpl(glp, url, internalFormat, pixelFormat, mipmap, fileSuffix);
-    }
-
-    //----------------------------------------------------------------------
-    // methods that *do* require a current context
-    //
-
-    /** 
-     * Creates an OpenGL texture object from the specified TextureData
-     * using the current OpenGL context.
-     *
-     * @param data the texture data to turn into an OpenGL texture
-     * @throws GLException if no OpenGL context is current or if an
-     *                     OpenGL error occurred
-     * @throws IllegalArgumentException if the passed TextureData was null
-     */
-    public static Texture newTexture(TextureData data) throws GLException, IllegalArgumentException {
-        if (data == null) {
-            throw new IllegalArgumentException("Null TextureData");
-        }
-        return new Texture(data);
-    }
-
-    /** 
-     * Creates an OpenGL texture object from the specified file using
-     * the current OpenGL context.
-     *
-     * @param file the file from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @throws IOException if an error occurred while reading the file
-     * @throws GLException if no OpenGL context is current or if an
-     *                     OpenGL error occurred
-     */
-    public static Texture newTexture(File file, boolean mipmap) throws IOException, GLException {
-        GLProfile glp = GLContext.getCurrentGL().getGLProfile();
-        TextureData data = newTextureData(glp, file, mipmap, FileUtil.getFileSuffix(file));
-        Texture texture = newTexture(data);
-        data.flush();
-        return texture;
-    }
-
-    /** 
-     * Creates an OpenGL texture object from the specified stream using
-     * the current OpenGL context.
-     *
-     * @param stream the stream from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @throws IOException if an error occurred while reading the stream
-     * @throws GLException if no OpenGL context is current or if an
-     *                     OpenGL error occurred
-     */
-    public static Texture newTexture(InputStream stream, boolean mipmap, String fileSuffix) throws IOException, GLException {
-        GLProfile glp = GLContext.getCurrentGL().getGLProfile();
-        TextureData data = newTextureData(glp, stream, mipmap, fileSuffix);
-        Texture texture = newTexture(data);
-        data.flush();
-        return texture;
-    }
-
-    /** 
-     * Creates an OpenGL texture object from the specified URL using the
-     * current OpenGL context.
-     *
-     * @param url the URL from which to read the texture data
-     * @param mipmap     whether mipmaps should be produced for this
-     *                   texture either by autogenerating them or
-     *                   reading them from the file. Some file formats
-     *                   support multiple mipmaps in a single file in
-     *                   which case those mipmaps will be used rather
-     *                   than generating them.
-     * @param fileSuffix the suffix of the file name to be used as a
-     *                   hint of the file format to the underlying
-     *                   texture provider, or null if none and should be
-     *                   auto-detected (some texture providers do not
-     *                   support this)
-     * @throws IOException if an error occurred while reading the URL
-     * @throws GLException if no OpenGL context is current or if an
-     *                     OpenGL error occurred
-     */
-    public static Texture newTexture(URL url, boolean mipmap, String fileSuffix) throws IOException, GLException {
-        if (fileSuffix == null) {
-            fileSuffix = FileUtil.getFileSuffix(url.getPath());
-        }
-        GLProfile glp = GLContext.getCurrentGL().getGLProfile();
-        TextureData data = newTextureData(glp, url, mipmap, fileSuffix);
-        Texture texture = newTexture(data);
-        data.flush();
-        return texture;
-    }
-
-    /** 
-     * Creates an OpenGL texture object associated with the given OpenGL
-     * texture target using the current OpenGL context. The texture has
-     * no initial data. This is used, for example, to construct cube
-     * maps out of multiple TextureData objects.
-     *
-     * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D, 
-     *               GL.GL_TEXTURE_RECTANGLE_ARB
-     *
-     * @throws GLException if no OpenGL context is current or if an
-     *                     OpenGL error occurred
-     */
-    public static Texture newTexture(int target) throws GLException {
-        return new Texture(target);
-    }
-
-    /**
-     * Wraps an OpenGL texture ID from an external library and allows
-     * some of the base methods from the Texture class, such as
-     * binding and querying of texture coordinates, to be used with
-     * it. Attempts to update such textures' contents will yield
-     * undefined results.
-     *
-     * @param textureID the OpenGL texture object to wrap
-     * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D, 
-     *               GL2.GL_TEXTURE_RECTANGLE
-     * @param texWidth the width of the texture in pixels
-     * @param texHeight the height of the texture in pixels
-     * @param imgWidth the width of the image within the texture in
-     *          pixels (if the content is a sub-rectangle in the upper
-     *          left corner); otherwise, pass in texWidth
-     * @param imgHeight the height of the image within the texture in
-     *          pixels (if the content is a sub-rectangle in the upper
-     *          left corner); otherwise, pass in texHeight
-     * @param mustFlipVertically indicates whether the texture
-     *                           coordinates must be flipped vertically
-     *                           in order to properly display the
-     *                           texture
-     */
-    public static Texture newTexture(int textureID,
-				     int target,
-				     int texWidth,
-				     int texHeight,
-				     int imgWidth,
-				     int imgHeight,
-				     boolean mustFlipVertically) {
-	return new Texture(textureID,
-			   target,
-			   texWidth,
-			   texHeight,
-			   imgWidth,
-			   imgHeight,
-			   mustFlipVertically);
-    }
-
-    /**
-     * Writes the given texture to a file. The type of the file is
-     * inferred from its suffix. An OpenGL context must be current in
-     * order to fetch the texture data back from the OpenGL pipeline.
-     * This method causes the specified Texture to be bound to the
-     * GL_TEXTURE_2D state. If no suitable writer for the requested file
-     * format was found, throws an IOException. <P>
-     *
-     * Reasonable attempts are made to produce good results in the
-     * resulting images. The Targa, SGI and ImageIO writers produce
-     * results in the correct vertical orientation for those file
-     * formats. The DDS writer performs no vertical flip of the data,
-     * even in uncompressed mode. (It is impossible to perform such a
-     * vertical flip with compressed data.) Applications should keep
-     * this in mind when using this routine to save textures to disk for
-     * later re-loading. <P>
-     *
-     * Any mipmaps for the specified texture are currently discarded
-     * when it is written to disk, regardless of whether the underlying
-     * file format supports multiple mipmaps in a given file.
-     *
-     * @throws IOException if an error occurred during writing or no
-     *   suitable writer was found
-     * @throws GLException if no OpenGL context was current or an
-     *   OpenGL-related error occurred
-     */
-    public static void write(Texture texture, File file) throws IOException, GLException {
-        if (texture.getTarget() != GL.GL_TEXTURE_2D) {
-            throw new GLException("Only GL_TEXTURE_2D textures are supported");
-        }
-
-        // First fetch the texture data
-        GL _gl = GLContext.getCurrentGL();
-        if (!_gl.isGL2()) {
-            throw new GLException("Only GL2 supports fetching compressed images, GL: " + _gl);
-        }
-        GL2 gl = _gl.getGL2();
-
-        texture.bind();
-        int internalFormat = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_INTERNAL_FORMAT);
-        int width  = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_WIDTH);
-        int height = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_HEIGHT);
-        int border = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_BORDER);
-        TextureData data = null;
-        if (internalFormat == GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
-            internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ||
-            internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT ||
-            internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) {
-            // Fetch using glGetCompressedTexImage
-            int size   = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_COMPRESSED_IMAGE_SIZE);
-            ByteBuffer res = ByteBuffer.allocate(size);
-            gl.glGetCompressedTexImage(GL.GL_TEXTURE_2D, 0, res);
-            data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, internalFormat, GL.GL_UNSIGNED_BYTE,
-                                   false, true, true, res, null);
-        } else {
-            int bytesPerPixel = 0;
-            int fetchedFormat = 0;
-            switch (internalFormat) {
-            case GL.GL_RGB:
-            case GL2.GL_BGR:
-            case GL.GL_RGB8:
-                bytesPerPixel = 3;
-                fetchedFormat = GL.GL_RGB;
-                break;
-            case GL.GL_RGBA:
-            case GL2.GL_BGRA:
-            case GL2.GL_ABGR_EXT:
-            case GL.GL_RGBA8:
-                bytesPerPixel = 4;
-                fetchedFormat = GL.GL_RGBA;
-                break;
-            default:
-                throw new IOException("Unsupported texture internal format 0x" + Integer.toHexString(internalFormat));
-            }
-
-            // Fetch using glGetTexImage
-            int packAlignment  = glGetInteger(GL.GL_PACK_ALIGNMENT);
-            int packRowLength  = glGetInteger(GL2.GL_PACK_ROW_LENGTH);
-            int packSkipRows   = glGetInteger(GL2.GL_PACK_SKIP_ROWS);
-            int packSkipPixels = glGetInteger(GL2.GL_PACK_SKIP_PIXELS);
-            int packSwapBytes  = glGetInteger(GL2.GL_PACK_SWAP_BYTES);
-
-            gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1);
-            gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, 0);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, 0);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, 0);
-            gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, 0);
-
-            ByteBuffer res = ByteBuffer.allocate((width + (2 * border)) *
-                                                 (height + (2 * border)) *
-                                                 bytesPerPixel);
-            if (DEBUG) {
-                System.out.println("Allocated buffer of size " + res.remaining() + " for fetched image (" +
-                                   ((fetchedFormat == GL.GL_RGB) ? "GL_RGB" : "GL_RGBA") + ")");
-            }
-            gl.glGetTexImage(GL.GL_TEXTURE_2D, 0, fetchedFormat, GL.GL_UNSIGNED_BYTE, res);
-
-            gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);
-            gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, packRowLength);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, packSkipRows);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels);
-            gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes);
-      
-            data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE,
-                                   false, false, false, res, null);
-
-            if (DEBUG) {
-                System.out.println("data.getPixelFormat() = " +
-                                   ((data.getPixelFormat() == GL.GL_RGB) ? "GL_RGB" : "GL_RGBA"));
-            }
-        }
-
-        write(data, file);
-    }
-  
-    public static void write(TextureData data, File file) throws IOException, GLException {
-        for (Iterator iter = textureWriters.iterator(); iter.hasNext(); ) {
-            TextureWriter writer = (TextureWriter) iter.next();
-            if (writer.write(file, data)) {
-                return;
-            }
-        }
-
-        throw new IOException("No suitable texture writer found for "+file.getAbsolutePath());
-    }
-  
-    //----------------------------------------------------------------------
-    // SPI support
-    //
-
-    /** Adds a TextureProvider to support reading of a new file
-        format. */
-    public static void addTextureProvider(TextureProvider provider) {
-        // Must always add at the front so the ImageIO provider is last,
-        // so we don't accidentally use it instead of a user's possibly
-        // more optimal provider
-        textureProviders.add(0, provider);
-    }
-
-    /** Adds a TextureWriter to support writing of a new file
-        format. */
-    public static void addTextureWriter(TextureWriter writer) {
-        // Must always add at the front so the ImageIO writer is last,
-        // so we don't accidentally use it instead of a user's possibly
-        // more optimal writer
-        textureWriters.add(0, writer);
-    }
-
-    //---------------------------------------------------------------------------
-    // Global disabling of texture rectangle extension
-    //
-
-    /** Toggles the use of the GL_ARB_texture_rectangle extension by the
-        TextureIO classes. By default, on hardware supporting this
-        extension, the TextureIO classes may use the
-        GL_ARB_texture_rectangle extension for non-power-of-two
-        textures. (If the hardware supports the
-        GL_ARB_texture_non_power_of_two extension, that one is
-        preferred.) In some situations, for example when writing
-        shaders, it is advantageous to force the texture target to
-        always be GL_TEXTURE_2D in order to have one version of the
-        shader, even at the expense of texture memory in the case where
-        NPOT textures are not supported. This method allows the use of
-        the GL_ARB_texture_rectangle extension to be turned off globally
-        for this purpose. The default is that the use of the extension
-        is enabled. */
-    public static void setTexRectEnabled(boolean enabled) {
-        texRectEnabled = enabled;
-    }
-
-    /** Indicates whether the GL_ARB_texture_rectangle extension is
-        allowed to be used for non-power-of-two textures; see {@link
-        #setTexRectEnabled setTexRectEnabled}. */
-    public static boolean isTexRectEnabled() {
-        return texRectEnabled;
-    }
-
-    //----------------------------------------------------------------------
-    // Internals only below this point
-    //
-
-    private static List/*<TextureProvider>*/ textureProviders = new ArrayList/*<TextureProvider>*/();
-    private static List/*<TextureWriter>*/   textureWriters   = new ArrayList/*<TextureWriter>*/();
-
-    static {
-        // ImageIO provider, the fall-back, must be the first one added
-        if(GLProfile.isAWTAvailable()) {
-            try {
-                // Use reflection to avoid compile-time dependencies on AWT-related classes
-                TextureProvider provider = (TextureProvider)
-                    Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureProvider").newInstance();
-                addTextureProvider(provider);
-            } catch (Exception e) {
-                if (DEBUG) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
-        // Other special-case providers
-        addTextureProvider(new DDSTextureProvider());
-        addTextureProvider(new SGITextureProvider());
-        addTextureProvider(new TGATextureProvider());
-
-        // ImageIO writer, the fall-back, must be the first one added
-        if(GLProfile.isAWTAvailable()) {
-            try {
-                // Use reflection to avoid compile-time dependencies on AWT-related classes
-                TextureWriter writer = (TextureWriter)
-                    Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureWriter").newInstance();
-                addTextureWriter(writer);
-            } catch (Exception e) {
-                if (DEBUG) {
-                    e.printStackTrace();
-                }
-            } catch (Error e) {
-                if (DEBUG) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
-        // Other special-case writers
-        addTextureWriter(new DDSTextureWriter());
-        addTextureWriter(new SGITextureWriter());
-        addTextureWriter(new TGATextureWriter());
-        addTextureWriter(new NetPbmTextureWriter());
-    }
-
-    // Implementation methods
-    private static TextureData newTextureDataImpl(GLProfile glp, File file,
-                                                  int internalFormat,
-                                                  int pixelFormat,
-                                                  boolean mipmap,
-                                                  String fileSuffix) throws IOException {
-        if (file == null) {
-            throw new IOException("File was null");
-        }
-
-        fileSuffix = toLowerCase(fileSuffix);
-
-        for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
-            TextureProvider provider = (TextureProvider) iter.next();
-            TextureData data = provider.newTextureData(glp, file,
-                                                       internalFormat,
-                                                       pixelFormat,
-                                                       mipmap,
-                                                       fileSuffix);
-            if (data != null) {
-                return data;
-            }
-        }
-
-        throw new IOException("No suitable reader for given file "+file.getAbsolutePath());
-    }
-
-    private static TextureData newTextureDataImpl(GLProfile glp, InputStream stream,
-                                                  int internalFormat,
-                                                  int pixelFormat,
-                                                  boolean mipmap,
-                                                  String fileSuffix) throws IOException {
-        if (stream == null) {
-            throw new IOException("Stream was null");
-        }
-
-        fileSuffix = toLowerCase(fileSuffix);
-
-        // Note: use of BufferedInputStream works around 4764639/4892246
-        if (!(stream instanceof BufferedInputStream)) {
-            stream = new BufferedInputStream(stream);
-        }
-
-        for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
-            TextureProvider provider = (TextureProvider) iter.next();
-            TextureData data = provider.newTextureData(glp, stream,
-                                                       internalFormat,
-                                                       pixelFormat,
-                                                       mipmap,
-                                                       fileSuffix);
-            if (data != null) {
-                return data;
-            }
-        }
-
-        throw new IOException("No suitable reader for given stream");
-    }
-
-    private static TextureData newTextureDataImpl(GLProfile glp, URL url,
-                                                  int internalFormat,
-                                                  int pixelFormat,
-                                                  boolean mipmap,
-                                                  String fileSuffix) throws IOException {
-        if (url == null) {
-            throw new IOException("URL was null");
-        }
-
-        fileSuffix = toLowerCase(fileSuffix);
-
-        for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
-            TextureProvider provider = (TextureProvider) iter.next();
-            TextureData data = provider.newTextureData(glp, url,
-                                                       internalFormat,
-                                                       pixelFormat,
-                                                       mipmap,
-                                                       fileSuffix);
-            if (data != null) {
-                return data;
-            }
-        }
-
-        throw new IOException("No suitable reader for given URL "+url);
-    }
-
-    //----------------------------------------------------------------------
-    // DDS provider -- supports files only for now
-    static class DDSTextureProvider implements TextureProvider {
-        public TextureData newTextureData(GLProfile glp, File file,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            if (DDS.equals(fileSuffix) ||
-                DDS.equals(FileUtil.getFileSuffix(file))) {
-                DDSImage image = DDSImage.read(file);
-                return newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
-            }
-
-            return null;
-        }
-
-        public TextureData newTextureData(GLProfile glp, InputStream stream,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            if (DDS.equals(fileSuffix) ||
-                DDSImage.isDDSImage(stream)) {
-                byte[] data = StreamUtil.readAll2Array(stream);
-                ByteBuffer buf = ByteBuffer.wrap(data);
-                DDSImage image = DDSImage.read(buf);
-                return newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
-            }
-
-            return null;
-        }
-
-        public TextureData newTextureData(GLProfile glp, URL url,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            InputStream stream = new BufferedInputStream(url.openStream());
-            try {
-                return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
-            } finally {
-                stream.close();
-            }
-        }
-
-        private TextureData newTextureData(GLProfile glp, final DDSImage image,
-                                           int internalFormat,
-                                           int pixelFormat,
-                                           boolean mipmap) {
-            DDSImage.ImageInfo info = image.getMipMap(0);
-            if (pixelFormat == 0) {
-                switch (image.getPixelFormat()) {
-                case DDSImage.D3DFMT_R8G8B8:
-                    pixelFormat = GL.GL_RGB;
-                    break;
-                default:
-                    pixelFormat = GL.GL_RGBA;
-                    break;
-                }
-            }
-            if (info.isCompressed()) {
-                switch (info.getCompressionFormat()) {
-                case DDSImage.D3DFMT_DXT1:
-                    internalFormat = GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
-                    break;
-                case DDSImage.D3DFMT_DXT3:
-                    internalFormat = GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
-                    break;
-                case DDSImage.D3DFMT_DXT5:
-                    internalFormat = GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
-                    break;
-                default:
-                    throw new RuntimeException("Unsupported DDS compression format \"" +
-                                               DDSImage.getCompressionFormatName(info.getCompressionFormat()) + "\"");
-                }
-            }
-            if (internalFormat == 0) {
-                switch (image.getPixelFormat()) {
-                case DDSImage.D3DFMT_R8G8B8:
-                    pixelFormat = GL.GL_RGB;
-                    break;
-                default:
-                    pixelFormat = GL.GL_RGBA;
-                    break;
-                }
-            }
-            TextureData.Flusher flusher = new TextureData.Flusher() {
-                    public void flush() {
-                        image.close();
-                    }
-                };
-            TextureData data;
-            if (mipmap && image.getNumMipMaps() > 0) {
-                Buffer[] mipmapData = new Buffer[image.getNumMipMaps()];
-                for (int i = 0; i < image.getNumMipMaps(); i++) {
-                    mipmapData[i] = image.getMipMap(i).getData();
-                }
-                data = new TextureData(glp, internalFormat,
-                                       info.getWidth(),
-                                       info.getHeight(),
-                                       0,
-                                       pixelFormat,
-                                       GL.GL_UNSIGNED_BYTE,
-                                       info.isCompressed(),
-                                       true,
-                                       mipmapData,
-                                       flusher);
-            } else {
-                // Fix this up for the end user because we can't generate
-                // mipmaps for compressed textures
-                mipmap = false;
-                data = new TextureData(glp, internalFormat,
-                                       info.getWidth(),
-                                       info.getHeight(),
-                                       0,
-                                       pixelFormat,
-                                       GL.GL_UNSIGNED_BYTE,
-                                       mipmap,
-                                       info.isCompressed(),
-                                       true,
-                                       info.getData(),
-                                       flusher);
-            }
-            return data;
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // Base class for SGI RGB and TGA image providers
-    static abstract class StreamBasedTextureProvider implements TextureProvider {
-        public TextureData newTextureData(GLProfile glp, File file,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            InputStream inStream = new BufferedInputStream(new FileInputStream(file));
-            try {
-                // The SGIImage and TGAImage implementations use InputStreams
-                // anyway so there isn't much point in having a separate code
-                // path for files
-                return newTextureData(glp, inStream,
-                                      internalFormat,
-                                      pixelFormat,
-                                      mipmap,
-                                      ((fileSuffix != null) ? fileSuffix : FileUtil.getFileSuffix(file)));
-            } finally {
-                inStream.close();
-            }
-        }
-
-        public TextureData newTextureData(GLProfile glp, URL url,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            InputStream stream = new BufferedInputStream(url.openStream());
-            try {
-                return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
-            } finally {
-                stream.close();
-            }
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // SGI RGB image provider
-    static class SGITextureProvider extends StreamBasedTextureProvider {
-        public TextureData newTextureData(GLProfile glp, InputStream stream,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            if (SGI.equals(fileSuffix) ||
-                SGI_RGB.equals(fileSuffix) ||
-                SGIImage.isSGIImage(stream)) {
-                SGIImage image = SGIImage.read(stream);
-                if (pixelFormat == 0) {
-                    pixelFormat = image.getFormat();
-                }
-                if (internalFormat == 0) {
-                    internalFormat = image.getFormat();
-                }
-                return new TextureData(glp, internalFormat,
-                                       image.getWidth(),
-                                       image.getHeight(),
-                                       0,
-                                       pixelFormat,
-                                       GL.GL_UNSIGNED_BYTE,
-                                       mipmap,
-                                       false,
-                                       false,
-                                       ByteBuffer.wrap(image.getData()),
-                                       null);
-            }
-
-            return null;
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // TGA (Targa) image provider
-    static class TGATextureProvider extends StreamBasedTextureProvider {
-        public TextureData newTextureData(GLProfile glp, InputStream stream,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            if (TGA.equals(fileSuffix)) {
-                TGAImage image = TGAImage.read(stream);
-                if (pixelFormat == 0) {
-                    pixelFormat = image.getGLFormat();
-                }
-                if (internalFormat == 0) {
-                    GL gl = GLContext.getCurrentGL();
-                    if(gl.isGL2()) {
-                        internalFormat = GL.GL_RGBA8;
-                    } else {
-                        internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB;
-                    }
-                }
-                return new TextureData(glp, internalFormat,
-                                       image.getWidth(),
-                                       image.getHeight(),
-                                       0,
-                                       pixelFormat,
-                                       GL.GL_UNSIGNED_BYTE,
-                                       mipmap,
-                                       false,
-                                       false,
-                                       image.getData(),
-                                       null);
-            }
-
-            return null;
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // DDS texture writer
-    //
-    static class DDSTextureWriter implements TextureWriter {
-        public boolean write(File file,
-                             TextureData data) throws IOException {
-            if (DDS.equals(FileUtil.getFileSuffix(file))) {
-                // See whether the DDS writer can handle this TextureData
-                int pixelFormat = data.getPixelFormat();
-                int pixelType   = data.getPixelType();
-                if (pixelType != GL.GL_BYTE &&
-                    pixelType != GL.GL_UNSIGNED_BYTE) {
-                    throw new IOException("DDS writer only supports byte / unsigned byte textures");
-                }
-
-                int d3dFormat = 0;
-                // FIXME: some of these are probably not completely correct and would require swizzling
-                switch (pixelFormat) {
-                case GL.GL_RGB:                        d3dFormat = DDSImage.D3DFMT_R8G8B8; break;
-                case GL.GL_RGBA:                       d3dFormat = DDSImage.D3DFMT_A8R8G8B8; break;
-                case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT:  d3dFormat = DDSImage.D3DFMT_DXT1; break;
-                case GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: throw new IOException("RGBA DXT1 not yet supported");
-                case GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: d3dFormat = DDSImage.D3DFMT_DXT3; break;
-                case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: d3dFormat = DDSImage.D3DFMT_DXT5; break;
-                default: throw new IOException("Unsupported pixel format 0x" + Integer.toHexString(pixelFormat) + " by DDS writer");
-                }
-        
-                ByteBuffer[] mipmaps = null;
-                if (data.getMipmapData() != null) {
-                    mipmaps = new ByteBuffer[data.getMipmapData().length];
-                    for (int i = 0; i < mipmaps.length; i++) {
-                        mipmaps[i] = (ByteBuffer) data.getMipmapData()[i];
-                    }
-                } else {
-                    mipmaps = new ByteBuffer[] { (ByteBuffer) data.getBuffer() };
-                }
-
-                DDSImage image = DDSImage.createFromData(d3dFormat,
-                                                         data.getWidth(),
-                                                         data.getHeight(),
-                                                         mipmaps);
-                image.write(file);
-                return true;
-            }
-
-            return false;
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // SGI (rgb) texture writer
-    //
-    static class SGITextureWriter implements TextureWriter {
-        public boolean write(File file,
-                             TextureData data) throws IOException {
-            String fileSuffix = FileUtil.getFileSuffix(file);
-            if (SGI.equals(fileSuffix) ||
-                SGI_RGB.equals(fileSuffix)) {
-                // See whether the SGI writer can handle this TextureData
-                int pixelFormat = data.getPixelFormat();
-                int pixelType   = data.getPixelType();
-                if ((pixelFormat == GL.GL_RGB ||
-                     pixelFormat == GL.GL_RGBA) &&
-                    (pixelType == GL.GL_BYTE ||
-                     pixelType == GL.GL_UNSIGNED_BYTE)) {
-                    ByteBuffer buf = ((data.getBuffer() != null) ?
-                                      (ByteBuffer) data.getBuffer() :
-                                      (ByteBuffer) data.getMipmapData()[0]);
-                    byte[] bytes;
-                    if (buf.hasArray()) {
-                        bytes = buf.array();
-                    } else {
-                        buf.rewind();
-                        bytes = new byte[buf.remaining()];
-                        buf.get(bytes);
-                        buf.rewind();
-                    }
-
-                    SGIImage image = SGIImage.createFromData(data.getWidth(),
-                                                             data.getHeight(),
-                                                             (pixelFormat == GL.GL_RGBA),
-                                                             bytes);
-                    image.write(file, false);
-                    return true;
-                }
-
-                throw new IOException("SGI writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
-            }
-
-            return false;
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // TGA (Targa) texture writer
-  
-    static class TGATextureWriter implements TextureWriter {
-        public boolean write(File file,
-                             TextureData data) throws IOException {
-            if (TGA.equals(FileUtil.getFileSuffix(file))) {
-                // See whether the TGA writer can handle this TextureData
-                int pixelFormat = data.getPixelFormat();
-                int pixelType   = data.getPixelType();
-                if ((pixelFormat == GL.GL_RGB ||
-                     pixelFormat == GL.GL_RGBA) &&
-                    (pixelType == GL.GL_BYTE ||
-                     pixelType == GL.GL_UNSIGNED_BYTE)) {
-                    ByteBuffer buf = ((data.getBuffer() != null) ?
-                                      (ByteBuffer) data.getBuffer() :
-                                      (ByteBuffer) data.getMipmapData()[0]);
-                    // Must reverse order of red and blue channels to get correct results
-                    int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
-                    for (int i = 0; i < buf.remaining(); i += skip) {
-                        byte red  = buf.get(i + 0);
-                        byte blue = buf.get(i + 2);
-                        buf.put(i + 0, blue);
-                        buf.put(i + 2, red);
-                    }
-
-                    TGAImage image = TGAImage.createFromData(data.getWidth(),
-                                                             data.getHeight(),
-                                                             (pixelFormat == GL.GL_RGBA),
-                                                             false,
-                                                             ((data.getBuffer() != null) ?
-                                                              (ByteBuffer) data.getBuffer() :
-                                                              (ByteBuffer) data.getMipmapData()[0]));
-                    image.write(file);
-                    return true;
-                }
-
-                throw new IOException("TGA writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
-            }
-
-            return false;
-        }    
-    }
-
-    //----------------------------------------------------------------------
-    // Helper routines
-    //
-
-    private static int glGetInteger(int pname) {
-        int[] tmp = new int[1];
-        GL gl = GLContext.getCurrentGL();
-        gl.glGetIntegerv(pname, tmp, 0);
-        return tmp[0];
-    }
-
-    private static int glGetTexLevelParameteri(GL2 gl, int target, int level, int pname) {
-        int[] tmp = new int[1];
-        gl.glGetTexLevelParameteriv(target, 0, pname, tmp, 0);
-        return tmp[0];
-    }
-
-    private static String toLowerCase(String arg) {
-        if (arg == null) {
-            return null;
-        }
-
-        return arg.toLowerCase();
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javase b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javase
rename to src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp
deleted file mode 100644
index b18991d..0000000
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp
+++ /dev/null
@@ -1,889 +0,0 @@
-/*
- * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.util.texture.spi;
-
-import java.io.*;
-import java.nio.*;
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.util.*;
-import com.jogamp.opengl.util.texture.*;
-
-/** A reader and writer for DirectDraw Surface (.dds) files, which are
-    used to describe textures. These files can contain multiple mipmap
-    levels in one file. This class is currently minimal and does not
-    support all of the possible file formats. */
-
-public class DDSImage {
-
-    /** Simple class describing images and data; does not encapsulate
-        image format information. User is responsible for transmitting
-        that information in another way. */
-
-    public static class ImageInfo {
-        private ByteBuffer data;
-        private int width;
-        private int height;
-        private boolean isCompressed;
-        private int compressionFormat;
-
-        public ImageInfo(ByteBuffer data, int width, int height, boolean compressed, int compressionFormat) {
-            this.data = data; this.width = width; this.height = height;
-            this.isCompressed = compressed; this.compressionFormat = compressionFormat;
-        }
-        public int        getWidth()  { return width;  }
-        public int        getHeight() { return height; }
-        public ByteBuffer getData()   { return data;   }
-        public boolean    isCompressed() { return isCompressed; }
-        public int        getCompressionFormat() {
-            if (!isCompressed())
-                throw new RuntimeException("Should not call unless compressed");
-            return compressionFormat;
-        }
-    }
-
-    private ByteBuffer buf;
-    private Header header;
-
-    //
-    // Selected bits in header flags
-    //
-
-    public static final int DDSD_CAPS            = 0x00000001; // Capacities are valid
-    public static final int DDSD_HEIGHT          = 0x00000002; // Height is valid
-    public static final int DDSD_WIDTH           = 0x00000004; // Width is valid
-    public static final int DDSD_PITCH           = 0x00000008; // Pitch is valid
-    public static final int DDSD_BACKBUFFERCOUNT = 0x00000020; // Back buffer count is valid
-    public static final int DDSD_ZBUFFERBITDEPTH = 0x00000040; // Z-buffer bit depth is valid (shouldn't be used in DDSURFACEDESC2)
-    public static final int DDSD_ALPHABITDEPTH   = 0x00000080; // Alpha bit depth is valid
-    public static final int DDSD_LPSURFACE       = 0x00000800; // lpSurface is valid
-    public static final int DDSD_PIXELFORMAT     = 0x00001000; // ddpfPixelFormat is valid
-    public static final int DDSD_MIPMAPCOUNT     = 0x00020000; // Mip map count is valid
-    public static final int DDSD_LINEARSIZE      = 0x00080000; // dwLinearSize is valid
-    public static final int DDSD_DEPTH           = 0x00800000; // dwDepth is valid
-
-    public static final int DDPF_ALPHAPIXELS     = 0x00000001; // Alpha channel is present
-    public static final int DDPF_ALPHA           = 0x00000002; // Only contains alpha information
-    public static final int DDPF_FOURCC          = 0x00000004; // FourCC code is valid
-    public static final int DDPF_PALETTEINDEXED4 = 0x00000008; // Surface is 4-bit color indexed
-    public static final int DDPF_PALETTEINDEXEDTO8 = 0x00000010; // Surface is indexed into a palette which stores indices
-    // into the destination surface's 8-bit palette
-    public static final int DDPF_PALETTEINDEXED8 = 0x00000020; // Surface is 8-bit color indexed
-    public static final int DDPF_RGB             = 0x00000040; // RGB data is present
-    public static final int DDPF_COMPRESSED      = 0x00000080; // Surface will accept pixel data in the format specified
-    // and compress it during the write
-    public static final int DDPF_RGBTOYUV        = 0x00000100; // Surface will accept RGB data and translate it during
-    // the write to YUV data. The format of the data to be written
-    // will be contained in the pixel format structure. The DDPF_RGB
-    // flag will be set.
-    public static final int DDPF_YUV             = 0x00000200; // Pixel format is YUV - YUV data in pixel format struct is valid
-    public static final int DDPF_ZBUFFER         = 0x00000400; // Pixel format is a z buffer only surface
-    public static final int DDPF_PALETTEINDEXED1 = 0x00000800; // Surface is 1-bit color indexed
-    public static final int DDPF_PALETTEINDEXED2 = 0x00001000; // Surface is 2-bit color indexed
-    public static final int DDPF_ZPIXELS         = 0x00002000; // Surface contains Z information in the pixels
-
-    // Selected bits in DDS capabilities flags
-    public static final int DDSCAPS_TEXTURE      = 0x00001000; // Can be used as a texture
-    public static final int DDSCAPS_MIPMAP       = 0x00400000; // Is one level of a mip-map
-    public static final int DDSCAPS_COMPLEX      = 0x00000008; // Complex surface structure, such as a cube map
-
-    // Selected bits in DDS extended capabilities flags
-    public static final int DDSCAPS2_CUBEMAP           = 0x00000200;
-    public static final int DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400;
-    public static final int DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800;
-    public static final int DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000;
-    public static final int DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000;
-    public static final int DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000;
-    public static final int DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x00008000;
-
-    // Known pixel formats
-    public static final int D3DFMT_UNKNOWN   =  0;
-    public static final int D3DFMT_R8G8B8    =  20;
-    public static final int D3DFMT_A8R8G8B8  =  21;
-    public static final int D3DFMT_X8R8G8B8  =  22;
-    // The following are also valid FourCC codes
-    public static final int D3DFMT_DXT1      =  0x31545844;
-    public static final int D3DFMT_DXT2      =  0x32545844;
-    public static final int D3DFMT_DXT3      =  0x33545844;
-    public static final int D3DFMT_DXT4      =  0x34545844;
-    public static final int D3DFMT_DXT5      =  0x35545844;
-
-    /** Reads a DirectDraw surface from the specified file name,
-        returning the resulting DDSImage.
-
-        @param filename File name
-        @return DDS image object
-        @throws java.io.IOException if an I/O exception occurred
-    */
-    public static DDSImage read(String filename) throws IOException {
-        return read(new File(filename));
-    }
-  
-    /** Reads a DirectDraw surface from the specified file, returning
-        the resulting DDSImage.
-
-        @param file File object
-        @return DDS image object
-        @throws java.io.IOException if an I/O exception occurred
-    */
-    public static DDSImage read(File file) throws IOException {
-        DDSImage image = new DDSImage();
-        image.readFromFile(file);
-        return image;
-    }
-
-    /** Reads a DirectDraw surface from the specified InputStream, returning
-        the resulting DDSImage.
-
-        @param input Input stream
-        @return DDS image object
-        @throws java.io.IOException if an I/O exception occurred
-    */
-    public static DDSImage read(InputStream input) throws IOException {
-        DDSImage image = new DDSImage();
-        image.readFromStream(input);
-        return image;
-    }
-
-    /** Closes open files and resources associated with the open
-        DDSImage. No other methods may be called on this object once
-        this is called. */
-    public void close() {
-    }
-
-    /** 
-     * Creates a new DDSImage from data supplied by the user. The
-     * resulting DDSImage can be written to disk using the write()
-     * method.
-     *
-     * @param d3dFormat the D3DFMT_ constant describing the data; it is
-     *                  assumed that it is packed tightly
-     * @param width  the width in pixels of the topmost mipmap image
-     * @param height the height in pixels of the topmost mipmap image
-     * @param mipmapData the data for each mipmap level of the resulting
-     *                   DDSImage; either only one mipmap level should
-     *                   be specified, or they all must be
-     * @throws IllegalArgumentException if the data does not match the
-     *   specified arguments
-     * @return DDS image object
-     */
-    public static DDSImage createFromData(int d3dFormat,
-                                          int width,
-                                          int height,
-                                          ByteBuffer[] mipmapData) throws IllegalArgumentException {
-        DDSImage image = new DDSImage();
-        image.initFromData(d3dFormat, width, height, mipmapData);
-        return image;
-    }
-
-    /** Determines from the magic number whether the given InputStream
-        points to a DDS image. The given InputStream must return true
-        from markSupported() and support a minimum of four bytes of
-        read-ahead.
-
-        @param in Stream to check
-        @return true if input stream is DDS image or false otherwise
-        @throws java.io.IOException if an I/O exception occurred
-    */
-    public static boolean isDDSImage(InputStream in) throws IOException {
-        if (!(in instanceof BufferedInputStream)) {
-            in = new BufferedInputStream(in);
-        }
-        if (!in.markSupported()) {
-            throw new IOException("Can not test non-destructively whether given InputStream is a DDS image");
-        }
-        in.mark(4);
-        int magic = 0;
-        for (int i = 0; i < 4; i++) {
-            int tmp = in.read();
-            if (tmp < 0) {
-                in.reset();
-                return false;
-            }
-            magic = ((magic >>> 8) | (tmp << 24));
-        }
-        in.reset();
-        return (magic == MAGIC);
-    }
-
-    /**
-     * Writes this DDSImage to the specified file name.
-     * @param filename File name to write to
-     * @throws java.io.IOException if an I/O exception occurred
-     */
-    public void write(String filename) throws IOException {
-        write(new File(filename));
-    }
-
-    /**
-     * Writes this DDSImage to the specified file name.
-     * @param file File object to write to
-     * @throws java.io.IOException if an I/O exception occurred
-     */
-    public void write(File file) throws IOException {
-        LEDataOutputStream output =
-            new LEDataOutputStream(new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file))));
-        header.write(output);
-        output.write(buf.array());
-        output.close();
-    }
-
-    /** Test for presence/absence of surface description flags (DDSD_*)
-     * @param flag DDSD_* flags set to test
-     * @return true if flag present or false otherwise
-     */
-    public boolean isSurfaceDescFlagSet(int flag) {
-        return ((header.flags & flag) != 0);
-    }
-
-    /** Test for presence/absence of pixel format flags (DDPF_*) */
-    public boolean isPixelFormatFlagSet(int flag) {
-        return ((header.pfFlags & flag) != 0);
-    }
-
-    /** Gets the pixel format of this texture (D3DFMT_*) based on some
-        heuristics. Returns D3DFMT_UNKNOWN if could not recognize the
-        pixel format. */
-    public int getPixelFormat() {
-        if (isCompressed()) {
-            return getCompressionFormat();
-        } else if (isPixelFormatFlagSet(DDPF_RGB)) {
-            if (isPixelFormatFlagSet(DDPF_ALPHAPIXELS)) {
-                if (getDepth() == 32 &&
-                    header.pfRBitMask == 0x00FF0000 &&
-                    header.pfGBitMask == 0x0000FF00 &&
-                    header.pfBBitMask == 0x000000FF &&
-                    header.pfABitMask == 0xFF000000) {
-                    return D3DFMT_A8R8G8B8;
-                }
-            } else {
-                if (getDepth() == 24 &&
-                    header.pfRBitMask == 0x00FF0000 &&
-                    header.pfGBitMask == 0x0000FF00 &&
-                    header.pfBBitMask == 0x000000FF) {
-                    return D3DFMT_R8G8B8;
-                } else if (getDepth() == 32 &&
-                           header.pfRBitMask == 0x00FF0000 &&
-                           header.pfGBitMask == 0x0000FF00 &&
-                           header.pfBBitMask == 0x000000FF) {
-                    return D3DFMT_X8R8G8B8;
-                }
-            }
-        }
-
-        return D3DFMT_UNKNOWN;
-    }
-
-    /**
-     * Indicates whether this texture is cubemap
-     * @return true if cubemap or false otherwise
-     */
-    public boolean isCubemap() {
-        return ((header.ddsCaps1 & DDSCAPS_COMPLEX) != 0) && ((header.ddsCaps2 & DDSCAPS2_CUBEMAP) != 0);
-    }
-
-    /**
-     * Indicates whethe this cubemap side present
-     * @param side Side to test
-     * @return true if side present or false otherwise
-     */
-    public boolean isCubemapSidePresent(int side) {
-        return isCubemap() && (header.ddsCaps2 & side) != 0;
-    }
-
-    /** Indicates whether this texture is compressed. */
-    public boolean isCompressed() {
-        return (isPixelFormatFlagSet(DDPF_FOURCC));
-    }
-
-    /** If this surface is compressed, returns the kind of compression
-        used (DXT1..DXT5). */
-    public int getCompressionFormat() {
-        return header.pfFourCC;
-    }
-
-    /** Width of the texture (or the top-most mipmap if mipmaps are
-        present) */
-    public int getWidth() {
-        return header.width;
-    }
-
-    /** Height of the texture (or the top-most mipmap if mipmaps are
-        present) */
-    public int getHeight() {
-        return header.height;
-    }
-
-    /** Total number of bits per pixel. Only valid if DDPF_RGB is
-        present. For A8R8G8B8, would be 32. */
-    public int getDepth() {
-        return header.pfRGBBitCount;
-    }
-
-    /** Number of mip maps in the texture */
-    public int getNumMipMaps() {
-        if (!isSurfaceDescFlagSet(DDSD_MIPMAPCOUNT)) {
-            return 0;
-        }
-        return header.mipMapCountOrAux;
-    }
-
-    /** Gets the <i>i</i>th mipmap data (0..getNumMipMaps() - 1)
-     * @param map Mipmap index
-     * @return Image object
-     */
-    public ImageInfo getMipMap(int map) {
-        return getMipMap( 0, map );
-    }
-
-    /**
-     * Gets the <i>i</i>th mipmap data (0..getNumMipMaps() - 1)
-     * @param side Cubemap side or 0 for 2D texture
-     * @param map Mipmap index
-     * @return Image object
-     */
-    public ImageInfo getMipMap(int side, int map) {
-        if (!isCubemap() && (side != 0)) {
-            throw new RuntimeException( "Illegal side for 2D texture: " + side );
-        }
-        if (isCubemap() && !isCubemapSidePresent(side)) {
-            throw new RuntimeException( "Illegal side, side not present: " + side );
-        }
-        if (getNumMipMaps() > 0 &&
-            ((map < 0) || (map >= getNumMipMaps()))) {
-            throw new RuntimeException("Illegal mipmap number " + map + " (0.." + (getNumMipMaps() - 1) + ")");
-        }
-
-        // Figure out how far to seek
-        int seek = 0;
-        if (isCubemap()) {
-            seek += sideShiftInBytes(side);
-        }
-        for (int i = 0; i < map; i++) {
-            seek += mipMapSizeInBytes(i);
-        }
-        buf.limit(seek + mipMapSizeInBytes(map));
-        buf.position(seek);
-        ByteBuffer next = buf.slice();
-        buf.position(0);
-        buf.limit(buf.capacity());
-        return new ImageInfo(next, mipMapWidth(map), mipMapHeight(map), isCompressed(), getCompressionFormat());
-    }
-
-    /** Returns an array of ImageInfos corresponding to all mipmap
-        levels of this DDS file.
-        @return Mipmap image objects set
-    */
-    public ImageInfo[] getAllMipMaps() {
-        return getAllMipMaps(0);
-    }
-
-    /**
-     * Returns an array of ImageInfos corresponding to all mipmap
-     * levels of this DDS file.
-     * @param side Cubemap side or 0 for 2D texture
-     * @return Mipmap image objects set
-     */
-    public ImageInfo[] getAllMipMaps( int side ) {
-        int numLevels = getNumMipMaps();
-        if (numLevels == 0) {
-            numLevels = 1;
-        }
-        ImageInfo[] result = new ImageInfo[numLevels];
-        for (int i = 0; i < numLevels; i++) {
-            result[i] = getMipMap(side, i);
-        }
-        return result;
-    }
-
-    /** Converts e.g. DXT1 compression format constant (see {@link
-        #getCompressionFormat}) into "DXT1".
-        @param compressionFormat Compression format constant
-        @return String format code
-    */
-    public static String getCompressionFormatName(int compressionFormat) {
-        StringBuffer buf = new StringBuffer();
-        for (int i = 0; i < 4; i++) {
-            char c = (char) (compressionFormat & 0xFF);
-            buf.append(c);
-            compressionFormat = compressionFormat >> 8;
-        }
-        return buf.toString();
-    }
-
-    /** Allocates a temporary, empty ByteBuffer suitable for use in a
-        call to glCompressedTexImage2D. This is used by the Texture
-        class to expand non-power-of-two DDS compressed textures to
-        power-of-two sizes on hardware not supporting OpenGL 2.0 and the
-        NPOT texture extension. The specified OpenGL internal format
-        must be one of GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
-        GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
-        GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, or
-        GL_COMPRESSED_RGBA_S3TC_DXT5_EXT.
-    */
-    public static ByteBuffer allocateBlankBuffer(int width,
-                                                 int height,
-                                                 int openGLInternalFormat) {
-        int size = width * height;
-        switch (openGLInternalFormat) {
-        case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
-        case GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
-            size /= 2;
-            break;
-
-        case GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
-        case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
-            break;
-
-        default:
-            throw new IllegalArgumentException("Illegal OpenGL texture internal format " +
-                                               openGLInternalFormat);
-        }
-        if (size == 0)
-            size = 1;
-        return GLBuffers.newDirectByteBuffer(size);
-    }
-
-    public void debugPrint() {
-        PrintStream tty = System.err;
-        tty.println("Compressed texture: " + isCompressed());
-        if (isCompressed()) {
-            int fmt = getCompressionFormat();
-            String name = getCompressionFormatName(fmt);
-            tty.println("Compression format: 0x" + Integer.toHexString(fmt) + " (" + name + ")");
-        }
-        tty.println("Width: " + header.width + " Height: " + header.height);
-        tty.println("header.pitchOrLinearSize: " + header.pitchOrLinearSize);
-        tty.println("header.pfRBitMask: 0x" + Integer.toHexString(header.pfRBitMask));
-        tty.println("header.pfGBitMask: 0x" + Integer.toHexString(header.pfGBitMask));
-        tty.println("header.pfBBitMask: 0x" + Integer.toHexString(header.pfBBitMask));
-        tty.println("SurfaceDesc flags:");
-        boolean recognizedAny = false;
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_CAPS, "DDSD_CAPS");
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_HEIGHT, "DDSD_HEIGHT");
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_WIDTH, "DDSD_WIDTH");
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_PITCH, "DDSD_PITCH");
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_BACKBUFFERCOUNT, "DDSD_BACKBUFFERCOUNT");
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_ZBUFFERBITDEPTH, "DDSD_ZBUFFERBITDEPTH");
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_ALPHABITDEPTH, "DDSD_ALPHABITDEPTH");
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_LPSURFACE, "DDSD_LPSURFACE");
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_PIXELFORMAT, "DDSD_PIXELFORMAT");
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_MIPMAPCOUNT, "DDSD_MIPMAPCOUNT");
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_LINEARSIZE, "DDSD_LINEARSIZE");
-        recognizedAny |= printIfRecognized(tty, header.flags, DDSD_DEPTH, "DDSD_DEPTH");
-        if (!recognizedAny) {
-            tty.println("(none)");
-        }
-        tty.println("Raw SurfaceDesc flags: 0x" + Integer.toHexString(header.flags));
-        tty.println("Pixel format flags:");
-        recognizedAny = false;
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ALPHAPIXELS, "DDPF_ALPHAPIXELS");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ALPHA, "DDPF_ALPHA");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_FOURCC, "DDPF_FOURCC");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED4, "DDPF_PALETTEINDEXED4");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXEDTO8, "DDPF_PALETTEINDEXEDTO8");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED8, "DDPF_PALETTEINDEXED8");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_RGB, "DDPF_RGB");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_COMPRESSED, "DDPF_COMPRESSED");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_RGBTOYUV, "DDPF_RGBTOYUV");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_YUV, "DDPF_YUV");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ZBUFFER, "DDPF_ZBUFFER");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED1, "DDPF_PALETTEINDEXED1");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED2, "DDPF_PALETTEINDEXED2");
-        recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ZPIXELS, "DDPF_ZPIXELS");
-        if (!recognizedAny) {
-            tty.println("(none)");
-        }
-        tty.println("Raw pixel format flags: 0x" + Integer.toHexString(header.pfFlags));
-        tty.println("Depth: " + getDepth());
-        tty.println("Number of mip maps: " + getNumMipMaps());
-        int fmt = getPixelFormat();
-        tty.print("Pixel format: ");
-        switch (fmt) {
-        case D3DFMT_R8G8B8:   tty.println("D3DFMT_R8G8B8"); break;
-        case D3DFMT_A8R8G8B8: tty.println("D3DFMT_A8R8G8B8"); break;
-        case D3DFMT_X8R8G8B8: tty.println("D3DFMT_X8R8G8B8"); break;
-        case D3DFMT_DXT1:     tty.println("D3DFMT_DXT1"); break;
-        case D3DFMT_DXT2:     tty.println("D3DFMT_DXT2"); break;
-        case D3DFMT_DXT3:     tty.println("D3DFMT_DXT3"); break;
-        case D3DFMT_DXT4:     tty.println("D3DFMT_DXT4"); break;
-        case D3DFMT_DXT5:     tty.println("D3DFMT_DXT5"); break;
-        case D3DFMT_UNKNOWN:  tty.println("D3DFMT_UNKNOWN"); break;
-        default:              tty.println("(unknown pixel format " + fmt + ")"); break;
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // Internals only below this point
-    //
-
-    private static final int MAGIC = 0x20534444;
-
-    static class Header {
-        int size;                 // size of the DDSURFACEDESC structure
-        int flags;                // determines what fields are valid
-        int height;               // height of surface to be created
-        int width;                // width of input surface
-        int pitchOrLinearSize;
-        int backBufferCountOrDepth;
-        int mipMapCountOrAux;     // number of mip-map levels requested (in this context)
-        int alphaBitDepth;        // depth of alpha buffer requested
-        int reserved1;            // reserved
-        int surface;              // pointer to the associated surface memory
-        // NOTE: following two entries are from DDCOLORKEY data structure
-        // Are overlaid with color for empty cubemap faces (unused in this reader)
-        int colorSpaceLowValue;
-        int colorSpaceHighValue;
-        int destBltColorSpaceLowValue;
-        int destBltColorSpaceHighValue;
-        int srcOverlayColorSpaceLowValue;
-        int srcOverlayColorSpaceHighValue;
-        int srcBltColorSpaceLowValue;
-        int srcBltColorSpaceHighValue;
-        // NOTE: following entries are from DDPIXELFORMAT data structure
-        // Are overlaid with flexible vertex format description of vertex
-        // buffers (unused in this reader)
-        int pfSize;                 // size of DDPIXELFORMAT structure
-        int pfFlags;                // pixel format flags
-        int pfFourCC;               // (FOURCC code)
-        // Following five entries have multiple interpretations, not just
-        // RGBA (but that's all we support right now)
-        int pfRGBBitCount;          // how many bits per pixel
-        int pfRBitMask;             // mask for red bits
-        int pfGBitMask;             // mask for green bits
-        int pfBBitMask;             // mask for blue bits
-        int pfABitMask;             // mask for alpha channel
-        int ddsCaps1;               // Texture and mip-map flags
-        int ddsCaps2;               // Advanced capabilities including cubemap support
-        int ddsCapsReserved1;
-        int ddsCapsReserved2;
-        int textureStage;           // stage in multitexture cascade
-
-        void read(LEDataInputStream input) throws IOException {
-            int magic                     = input.readInt();
-            if (magic != MAGIC) {
-                throw new IOException("Incorrect magic number 0x" +
-                                      Integer.toHexString(magic) +
-                                      " (expected " + MAGIC + ")");
-            }
-
-            size                          = input.readInt();
-            flags                         = input.readInt();
-            height                        = input.readInt();
-            width                         = input.readInt();
-            pitchOrLinearSize             = input.readInt();
-            backBufferCountOrDepth        = input.readInt();
-            mipMapCountOrAux              = input.readInt();
-            alphaBitDepth                 = input.readInt();
-            reserved1                     = input.readInt();
-            surface                       = input.readInt();
-            colorSpaceLowValue            = input.readInt();
-            colorSpaceHighValue           = input.readInt();
-            destBltColorSpaceLowValue     = input.readInt();
-            destBltColorSpaceHighValue    = input.readInt();
-            srcOverlayColorSpaceLowValue  = input.readInt();
-            srcOverlayColorSpaceHighValue = input.readInt();
-            srcBltColorSpaceLowValue      = input.readInt();
-            srcBltColorSpaceHighValue     = input.readInt();
-            pfSize                        = input.readInt();
-            pfFlags                       = input.readInt();
-            pfFourCC                      = input.readInt();
-            pfRGBBitCount                 = input.readInt();
-            pfRBitMask                    = input.readInt();
-            pfGBitMask                    = input.readInt();
-            pfBBitMask                    = input.readInt();
-            pfABitMask                    = input.readInt();
-            ddsCaps1                      = input.readInt();
-            ddsCaps2                      = input.readInt();
-            ddsCapsReserved1              = input.readInt();
-            ddsCapsReserved2              = input.readInt();
-            textureStage                  = input.readInt();
-        }
-
-        // buf must be in little-endian byte order
-        void write(LEDataOutputStream output) throws IOException {
-            output.writeInt(MAGIC);
-            output.writeInt(size);
-            output.writeInt(flags);
-            output.writeInt(height);
-            output.writeInt(width);
-            output.writeInt(pitchOrLinearSize);
-            output.writeInt(backBufferCountOrDepth);
-            output.writeInt(mipMapCountOrAux);
-            output.writeInt(alphaBitDepth);
-            output.writeInt(reserved1);
-            output.writeInt(surface);
-            output.writeInt(colorSpaceLowValue);
-            output.writeInt(colorSpaceHighValue);
-            output.writeInt(destBltColorSpaceLowValue);
-            output.writeInt(destBltColorSpaceHighValue);
-            output.writeInt(srcOverlayColorSpaceLowValue);
-            output.writeInt(srcOverlayColorSpaceHighValue);
-            output.writeInt(srcBltColorSpaceLowValue);
-            output.writeInt(srcBltColorSpaceHighValue);
-            output.writeInt(pfSize);
-            output.writeInt(pfFlags);
-            output.writeInt(pfFourCC);
-            output.writeInt(pfRGBBitCount);
-            output.writeInt(pfRBitMask);
-            output.writeInt(pfGBitMask);
-            output.writeInt(pfBBitMask);
-            output.writeInt(pfABitMask);
-            output.writeInt(ddsCaps1);
-            output.writeInt(ddsCaps2);
-            output.writeInt(ddsCapsReserved1);
-            output.writeInt(ddsCapsReserved2);
-            output.writeInt(textureStage);
-        }
-
-        private static int size() {
-            return 124;
-        }
-
-        private static int pfSize() {
-            return 32;
-        }
-
-        private static int writtenSize() {
-            return 128;
-        }
-    }
-
-    private DDSImage() {
-    }
-
-    private void readFromFile(File file) throws IOException {
-        readFromStream(new BufferedInputStream(new FileInputStream(file)));
-    }
-
-    private void readFromStream(InputStream input) throws IOException {
-        LEDataInputStream leInput = new LEDataInputStream(input);
-        header = new Header();
-        header.read(leInput);
-        fixupHeader();
-        buf = StreamUtil.readAll2Buffer(input);
-    }
-
-    private void initFromData(int d3dFormat,
-                              int width,
-                              int height,
-                              ByteBuffer[] mipmapData) throws IllegalArgumentException {
-        // Check size of mipmap data compared against format, width and
-        // height
-        int topmostMipmapSize = width * height;
-        int pitchOrLinearSize = width;
-        boolean isCompressed = false;
-        switch (d3dFormat) {
-        case D3DFMT_R8G8B8:   topmostMipmapSize *= 3; pitchOrLinearSize *= 3; break;
-        case D3DFMT_A8R8G8B8: topmostMipmapSize *= 4; pitchOrLinearSize *= 4; break;
-        case D3DFMT_X8R8G8B8: topmostMipmapSize *= 4; pitchOrLinearSize *= 4; break;
-        case D3DFMT_DXT1:
-        case D3DFMT_DXT2:
-        case D3DFMT_DXT3:
-        case D3DFMT_DXT4:
-        case D3DFMT_DXT5:
-            topmostMipmapSize = computeCompressedBlockSize(width, height, 1, d3dFormat);
-            pitchOrLinearSize = topmostMipmapSize;
-            isCompressed = true;
-            break;
-        default:
-            throw new IllegalArgumentException("d3dFormat must be one of the known formats");
-        }
-    
-        // Now check the mipmaps against this size
-        int curSize = topmostMipmapSize;
-        int totalSize = 0;
-        for (int i = 0; i < mipmapData.length; i++) {
-            if (mipmapData[i].remaining() != curSize) {
-                throw new IllegalArgumentException("Mipmap level " + i +
-                                                   " didn't match expected data size (expected " + curSize + ", got " +
-                                                   mipmapData[i].remaining() + ")");
-            }
-            curSize /= 4;
-            totalSize += mipmapData[i].remaining();
-        }
-
-        // OK, create one large byte array to hold all of the mipmap data
-        byte[] data = new byte[totalSize];
-        ByteBuffer buf = ByteBuffer.wrap(data);
-        for (int i = 0; i < mipmapData.length; i++) {
-            buf.put(mipmapData[i]);
-        }
-        this.buf = buf;
-    
-        // Allocate and initialize a Header
-        header = new Header();
-        header.size = Header.size();
-        header.flags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT;
-        if (mipmapData.length > 1) {
-            header.flags |= DDSD_MIPMAPCOUNT;
-            header.mipMapCountOrAux = mipmapData.length;
-        }
-        header.width = width;
-        header.height = height;
-        if (isCompressed) {
-            header.flags |= DDSD_LINEARSIZE;
-            header.pfFlags |= DDPF_FOURCC;
-            header.pfFourCC = d3dFormat;
-        } else {
-            header.flags |= DDSD_PITCH;
-            // Figure out the various settings from the pixel format
-            header.pfFlags |= DDPF_RGB;
-            switch (d3dFormat) {
-            case D3DFMT_R8G8B8:   header.pfRGBBitCount = 24; break;
-            case D3DFMT_A8R8G8B8: header.pfRGBBitCount = 32; header.pfFlags |= DDPF_ALPHAPIXELS; break;
-            case D3DFMT_X8R8G8B8: header.pfRGBBitCount = 32; break;
-            }
-            header.pfRBitMask = 0x00FF0000;
-            header.pfGBitMask = 0x0000FF00;
-            header.pfBBitMask = 0x000000FF;
-            if (d3dFormat == D3DFMT_A8R8G8B8) {
-                header.pfABitMask = 0xFF000000;
-            }
-        }
-        header.pitchOrLinearSize = pitchOrLinearSize;
-        header.pfSize = Header.pfSize();
-        // Not sure whether we can get away with leaving the rest of the
-        // header blank
-    }
-
-    // Microsoft doesn't follow their own specifications and the
-    // simplest conversion using the DxTex tool to e.g. a DXT3 texture
-    // results in an illegal .dds file without either DDSD_PITCH or
-    // DDSD_LINEARSIZE set in the header's flags. This code, adapted
-    // from the DevIL library, fixes up the header in these situations.
-    private void fixupHeader() {
-        if (isCompressed() && !isSurfaceDescFlagSet(DDSD_LINEARSIZE)) {
-            // Figure out how big the linear size should be
-            int depth = header.backBufferCountOrDepth;
-            if (depth == 0) {
-                depth = 1;
-            }
-
-            header.pitchOrLinearSize = computeCompressedBlockSize(getWidth(), getHeight(), depth, getCompressionFormat());
-            header.flags |= DDSD_LINEARSIZE;
-        }
-    }
-
-    private static int computeCompressedBlockSize(int width,
-                                                  int height,
-                                                  int depth,
-                                                  int compressionFormat) {
-        int blockSize = ((width + 3)/4) * ((height + 3)/4) * ((depth + 3)/4);
-        switch (compressionFormat) {
-        case D3DFMT_DXT1:  blockSize *=  8; break;
-        default:           blockSize *= 16; break;
-        }
-        return blockSize;
-    }
-
-    private int mipMapWidth(int map) {
-        int width = getWidth();
-        for (int i = 0; i < map; i++) {
-            width >>= 1;
-        }
-        return Math.max(width, 1);
-    }
-
-    private int mipMapHeight(int map) {
-        int height = getHeight();
-        for (int i = 0; i < map; i++) {
-            height >>= 1;
-        }
-        return Math.max(height, 1);
-    }
-
-    private int mipMapSizeInBytes(int map) {
-        int width  = mipMapWidth(map);
-        int height = mipMapHeight(map);
-        if (isCompressed()) {
-            int blockSize = (getCompressionFormat() == D3DFMT_DXT1 ? 8 : 16);
-            return ((width+3)/4)*((height+3)/4)*blockSize;
-        } else {
-            return width * height * (getDepth() / 8);
-        }
-    }
-
-    private int sideSizeInBytes() {
-        int numLevels = getNumMipMaps();
-        if (numLevels == 0) {
-            numLevels = 1;
-        }
-
-        int size = 0;
-        for (int i = 0; i < numLevels; i++) {
-            size += mipMapSizeInBytes(i);
-        }
-
-        return size;
-    }
-
-    private int sideShiftInBytes(int side) {
-        int[] sides = {
-            DDSCAPS2_CUBEMAP_POSITIVEX,
-            DDSCAPS2_CUBEMAP_NEGATIVEX,
-            DDSCAPS2_CUBEMAP_POSITIVEY,
-            DDSCAPS2_CUBEMAP_NEGATIVEY,
-            DDSCAPS2_CUBEMAP_POSITIVEZ,
-            DDSCAPS2_CUBEMAP_NEGATIVEZ
-        };
-
-        int shift = 0;
-        int sideSize = sideSizeInBytes();
-        for (int i = 0; i < sides.length; i++) {
-            int temp = sides[i];
-            if ((temp & side) != 0) {
-                return shift;
-            }
-
-            shift += sideSize;
-        }
-
-        throw new RuntimeException("Illegal side: " + side);
-    }
-
-    private boolean printIfRecognized(PrintStream tty, int flags, int flag, String what) {
-        if ((flags & flag) != 0) {
-            tty.println(what);
-            return true;
-        }
-        return false;
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javase b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javase
rename to src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp
deleted file mode 100644
index 6e6e4ab..0000000
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.opengl.util.texture.spi;
-
-import java.io.*;
-import java.nio.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.util.*;
-import com.jogamp.opengl.util.texture.spi.*;
-import com.jogamp.opengl.util.texture.*;
-
-/**
- * Targa image reader and writer adapted from sources of the <a href =
- * "http://java.sun.com/products/jimi/">Jimi</a> image I/O class library.
- *
- * <P>
- *
- * Image decoder for image data stored in TGA file format.
- * Currently only the original TGA file format is supported. This is
- * because the new TGA format has data at the end of the file, getting
- * to the end of a file in an InputStream orient environment presents
- * several difficulties which are avoided at the moment.
- *
- * <P>
- *
- * This is a simple decoder and is only setup to load a single image
- * from the input stream
- *
- * <P>
- *
- * @author    Robin Luiten
- * @author    Kenneth Russell
- * @version    $Revision: 1768 $
- */
-
-public class TGAImage {
-    private Header header;
-    private int    format;
-    private int    bpp;
-    private ByteBuffer data;
-
-    private TGAImage(Header header) {
-        this.header = header;
-    }
-
-    /**
-     * This class reads in all of the TGA image header in addition it also
-     * reads in the imageID field as it is convenient to handle that here.
-     *
-     * @author    Robin Luiten
-     * @version   1.1
-     */
-    public static class Header {
-        /** Set of possible file format TGA types */
-        public final static int TYPE_NEW = 0;
-        public final static int TYPE_OLD = 1;
-        public final static int TYPE_UNK = 2;               // cant rewind stream so unknown for now.
-
-        /**  Set of possible image types in TGA file */
-        public final static int NO_IMAGE = 0;               // no image data
-        public final static int UCOLORMAPPED = 1;           // uncompressed color mapped image
-        public final static int UTRUECOLOR = 2;             // uncompressed true color image
-        public final static int UBLACKWHITE = 3;            // uncompressed black and white image
-        public final static int COLORMAPPED = 9;            // compressed color mapped image
-        public final static int TRUECOLOR = 10;             // compressed true color image
-        public final static int BLACKWHITE = 11;            // compressed black and white image
-
-        /** Field image descriptor bitfield values definitions */
-        public final static int ID_ATTRIBPERPIXEL = 0xF;
-        public final static int ID_RIGHTTOLEFT = 0x10;
-        public final static int ID_TOPTOBOTTOM = 0x20;
-        public final static int ID_INTERLEAVE  = 0xC0;
-
-        /** Field image descriptor / interleave values */
-        public final static int I_NOTINTERLEAVED = 0;
-        public final static int I_TWOWAY = 1;
-        public final static int I_FOURWAY = 2;
-
-        /** Type of this TGA file format */
-        private int tgaType;
-
-        /** initial TGA image data fields */
-        private int idLength;         // byte value
-        private int colorMapType;     // byte value
-        private int imageType;        // byte value
-
-        /** TGA image colour map fields */
-        private int firstEntryIndex;
-        private int colorMapLength;
-        private byte colorMapEntrySize;
-
-        /** TGA image specification fields */
-        private int xOrigin;
-        private int yOrigin;
-        private int width;
-        private int height;
-        private byte pixelDepth;
-        private byte imageDescriptor;
-
-        private byte[] imageIDbuf;
-        private String imageID;
-
-        // For construction from user data
-        Header() {
-            tgaType = TYPE_OLD; // dont try and get footer.
-        }
-
-        Header(LEDataInputStream in) throws IOException {
-            int ret;
-
-            tgaType = TYPE_OLD; // dont try and get footer.
-
-            // initial header fields
-            idLength = in.readUnsignedByte();    
-            colorMapType = in.readUnsignedByte();
-            imageType = in.readUnsignedByte();    
-
-            // color map header fields
-            firstEntryIndex = in.readUnsignedShort();
-            colorMapLength = in.readUnsignedShort();
-            colorMapEntrySize = in.readByte();
-
-            // TGA image specification fields
-            xOrigin = in.readUnsignedShort();
-            yOrigin = in.readUnsignedShort();
-            width = in.readUnsignedShort();
-            height = in.readUnsignedShort();
-            pixelDepth = in.readByte();
-            imageDescriptor = in.readByte();
-
-            if (idLength > 0) {
-                imageIDbuf = new byte[idLength];
-                in.read(imageIDbuf, 0, idLength);
-                imageID = new String(imageIDbuf, "US-ASCII");
-            }
-        }
-
-        public int tgaType()                 { return tgaType; }
-
-        /** initial TGA image data fields */
-        public int idLength()                { return idLength; }
-        public int colorMapType()            { return colorMapType; }
-        public int imageType()               { return imageType; }
-
-        /** TGA image colour map fields */
-        public int firstEntryIndex()         { return firstEntryIndex; }
-        public int colorMapLength()          { return colorMapLength; }
-        public byte colorMapEntrySize()      { return colorMapEntrySize; }
-
-        /** TGA image specification fields */
-        public int xOrigin()                 { return xOrigin; }
-        public int yOrigin()                 { return yOrigin; }
-        public int width()                   { return width; }
-        public int height()                  { return height; }
-        public byte pixelDepth()             { return pixelDepth; }
-        public byte imageDescriptor()        { return imageDescriptor; }
-
-        /** bitfields in imageDescriptor */
-        public byte attribPerPixel()         { return (byte)(imageDescriptor & ID_ATTRIBPERPIXEL); }
-        public boolean rightToLeft()         { return ((imageDescriptor & ID_RIGHTTOLEFT) != 0); }
-        public boolean topToBottom()         { return ((imageDescriptor & ID_TOPTOBOTTOM) != 0); }
-        public byte interleave()             { return (byte)((imageDescriptor & ID_INTERLEAVE) >> 6); }
-
-        public byte[] imageIDbuf()           { return imageIDbuf; }
-        public String imageID()              { return imageID; }
-
-        public String toString() {
-            return "TGA Header " +
-                " id length: " + idLength +
-                " color map type: "+ colorMapType +
-                " image type: "+ imageType +
-                " first entry index: " + firstEntryIndex +
-                " color map length: " + colorMapLength +
-                " color map entry size: " + colorMapEntrySize +
-                " x Origin: " + xOrigin +
-                " y Origin: " + yOrigin +
-                " width: "+ width +
-                " height: "+ height +
-                " pixel depth: "+ pixelDepth +
-                " image descriptor: "+ imageDescriptor +
-                (imageIDbuf == null ? "" : (" ID String: " + imageID));
-        }
-
-        public int size() { return 18 + idLength; }
-
-        private void write(LEDataOutputStream output) throws IOException {
-            output.write(idLength);
-            output.write(colorMapType);
-            output.write(imageType);
-            output.writeShort(firstEntryIndex);
-            output.writeShort(colorMapLength);
-            output.write(colorMapEntrySize);
-            output.writeShort(xOrigin);
-            output.writeShort(yOrigin);
-            output.writeShort(width);
-            output.writeShort(height);
-            output.write(pixelDepth);
-            output.write(imageDescriptor);
-            if (idLength > 0) {
-                try {
-                    byte[] chars = imageID.getBytes("US-ASCII");
-                    output.write(chars);
-                } catch (UnsupportedEncodingException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-        }
-    }
-
-
-    /**
-     * Identifies the image type of the tga image data and loads
-     * it into the JimiImage structure. This was taken from the
-     * prototype and modified for the new Jimi structure
-     */
-    private void decodeImage(LEDataInputStream dIn) throws IOException {
-        switch (header.imageType()) {
-        case Header.UCOLORMAPPED:
-            throw new IOException("TGADecoder Uncompressed Colormapped images not supported");
-
-        case Header.UTRUECOLOR:    // pixelDepth 15, 16, 24 and 32
-            switch (header.pixelDepth) {
-            case 16:
-                throw new IOException("TGADecoder Compressed 16-bit True Color images not supported");
-
-            case 24:
-            case 32:
-                decodeRGBImageU24_32(dIn);
-                break;
-            }
-            break;
-
-        case Header.UBLACKWHITE:
-            throw new IOException("TGADecoder Uncompressed Grayscale images not supported");
-
-        case Header.COLORMAPPED:
-            throw new IOException("TGADecoder Compressed Colormapped images not supported");
-
-        case Header.TRUECOLOR:
-            throw new IOException("TGADecoder Compressed True Color images not supported");
-
-        case Header.BLACKWHITE:
-            throw new IOException("TGADecoder Compressed Grayscale images not supported");
-        }
-    }
-  
-    /**
-     * This assumes that the body is for a 24 bit or 32 bit for a
-     * RGB or ARGB image respectively.
-     */
-    private void decodeRGBImageU24_32(LEDataInputStream dIn) throws IOException {
-        int i;    // row index
-        int j;    // column index
-        int y;    // output row index
-        int raw;  // index through the raw input buffer
-        int rawWidth = header.width() * (header.pixelDepth() / 8);
-        byte[] rawBuf = new byte[rawWidth];
-        byte[] tmpData = new byte[rawWidth * header.height()];
-
-        for (i = 0; i < header.height(); ++i) {
-            dIn.readFully(rawBuf, 0, rawWidth);
-
-            if (header.topToBottom())
-                y = header.height - i - 1; // range 0 to (header.height - 1)
-            else
-                y = i;
-
-            System.arraycopy(rawBuf, 0, tmpData, y * rawWidth, rawBuf.length);
-        }
-
-        GL gl = GLContext.getCurrentGL();
-        if (header.pixelDepth() == 24) {
-            bpp=3;
-            if(gl.isGL2GL3()) {
-                format = GL2GL3.GL_BGR;
-            } else {
-                format = GL.GL_RGB;
-                swapBGR(tmpData, rawWidth, header.height(), bpp);
-            }
-        } else {
-            assert header.pixelDepth() == 32;
-            bpp=4;
-
-            if(gl.isGL2GL3()) {
-                format = GL2GL3.GL_BGRA;
-            } else {
-                format = GL.GL_RGBA;
-                swapBGR(tmpData, rawWidth, header.height(), bpp);
-            }
-        }
-
-        data = ByteBuffer.wrap(tmpData);
-    }
-
-    private static void swapBGR(byte[] data, int bWidth, int height, int bpp) {
-        byte r,b;
-        int k;
-        for(int i=0; i<height; ++i) {
-            for(int j=0; j<bWidth; j+=bpp) {
-                k=i*bWidth+j;
-                b=data[k+0];
-                r=data[k+2];
-                data[k+0]=r;
-                data[k+2]=b;
-            }
-        }
-    }
-
-    /** Returns the width of the image. */
-    public int getWidth()    { return header.width(); }
-
-    /** Returns the height of the image. */
-    public int getHeight()   { return header.height(); }
-
-    /** Returns the OpenGL format for this texture; e.g. GL.GL_BGR or GL.GL_BGRA. */
-    public int getGLFormat() { return format; }
-
-    /** Returns the bytes per pixel */
-    public int getBytesPerPixel() { return bpp; }
-
-    /** Returns the raw data for this texture in the correct
-        (bottom-to-top) order for calls to glTexImage2D. */
-    public ByteBuffer getData()  { return data; }
-
-    /** Reads a Targa image from the specified file. */
-    public static TGAImage read(String filename) throws IOException {
-        return read(new FileInputStream(filename));
-    }
-
-    /** Reads a Targa image from the specified InputStream. */
-    public static TGAImage read(InputStream in) throws IOException {
-        LEDataInputStream dIn = new LEDataInputStream(new BufferedInputStream(in));
-
-        Header header = new Header(dIn);
-        TGAImage res = new TGAImage(header);
-        res.decodeImage(dIn);
-        return res;
-    }
-
-    /** Writes the image in Targa format to the specified file name. */
-    public void write(String filename) throws IOException {
-        write(new File(filename));
-    }
-
-    /** Writes the image in Targa format to the specified file. */
-    public void write(File file) throws IOException {
-        LEDataOutputStream output =
-            new LEDataOutputStream(new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file))));
-        header.write(output);
-        if (!data.isDirect()) {
-            output.write(data.array());
-        } else {
-            for (int i = 0; i < data.limit(); i++) {
-                output.write(data.get(i));
-            }
-        }
-        output.close();
-    }
-
-    /** Creates a TGAImage from data supplied by the end user. Shares
-        data with the passed ByteBuffer. Assumes the data is already in
-        the correct byte order for writing to disk, i.e., BGR or
-        BGRA. */
-    public static TGAImage createFromData(int width,
-                                          int height,
-                                          boolean hasAlpha,
-                                          boolean topToBottom,
-                                          ByteBuffer data) {
-        Header header = new Header();
-        header.imageType = Header.UTRUECOLOR;
-        header.width = width;
-        header.height = height;
-        header.pixelDepth = (byte) (hasAlpha ? 32 : 24);
-        header.imageDescriptor = (byte) (topToBottom ? Header.ID_TOPTOBOTTOM : 0);
-        // Note ID not supported
-        TGAImage ret = new TGAImage(header);
-        ret.data = data;
-        return ret;
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
index a45821d..6e2f1b9 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
@@ -46,7 +46,7 @@ import java.net.*;
 import javax.imageio.*;
 import javax.media.opengl.GLProfile;
 
-import com.jogamp.opengl.impl.Debug;
+import jogamp.opengl.Debug;
 import com.jogamp.opengl.util.texture.*;
 import com.jogamp.opengl.util.texture.awt.*;
 import com.jogamp.opengl.util.texture.spi.*;
diff --git a/src/jogl/classes/com/jogamp/openmax/OMXInstance.java b/src/jogl/classes/com/jogamp/openmax/OMXInstance.java
index d49eeb8..fcd055f 100644
--- a/src/jogl/classes/com/jogamp/openmax/OMXInstance.java
+++ b/src/jogl/classes/com/jogamp/openmax/OMXInstance.java
@@ -5,10 +5,10 @@ import javax.media.opengl.*;
 import javax.media.opengl.glu.GLU;
 import com.jogamp.opengl.util.texture.*;
 
-import com.jogamp.opengl.impl.egl.EGL;
-import com.jogamp.opengl.impl.egl.EGLContext;
-import com.jogamp.opengl.impl.egl.EGLDrawable;
-import com.jogamp.opengl.impl.egl.EGLExt;
+import jogamp.opengl.egl.EGL;
+import jogamp.opengl.egl.EGLContext;
+import jogamp.opengl.egl.EGLDrawable;
+import jogamp.opengl.egl.EGLExt;
 
 import java.net.URL;
 import java.nio.ByteBuffer;
diff --git a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
index 695fad5..9352ad4 100644
--- a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
+++ b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
@@ -41,7 +41,8 @@
 package javax.media.opengl;
 
 import javax.media.nativewindow.NativeWindowException;
-import com.jogamp.opengl.impl.Debug;
+import jogamp.opengl.Debug;
+import java.util.List;
 import javax.media.nativewindow.CapabilitiesImmutable;
 
 /** <P> The default implementation of the {@link
@@ -85,38 +86,40 @@ import javax.media.nativewindow.CapabilitiesImmutable;
 public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
   private static final boolean DEBUG = Debug.debug("CapabilitiesChooser");
 
-  public int chooseCapabilities(CapabilitiesImmutable desired,
-                                CapabilitiesImmutable[] available,
-                                int windowSystemRecommendedChoice) {
-    GLCapabilitiesImmutable _desired = (GLCapabilitiesImmutable) desired;
-    GLCapabilitiesImmutable[] _available = (GLCapabilitiesImmutable[]) available;
-    int availnum = 0;
-
-    for (int i = 0; i < _available.length; i++) {
-      if(null != _available[i]) { availnum++; }
+  public int chooseCapabilities(final CapabilitiesImmutable desired,
+                                final List /*<CapabilitiesImmutable>*/ available,
+                                final int windowSystemRecommendedChoice) {
+    if ( null == desired ) {
+      throw new NativeWindowException("Null desired capabilities");
+    }
+    if ( 0 == available.size() ) {
+      throw new NativeWindowException("Empty available capabilities");
     }
 
+    final GLCapabilitiesImmutable gldes = (GLCapabilitiesImmutable) desired;
+    final int availnum = available.size();
+
     if (DEBUG) {
-      System.err.println("Desired: " + _desired);
-      System.err.println("Available: Valid " + availnum + "/" + _available.length);
-      for (int i = 0; i < _available.length; i++) {
-        System.err.println(i + ": " + _available[i]);
+      System.err.println("Desired: " + gldes);
+      System.err.println("Available: " + availnum);
+      for (int i = 0; i < available.size(); i++) {
+        System.err.println(i + ": " + available.get(i));
       }
       System.err.println("Window system's recommended choice: " + windowSystemRecommendedChoice);
     }
 
     if (windowSystemRecommendedChoice >= 0 &&
-        windowSystemRecommendedChoice < _available.length &&
-        _available[windowSystemRecommendedChoice] != null) {
+        windowSystemRecommendedChoice < availnum &&
+        null != available.get(windowSystemRecommendedChoice)) {
       if (DEBUG) {
         System.err.println("Choosing window system's recommended choice of " + windowSystemRecommendedChoice);
-        System.err.println(_available[windowSystemRecommendedChoice]);
+        System.err.println(available.get(windowSystemRecommendedChoice));
       }
       return windowSystemRecommendedChoice;
     }
 
     // Create score array
-    int[] scores = new int[_available.length];
+    int[] scores = new int[availnum];
     int NO_SCORE = -9999999;
     int DOUBLE_BUFFER_MISMATCH_PENALTY = 1000;
     int STENCIL_MISMATCH_PENALTY = 500;
@@ -131,18 +134,18 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
       scores[i] = NO_SCORE;
     }
     // Compute score for each
-    for (int i = 0; i < scores.length; i++) {
-      GLCapabilitiesImmutable cur = _available[i];
+    for (int i = 0; i < availnum; i++) {
+      GLCapabilitiesImmutable cur = (GLCapabilitiesImmutable) available.get(i);
       if (cur == null) {
         continue;
       }
-      if (_desired.isOnscreen() != cur.isOnscreen()) {
+      if (gldes.isOnscreen() != cur.isOnscreen()) {
         continue;
       }
-      if (!_desired.isOnscreen() && _desired.isPBuffer() && !cur.isPBuffer()) {
+      if (!gldes.isOnscreen() && gldes.isPBuffer() && !cur.isPBuffer()) {
         continue; // only skip if requested Offscreen && PBuffer, but no PBuffer available
       }
-      if (_desired.getStereo() != cur.getStereo()) {
+      if (gldes.getStereo() != cur.getStereo()) {
         continue;
       }
       int score = 0;
@@ -150,20 +153,20 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
       // (Note that this decides the direction of all other penalties)
       score += (COLOR_MISMATCH_PENALTY_SCALE *
                 ((cur.getRedBits() + cur.getGreenBits() + cur.getBlueBits() + cur.getAlphaBits()) -
-                 (_desired.getRedBits() + _desired.getGreenBits() + _desired.getBlueBits() + _desired.getAlphaBits())));
+                 (gldes.getRedBits() + gldes.getGreenBits() + gldes.getBlueBits() + gldes.getAlphaBits())));
       // Compute difference in depth buffer depth
       score += (DEPTH_MISMATCH_PENALTY_SCALE * sign(score) * 
-                Math.abs(cur.getDepthBits() - _desired.getDepthBits()));
+                Math.abs(cur.getDepthBits() - gldes.getDepthBits()));
       // Compute difference in accumulation buffer depth
       score += (ACCUM_MISMATCH_PENALTY_SCALE * sign(score) *
                 Math.abs((cur.getAccumRedBits() + cur.getAccumGreenBits() + cur.getAccumBlueBits() + cur.getAccumAlphaBits()) -
-                         (_desired.getAccumRedBits() + _desired.getAccumGreenBits() + _desired.getAccumBlueBits() + _desired.getAccumAlphaBits())));
+                         (gldes.getAccumRedBits() + gldes.getAccumGreenBits() + gldes.getAccumBlueBits() + gldes.getAccumAlphaBits())));
       // Compute difference in stencil bits
-      score += STENCIL_MISMATCH_PENALTY_SCALE * sign(score) * (cur.getStencilBits() - _desired.getStencilBits());
-      if (cur.getDoubleBuffered() != _desired.getDoubleBuffered()) {
+      score += STENCIL_MISMATCH_PENALTY_SCALE * sign(score) * (cur.getStencilBits() - gldes.getStencilBits());
+      if (cur.getDoubleBuffered() != gldes.getDoubleBuffered()) {
         score += sign(score) * DOUBLE_BUFFER_MISMATCH_PENALTY;
       }
-      if ((_desired.getStencilBits() > 0) && (cur.getStencilBits() == 0)) {
+      if ((gldes.getStencilBits() > 0) && (cur.getStencilBits() == 0)) {
         score += sign(score) * STENCIL_MISMATCH_PENALTY;
       }
       scores[i] = score;
@@ -172,12 +175,12 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
     // non-hardware-accelerated visuals out
     boolean gotHW = false;
     int maxAbsoluteHWScore = 0;
-    for (int i = 0; i < scores.length; i++) {
+    for (int i = 0; i < availnum; i++) {
       int score = scores[i];
       if (score == NO_SCORE) {
         continue;
       }
-      GLCapabilitiesImmutable cur = _available[i];
+      GLCapabilitiesImmutable cur = (GLCapabilitiesImmutable) available.get(i);
       if (cur.getHardwareAccelerated()) {
         int absScore = Math.abs(score);
         if (!gotHW ||
@@ -188,12 +191,12 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
       }
     }
     if (gotHW) {
-      for (int i = 0; i < scores.length; i++) {
+      for (int i = 0; i < availnum; i++) {
         int score = scores[i];
         if (score == NO_SCORE) {
           continue;
         }
-        GLCapabilitiesImmutable cur = _available[i];
+        GLCapabilitiesImmutable cur = (GLCapabilitiesImmutable) available.get(i);
         if (!cur.getHardwareAccelerated()) {
           if (score <= 0) {
             score -= maxAbsoluteHWScore;
@@ -207,7 +210,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
 
     if (DEBUG) {
       System.err.print("Scores: [");
-      for (int i = 0; i < _available.length; i++) {
+      for (int i = 0; i < availnum; i++) {
         if (i > 0) {
           System.err.print(",");
         }
@@ -219,7 +222,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
     // Ready to select. Choose score closest to 0. 
     int scoreClosestToZero = NO_SCORE;
     int chosenIndex = -1;
-    for (int i = 0; i < scores.length; i++) {
+    for (int i = 0; i < availnum; i++) {
       int score = scores[i];
       if (score == NO_SCORE) {
         continue;
@@ -238,7 +241,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
     if (DEBUG) {
       System.err.println("Chosen index: " + chosenIndex);
       System.err.println("Chosen capabilities:");
-      System.err.println(_available[chosenIndex]);
+      System.err.println(available.get(chosenIndex));
     }
 
     return chosenIndex;
@@ -250,4 +253,5 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
     }
     return 1;
   }
+
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
index 0282b3a..2c8c7cc 100644
--- a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
+++ b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
@@ -31,10 +31,6 @@ package javax.media.opengl;
 /**
  * An animator control interface, 
  * which implementation may drive a {@link javax.media.opengl.GLAutoDrawable} animation.
- * <P>
- * Note that the methods {@link #start()} and {@link #stop()}
- * shall be implemented fail-fast, ie {@link #start()} fails if not started, etc.
- * This way an implementation can find implementation errors faster.
  */
 public interface GLAnimatorControl {
 
@@ -127,12 +123,14 @@ public interface GLAnimatorControl {
      * <P>
      * If started, all counters (time, frames, ..) are reset to zero.
      *
+     * @return true is started due to this call,
+     *         otherwise false, ie started already or unable to start.
+     *
      * @see #stop()
      * @see #isAnimating()
      * @see #getThread()
-     * @throws GLException if started already
      */
-    void start();
+    boolean start();
 
     /**
      * Stops this animator.
@@ -142,12 +140,14 @@ public interface GLAnimatorControl {
      * or in some cases from an implementation-internal thread like the
      * AWT event queue thread.
      *
+     * @return true is stopped due to this call,
+     *         otherwise false, ie not started or unable to stop.
+     *
      * @see #start()
      * @see #isAnimating()
      * @see #getThread()
-     * @throws GLException if not started
      */
-    void stop();
+    boolean stop();
 
     /**
      * Pauses this animator.
diff --git a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
index cde327a..cf24d10 100644
--- a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
@@ -40,7 +40,7 @@
 
 package javax.media.opengl;
 
-import com.jogamp.opengl.impl.Debug;
+import jogamp.opengl.Debug;
 import java.security.*;
 
 /** A higher-level abstraction than {@link GLDrawable} which supplies
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilities.java b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
index 82f83dc..1ae9e40 100644
--- a/src/jogl/classes/javax/media/opengl/GLCapabilities.java
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
@@ -143,6 +143,56 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
     return res;
   }
 
+  /** comparing hw/sw, stereo, multisample, stencil, RGBA and depth only */
+  public int compareTo(Object o) {
+    if ( ! ( o instanceof GLCapabilities ) ) {
+        Class c = (null != o) ? o.getClass() : null ;
+        throw new ClassCastException("Not a GLCapabilities object: " + c);
+    }
+
+    final GLCapabilities caps = (GLCapabilities) o;
+
+    if(hardwareAccelerated && !caps.hardwareAccelerated) {
+        return 1;
+    } else if(!hardwareAccelerated && caps.hardwareAccelerated) {
+        return -1;
+    }
+
+    if(stereo && !caps.stereo) {
+        return 1;
+    } else if(!stereo && caps.stereo) {
+        return -1;
+    }
+
+    final int ms = sampleBuffers ? numSamples : 0;
+    final int xms = caps.sampleBuffers ? caps.numSamples : 0;
+
+    if(ms > xms) {
+        return 1;
+    } else if( ms < xms ) {
+        return -1;
+    }
+
+    if(stencilBits > caps.stencilBits) {
+        return 1;
+    } else if(stencilBits < caps.stencilBits) {
+        return -1;
+    }
+
+    final int sc = super.compareTo(caps); // RGBA
+    if(0 != sc) {
+        return sc;
+    }
+
+    if(depthBits > caps.depthBits) {
+        return 1;
+    } else if(depthBits < caps.depthBits) {
+        return -1;
+    }
+
+    return 0; // they are equal: hw/sw, stereo, multisample, stencil, RGBA and depth
+  }
+
   /** Returns the GL profile you desire or used by the drawable. */
   public GLProfile getGLProfile() {
     return glProfile;
@@ -158,11 +208,30 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
     return pbuffer;
   }
 
-  /** Enables or disables pbuffer usage. */
+  /** 
+   * Enables or disables pbuffer usage.<br>
+   * If enabled, onscreen := false.
+   * Defaults to false.
+   */
   public void setPBuffer(boolean onOrOff) {
+    if(onOrOff) {
+      setOnscreen(false);
+    }
     pbuffer = onOrOff;
   }
 
+  /**
+   * Sets whether the drawable surface supports onscreen.<br>
+   * If enabled, pbuffer := false.<br>
+   * Defaults to true.
+  */
+  public void setOnscreen(boolean onscreen) {
+    if(onscreen) {
+        setPBuffer(false);
+    }
+    super.setOnscreen(onscreen);
+  }
+
   /** Indicates whether double-buffering is enabled. */
   public boolean getDoubleBuffered() {
     return doubleBuffered;
@@ -340,28 +409,54 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
     return pbufferRenderToTextureRectangle;
   }
 
+  public StringBuffer toString(StringBuffer sink) {
+    if(null == sink) {
+        sink = new StringBuffer();
+    }
+
+    int samples = sampleBuffers ? numSamples : 0 ;
+
+    super.toString(sink);
+
+    sink.append(", accum-rgba ").append(accumRedBits).append("/").append(accumGreenBits).append("/").append(accumBlueBits).append("/").append(accumAlphaBits);
+    sink.append(", dp/st/ms: ").append(depthBits).append("/").append(stencilBits).append("/").append(samples);
+    if(doubleBuffered) {
+        sink.append(", dbl");
+    } else {
+        sink.append(", one");
+    }
+    if(stereo) {
+        sink.append(", stereo");
+    } else {
+        sink.append(", mono  ");
+    }
+    if(hardwareAccelerated) {
+        sink.append(", hw, ");
+    } else {
+        sink.append(", sw, ");
+    }
+    sink.append(glProfile);
+    if(!isOnscreen()) {
+        if(pbuffer) {
+            sink.append(", pbuffer [r2t ").append(pbufferRenderToTexture?1:0)
+                .append(", r2tr ").append(pbufferRenderToTextureRectangle?1:0)
+                .append(", float ").append(pbufferFloatingPointBuffers?1:0)
+                .append("]");
+        } else {
+            sink.append(", pixmap");
+        }
+    }
+    
+    return sink;
+  }
+
   /** Returns a textual representation of this GLCapabilities
       object. */ 
   public String toString() {
     StringBuffer msg = new StringBuffer();
-    msg.append("GLCapabilities[");
-    msg.append(super.toString());
-    msg.append(", GL profile: " + glProfile +
-        ", PBuffer: " + pbuffer +
-        ", DoubleBuffered: " + doubleBuffered +
-	    ", Stereo: " + stereo + 
-        ", HardwareAccelerated: " + hardwareAccelerated +
-	    ", DepthBits: " + depthBits +
-	    ", StencilBits: " + stencilBits +
-	    ", Red Accum: " + accumRedBits +
-	    ", Green Accum: " + accumGreenBits +
-	    ", Blue Accum: " + accumBlueBits +
-	    ", Alpha Accum: " + accumAlphaBits +
-        ", Multisample: " + sampleBuffers +
-        ", Num samples: "+(sampleBuffers ? numSamples : 0));
-    msg.append(", PBuffer-FloatingPointBuffers: "+pbufferFloatingPointBuffers+
-        ", PBuffer-RenderToTexture: "+pbufferRenderToTexture+
-        ", PBuffer-RenderToTextureRectangle: "+pbufferRenderToTextureRectangle+ "]");
+    msg.append("GLCaps[");
+    toString(msg);
+    msg.append("]");
     return msg.toString();
   }
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index 45e1361..b859dee 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -40,10 +40,10 @@
 
 package javax.media.opengl;
 
-import com.jogamp.opengl.impl.Debug;
 import java.util.HashMap;
 import java.util.HashSet;
 import javax.media.nativewindow.AbstractGraphicsDevice;
+import jogamp.opengl.Debug;
 
 /** Abstraction for an OpenGL rendering context. In order to perform
     OpenGL rendering, a context must be "made current" on the current
@@ -82,6 +82,11 @@ public abstract class GLContext {
   /** <code>ARB_create_context</code> related: flag debug */
   protected static final int CTX_OPTION_DEBUG   = 1 << 6;
 
+  /** GLContext {@link com.jogamp.gluegen.runtime.ProcAddressTable} caching related: GL software implementation */
+  protected static final int CTX_IMPL_ACCEL_SOFT = 1 << 0;
+  /** GLContext {@link com.jogamp.gluegen.runtime.ProcAddressTable} caching related: GL hardware implementation */
+  protected static final int CTX_IMPL_ACCEL_HARD = 1 << 1;
+
   private static ThreadLocal currentContext = new ThreadLocal();
 
   private HashMap/*<int, Object>*/ attachedObjects = new HashMap();
@@ -116,17 +121,32 @@ public abstract class GLContext {
   public abstract GLDrawable getGLDrawable();
 
   /**
-   * Set the GLDrawable from which this context may be used to
-   * read.<br>
-   * If read is null, the default write drawable will be used.
+   * Return availability of GL read drawable.
+   * @return true if a GL read drawable is supported with your driver, otherwise false.
+   */
+  public abstract boolean isGLReadDrawableAvailable();
+
+  /**
+   * Set the read GLDrawable for read framebuffer operations.<br>
+   * The caller should query if this feature is supported via {@link #isGLReadDrawableAvailable()}.
+   *
+   * @param read the read GLDrawable for read framebuffer operations.
+   * If null is passed, the default write drawable will be set.
+   *
+   * @throws GLException in case a read drawable is not supported
+   *         and the given drawable is not null and not equal to the internal write drawable.
+   *
+   * @see #isGLReadDrawableAvailable()
+   * @see #getGLReadDrawable()
    */
-  public abstract void setGLDrawableRead(GLDrawable read);
+  public abstract void setGLReadDrawable(GLDrawable read);
 
   /**
-   * Returns the GLDrawable from which this context may be used to
-   * read.
+   * Returns the read GLDrawable this context uses for read framebuffer operations.
+   * @see #isGLReadDrawableAvailable()
+   * @see #setGLReadDrawable(javax.media.opengl.GLDrawable)
    */
-  public abstract GLDrawable getGLDrawableRead();
+  public abstract GLDrawable getGLReadDrawable();
 
   /**
    * Makes this GLContext current on the calling thread.
@@ -341,13 +361,13 @@ public abstract class GLContext {
     sb.append(toHexString(contextHandle));
     sb.append(", ");
     sb.append(getGL());
-    if(getGLDrawable()!=getGLDrawableRead()) {
-        sb.append(",\n\tDrawable Read : ");
-        sb.append(getGLDrawableRead());
-        sb.append(",\n\tDrawable Write: ");
+    if(getGLDrawable()!=getGLReadDrawable()) {
+        sb.append(",\n\tRead Drawable : ");
+        sb.append(getGLReadDrawable());
+        sb.append(",\n\tWrite Drawable: ");
         sb.append(getGLDrawable());
     } else {
-        sb.append(",\n\tDrawable Read/Write: ");
+        sb.append(",\n\tDrawable: ");
         sb.append(getGLDrawable());
     }
     return sb;
@@ -359,6 +379,14 @@ public abstract class GLContext {
       current. */
   public abstract String getPlatformExtensionsString();
 
+  /** Returns a non-null (but possibly empty) string containing the
+      space-separated list of available extensions.
+      Can only be called while this context is current.
+      This is equivalent to
+      {@link javax.media.opengl.GL#glGetString(int) glGetString}({@link javax.media.opengl.GL#GL_EXTENSIONS GL_EXTENSIONS})
+   */
+  public abstract String getGLExtensionsString();
+
   public final int getGLVersionMajor() { return ctxMajorVersion; }
   public final int getGLVersionMinor() { return ctxMinorVersion; }
   public final boolean isGLCompatibilityProfile() { return ( 0 != ( CTX_PROFILE_COMPAT & ctxOptions ) ); }
@@ -556,10 +584,6 @@ public abstract class GLContext {
    */
   private static /*final*/ HashSet/*<UniqueDeviceString>*/ deviceVersionsAvailableSet = new HashSet();
 
-  protected static String getContextFQN(AbstractGraphicsDevice device, int major, int minor, int ctp) {
-      return device.getUniqueID() + "-" + toHexString(compose8bit(major, minor, ctp, 0));
-  }
-
   protected static String getDeviceVersionAvailableKey(AbstractGraphicsDevice device, int major, int profile) {
       return device.getUniqueID() + "-" + toHexString(compose8bit(major, profile, 0, 0));
   }
@@ -579,15 +603,15 @@ public abstract class GLContext {
           deviceVersionsAvailableSet.add(devKey);
           if (DEBUG0) {
             String msg = getThreadName() + ": !!! createContextARB: SET mappedVersionsAvailableSet "+devKey;
-            Throwable t = new Throwable(msg);
-            t.printStackTrace();
-            // System.err.println(msg);
+            // Throwable t = new Throwable(msg);
+            // t.printStackTrace();
+            System.err.println(msg);
           }
       }
   }
 
   /**
-   * Called by {@link com.jogamp.opengl.impl.GLContextImpl#createContextARBMapVersionsAvailable} not intended to be used by
+   * Called by {@link jogamp.opengl.GLContextImpl#createContextARBMapVersionsAvailable} not intended to be used by
    * implementations. However, if {@link #createContextARB} is not being used within
    * {@link javax.media.opengl.GLDrawableFactory#getOrCreateSharedContext(javax.media.nativewindow.AbstractGraphicsDevice)},
    * GLProfile has to map the available versions.
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index fd6aa78..c433e8b 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -40,18 +40,19 @@
 
 package javax.media.opengl;
 
-import com.jogamp.common.JogampRuntimeException;
-import com.jogamp.common.impl.Debug;
-import com.jogamp.common.util.ReflectionUtil;
-
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
-import java.util.HashSet;
+import java.util.List;
+
+import com.jogamp.common.JogampRuntimeException;
+import jogamp.common.Debug;
+import com.jogamp.common.util.ReflectionUtil;
 
 import javax.media.nativewindow.AbstractGraphicsDevice;
 import javax.media.nativewindow.NativeSurface;
 import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.nativewindow.ProxySurface;
 
 /** <P> Provides a virtual machine- and operating system-independent
     mechanism for creating {@link GLDrawable}s. </P>
@@ -92,8 +93,8 @@ public abstract class GLDrawableFactory {
   private static final GLDrawableFactory eglFactory;
   private static final GLDrawableFactory nativeOSFactory;
   private static final String nativeOSType;
-  static final String macosxFactoryClassNameCGL = "com.jogamp.opengl.impl.macosx.cgl.MacOSXCGLDrawableFactory";
-  static final String macosxFactoryClassNameAWTCGL = "com.jogamp.opengl.impl.macosx.cgl.awt.MacOSXAWTCGLDrawableFactory";
+  static final String macosxFactoryClassNameCGL = "jogamp.opengl.macosx.cgl.MacOSXCGLDrawableFactory";
+  static final String macosxFactoryClassNameAWTCGL = "jogamp.opengl.macosx.cgl.awt.MacOSXAWTCGLDrawableFactory";
 
   protected static ArrayList/*<GLDrawableFactoryImpl>*/ glDrawableFactories = new ArrayList();
 
@@ -119,9 +120,9 @@ public abstract class GLDrawableFactory {
     ClassLoader cl = GLDrawableFactory.class.getClassLoader();
     if (null == factoryClassName) {
         if ( nativeOSType.equals(NativeWindowFactory.TYPE_X11) ) {
-          factoryClassName = "com.jogamp.opengl.impl.x11.glx.X11GLXDrawableFactory";
+          factoryClassName = "jogamp.opengl.x11.glx.X11GLXDrawableFactory";
         } else if ( nativeOSType.equals(NativeWindowFactory.TYPE_WINDOWS) ) {
-          factoryClassName = "com.jogamp.opengl.impl.windows.wgl.WindowsWGLDrawableFactory";
+          factoryClassName = "jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory";
         } else if ( nativeOSType.equals(NativeWindowFactory.TYPE_MACOSX) ) {
             if(ReflectionUtil.isClassAvailable(macosxFactoryClassNameAWTCGL, cl)) {
                 factoryClassName = macosxFactoryClassNameAWTCGL;
@@ -152,7 +153,7 @@ public abstract class GLDrawableFactory {
 
     tmp = null;
     try {
-        tmp = (GLDrawableFactory) ReflectionUtil.createInstance("com.jogamp.opengl.impl.egl.EGLDrawableFactory", cl);
+        tmp = (GLDrawableFactory) ReflectionUtil.createInstance("jogamp.opengl.egl.EGLDrawableFactory", cl);
     } catch (JogampRuntimeException jre) {
         if (GLProfile.DEBUG) {
             System.err.println("Info: GLDrawableFactory.static - EGLDrawableFactory - not available");
@@ -221,26 +222,49 @@ public abstract class GLDrawableFactory {
     }
   }
 
+  protected void enterThreadCriticalZone() {};
+  protected void leaveThreadCriticalZone() {};
+
   protected abstract void shutdownInstance();
 
   /**
-   * Retrieve the default <code>device</code> {@link AbstractGraphicsDevice#getConnection()}. for this factory<br>
-   * The implementation must return a non <code>null</code> default device, which must not be opened, ie. it's native handle may be <code>null</code>.
+   * Retrieve the default <code>device</code> {@link AbstractGraphicsDevice#getConnection() connection},
+   * {@link AbstractGraphicsDevice#getUnitID() unit ID} and {@link AbstractGraphicsDevice#getUniqueID() unique ID name}. for this factory<br>
+   * The implementation must return a non <code>null</code> default device, which must not be opened, ie. it's native handle is <code>null</code>.
    * @return the default shared device for this factory, eg. :0.0 on X11 desktop.
    */
   public abstract AbstractGraphicsDevice getDefaultDevice();
 
   /**
+   * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
    * @return true if the device is compatible with this factory, ie. if it can be used for creation. Otherwise false.
    */
   public abstract boolean getIsDeviceCompatible(AbstractGraphicsDevice device);
 
+  protected final AbstractGraphicsDevice validateDevice(AbstractGraphicsDevice device) {
+      if(null==device) {
+          device = getDefaultDevice();
+          if(null==device) {
+              throw new InternalError("no default device");
+          }
+          if (GLProfile.DEBUG) {
+              System.err.println("Info: GLDrawableFactory.validateDevice: using default device : "+device);
+          }
+      } else if( !getIsDeviceCompatible(device) ) {
+          if (GLProfile.DEBUG) {
+              System.err.println("Info: GLDrawableFactory.validateDevice: device not compatible : "+device);
+          }
+          return null;
+      }
+      return device;
+  }
+
   /**
    * Returns true if a shared context is already mapped to the <code>device</code> {@link AbstractGraphicsDevice#getConnection()},
    * or if a new shared context could be created and mapped. Otherwise return false.<br>
    * Creation of the shared context is tried only once.
    *
-   * @param device if <code>null</code>, the platform default device is being used
+   * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
    */
   public final boolean getIsSharedContextAvailable(AbstractGraphicsDevice device) {
       return null != getOrCreateSharedContext(device);
@@ -251,27 +275,31 @@ public abstract class GLDrawableFactory {
    * either a preexisting or newly created, or <code>null</code> if creation failed or not supported.<br>
    * Creation of the shared context is tried only once.
    *
-   * @param device if <code>null</code>, the platform default device is being used
+   * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
    */
   protected final GLContext getOrCreateSharedContext(AbstractGraphicsDevice device) {
-      if(null==device) {
-          device = getDefaultDevice();
-          if(null==device) {
-              throw new InternalError("no default device");
-          }
-          if (GLProfile.DEBUG) {
-              System.err.println("Info: GLDrawableFactory.getOrCreateSharedContext: using default device : "+device);
-          }
-      } else if( !getIsDeviceCompatible(device) ) {
-          if (GLProfile.DEBUG) {
-              System.err.println("Info: GLDrawableFactory.getOrCreateSharedContext: device not compatible : "+device);
-          }
-          return null;
+      device = validateDevice(device);
+      if(null!=device) {
+        return getOrCreateSharedContextImpl(device);
       }
-      return getOrCreateSharedContextImpl(device);
+      return null;
   }
   protected abstract GLContext getOrCreateSharedContextImpl(AbstractGraphicsDevice device);
 
+  /**
+   * Returns the sole GLDrawableFactory instance for the desktop (X11, WGL, ..) if exist or null
+   */
+  public static GLDrawableFactory getDesktopFactory() {
+    return nativeOSFactory;
+  }
+
+  /**
+   * Returns the sole GLDrawableFactory instance for EGL if exist or null
+   */
+  public static GLDrawableFactory getEGLFactory() {
+    return eglFactory;
+  }
+
   /** 
    * Returns the sole GLDrawableFactory instance. 
    * 
@@ -296,6 +324,34 @@ public abstract class GLDrawableFactory {
     throw new GLException("No native platform GLDrawableFactory, nor EGLDrawableFactory available: "+glProfileImplName);
   }
 
+  protected static GLDrawableFactory getFactoryImpl(AbstractGraphicsDevice device) throws GLException {
+    if(null != nativeOSFactory && nativeOSFactory.getIsDeviceCompatible(device)) {
+        return nativeOSFactory;
+    }
+    if(null != eglFactory && eglFactory.getIsDeviceCompatible(device)) {
+        return eglFactory;
+    }
+    throw new GLException("No native platform GLDrawableFactory, nor EGLDrawableFactory available: "+device);
+  }
+
+  /**
+   * Returns an array of available GLCapabilities for the device.<br>
+   * The list is sorted by the native ID, ascending.<br>
+   * The chosen GLProfile statement in the result may not refer to the maximum available profile
+   * due to implementation constraints, ie using the shared resource.
+   *
+   * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
+   * @return A list of {@link javax.media.opengl.GLCapabilitiesImmutable}'s, maybe empty if none is available.
+   */
+  public final List/*GLCapabilitiesImmutable*/ getAvailableCapabilities(AbstractGraphicsDevice device) {
+      device = validateDevice(device);
+      if(null!=device) {
+        return getAvailableCapabilitiesImpl(device);
+      }
+      return null;
+  }
+  protected abstract List/*GLCapabilitiesImmutable*/ getAvailableCapabilitiesImpl(AbstractGraphicsDevice device);
+
   //----------------------------------------------------------------------
   // Methods to create high-level objects
 
@@ -306,12 +362,12 @@ public abstract class GLDrawableFactory {
    * The native platform's chosen Capabilties are referenced within the target
    * NativeSurface's AbstractGraphicsConfiguration.<p>
    *
-   * In case {@link javax.media.nativewindow.Capabilities#isOnscreen()} is true,<br>
+   * In case target's {@link javax.media.nativewindow.Capabilities#isOnscreen()} is true,<br>
    * an onscreen GLDrawable will be realized.
    * <p>
-   * In case {@link javax.media.nativewindow.Capabilities#isOnscreen()} is false,<br>
-   * either a Pbuffer drawable is created if {@link javax.media.opengl.GLCapabilities#isPBuffer()} is true,<br>
-   * or a simple offscreen drawable is creates. The latter is unlikely to be hardware accelerated.<br>
+   * In case target's {@link javax.media.nativewindow.Capabilities#isOnscreen()} is false,<br>
+   * either a Pbuffer drawable is created if target's {@link javax.media.opengl.GLCapabilities#isPBuffer()} is true,<br>
+   * or a simple pixmap/bitmap drawable is created. The latter is unlikely to be hardware accelerated.<br>
    * <p>
    *
    * @throws IllegalArgumentException if the passed target is null
@@ -324,34 +380,75 @@ public abstract class GLDrawableFactory {
     throws IllegalArgumentException, GLException;
 
   /**
-   * Creates a Offscreen GLDrawable with the given capabilites and dimensions. <P>
+   * Creates a Offscreen GLDrawable incl it's offscreen {@link javax.media.nativewindow.NativeSurface} with the given capabilites and dimensions.
+   * <p>
+   * A Pbuffer drawable/surface is created if both {@link javax.media.opengl.GLCapabilities#isPBuffer() caps.isPBuffer()}
+   * and {@link #canCreateGLPbuffer(javax.media.nativewindow.AbstractGraphicsDevice) canCreateGLPbuffer(device)} is true.<br>
+   * Otherwise a simple pixmap/bitmap drawable/surface is created, which is unlikely to be hardware accelerated.<br>
+   * </p>
+   *
+   * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared device to be used, may be <code>null</code> for the platform's default device.
+   * @param caps the requested GLCapabilties
+   * @param chooser the custom chooser, may be null for default
+   * @param width the requested offscreen width
+   * @param height the requested offscreen height
+   *
+   * @return the created offscreen GLDrawable
    *
    * @throws GLException if any window system-specific errors caused
    *         the creation of the Offscreen to fail.
    */
-  public abstract GLDrawable createOffscreenDrawable(GLCapabilitiesImmutable capabilities,
+  public abstract GLDrawable createOffscreenDrawable(AbstractGraphicsDevice device,
+                                                     GLCapabilitiesImmutable capabilities,
                                                      GLCapabilitiesChooser chooser,
                                                      int width, int height)
     throws GLException;
 
   /**
-   * Returns true if it is possible to create a GLPbuffer. Some older
-   * graphics cards do not have this capability.
-   * @param passing the device for the query, may be null
+   * Creates an offscreen NativeSurface.<br>
+   * A Pbuffer surface is created if both {@link javax.media.opengl.GLCapabilities#isPBuffer() caps.isPBuffer()}
+   * and {@link #canCreateGLPbuffer(javax.media.nativewindow.AbstractGraphicsDevice) canCreateGLPbuffer(device)} is true.<br>
+   * Otherwise a simple pixmap/bitmap surface is created. The latter is unlikely to be hardware accelerated.<br>
+   *
+   * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
+   * @param caps the requested GLCapabilties
+   * @param chooser the custom chooser, may be null for default
+   * @param width the requested offscreen width
+   * @param height the requested offscreen height
+   * @return the created offscreen native surface
+   *
+   * @throws GLException if any window system-specific errors caused
+   *         the creation of the GLDrawable to fail.
    */
-  public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device);
+  public abstract NativeSurface createOffscreenSurface(AbstractGraphicsDevice device,
+                                                       GLCapabilitiesImmutable caps,
+                                                       GLCapabilitiesChooser chooser,
+                                                       int width, int height);
 
   /**
-   * Creates a Pbuffer GLDrawable with the given capabilites and dimensions. <P>
+   * Highly experimental API entry, allowing developer of new windowing system bindings 
+   * to leverage the native window handle to produce a NativeSurface implementation (ProxySurface), having the required GLCapabilities.<br>
+   * Such surface can be used to instantiate a GLDrawable and hence test your new binding w/o the 
+   * costs of providing a full set of abstraction like the AWT GLCanvas or even the native NEWT bindings.
+   * 
+   * @param device the platform's target device, shall not be <code>null</code>
+   * @param windowHandle the native window handle
+   * @param caps the requested GLCapabilties
+   * @param chooser the custom chooser, may be null for default
+   * @return The proxy surface wrapping the windowHandle on the device
+   */
+  public abstract ProxySurface createProxySurface(AbstractGraphicsDevice device, 
+                                                  long windowHandle, 
+                                                  GLCapabilitiesImmutable caps, 
+                                                  GLCapabilitiesChooser chooser);
+
+  /**
+   * Returns true if it is possible to create a GLPbuffer. Some older
+   * graphics cards do not have this capability.
    *
-   * @throws GLException if any window system-specific errors caused
-   *         the creation of the GLPbuffer to fail.
+   * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
    */
-  public abstract GLDrawable createGLPbufferDrawable(GLCapabilitiesImmutable capabilities,
-                                                     GLCapabilitiesChooser chooser,
-                                                     int initialWidth,
-                                                     int initialHeight)
-    throws GLException;
+  public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device);
 
   /**
    * Creates a GLPbuffer with the given capabilites and dimensions. <P>
@@ -359,10 +456,20 @@ public abstract class GLDrawableFactory {
    * See the note in the overview documentation on
    * <a href="../../../overview-summary.html#SHARING">context sharing</a>.
    *
+   * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
+   * @param capabilities the requested capabilities
+   * @param chooser the custom chooser, may be null for default
+   * @param initialWidth initial width of pbuffer
+   * @param initialHeight initial height of pbuffer
+   * @param shareWith a shared GLContext this GLPbuffer shall use
+   *
+   * @return the new {@link GLPbuffer} specific {@link GLAutoDrawable}
+   *
    * @throws GLException if any window system-specific errors caused
    *         the creation of the GLPbuffer to fail.
    */
-  public abstract GLPbuffer createGLPbuffer(GLCapabilitiesImmutable capabilities,
+  public abstract GLPbuffer createGLPbuffer(AbstractGraphicsDevice device,
+                                            GLCapabilitiesImmutable capabilities,
                                             GLCapabilitiesChooser chooser,
                                             int initialWidth,
                                             int initialHeight,
@@ -400,7 +507,8 @@ public abstract class GLDrawableFactory {
   /**
    * Returns true if it is possible to create an external GLDrawable
    * object via {@link #createExternalGLDrawable}.
-   * @param passing the device for the query, may be null
+   *
+   * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
    */
   public abstract boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device);
 
diff --git a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
index 590e88a..926651c 100644
--- a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
@@ -39,7 +39,7 @@ package javax.media.opengl;
 import java.lang.reflect.*;
 import java.util.StringTokenizer;
 
-import com.jogamp.opengl.impl.*;
+import jogamp.opengl.*;
 
 /**
  * Factory for pipelining GL instances
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index dab0c0d..17313f7 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -37,22 +37,27 @@
 
 package javax.media.opengl;
 
+import jogamp.opengl.Debug;
+import jogamp.opengl.GLDrawableFactoryImpl;
+import jogamp.opengl.GLDynamicLookupHelper;
+import jogamp.opengl.DesktopGLDynamicLookupHelper;
+
 import com.jogamp.common.GlueGenVersion;
 import com.jogamp.common.jvm.JVMUtil;
 import com.jogamp.common.util.ReflectionUtil;
 import com.jogamp.common.util.VersionUtil;
 import com.jogamp.nativewindow.NativeWindowVersion;
-import com.jogamp.opengl.impl.Debug;
-import com.jogamp.opengl.impl.GLDrawableFactoryImpl;
-import com.jogamp.opengl.impl.GLDynamicLookupHelper;
-import com.jogamp.opengl.impl.DesktopGLDynamicLookupHelper;
 import com.jogamp.opengl.JoglVersion;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.security.*;
+
 import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.opengl.fixedfunc.GLPointerFunc;
 import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.opengl.fixedfunc.GLPointerFunc;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * Specifies the the OpenGL profile.
@@ -70,8 +75,13 @@ public class GLProfile {
     /**
      * Static one time initialization of JOGL.
      * <p>
+     * The parameter <code>firstUIActionOnProcess</code> has an impact on concurrent locking,<br>
+     * see {@link javax.media.nativewindow.NativeWindowFactory#initSingleton(boolean) NativeWindowFactory.initSingleton(firstUIActionOnProcess)}.
+     * </p>
+     * <p>
      * Applications shall call this methods <b>ASAP</b>, before any other UI invocation.<br>
-     * You may issue the call in your main function.<br>
+     * You may issue the call in your <code>main class</code> static block, which is the earliest point in your application/applet lifecycle,
+     * or within the <code>main function</code>.<br>
      * In case applications are able to initialize JOGL before any other UI action,<br>
      * they shall invoke this method with <code>firstUIActionOnProcess=true</code> and benefit from fast native multithreading support on all platforms if possible.</P>
      * <P>
@@ -341,17 +351,35 @@ public class GLProfile {
 
     /** 
      * All GL Profiles in the order of default detection.
-     * Desktop compatibility profiles (the one with fixed function pipeline) comes first.
-     *
-     * FIXME GL3GL4: Due to GL3 and GL4 implementation bugs, we still choose GL2 first, if available!
+     * Desktop compatibility profiles (the one with fixed function pipeline) comes first
+     * from highest to lowest version.
      *
      * <ul>
-     *  <li> GL2
-     *  <li> GL3bc
      *  <li> GL4bc
+     *  <li> GL3bc
+     *  <li> GL2
      *  <li> GL2GL3
+     *  <li> GL4
      *  <li> GL3
+     *  <li> GL2ES2
+     *  <li> GLES2
+     *  <li> GL2ES1
+     *  <li> GLES1
+     * </ul>
+     *
+     */
+    public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL4bc, GL3bc, GL2, GL2GL3, GL4, GL3, GL2ES2, GLES2, GL2ES1, GLES1 };
+
+    /**
+     * Order of maximum profiles.
+     *
+     * <ul>
+     *  <li> GL4bc
      *  <li> GL4
+     *  <li> GL3bc
+     *  <li> GL3
+     *  <li> GL2
+     *  <li> GL2GL3
      *  <li> GL2ES2
      *  <li> GLES2
      *  <li> GL2ES1
@@ -359,7 +387,21 @@ public class GLProfile {
      * </ul>
      *
      */
-    public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL2, GL3bc, GL4bc, GL2GL3, GL3, GL4, GL2ES2, GLES2, GL2ES1, GLES1 };
+    public static final String[] GL_PROFILE_LIST_MAX = new String[] { GL4bc, GL4, GL3bc, GL3, GL2, GL2GL3, GL2ES2, GLES2, GL2ES1, GLES1 };
+
+    /**
+     * Order of minimum original desktop profiles.
+     *
+     * <ul>
+     *  <li> GL2
+     *  <li> GL3bc
+     *  <li> GL4bc
+     *  <li> GL3
+     *  <li> GL4
+     * </ul>
+     *
+     */
+    public static final String[] GL_PROFILE_LIST_MIN_DESKTOP = new String[] { GL2, GL3bc, GL4bc, GL3, GL4 };
 
     /**
      * Order of maximum fixed function profiles
@@ -389,13 +431,11 @@ public class GLProfile {
      * </ul>
      *
      */
-    public static final String[] GL_PROFILE_LIST_MAX_PROGSHADER   = new String[] { GL4, GL4bc, GL3, GL3bc, GL2, GL2ES2, GLES2 };
+    public static final String[] GL_PROFILE_LIST_MAX_PROGSHADER   = new String[] { GL4bc, GL4, GL3bc, GL3, GL2, GL2ES2, GLES2 };
 
     /**
      * All GL2ES2 Profiles in the order of default detection.
      *
-     * FIXME GL3GL4: Due to GL3 and GL4 implementation bugs, we still choose GL2 first, if available!
-     *
      * <ul>
      *  <li> GL2ES2
      *  <li> GL2
@@ -405,13 +445,11 @@ public class GLProfile {
      * </ul>
      *
      */
-    public static final String[] GL_PROFILE_LIST_GL2ES2 = new String[] { GL2ES2, GL2, GL3, GL4, GLES2 };
+    public static final String[] GL_PROFILE_LIST_GL2ES2 = new String[] { GL2ES2, GL4, GL3, GL2, GLES2 };
 
     /**
      * All GL2ES1 Profiles in the order of default detection.
      *
-     * FIXME GL3GL4: Due to GL3 and GL4 implementation bugs, we still choose GL2 first, if available!
-     *
      * <ul>
      *  <li> GL2ES1
      *  <li> GL2
@@ -421,7 +459,18 @@ public class GLProfile {
      * </ul>
      *
      */
-    public static final String[] GL_PROFILE_LIST_GL2ES1 = new String[] { GL2ES1, GL2, GL3bc, GL4bc, GLES1 };
+    public static final String[] GL_PROFILE_LIST_GL2ES1 = new String[] { GL2ES1, GL4bc, GL3bc, GL2, GLES1 };
+
+    /**
+     * All GLES Profiles in the order of default detection.
+     *
+     * <ul>
+     *  <li> GLES2
+     *  <li> GLES1
+     * </ul>
+     *
+     */
+    public static final String[] GL_PROFILE_LIST_GLES = new String[] { GLES2, GLES1 };
 
     /** Returns a default GLProfile object, reflecting the best for the running platform.
      * It selects the first of the set {@link GLProfile#GL_PROFILE_LIST_ALL}
@@ -438,7 +487,48 @@ public class GLProfile {
     }
 
     /**
-     * Returns the highest profile, implementing the fixed function pipeline
+     * Returns the highest profile.
+     * It selects the first of the set: {@link GLProfile#GL_PROFILE_LIST_MAX}
+     *
+     * @throws GLException if no implementation for the given profile is found.
+     * @see #GL_PROFILE_LIST_MAX
+     */
+    public static GLProfile getMaximum(AbstractGraphicsDevice device)
+        throws GLException
+    {
+        return get(device, GL_PROFILE_LIST_MAX);
+    }
+
+    /** Uses the default device */
+    public static GLProfile getMaximum()
+        throws GLException
+    {
+        return get(GL_PROFILE_LIST_MAX);
+    }
+
+    /**
+     * Returns the lowest desktop profile.
+     * It selects the first of the set: {@link GLProfile#GL_PROFILE_LIST_MIN_DESKTOP}
+     *
+     * @throws GLException if no implementation for the given profile is found.
+     * @see #GL_PROFILE_LIST_MIN_DESKTOP
+     */
+    public static GLProfile getMinDesktop(AbstractGraphicsDevice device)
+        throws GLException
+    {
+        return get(device, GL_PROFILE_LIST_MIN_DESKTOP);
+    }
+
+    /** Uses the default device */
+    public static GLProfile getMinDesktop()
+        throws GLException
+    {
+        return get(GL_PROFILE_LIST_MIN_DESKTOP);
+    }
+
+
+    /**
+     * Returns the highest profile, implementing the fixed function pipeline.
      * It selects the first of the set: {@link GLProfile#GL_PROFILE_LIST_MAX_FIXEDFUNC}
      *
      * @throws GLException if no implementation for the given profile is found.
@@ -1071,19 +1161,23 @@ public class GLProfile {
      * Throws an GLException if no profile could be found at all.
      */
     private static void initProfilesForDefaultDevices(boolean firstUIActionOnProcess) {
+        NativeWindowFactory.initSingleton(firstUIActionOnProcess);
 
         if(DEBUG) {
-            System.err.println("GLProfile.init firstUIActionOnProcess "+firstUIActionOnProcess);
+            System.err.println("GLProfile.init firstUIActionOnProcess: "+ firstUIActionOnProcess
+                               + ", thread: " + Thread.currentThread().getName());
+            System.err.println(VersionUtil.getPlatformInfo());
+            System.err.println(GlueGenVersion.getInstance());
+            System.err.println(NativeWindowVersion.getInstance());
+            System.err.println(JoglVersion.getInstance());
         }
 
-        NativeWindowFactory.initSingleton(firstUIActionOnProcess);
-
         ClassLoader classloader = GLProfile.class.getClassLoader();
 
         isAWTAvailable = NativeWindowFactory.isAWTAvailable() &&
                          ReflectionUtil.isClassAvailable("javax.media.opengl.awt.GLCanvas", classloader) ; // JOGL
 
-        hasGL234Impl   = ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.gl4.GL4bcImpl", classloader);
+        hasGL234Impl   = ReflectionUtil.isClassAvailable("jogamp.opengl.gl4.GL4bcImpl", classloader);
         
         //
         // Iteration of desktop GL availability detection
@@ -1126,7 +1220,7 @@ public class GLProfile {
             defaultDevice = defaultDesktopDevice;
         }
 
-        if ( ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.egl.EGLDrawableFactory", classloader) ) {
+        if ( ReflectionUtil.isClassAvailable("jogamp.opengl.egl.EGLDrawableFactory", classloader) ) {
             t=null;
             try {
                 eglFactory = (GLDrawableFactoryImpl) GLDrawableFactory.getFactoryImpl(GLES2);
@@ -1169,15 +1263,10 @@ public class GLProfile {
             }
         }
 
-        boolean addedAnyProfile = initProfilesForDevice(defaultDesktopDevice);
-        addedAnyProfile = addedAnyProfile || initProfilesForDevice(defaultEGLDevice);
-
+        boolean addedAnyProfile = initProfilesForDevice(defaultDesktopDevice) ||
+                                  initProfilesForDevice(defaultEGLDevice);
+        
         if(DEBUG) {
-            System.err.println(VersionUtil.getPlatformInfo());
-            System.err.println(GlueGenVersion.getInstance());
-            System.err.println(NativeWindowVersion.getInstance());
-            System.err.print(JoglVersion.getInstance());
-
             System.err.println("GLProfile.init isAWTAvailable       "+isAWTAvailable);
             System.err.println("GLProfile.init has desktopFactory   "+(null!=desktopFactory));
             System.err.println("GLProfile.init hasDesktopGL         "+hasDesktopGL);
@@ -1185,8 +1274,8 @@ public class GLProfile {
             System.err.println("GLProfile.init has eglFactory       "+(null!=eglFactory));
             System.err.println("GLProfile.init hasGLES1Impl         "+hasGLES1Impl);
             System.err.println("GLProfile.init hasGLES2Impl         "+hasGLES2Impl);
-            System.err.println("GLProfile.init defaultDesktopDevice "+defaultDevice);
-            System.err.println("GLProfile.init defaultEGLDevice     "+defaultDevice);
+            System.err.println("GLProfile.init defaultDesktopDevice "+defaultDesktopDevice);
+            System.err.println("GLProfile.init defaultEGLDevice     "+defaultEGLDevice);
             System.err.println("GLProfile.init defaultDevice        "+defaultDevice);
         }
         
@@ -1200,10 +1289,22 @@ public class GLProfile {
      * @return true if any profile for the device exists, otherwise false
      */
     private static synchronized boolean initProfilesForDevice(AbstractGraphicsDevice device) {
+        if(null == device) {
+            return false;
+        }
+        GLDrawableFactory factory = GLDrawableFactory.getFactoryImpl(device);
+        factory.enterThreadCriticalZone();
+        try {
+            return initProfilesForDeviceImpl(device);
+        } finally {
+            factory.leaveThreadCriticalZone();
+        }
+    }
+    private static synchronized boolean initProfilesForDeviceImpl(AbstractGraphicsDevice device) {
         boolean isSet = GLContext.getAvailableGLVersionsSet(device);
 
         if(DEBUG) {
-            String msg = "Info: GLProfile.initProfilesForDevice: "+device.getConnection()+", isSet "+isSet;
+            String msg = "Info: GLProfile.initProfilesForDevice: "+device+", isSet "+isSet;
             Throwable t = new Throwable(msg);
             t.printStackTrace();
             // System.err.println(msg);
@@ -1212,7 +1313,8 @@ public class GLProfile {
             return null != GLProfile.getDefault(device);
         }
 
-        boolean addedAnyProfile = false;
+        boolean addedDesktopProfile = false;
+        boolean addedEGLProfile = false;
 
         if( hasDesktopGL && desktopFactory.getIsDeviceCompatible(device)) {
             // 1st pretend we have all Desktop and EGL profiles ..
@@ -1222,7 +1324,7 @@ public class GLProfile {
             // hence querying all available GLProfiles
             boolean desktopSharedCtxAvail = desktopFactory.getIsSharedContextAvailable(device);
             if (DEBUG) {
-                System.err.println("GLProfile.initProfilesForDevice: "+device.getConnection()+": desktop Shared Ctx "+desktopSharedCtxAvail);
+                System.err.println("GLProfile.initProfilesForDevice: "+device+": desktop Shared Ctx "+desktopSharedCtxAvail);
             }
             if( null == GLContext.getAvailableGLVersion(device, 2, GLContext.CTX_PROFILE_COMPAT) ) {
                 // nobody yet set the available desktop versions, see {@link GLContextImpl#makeCurrent},
@@ -1231,15 +1333,8 @@ public class GLProfile {
                                                 2, GLContext.CTX_PROFILE_COMPAT,
                                                 1, 5, GLContext.CTX_PROFILE_COMPAT|GLContext.CTX_OPTION_ANY);
             }
-            computeProfileMap(device, false /* desktopCtxUndef*/, false /* eglCtxUndef */);
-            addedAnyProfile = null != GLProfile.getDefault(device);
-        } else {
-            if(DEBUG) {
-                System.err.println("GLProfile: DesktopFactory - Device is not available: "+device.getConnection());
-            }
-        }
-
-        if( null!=eglFactory && ( hasGLES2Impl || hasGLES1Impl ) && eglFactory.getIsDeviceCompatible(device)) {
+            addedDesktopProfile = computeProfileMap(device, false /* desktopCtxUndef*/, false /* eglCtxUndef */);
+        } else if( null!=eglFactory && ( hasGLES2Impl || hasGLES1Impl ) && eglFactory.getIsDeviceCompatible(device)) {
             // 1st pretend we have all EGL profiles ..
             computeProfileMap(device, false /* desktopCtxUndef*/, true /* eglCtxUndef */);
 
@@ -1247,7 +1342,7 @@ public class GLProfile {
             // hence querying all available GLProfiles
             boolean eglSharedCtxAvail = eglFactory.getIsSharedContextAvailable(device);
             if (DEBUG) {
-                System.err.println("GLProfile.initProfilesForDevice: "+device.getConnection()+": egl Shared Ctx "+eglSharedCtxAvail);
+                System.err.println("GLProfile.initProfilesForDevice: "+device+": egl Shared Ctx "+eglSharedCtxAvail);
             }
             if(hasGLES2Impl && null == GLContext.getAvailableGLVersion(device, 2, GLContext.CTX_PROFILE_ES) ) {
                 // nobody yet set the available desktop versions, see {@link GLContextImpl#makeCurrent},
@@ -1263,23 +1358,52 @@ public class GLProfile {
                                                 1, GLContext.CTX_PROFILE_ES,
                                                 1, 0, GLContext.CTX_PROFILE_ES|GLContext.CTX_OPTION_ANY);
             }
-            computeProfileMap(device, false /* desktopCtxUndef*/, false /* eglCtxUndef */);
-            addedAnyProfile = addedAnyProfile || null != GLProfile.getDefault(device);
+            addedEGLProfile = computeProfileMap(device, false /* desktopCtxUndef*/, false /* eglCtxUndef */);
         } else {
+            setProfileMap(device, new HashMap()); // empty
             if(DEBUG) {
-                System.err.println("GLProfile: EGLFactory - Device is not available: "+device.getConnection());
+                System.err.println("GLProfile: EGLFactory - Device is not available: "+device);
             }
         }
+
         if(!GLContext.getAvailableGLVersionsSet(device)) {
             GLContext.setAvailableGLVersionsSet(device);
         }
 
         if (DEBUG) {
-            System.err.println("GLProfile.initProfilesForDevice: "+device.getConnection()+": added profile(s): "+addedAnyProfile);
+            System.err.println("GLProfile.initProfilesForDevice: "+device.getConnection()+": added profile(s): desktop "+addedDesktopProfile+", egl "+addedEGLProfile);
             System.err.println("GLProfile.initProfilesForDevice: "+device.getConnection()+": "+glAvailabilityToString(device));
+            if(addedDesktopProfile) {
+                dumpGLInfo(desktopFactory, device);
+                List/*<GLCapabilitiesImmutable>*/ availCaps = desktopFactory.getAvailableCapabilities(device);
+                for(int i=0; i<availCaps.size(); i++) {
+                    System.err.println(availCaps.get(i));
+                }
+            } else if(addedEGLProfile) {
+                dumpGLInfo(eglFactory, device);
+                List/*<GLCapabilitiesImmutable>*/ availCaps = eglFactory.getAvailableCapabilities(device);
+                for(int i=0; i<availCaps.size(); i++) {
+                    System.err.println(availCaps.get(i));
+                }
+            }
         }
 
-        return addedAnyProfile;
+        return addedDesktopProfile || addedEGLProfile;
+    }
+
+    private static void dumpGLInfo(GLDrawableFactoryImpl factory, AbstractGraphicsDevice device)  {
+        GLContext ctx = factory.getOrCreateSharedContext(device);
+        if(null != ctx) {
+            System.err.println("GLProfile.dumpGLInfo: "+ctx);
+            ctx.makeCurrent();
+            try {
+                System.err.println(JoglVersion.getGLInfo(ctx.getGL(), null));
+            } finally {
+                ctx.release();
+            }
+        } else {
+            System.err.println("GLProfile.dumpGLInfo: shared context n/a");
+        }
     }
 
     public static AbstractGraphicsDevice getDefaultDevice() {
@@ -1329,7 +1453,7 @@ public class GLProfile {
         sb.append("]");
     }
 
-    private static void computeProfileMap(AbstractGraphicsDevice device, boolean desktopCtxUndef, boolean eglCtxUndef) {
+    private static boolean computeProfileMap(AbstractGraphicsDevice device, boolean desktopCtxUndef, boolean eglCtxUndef) {
         if (DEBUG) {
             System.err.println("GLProfile.init map "+device.getConnection()+", desktopCtxUndef "+desktopCtxUndef+", eglCtxUndef "+eglCtxUndef);
         }
@@ -1360,6 +1484,7 @@ public class GLProfile {
             _mappedProfiles.put(GL_DEFAULT, defaultGLProfile);
         }
         setProfileMap(device, _mappedProfiles);
+        return _mappedProfiles.size() > 0;
     }
 
     /**
@@ -1430,11 +1555,11 @@ public class GLProfile {
              GL3bc.equals(profileImpl) ||
              GL3.equals(profileImpl)   ||
              GL2.equals(profileImpl) ) {
-            return "com.jogamp.opengl.impl.gl4.GL4bc";
+            return "jogamp.opengl.gl4.GL4bc";
         } else if(GLES1.equals(profileImpl) || GL2ES1.equals(profileImpl)) {
-            return "com.jogamp.opengl.impl.es1.GLES1";
+            return "jogamp.opengl.es1.GLES1";
         } else if(GLES2.equals(profileImpl) || GL2ES2.equals(profileImpl)) {
-            return "com.jogamp.opengl.impl.es2.GLES2";
+            return "jogamp.opengl.es2.GLES2";
         } else {
             throw new GLException("unsupported profile \"" + profileImpl + "\"");
         }
@@ -1459,11 +1584,10 @@ public class GLProfile {
         String deviceKey = device.getUniqueID();
         HashMap map = (HashMap) deviceConn2ProfileMap.get(deviceKey);
         if(null==map) {
-            map = new HashMap();
-            synchronized ( deviceConn2ProfileMap ) {
-                deviceConn2ProfileMap.put(deviceKey, map);
-            }
             initProfilesForDevice(device);
+            if( null == deviceConn2ProfileMap.get(deviceKey) ) {
+                throw new InternalError("initProfilesForDevice(..) didn't issue setProfileMap(..) on "+device);
+            }
         }
         return map;
     }
diff --git a/src/jogl/classes/javax/media/opengl/Threading.java b/src/jogl/classes/javax/media/opengl/Threading.java
index e58792b..d0f3ebb 100644
--- a/src/jogl/classes/javax/media/opengl/Threading.java
+++ b/src/jogl/classes/javax/media/opengl/Threading.java
@@ -39,7 +39,7 @@
 
 package javax.media.opengl;
 
-import com.jogamp.opengl.impl.*;
+import jogamp.opengl.*;
 
 /** This API provides access to the threading model for the implementation of 
     the classes in this package.
diff --git a/src/jogl/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java
index d92cec3..d1e725b 100644
--- a/src/jogl/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java
@@ -40,7 +40,6 @@
 package javax.media.opengl.awt;
 
 import javax.media.opengl.*;
-import javax.media.opengl.glu.*;
 
 public interface AWTGLAutoDrawable extends GLAutoDrawable, ComponentEvents {
   /** Requests a new width and height for this AWTGLAutoDrawable. */
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index b2d919e..086a173 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -40,63 +40,127 @@
 
 package javax.media.opengl.awt;
 
-import com.jogamp.common.GlueGenVersion;
-import com.jogamp.common.util.VersionUtil;
-import com.jogamp.nativewindow.NativeWindowVersion;
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.awt.*;
-
-import com.jogamp.opengl.impl.*;
-import com.jogamp.opengl.JoglVersion;
+import java.beans.Beans;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 import java.awt.Canvas;
 import java.awt.Color;
-import java.awt.Component;
 import java.awt.FontMetrics;
 import java.awt.Frame;
 import java.awt.Graphics;
 import java.awt.GraphicsConfiguration;
 import java.awt.GraphicsDevice;
-import java.awt.Window;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.geom.*;
-import java.beans.*;
-import java.lang.reflect.*;
-import java.security.*;
+import java.awt.geom.Rectangle2D;
+
+import java.awt.EventQueue;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.media.nativewindow.WindowClosingProtocol;
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.nativewindow.awt.AWTGraphicsConfiguration;
+import javax.media.nativewindow.awt.AWTGraphicsDevice;
+import javax.media.nativewindow.awt.AWTGraphicsScreen;
+import javax.media.nativewindow.awt.AWTWindowClosingProtocol;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GLAnimatorControl;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawable;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLRunnable;
+import javax.media.opengl.Threading;
+
+import com.jogamp.nativewindow.NativeWindowVersion;
+import com.jogamp.common.GlueGenVersion;
+import com.jogamp.common.util.VersionUtil;
+import com.jogamp.opengl.JoglVersion;
+
+import com.jogamp.common.util.locks.RecursiveLock;
+import jogamp.opengl.Debug;
+import jogamp.opengl.GLContextImpl;
+import jogamp.opengl.GLDrawableHelper;
+import jogamp.opengl.ThreadingImpl;
 
 // FIXME: Subclasses need to call resetGLFunctionAvailability() on their
 // context whenever the displayChanged() function is called on our
 // GLEventListeners
 
 /** A heavyweight AWT component which provides OpenGL rendering
-    support. This is the primary implementation of {@link GLDrawable};
+    support. This is the primary implementation of an AWT {@link GLDrawable};
     {@link GLJPanel} is provided for compatibility with Swing user
     interfaces when adding a heavyweight doesn't work either because
-    of Z-ordering or LayoutManager problems. */
+    of Z-ordering or LayoutManager problems.
+ *
+ * <h5><A NAME="java2dgl">Java2D OpenGL Remarks</A></h5>
+ *
+ * To avoid any conflicts with a potential Java2D OpenGL context,<br>
+ * you shall consider setting the following JVM properties:<br>
+ * <ul>
+ *    <li><pre>sun.java2d.opengl=false</pre></li>
+ *    <li><pre>sun.java2d.noddraw=true</pre></li>
+ * </ul>
+ * This is especially true in case you want to utilize a GLProfile other than
+ * {@link GLProfile#GL2}, eg. using {@link GLProfile#getMaxFixedFunc()}.<br>
+ * On the other hand, if you like to experiment with GLJPanel's utilization
+ * of Java2D's OpenGL pipeline, you have to set them to
+ * <ul>
+ *    <li><pre>sun.java2d.opengl=true</pre></li>
+ *    <li><pre>sun.java2d.noddraw=true</pre></li>
+ * </ul>
+ *
+ * <h5><A NAME="backgrounderase">Disable Background Erase</A></h5>
+ *
+ * GLCanvas tries to disable background erase for the AWT Canvas
+ * before native peer creation (X11) and after it (Windows), <br>
+ * utilizing the optional {@link java.awt.Toolkit} method <code>disableBeackgroundErase(java.awt.Canvas)</code>.<br>
+ * However if this does not give you the desired results, you may want to disable AWT background erase in general:
+ * <ul>
+ *   <li><pre>sun.awt.noerasebackground=true</pre></li>
+ * </ul>
+ */
 
-public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
+public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosingProtocol {
 
   private static final boolean DEBUG;
-  private static final GLProfile defaultGLProfile;
 
   static {
       DEBUG = Debug.debug("GLCanvas");
-      defaultGLProfile = GLProfile.getDefault(GLProfile.getDefaultDesktopDevice());
   }
 
-  private GLProfile glProfile;
   private GLDrawableHelper drawableHelper = new GLDrawableHelper();
-  private GraphicsConfiguration chosen;
   private AWTGraphicsConfiguration awtConfig;
   private GLDrawable drawable;
   private GLContextImpl context;
   private boolean sendReshape = false;
   
-  // copy of the cstr args ..
+  // copy of the cstr args, mainly for recreation
+  private GLCapabilitiesImmutable capsReqUser;
   private GLCapabilitiesChooser chooser;
-  private GLContext shareWith;
+  private GLContext shareWith;  
+  private GraphicsDevice device;
+
+  private AWTWindowClosingProtocol awtWindowClosingProtocol =
+          new AWTWindowClosingProtocol(this, new Runnable() {
+                public void run() {
+                    GLCanvas.this.destroy();
+                }
+            });
 
   /** Creates a new GLCanvas component with a default set of OpenGL
       capabilities, using the default OpenGL capabilities selection
@@ -107,11 +171,24 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
 
   /** Creates a new GLCanvas component with the requested set of
       OpenGL capabilities, using the default OpenGL capabilities
-      selection mechanism, on the default screen device. */
+      selection mechanism, on the default screen device. 
+   * @see GLCanvas#GLCanvas(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, javax.media.opengl.GLContext, java.awt.GraphicsDevice)
+   */
   public GLCanvas(GLCapabilitiesImmutable capsReqUser) {
     this(capsReqUser, null, null, null);
   }
 
+  /** Creates a new GLCanvas component with the requested set of
+      OpenGL capabilities, using the default OpenGL capabilities
+      selection mechanism, on the default screen device.
+   *  This constructor variant also supports using a shared GLContext.
+   *
+   * @see GLCanvas#GLCanvas(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, javax.media.opengl.GLContext, java.awt.GraphicsDevice)
+   */
+  public GLCanvas(GLCapabilitiesImmutable capsReqUser, GLContext shareWith) {
+    this(capsReqUser, null, shareWith, null);
+  }
+
   /** Creates a new GLCanvas component. The passed GLCapabilities
       specifies the OpenGL capabilities for the component; if null, a
       default set of capabilities is used. The GLCapabilitiesChooser
@@ -141,7 +218,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
     super();
 
     if(null==capsReqUser) {
-        capsReqUser = new GLCapabilities(defaultGLProfile);
+        capsReqUser = new GLCapabilities(GLProfile.getDefault(GLProfile.getDefaultDesktopDevice()));
     } else {
         // don't allow the user to change data
         capsReqUser = (GLCapabilitiesImmutable) capsReqUser.cloneMutable();
@@ -154,58 +231,18 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
         }
     }
 
-    this.glProfile = capsReqUser.getGLProfile();
+    // instantiation will be issued in addNotify()
+    this.capsReqUser = capsReqUser;
     this.chooser = chooser;
     this.shareWith = shareWith;
-
-    /*
-     * Save the 'chosen' GraphicsConfiguration for use in getGraphicsConfiguration().
-     */
-    awtConfig = chooseGraphicsConfiguration(capsReqUser, capsReqUser, chooser, device);
-    if(null==awtConfig) {
-        throw new GLException("Error: NULL AWTGraphicsConfiguration");
-    }
-    chosen = awtConfig.getGraphicsConfiguration();
-
-    if (!Beans.isDesignTime()) {
-        // no lock required, since this resource ain't available yet
-        drawable = GLDrawableFactory.getFactory(glProfile).createGLDrawable(NativeWindowFactory.getNativeWindow(this, awtConfig));
-        context = (GLContextImpl) drawable.createContext(shareWith);
-        context.setSynchronized(true);
-    }
-  }
-
-  protected interface DestroyMethod {
-    public void destroyMethod();
-  }
-
-  protected final static Object addClosingListener(Component c, final DestroyMethod d) {
-    WindowAdapter cl = null;
-    Window w = getWindow(c);
-    if(null!=w) {
-        cl = new WindowAdapter() {
-                public void windowClosing(WindowEvent e) {
-                  // we have to issue this call rigth away,
-                  // otherwise the window gets destroyed
-                  d.destroyMethod();
-                }
-            };
-        w.addWindowListener(cl);
-    }
-    return cl;
-  }
-
-  protected final static Window getWindow(Component c) {
-    while ( c!=null && ! ( c instanceof Window ) ) {
-        c = c.getParent();
-    }
-    return (Window)c;
+    this.device = device;
   }
 
   /**
    * Overridden to choose a GraphicsConfiguration on a parent container's
    * GraphicsDevice because both devices
    */
+    @Override
   public GraphicsConfiguration getGraphicsConfiguration() {
     /*
      * Workaround for problems with Xinerama and java.awt.Component.checkGD
@@ -230,6 +267,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
      * otherwise it is from an ancestor component that this Canvas is being
      * added to, and we go into this block.
      */
+    GraphicsConfiguration chosen =  awtConfig.getGraphicsConfiguration();
+
     if (gc != null && chosen != null && !chosen.equals(gc)) {
       /*
        * Check for compatibility with gc. If they differ by only the
@@ -311,85 +350,100 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
   }
   
   public GLContext createContext(GLContext shareWith) {
-    return drawable.createContext(shareWith);
+      drawableSync.lock();
+      try {
+        return (null != drawable) ? drawable.createContext(shareWith) : null;
+      } finally {
+        drawableSync.unlock();
+      }
   }
 
   public void setRealized(boolean realized) {
   }
 
   public boolean isRealized() {
-    return ( null != drawable ) ? drawable.isRealized() : false;
+      drawableSync.lock();
+      try {
+        return ( null != drawable ) ? drawable.isRealized() : false;
+      } finally {
+        drawableSync.unlock();
+      }
+  }
+
+  public int getDefaultCloseOperation() {
+      return awtWindowClosingProtocol.getDefaultCloseOperation();
   }
 
-  private Object closingListener = null;
-  private Object closingListenerLock = new Object();
+  public int setDefaultCloseOperation(int op) {
+      return awtWindowClosingProtocol.setDefaultCloseOperation(op);
+  }
 
   public void display() {
-    if(!drawable.isRealized()) {
+    if( !validateGLDrawable() ) {
+        if(DEBUG) {
+            System.err.println("Info: GLCanvas display - skipped GL render, drawable not valid yet");
+        }
         return; // not yet available ..
     }
     maybeDoSingleThreadedWorkaround(displayOnEventDispatchThreadAction,
                                     displayAction);
-    if(null==closingListener) {
-      synchronized(closingListenerLock) {
-        if(null==closingListener) {
-            closingListener=addClosingListener(this, new DestroyMethod() { 
-                        public void destroyMethod() { destroy(); } });
-        }
-      }
-    }
+
+    awtWindowClosingProtocol.addClosingListenerOneShot();
   }
 
-  protected void dispose(boolean regenerate) {
-    if(DEBUG) {
-        Exception ex1 = new Exception("Info: dispose("+regenerate+") - start");
-        ex1.printStackTrace();
-    }
+  private void dispose(boolean regenerate) {
+    drawableSync.lock();
+    try {
+        if(DEBUG) {
+            Exception ex1 = new Exception("Info: dispose("+regenerate+") - start, hasContext " +
+                    (null!=context) + ", hasDrawable " + (null!=drawable));
+            ex1.printStackTrace();
+        }
 
-    if(null!=context) {
-        boolean animatorPaused = false;
-        GLAnimatorControl animator =  getAnimator();
-        if(null!=animator) {
-            if(regenerate) {
+        if(null!=context) {
+            boolean animatorPaused = false;
+            GLAnimatorControl animator =  getAnimator();
+            if(null!=animator) {
+                // can't remove us from animator for recreational addNotify()
                 animatorPaused = animator.pause();
-            } else {
-                animator.remove(this);
             }
-        }
 
-        disposeRegenerate=regenerate;
-
-        if (Threading.isSingleThreaded() &&
-            !Threading.isOpenGLThread()) {
-          // Workaround for termination issues with applets --
-          // sun.applet.AppletPanel should probably be performing the
-          // remove() call on the EDT rather than on its own thread
-          // Hint: User should run remove from EDT.
-          if (ThreadingImpl.isAWTMode() &&
-              Thread.holdsLock(getTreeLock())) {
-            // The user really should not be invoking remove() from this
-            // thread -- but since he/she is, we can not go over to the
-            // EDT at this point. Try to destroy the context from here.
-            if(context.isCreated()) {
-                drawableHelper.invokeGL(drawable, context, disposeAction, null);
+            disposeRegenerate=regenerate;
+
+            if (Threading.isSingleThreaded() &&
+                !Threading.isOpenGLThread()) {
+              // Workaround for termination issues with applets --
+              // sun.applet.AppletPanel should probably be performing the
+              // remove() call on the EDT rather than on its own thread
+              // Hint: User should run remove from EDT.
+              if (ThreadingImpl.isAWTMode() &&
+                  Thread.holdsLock(getTreeLock())) {
+                // The user really should not be invoking remove() from this
+                // thread -- but since he/she is, we can not go over to the
+                // EDT at this point. Try to destroy the context from here.
+                if(context.isCreated()) {
+                    drawableHelper.invokeGL(drawable, context, disposeAction, null);
+                }
+              } else if(context.isCreated()) {
+                Threading.invokeOnOpenGLThread(disposeOnEventDispatchThreadAction);
+              }
+            } else if(context.isCreated()) {
+              drawableHelper.invokeGL(drawable, context, disposeAction, null);
             }
-          } else if(context.isCreated()) {
-            Threading.invokeOnOpenGLThread(disposeOnEventDispatchThreadAction);
-          }
-        } else if(context.isCreated()) {
-          drawableHelper.invokeGL(drawable, context, disposeAction, null);
-        }
 
-        if(animatorPaused) {
-            animator.resume();
+            if(animatorPaused) {
+                animator.resume();
+            }
+        }
+        if(!regenerate) {
+            disposeAbstractGraphicsDevice();
         }
-    }
-    if(!regenerate) {
-        disposeAbstractGraphicsDeviceAction.run();
-    }
 
-    if(DEBUG) {
-        System.err.println("dispose("+regenerate+") - stop");
+        if(DEBUG) {
+            System.err.println("dispose("+regenerate+") - stop");
+        }
+    } finally {
+        drawableSync.unlock();
     }
   }
 
@@ -407,6 +461,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
 
       <B>Overrides:</B>
       <DL><DD><CODE>paint</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+    @Override
   public void paint(Graphics g) {
     if (Beans.isDesignTime()) {
       // Make GLCanvas behave better in NetBeans GUI builder
@@ -433,6 +488,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
     }
   }
 
+  RecursiveLock drawableSync = new RecursiveLock();
+
   /** Overridden to track when this component is added to a container.
       Subclasses which override this method must call
       super.addNotify() in their addNotify() method in order to
@@ -440,28 +497,81 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
 
       <B>Overrides:</B>
       <DL><DD><CODE>addNotify</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+    @Override
   public void addNotify() {
     if(DEBUG) {
-        Exception ex1 = new Exception(Thread.currentThread().getName()+" - Info: addNotify - start");
+        Exception ex1 = new Exception(Thread.currentThread().getName()+" - Info: addNotify - start, bounds: "+this.getBounds());
         ex1.printStackTrace();
     }
-    // 'super.addNotify()' determines the GraphicsConfiguration,
-    // while calling this class's overriden 'getGraphicsConfiguration()' method.
-    // Then it creates the native peer.
-    // Hence we chose the proper GraphicsConfiguration beforehand (see constructor).
-    super.addNotify();
 
-    if (!Beans.isDesignTime()) {
-        // no lock required, since this resource ain't available yet
+    drawableSync.lock();
+    try {
+        /**
+         * 'super.addNotify()' determines the GraphicsConfiguration,
+         * while calling this class's overriden 'getGraphicsConfiguration()' method
+         * after which it creates the native peer.
+         * Hence we have to set the 'awtConfig' before since it's GraphicsConfiguration
+         * is being used in getGraphicsConfiguration().
+         * This code order also allows recreation, ie re-adding the GLCanvas.
+         */
+        awtConfig = chooseGraphicsConfiguration(capsReqUser, capsReqUser, chooser, device);
+        if(null==awtConfig) {
+            throw new GLException("Error: NULL AWTGraphicsConfiguration");
+        }
+
+        if (!Beans.isDesignTime()) {
+            // no lock required, since this resource ain't available yet
+            drawable = GLDrawableFactory.getFactory(capsReqUser.getGLProfile())
+                           .createGLDrawable(NativeWindowFactory.getNativeWindow(this, awtConfig));
+            context = (GLContextImpl) drawable.createContext(shareWith);
+            context.setSynchronized(true);
+        }
+
+        // before native peer is valid: X11
+        disableBackgroundErase();
+
+        // issues getGraphicsConfiguration() and creates the native peer
+        super.addNotify();
+
+        // after native peer is valid: Windows
         disableBackgroundErase();
-        drawable.setRealized(true);
+
+        // init drawable by paint/display makes the init sequence more equal
+        // for all launch flavors (applet/javaws/..)
+        // validateGLDrawable();
+
         if(DEBUG) {
-            System.err.println(Thread.currentThread().getName()+" - Realized Drawable: "+drawable);
+            System.err.println(Thread.currentThread().getName()+" - Info: addNotify - end: peer: "+getPeer());
         }
+    } finally {
+       drawableSync.unlock();
     }
-    if(DEBUG) {
-        System.err.println(Thread.currentThread().getName()+" - Info: addNotify - end");
+  }
+
+  private boolean validateGLDrawable() {
+    boolean realized = false;
+    if (!Beans.isDesignTime()) {
+        drawableSync.lock();
+        try {
+            if ( null != drawable ) {
+                realized = drawable.isRealized();
+                if ( !realized && 0 < drawable.getWidth() * drawable.getHeight() ) {
+                    drawable.setRealized(true);
+                    realized = true;
+                    sendReshape=true; // ensure a reshape is being send ..
+                    if(DEBUG) {
+                        String msg = Thread.currentThread().getName()+" - Realized Drawable: "+drawable.toString();
+                        // System.err.println(msg);
+                        Throwable t = new Throwable(msg);
+                        t.printStackTrace();
+                    }
+                }
+            }
+        } finally {
+           drawableSync.unlock();
+        }
     }
+    return realized;
   }
 
   /** <p>Overridden to track when this component is removed from a
@@ -472,24 +582,31 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
       about this.</p>
       <B>Overrides:</B>
       <DL><DD><CODE>removeNotify</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+    @Override
   public void removeNotify() {
     if(DEBUG) {
         Exception ex1 = new Exception(Thread.currentThread().getName()+" - Info: removeNotify - start");
         ex1.printStackTrace();
     }
 
+    awtWindowClosingProtocol.removeClosingListener();
+
     if (Beans.isDesignTime()) {
       super.removeNotify();
     } else {
+      drawableSync.lock();
       try {
         dispose(false);
       } finally {
+        context=null;
         drawable=null;
+        awtConfig=null;
         super.removeNotify();
+        drawableSync.unlock();
       }
     }
     if(DEBUG) {
-        System.err.println(Thread.currentThread().getName()+" - Info: removeNotify - end");
+        System.err.println(Thread.currentThread().getName()+" - Info: removeNotify - end, peer: "+getPeer());
     }
   }
 
@@ -500,6 +617,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
 
       <B>Overrides:</B>
       <DL><DD><CODE>reshape</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+    @Override
   public void reshape(int x, int y, int width, int height) {
     super.reshape(x, y, width, height);
     sendReshape = true;
@@ -507,8 +625,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
 
   /** <B>Overrides:</B>
       <DL><DD><CODE>update</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
-  // Overridden from Canvas to prevent the AWT's clearing of the
-  // canvas from interfering with the OpenGL rendering.
+  /** 
+   * Overridden from Canvas to prevent the AWT's clearing of the
+   * canvas from interfering with the OpenGL rendering.
+   */
+    @Override
   public void update(Graphics g) {
     paint(g);
   }
@@ -549,14 +670,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
     if (Beans.isDesignTime()) {
       return null;
     }
-    GLContext context = getContext();
-    return (context == null) ? null : context.getGL();
+    GLContext ctx = getContext();
+    return (ctx == null) ? null : ctx.getGL();
   }
 
   public GL setGL(GL gl) {
-    GLContext context = getContext();
-    if (context != null) {
-      context.setGL(gl);
+    GLContext ctx = getContext();
+    if (ctx != null) {
+      ctx.setGL(gl);
       return gl;
     }
     return null;
@@ -576,7 +697,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
   }
 
   public GLProfile getGLProfile() {
-    return glProfile;
+    return capsReqUser.getGLProfile();
   }
 
   public GLCapabilitiesImmutable getChosenGLCapabilities() {
@@ -596,21 +717,45 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
   }
 
   public NativeSurface getNativeSurface() {
-    return drawable.getNativeSurface();
+      drawableSync.lock();
+      try {
+        return (null != drawable) ? drawable.getNativeSurface() : null;
+      } finally {
+        drawableSync.unlock();
+      }
   }
 
   public long getHandle() {
-    return drawable.getHandle();
+      drawableSync.lock();
+      try {
+        return (null != drawable) ? drawable.getHandle() : 0;
+      } finally {
+        drawableSync.unlock();
+      }
   }
 
   public GLDrawableFactory getFactory() {
-    return drawable.getFactory();
+      drawableSync.lock();
+      try {
+        return (null != drawable) ? drawable.getFactory() : null;
+      } finally {
+        drawableSync.unlock();
+      }
   }
 
+  @Override
   public String toString() {
-    return "AWT-GLCanvas[ "+awtConfig+", "+((null!=drawable)?drawable.getClass().getName():"null-drawable")+"]";
+    return "AWT-GLCanvas[Realized "+isRealized()+
+                          ",\n\t"+((null!=drawable)?drawable.getClass().getName():"null-drawable")+                         
+                          ",\n\tRealized "+isRealized()+
+                          ",\n\tFactory   "+getFactory()+
+                          ",\n\thandle    0x"+Long.toHexString(getHandle())+
+                          ",\n\tDrawable size "+drawable.getWidth()+"x"+drawable.getHeight()+
+                          ",\n\tAWT pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+
+                          ",\n\tvisible "+isVisible()+
+                          ",\n\t"+awtConfig+"]";
   }
-
+  
   //----------------------------------------------------------------------
   // Internals only below this point
   //
@@ -637,11 +782,13 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
 
       if(null!=drawable) {
           drawable.setRealized(false);
+          drawable=null;
       }
 
       if(disposeRegenerate) {
           // recreate GLDrawable to reflect it's new graphics configuration
-          drawable = GLDrawableFactory.getFactory(glProfile).createGLDrawable(NativeWindowFactory.getNativeWindow(GLCanvas.this, awtConfig));
+          drawable = GLDrawableFactory.getFactory(capsReqUser.getGLProfile())
+                        .createGLDrawable(NativeWindowFactory.getNativeWindow(GLCanvas.this, awtConfig));
           if(DEBUG) {
             System.err.println("GLCanvas.dispose(true): new drawable: "+drawable);
           }
@@ -676,12 +823,33 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
           }
           boolean closed = adevice.close();
           if(DEBUG) {
-            System.err.println("GLCanvas.dispose(false): closed GraphicsDevice: "+adeviceMsg+", result: "+closed);
+            System.err.println(Thread.currentThread().getName() + " - GLCanvas.dispose(false): closed GraphicsDevice: "+adeviceMsg+", result: "+closed);
           }
       }
+      awtConfig=null;
+    }
+  }
+  private DisposeAbstractGraphicsDeviceAction disposeAbstractGraphicsDeviceAction = new DisposeAbstractGraphicsDeviceAction();
+
+  /**
+   * Disposes the AbstractGraphicsDevice within EDT,
+   * since resources created (X11: Display), must be destroyed in the same thread, where they have been created.
+   *
+   * @see #chooseGraphicsConfiguration(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, java.awt.GraphicsDevice)
+   */
+  void disposeAbstractGraphicsDevice()  {
+    if( EventQueue.isDispatchThread() || Thread.holdsLock(getTreeLock()) ) {
+        disposeAbstractGraphicsDeviceAction.run();
+    } else {
+        try {
+            EventQueue.invokeAndWait(disposeAbstractGraphicsDeviceAction);
+        } catch (InvocationTargetException e) {
+            throw new GLException(e.getTargetException());
+        } catch (InterruptedException e) {
+            throw new GLException(e);
+        }
     }
   }
-  DisposeAbstractGraphicsDeviceAction disposeAbstractGraphicsDeviceAction = new DisposeAbstractGraphicsDeviceAction();
 
   class InitAction implements Runnable {
     public void run() {
@@ -693,6 +861,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
   class DisplayAction implements Runnable {
     public void run() {
       if (sendReshape) {
+        if(DEBUG) {
+            System.err.println(Thread.currentThread().getName()+" - reshape: "+getWidth()+"x"+getHeight());
+        }
         // Note: we ignore the given x and y within the parent component
         // since we are drawing directly into this heavyweight component.
         drawableHelper.reshape(GLCanvas.this, 0, 0, getWidth(), getHeight());
@@ -761,31 +932,73 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
       } catch (Exception e) {
       }
       disableBackgroundEraseInitialized = true;
+      if(DEBUG) {
+        System.err.println("GLCanvas: TK disableBackgroundErase method found: "+
+                (null!=disableBackgroundEraseMethod));
+      }
     }
     if (disableBackgroundEraseMethod != null) {
+      Throwable t=null;
       try {
         disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
       } catch (Exception e) {
-        // FIXME: workaround for 6504460 (incorrect backport of 6333613 in 5.0u10)
-        // throw new GLException(e);
+        t = e;
+      }
+      if(DEBUG) {
+        System.err.println("GLCanvas: TK disableBackgroundErase error: "+t);
       }
     }
   }
 
-  private static AWTGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilitiesImmutable capsChosen,
-                                                                      GLCapabilitiesImmutable capsRequested,
-                                                                      GLCapabilitiesChooser chooser,
-                                                                      GraphicsDevice device) {
+  /**
+   * Issues the GraphicsConfigurationFactory's choosing facility within EDT,
+   * since resources created (X11: Display), must be destroyed in the same thread, where they have been created.
+   *
+   * @param capsChosen
+   * @param capsRequested
+   * @param chooser
+   * @param device
+   * @return the chosen AWTGraphicsConfiguration
+   *
+   * @see #disposeAbstractGraphicsDevice()
+   */
+  private AWTGraphicsConfiguration chooseGraphicsConfiguration(final GLCapabilitiesImmutable capsChosen,
+                                                               final GLCapabilitiesImmutable capsRequested,
+                                                               final GLCapabilitiesChooser chooser,
+                                                               final GraphicsDevice device) {
     // Make GLCanvas behave better in NetBeans GUI builder
     if (Beans.isDesignTime()) {
       return null;
     }
 
-    AbstractGraphicsScreen aScreen = AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT);
-    AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
-          GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(capsChosen,
-                                                                                                       capsRequested,
-                                                                                                       chooser, aScreen);
+    final AbstractGraphicsScreen aScreen = AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT);
+    AWTGraphicsConfiguration config = null;
+
+    if( EventQueue.isDispatchThread() || Thread.holdsLock(getTreeLock()) ) {
+        config = (AWTGraphicsConfiguration)
+                GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(capsChosen,
+                                                                                                             capsRequested,
+                                                                                                             chooser, aScreen);
+    } else {
+        try {
+            final ArrayList bucket = new ArrayList(1);
+            EventQueue.invokeAndWait(new Runnable() {
+                public void run() {
+                    AWTGraphicsConfiguration c = (AWTGraphicsConfiguration)
+                            GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(capsChosen,
+                                                                                                                         capsRequested,
+                                                                                                                         chooser, aScreen);
+                    bucket.add(c);
+                }
+            });
+            config = ( bucket.size() > 0 ) ? (AWTGraphicsConfiguration)bucket.get(0) : null ;
+        } catch (InvocationTargetException e) {
+            throw new GLException(e.getTargetException());
+        } catch (InterruptedException e) {
+            throw new GLException(e);
+        }
+    }
+
     if (config == null) {
       throw new GLException("Error: Couldn't fetch AWTGraphicsConfiguration");
     }
@@ -800,7 +1013,13 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
     System.err.println(VersionUtil.getPlatformInfo());
     System.err.println(GlueGenVersion.getInstance());
     System.err.println(NativeWindowVersion.getInstance());
-    System.err.print(JoglVersion.getInstance());
+    System.err.println(JoglVersion.getInstance());
+
+    GLDrawableFactory factory = GLDrawableFactory.getDesktopFactory();
+    List/*<GLCapabilitiesImmutable>*/ availCaps = factory.getAvailableCapabilities(null);
+    for(int i=0; i<availCaps.size(); i++) {
+        System.err.println(availCaps.get(i));
+    }
 
     GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault(GLProfile.getDefaultDesktopDevice()) );
     Frame frame = new Frame("JOGL AWT Test");
@@ -812,7 +1031,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
     glCanvas.addGLEventListener(new GLEventListener() {
         public void init(GLAutoDrawable drawable) {
             GL gl = drawable.getGL();
-            System.err.println(JoglVersion.getInstance().toString(gl));
+            System.err.println(JoglVersion.getGLInfo(gl, null));
         }
 
         public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index c69603e..d58ad03 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -40,19 +40,57 @@
 
 package javax.media.opengl.awt;
 
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-
-import java.awt.*;
-import java.awt.geom.*;
-import java.awt.image.*;
-import java.beans.*;
-import java.nio.*;
-import java.security.*;
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+import java.beans.Beans;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+
+import java.awt.Color;
+import java.awt.EventQueue;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.Rectangle;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.awt.image.DataBufferByte;
+import java.awt.image.DataBufferInt;
 import javax.swing.JPanel;
+
+import javax.media.nativewindow.WindowClosingProtocol;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.awt.AWTWindowClosingProtocol;
+
+import javax.media.opengl.DefaultGLCapabilitiesChooser;
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
+import javax.media.opengl.GLAnimatorControl;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawable;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLPbuffer;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLRunnable;
+import javax.media.opengl.Threading;
 import com.jogamp.opengl.util.FBObject;
-import com.jogamp.opengl.impl.*;
-import com.jogamp.opengl.impl.awt.*;
+import jogamp.opengl.Debug;
+import jogamp.opengl.GLContextImpl;
+import jogamp.opengl.GLDrawableFactoryImpl;
+import jogamp.opengl.GLDrawableHelper;
+import jogamp.opengl.GLDrawableImpl;
+import jogamp.opengl.ThreadingImpl;
+import jogamp.opengl.awt.Java2D;
+import jogamp.opengl.awt.Java2DGLContext;
 
 // FIXME: Subclasses need to call resetGLFunctionAvailability() on their
 // context whenever the displayChanged() function is called on their
@@ -61,13 +99,13 @@ import com.jogamp.opengl.impl.awt.*;
 /** A lightweight Swing component which provides OpenGL rendering
     support. Provided for compatibility with Swing user interfaces
     when adding a heavyweight doesn't work either because of
-    Z-ordering or LayoutManager problems. <P>
-
+    Z-ordering or LayoutManager problems.
+    <P>
     The GLJPanel can be made transparent by creating it with a
     GLCapabilities object with alpha bits specified and calling {@link
     #setOpaque}(false). Pixels with resulting OpenGL alpha values less
-    than 1.0 will be overlaid on any underlying Swing rendering. <P>
-
+    than 1.0 will be overlaid on any underlying Swing rendering. </P>
+    <P>
     Notes specific to the Reference Implementation: This component 
     attempts to use hardware-accelerated rendering via pbuffers and 
     falls back on to software rendering if problems occur. 
@@ -79,11 +117,13 @@ import com.jogamp.opengl.impl.awt.*;
     This behavior is correct, as the textures and display lists for
     the GLJPanel will have been lost during the resize operation. The
     application should attempt to make its GLEventListener.init()
-    methods as side-effect-free as possible. <P>
-
+    methods as side-effect-free as possible. </P>
+    <P>
+ *  Please read <A HREF="GLCanvas.html#java2dgl">Java2D OpenGL Remarks</A>.
+ *  </P>
 */
 
-public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
+public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosingProtocol {
   private static final boolean DEBUG = Debug.debug("GLJPanel");
   private static final boolean VERBOSE = Debug.verbose();
 
@@ -127,8 +167,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
     !Debug.isPropertyDefined("jogl.gljpanel.noogl", true, localACC);
 
   // For handling reshape events lazily
-  private int reshapeX;
-  private int reshapeY;
+  // private int reshapeX;
+  // private int reshapeY;
   private int reshapeWidth;
   private int reshapeHeight;
 
@@ -137,6 +177,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
   private int viewportX;
   private int viewportY;
 
+  private AWTWindowClosingProtocol awtWindowClosingProtocol =
+          new AWTWindowClosingProtocol(this, new Runnable() {
+                public void run() {
+                    GLJPanel.this.destroy();
+                }
+            });
+
   static {
     // Force eager initialization of part of the Java2D class since
     // otherwise it's likely it will try to be initialized while on
@@ -253,6 +300,19 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
           drawableHelper.invokeGL(disposeDrawable, disposeContext, disposeAction, null);
       }
 
+      if(!regenerate) {
+          AbstractGraphicsDevice adevice = disposeDrawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice();
+          String adeviceMsg=null;
+          if(DEBUG) {
+            adeviceMsg = adevice.toString();
+          }
+          // boolean closed = adevice.close();
+          boolean closed = false;
+          if (DEBUG) {
+              System.err.println("GLJPanel.dispose(false): closed GraphicsDevice: " + adeviceMsg + ", result: " + closed);
+          }
+      }
+
       backend.setContext(disposeContext);
       if(null==disposeContext) {
         isInitialized = false;
@@ -350,6 +410,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
         Exception ex1 = new Exception("Info: removeNotify - start");
         ex1.printStackTrace();
     }
+
+    awtWindowClosingProtocol.removeClosingListener();
+
     dispose(false);
     if (backend != null) {
       backend.destroy();
@@ -372,8 +435,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
   public void reshape(int x, int y, int width, int height) {
     super.reshape(x, y, width, height);
 
-    reshapeX = x;
-    reshapeY = y;
+    // reshapeX = x;
+    // reshapeY = y;
     reshapeWidth = width;
     reshapeHeight = height;
     handleReshape = true;
@@ -558,17 +621,16 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
       // a different implementation -- try again
     } while (backend == null);
 
-    if(null==closingListener) {
-      synchronized(closingListenerLock) {
-        if(null==closingListener) {
-            closingListener=GLCanvas.addClosingListener(this, new GLCanvas.DestroyMethod() {
-                        public void destroyMethod() { destroy(); } });
-        }
-      }
-    }
+    awtWindowClosingProtocol.addClosingListenerOneShot();
+  }
+
+  public int getDefaultCloseOperation() {
+      return awtWindowClosingProtocol.getDefaultCloseOperation();
+  }
+
+  public int setDefaultCloseOperation(int op) {
+      return awtWindowClosingProtocol.setDefaultCloseOperation(op);
   }
-  private Object closingListener = null;
-  private Object closingListenerLock = new Object();
 
   private void handleReshape() {
     panelWidth  = reshapeWidth;
@@ -654,16 +716,6 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
                   disposeDrawable.setRealized(true);
                   disposeContext = (GLContextImpl) disposeDrawable.createContext(shareWith);
                   disposeContext.setSynchronized(true);
-              } else {
-                  AbstractGraphicsDevice adevice = disposeDrawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice();
-                  String adeviceMsg=null;
-                  if(DEBUG) {
-                    adeviceMsg = adevice.toString();
-                  }
-                  boolean closed = adevice.close();
-                  if (DEBUG) {
-                      System.err.println("GLJPanel.dispose(false): closed GraphicsDevice: " + adeviceMsg + ", result: " + closed);
-                  }
               }
           }
       }
@@ -964,6 +1016,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
     public void initialize() {
       // Fall-through path: create an offscreen context instead
       offscreenDrawable = (GLDrawableImpl) factory.createOffscreenDrawable(
+                                                null /* default platform device */,
                                                 offscreenCaps,
                                                 chooser,
                                                 Math.max(1, panelWidth),
@@ -1049,7 +1102,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
         throw new InternalError("Creating pbuffer twice without destroying it (memory leak / correctness bug)");
       }
       try {
-        pbuffer = factory.createGLPbuffer(offscreenCaps,
+        pbuffer = factory.createGLPbuffer(null /* default platform device */,
+                                          offscreenCaps,
                                           null,
                                           pbufferWidth,
                                           pbufferHeight,
diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java
index 72ad68c..0f05619 100644
--- a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java
+++ b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java
@@ -352,5 +352,5 @@ public interface GLUtessellatorCallback {
    */
   public void errorData(int errnum, Object polygonData);
 
-  //void mesh(com.jogamp.opengl.impl.tessellator.GLUmesh mesh);
+  //void mesh(jogamp.opengl.tessellator.GLUmesh mesh);
 }
diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
index f380f46..bd12dfb 100644
--- a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
+++ b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
@@ -68,7 +68,7 @@ public class GLUtessellatorCallbackAdapter implements GLUtessellatorCallback {
     public void edgeFlag(boolean boundaryEdge) {}
     public void vertex(Object vertexData) {}
     public void end() {}
-//  public void mesh(com.jogamp.opengl.impl.tessellator.GLUmesh mesh) {}
+//  public void mesh(jogamp.opengl.tessellator.GLUmesh mesh) {}
     public void error(int errnum) {}
     public void combine(double[] coords, Object[] data,
                             float[] weight, Object[] outData) {}
diff --git a/src/jogl/classes/jogamp/opengl/Debug.java b/src/jogl/classes/jogamp/opengl/Debug.java
new file mode 100644
index 0000000..83c79c1
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/Debug.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import java.security.*;
+
+/** Helper routines for logging and debugging. */
+
+public class Debug {
+  // Some common properties
+  private static boolean verbose;
+  private static boolean debugAll;
+  private static AccessControlContext localACC;
+  
+  static {
+    localACC=AccessController.getContext();
+    verbose = isPropertyDefined("jogl.verbose", true);
+    debugAll = isPropertyDefined("jogl.debug", true);
+    if (verbose) {
+       Package p = Package.getPackage("javax.media.opengl");
+       System.err.println("JOGL specification version " + p.getSpecificationVersion());
+       System.err.println("JOGL implementation version " + p.getImplementationVersion());
+       System.err.println("JOGL implementation vendor " + p.getImplementationVendor());
+    }
+  }
+
+  static int getIntProperty(final String property, final boolean jnlpAlias) {
+      return getIntProperty(property, jnlpAlias, localACC);
+  }
+
+  public static int getIntProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    int i=0;
+    try {
+        Integer iv = Integer.valueOf(Debug.getProperty(property, jnlpAlias, acc));
+        i = iv.intValue();
+    } catch (NumberFormatException nfe) {}
+    return i;
+  }
+
+  static boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
+    return getBooleanProperty(property, jnlpAlias, localACC);
+  }
+
+  public static boolean getBooleanProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    Boolean b = Boolean.valueOf(Debug.getProperty(property, jnlpAlias, acc));
+    return b.booleanValue();
+  }
+
+  static boolean isPropertyDefined(final String property, final boolean jnlpAlias) {
+    return isPropertyDefined(property, jnlpAlias, localACC);
+  }
+
+  public static boolean isPropertyDefined(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    return (Debug.getProperty(property, jnlpAlias, acc) != null) ? true : false;
+  }
+
+  static String getProperty(final String property, final boolean jnlpAlias) {
+    return getProperty(property, jnlpAlias, localACC);
+  }
+
+  public static String getProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    String s=null;
+    if(null!=acc && acc.equals(localACC)) {
+        s = (String) AccessController.doPrivileged(new PrivilegedAction() {
+            public Object run() {
+              String val=null;
+              try {
+                  val = System.getProperty(property);
+              } catch (Exception e) {}
+              if(null==val && jnlpAlias && !property.startsWith(jnlp_prefix)) {
+                  try {
+                      val = System.getProperty(jnlp_prefix + property);
+                  } catch (Exception e) {}
+              }
+              return val;
+            }
+          });
+    } else {
+        try {
+            s = System.getProperty(property);
+        } catch (Exception e) {}
+        if(null==s && jnlpAlias && !property.startsWith(jnlp_prefix)) {
+            try {
+                s = System.getProperty(jnlp_prefix + property);
+            } catch (Exception e) {}
+        }
+    }
+    return s;
+  }
+  public static final String jnlp_prefix = "jnlp." ;
+
+  public static boolean verbose() {
+    return verbose;
+  }
+
+  public static boolean debugAll() {
+    return debugAll;
+  }
+
+  public static boolean debug(String subcomponent) {
+    return debugAll() || isPropertyDefined("jogl.debug." + subcomponent, true);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
new file mode 100644
index 0000000..dc33541
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl;
+
+import java.util.List;
+import java.util.ArrayList;
+
+public abstract class DesktopGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundleInfo {
+    private static int posGlueLibGLDESKTOP;
+    private static List/*<String>*/ glueLibNames;
+    static {
+        glueLibNames = new ArrayList();
+
+        glueLibNames.addAll(getGlueLibNamesPreload());
+
+        posGlueLibGLDESKTOP = glueLibNames.size();
+        glueLibNames.add("jogl_desktop");
+    }
+
+    public static final int getGlueLibPosGLDESKTOP() { 
+        return posGlueLibGLDESKTOP; 
+    }
+
+    public DesktopGLDynamicLibraryBundleInfo() {
+        super();
+    }
+
+    public final List/*<String>*/ getGlueLibNames() {
+        return glueLibNames;
+    }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
new file mode 100644
index 0000000..4879c61
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl;
+
+import com.jogamp.common.os.NativeLibrary;
+import java.util.*;
+
+public class DesktopGLDynamicLookupHelper extends GLDynamicLookupHelper {
+
+    public DesktopGLDynamicLookupHelper(DesktopGLDynamicLibraryBundleInfo info) {
+        super(info);
+    }
+
+    public DesktopGLDynamicLibraryBundleInfo getDesktopGLBundleInfo() { return (DesktopGLDynamicLibraryBundleInfo) getBundleInfo(); }
+
+    public boolean hasGLBinding() {
+        return isToolLibLoaded() && isGlueLibLoaded(DesktopGLDynamicLibraryBundleInfo.getGlueLibPosGLDESKTOP());
+    }
+
+    public synchronized boolean loadGLULibrary() {
+        /** hacky code .. where all platform GLU libs are tried ..*/
+        if(null==gluLib) {
+            List/*<String>*/ gluLibNames = new ArrayList();
+            gluLibNames.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib"); // osx
+            gluLibNames.add("libGLU.so"); // unix
+            gluLibNames.add("GLU32"); // windows
+            gluLibNames.add("GLU"); // generic
+            gluLib = loadFirstAvailable(gluLibNames, null, true);
+            if(null != gluLib) {
+                nativeLibraries.add(gluLib);
+            }
+        }
+        return null != gluLib ;
+    }
+    NativeLibrary gluLib = null;
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
new file mode 100644
index 0000000..b5223a5
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import javax.media.opengl.*;
+import java.util.*;
+
+/**
+ * A utility object intended to be used by implementations to act as a cache
+ * of which OpenGL extensions are currently available on both the host machine
+ * and display.
+ */
+final class ExtensionAvailabilityCache {
+  protected static final boolean DEBUG = GLContextImpl.DEBUG;
+  private static final boolean DEBUG_AVAILABILITY = Debug.isPropertyDefined("jogl.debug.ExtensionAvailabilityCache", true);
+
+  ExtensionAvailabilityCache(GLContextImpl context)
+  {
+    this.context = context;
+  }
+
+  /**
+   * Flush the cache. The cache will be rebuilt lazily as calls to {@link
+   * #isExtensionAvailable(String)} are received.
+   */
+  final void flush()
+  {
+    if(DEBUG) {
+        System.out.println("ExtensionAvailabilityCache: Flush availability OpenGL "+context.getGLVersion());
+    }
+    availableExtensionCache.clear();
+    initialized = false;
+  }
+
+  /**
+   * Flush the cache and rebuild the cache.
+   */
+  final void reset() {
+    flush();
+    initAvailableExtensions();
+  }
+
+  final boolean isInitialized() {
+    return initialized && !availableExtensionCache.isEmpty() ;
+  }
+
+  final boolean isExtensionAvailable(String glExtensionName) {
+    initAvailableExtensions();
+    return availableExtensionCache.contains(mapGLExtensionName(glExtensionName));
+  }
+
+  final String getPlatformExtensionsString() {
+    initAvailableExtensions();
+    return glXExtensions;
+  }
+
+  final String getGLExtensionsString() {
+    initAvailableExtensions();
+    if(DEBUG) {
+        System.err.println("ExtensionAvailabilityCache: getGLExtensions() called");
+    }
+    return glExtensions;
+  }
+
+  private final void initAvailableExtensions() {
+    GL gl = context.getGL();
+    // if hash is empty (meaning it was flushed), pre-cache it with the list
+    // of extensions that are in the GL_EXTENSIONS string
+    if (availableExtensionCache.isEmpty() || !initialized) {
+      if (DEBUG) {
+         System.err.println(getThreadName() + ":ExtensionAvailabilityCache: Pre-caching init "+gl+", OpenGL "+context.getGLVersion());
+      }
+
+      boolean useGetStringi = false;
+
+      // Use 'glGetStringi' only for ARB GL3 context,
+      // on GL2 platforms the function might be available, but not working.
+      if ( context.isGL3() ) {
+          if ( ! context.isFunctionAvailable("glGetStringi") ) {
+            if(DEBUG) {
+                System.err.println("GLContext: GL >= 3.1 usage, but no glGetStringi");
+            }
+          } else {
+              useGetStringi = true;
+          }
+      }
+
+      if (DEBUG) {
+        System.err.println(getThreadName() + ":ExtensionAvailabilityCache: Pre-caching extension availability OpenGL "+context.getGLVersion()+
+                           ", use "+ ( useGetStringi ? "glGetStringi" : "glGetString" ) );
+      }
+
+      StringBuffer sb = new StringBuffer();
+      if(useGetStringi) {
+        GL2GL3 gl2gl3 = gl.getGL2GL3();
+        int[] numExtensions = { 0 } ;
+        gl2gl3.glGetIntegerv(gl2gl3.GL_NUM_EXTENSIONS, numExtensions, 0);
+        for (int i = 0; i < numExtensions[0]; i++) {
+            sb.append(gl2gl3.glGetStringi(gl2gl3.GL_EXTENSIONS, i));
+            if(i < numExtensions[0]) {
+                sb.append(" ");
+            }
+        }
+        if (DEBUG) {
+            System.err.println(getThreadName() + ":ExtensionAvailabilityCache: GL_EXTENSIONS: "+numExtensions[0]);
+        }
+        if(0==numExtensions[0]) {
+            // fall back ..
+            useGetStringi=false;
+        }
+      }
+      if(!useGetStringi) {
+        sb.append(gl.glGetString(GL.GL_EXTENSIONS));
+      }
+      glExtensions = sb.toString();
+      glXExtensions = context.getPlatformExtensionsString();
+
+      sb.append(" ");
+      sb.append(glXExtensions);
+
+      String allAvailableExtensions = sb.toString();
+      if (DEBUG_AVAILABILITY) {
+        System.err.println(getThreadName() + ":ExtensionAvailabilityCache: GL vendor: " + gl.glGetString(GL.GL_VENDOR));
+      }
+      StringTokenizer tok = new StringTokenizer(allAvailableExtensions);
+      while (tok.hasMoreTokens()) {
+        String availableExt = tok.nextToken().trim();
+        availableExt = availableExt.intern();
+        availableExtensionCache.add(availableExt);
+        if (DEBUG_AVAILABILITY) {
+          System.err.println(getThreadName() + ":ExtensionAvailabilityCache: Available: " + availableExt);
+        }
+      }
+      if (DEBUG) {
+        System.err.println(getThreadName() + ":ExtensionAvailabilityCache: ALL EXTENSIONS: "+availableExtensionCache.size());
+      }
+
+      int major[] = new int[] { context.getGLVersionMajor() };
+      int minor[] = new int[] { context.getGLVersionMinor() };
+      while (GLContext.isValidGLVersion(major[0], minor[0])) {
+        availableExtensionCache.add("GL_VERSION_" + major[0] + "_" + minor[0]);
+        if (DEBUG) {
+            System.err.println(getThreadName() + ":ExtensionAvailabilityCache: Added GL_VERSION_" + major[0] + "_" + minor[0] + " to known extensions");
+        }
+        if(!GLContext.decrementGLVersion(major, minor)) break;
+      }
+
+      // put a dummy var in here so that the cache is no longer empty even if
+      // no extensions are in the GL_EXTENSIONS string
+      availableExtensionCache.add("<INTERNAL_DUMMY_PLACEHOLDER>");
+
+      initialized = true;
+    }
+  }
+
+  // FIXME: hack to re-enable GL_NV_vertex_array_range extension after
+  // recent upgrade to new wglext.h and glxext.h headers
+  private static String mapGLExtensionName(String extensionName) {
+    if (extensionName != null &&
+        (extensionName.equals("WGL_NV_vertex_array_range") ||
+         extensionName.equals("GLX_NV_vertex_array_range"))) 
+      return "GL_NV_vertex_array_range";
+    return extensionName;
+  }
+
+  //----------------------------------------------------------------------
+  // Internals only below this point
+  //
+
+  private boolean initialized = false;
+  private String glExtensions = null;
+  private String glXExtensions = null;
+  private HashSet availableExtensionCache = new HashSet(50);
+  private GLContextImpl context;
+
+  static String getThreadName() {
+    return Thread.currentThread().getName();
+  }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
new file mode 100644
index 0000000..15e3aff
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import javax.media.opengl.*;
+import com.jogamp.common.util.IntLongHashMap;
+
+/**
+ * Tracks as closely as possible the sizes of allocated OpenGL buffer
+ * objects. When glMapBuffer or glMapBufferARB is called, in order to
+ * turn the resulting base address into a java.nio.ByteBuffer, we need
+ * to know the size in bytes of the allocated OpenGL buffer object.
+ * Previously we would compute this size by using
+ * glGetBufferParameterivARB with a pname of GL_BUFFER_SIZE, but
+ * it appears doing so each time glMapBuffer is called is too costly
+ * on at least Apple's new multithreaded OpenGL implementation. <P>
+ *
+ * Instead we now try to track the sizes of allocated buffer objects.
+ * We watch calls to glBindBuffer to see which buffer is bound to
+ * which target and to glBufferData to see how large the buffer's
+ * allocated size is. When glMapBuffer is called, we consult our table
+ * of buffer sizes to see if we can return an answer without a glGet
+ * call. <P>
+ *
+ * We share the GLBufferSizeTracker objects among all GLContexts for
+ * which sharing is enabled, because the namespace for buffer objects
+ * is the same for these contexts. <P>
+ *
+ * Tracking the state of which buffer objects are bound is done in the
+ * GLBufferStateTracker and is not completely trivial. In the face of
+ * calls to glPushClientAttrib / glPopClientAttrib we currently punt
+ * and re-fetch the bound buffer object for the state in question;
+ * see, for example, glVertexPointer and the calls down to
+ * GLBufferStateTracker.getBoundBufferObject(). Note that we currently
+ * ignore new binding targets such as GL_TRANSFORM_FEEDBACK_BUFFER_NV;
+ * the fact that new binding targets may be added in the future makes
+ * it impossible to cache state for these new targets. <P>
+ *
+ * Ignoring new binding targets, the primary situation in which we may
+ * not be able to return a cached answer is in the case of an error,
+ * where glBindBuffer may not have been called before trying to call
+ * glBufferData. Also, if external native code modifies a buffer
+ * object, we may return an incorrect answer. (FIXME: this case
+ * requires more thought, and perhaps stochastic and
+ * exponential-fallback checking. However, note that it can only occur
+ * in the face of external native code which requires that the
+ * application be signed anyway, so there is no security risk in this
+ * area.)
+ */
+
+public class GLBufferSizeTracker {
+  // Map from buffer names to sizes.
+  // Note: should probably have some way of shrinking this map, but
+  // can't just make it a WeakHashMap because nobody holds on to the
+  // keys; would have to always track creation and deletion of buffer
+  // objects, which is probably sub-optimal. The expected usage
+  // pattern of buffer objects indicates that the fact that this map
+  // never shrinks is probably not that bad.
+  private IntLongHashMap bufferSizeMap;
+
+  protected static final boolean DEBUG = Debug.debug("GLStatusTracker");
+
+  public GLBufferSizeTracker() {
+      bufferSizeMap = new IntLongHashMap();
+      bufferSizeMap.setKeyNotFoundValue(-1);
+  }
+
+  public void setBufferSize(GLBufferStateTracker bufferStateTracker,
+                            int target, GL caller, long size) {
+    // Need to do some similar queries to getBufferSize below
+    int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
+    boolean valid = bufferStateTracker.isBoundBufferObjectKnown(target);
+    if (valid) {
+      if (buffer == 0) {
+        // FIXME: this really should not happen if we know what's
+        // going on. Very likely there is an OpenGL error in the
+        // application if we get here. Could silently return 0, but it
+        // seems better to get an early warning that something is
+        // wrong.
+        throw new GLException("Error: no OpenGL buffer object appears to be bound to target 0x" +
+                              Integer.toHexString(target));
+      }
+      setDirectStateBufferSize(buffer, caller, size);
+    }
+    // We don't know the current buffer state. Note that the buffer
+    // state tracker will have made the appropriate OpenGL query if it
+    // didn't know what was going on, so at this point we have nothing
+    // left to do except drop this piece of information on the floor.
+  }
+
+  public void setDirectStateBufferSize(int buffer, GL caller, long size) {
+      bufferSizeMap.put(buffer, size);
+  }
+
+  public long getBufferSize(GLBufferStateTracker bufferStateTracker,
+                           int target,
+                           GL caller) {
+    // See whether we know what buffer is currently bound to the given
+    // state
+    int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
+    boolean valid = bufferStateTracker.isBoundBufferObjectKnown(target);
+    if (valid) {
+      if (0 == buffer) {
+        // FIXME: this really should not happen if we know what's
+        // going on. Very likely there is an OpenGL error in the
+        // application if we get here. Could silently return 0, but it
+        // seems better to get an early warning that something is
+        // wrong.
+        throw new GLException("Error: no OpenGL buffer object appears to be bound to target 0x" +
+                              Integer.toHexString(target));
+      }
+      return getBufferSizeImpl(target, buffer, caller);
+    }
+    // We don't know what's going on in this case; query the GL for an answer
+    // FIXME: both functions return 'int' types, which is not suitable,
+    // since buffer lenght is 64bit ?
+    int[] tmp = new int[1];
+    caller.glGetBufferParameteriv(target, GL.GL_BUFFER_SIZE, tmp, 0);
+    if (DEBUG) {
+      System.err.println("GLBufferSizeTracker.getBufferSize(): no cached buffer information");
+    }
+    return (long) tmp[0];
+  }
+
+  public long getDirectStateBufferSize(int buffer, GL caller) {
+      return getBufferSizeImpl(0, buffer, caller);
+  }
+
+  private long getBufferSizeImpl(int target, int buffer, GL caller) {
+      // See whether we know the size of this buffer object; at this
+      // point we almost certainly should if the application is
+      // written correctly
+      long sz = bufferSizeMap.get(buffer);
+      if (0 > sz) {
+        // For robustness, try to query this value from the GL as we used to
+        // FIXME: both functions return 'int' types, which is not suitable,
+        // since buffer lenght is 64bit ?
+        int[] tmp = new int[1];
+        if(0==target) {
+            // DirectState ..
+            if(caller.isFunctionAvailable("glGetNamedBufferParameterivEXT")) {
+                caller.getGL2().glGetNamedBufferParameterivEXT(buffer, GL.GL_BUFFER_SIZE, tmp, 0);
+            } else {
+                throw new GLException("Error: getDirectStateBufferSize called with unknown state and GL function 'glGetNamedBufferParameterivEXT' n/a to query size");
+            }
+        } else {
+            caller.glGetBufferParameteriv(target, GL.GL_BUFFER_SIZE, tmp, 0);
+        }
+        if (tmp[0] == 0) {
+          // Assume something is wrong rather than silently going along
+          throw new GLException("Error: buffer size returned by "+
+                                ((0==target)?"glGetNamedBufferParameterivEXT":"glGetBufferParameteriv")+
+                                " was zero; probably application error");
+        }
+        // Assume we just don't know what's happening
+        sz = (long) tmp[0];
+        bufferSizeMap.put(buffer, sz);
+        if (DEBUG) {
+          System.err.println("GLBufferSizeTracker.getBufferSize(): made slow query to cache size " +
+                             sz +
+                             " for buffer " +
+                             buffer);
+        }
+      }
+      return sz;
+  }
+
+  // This should be called on any major event where we might start
+  // producing wrong answers, such as OpenGL context creation and
+  // destruction if we don't know whether there are other currently-
+  // created contexts that might be keeping the buffer objects alive
+  // that we're dealing with
+  public void clearCachedBufferSizes() {
+    bufferSizeMap.clear();
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
new file mode 100644
index 0000000..d028bf9
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import javax.media.opengl.*;
+import com.jogamp.common.util.IntIntHashMap;
+
+/**
+ * Tracks as closely as possible which OpenGL buffer object is bound
+ * to which binding target in the current OpenGL context.
+ * GLBufferStateTracker objects are allocated on a per-OpenGL-context basis.
+ * This class is used to verify that e.g. the vertex
+ * buffer object extension is in use when the glVertexPointer variant
+ * taking a long as argument is called. <P>
+ * 
+ * Note that because the enumerated value used for the binding of a
+ * buffer object (e.g. GL_ARRAY_BUFFER) is different than that used to
+ * query the binding using glGetIntegerv (e.g.
+ * GL_ARRAY_BUFFER_BINDING), then in the face of new binding targets
+ * being added to the GL (e.g. GL_TRANSFORM_FEEDBACK_BUFFER_NV) it is
+ * impossible to set up a query of the buffer object currently bound
+ * to a particular state. It turns out that for some uses, such as
+ * finding the size of the currently bound buffer, this doesn't
+ * matter, though of course without knowing the buffer object we can't
+ * re-associate the queried size with the buffer object ID. <P>
+ *
+ * Because the namespace of buffer objects is the unsigned integers
+ * with 0 reserved by the GL, and because we have to be able to return
+ * both 0 and other integers as valid answers from
+ * getBoundBufferObject(), we need a second query, which is to ask
+ * whether we know the state of the binding for a given target. For
+ * "unknown" targets such as GL_TRANSFORM_FEEDBACK_BUFFER_NV we return
+ * false from this, but we also clear the valid bit and later refresh
+ * the binding state if glPushClientAttrib / glPopClientAttrib are
+ * called, since we don't want the complexity of tracking stacks of
+ * these attributes.
+ *
+ */
+
+public class GLBufferStateTracker {
+  protected static final boolean DEBUG = GLBufferSizeTracker.DEBUG;
+
+  // Maps binding targets to buffer objects. A null value indicates
+  // that the binding is unknown. A zero value indicates that it is
+  // known that no buffer is bound to the target, according to the 
+  // OpenGL specifications. 
+  // http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml
+  private IntIntHashMap bindingMap;
+
+  private int[] bufTmp = new int[1];
+
+  public GLBufferStateTracker() {
+    bindingMap = new IntIntHashMap();
+    bindingMap.setKeyNotFoundValue(-1);
+
+    // Start with known unbound targets for known keys
+    bindingMap.put(GL.GL_ARRAY_BUFFER,         0);
+    bindingMap.put(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
+    bindingMap.put(GL2.GL_PIXEL_PACK_BUFFER,   0);
+    bindingMap.put(GL2.GL_PIXEL_UNPACK_BUFFER, 0);
+  }
+
+  public void setBoundBufferObject(int target, int buffer) {
+    bindingMap.put(target, buffer);
+  }
+
+  /** Note: returns an unspecified value if the binding for the
+      specified target (e.g. GL_ARRAY_BUFFER) is currently unknown.
+      You must use isBoundBufferObjectKnown() to see whether the
+      return value is valid. */
+  public int getBoundBufferObject(int target, GL caller) {
+    int value = bindingMap.get(target);
+    if (0 > value) {
+      // User probably either called glPushClientAttrib /
+      // glPopClientAttrib or is querying an unknown target. See
+      // whether we know how to fetch this state.
+      boolean gotQueryTarget = true;
+      int queryTarget = 0;
+      switch (target) {
+        case GL.GL_ARRAY_BUFFER:          queryTarget = GL.GL_ARRAY_BUFFER_BINDING;         break;
+        case GL.GL_ELEMENT_ARRAY_BUFFER:  queryTarget = GL.GL_ELEMENT_ARRAY_BUFFER_BINDING; break;
+        case GL2.GL_PIXEL_PACK_BUFFER:    queryTarget = GL2.GL_PIXEL_PACK_BUFFER_BINDING;    break;
+        case GL2.GL_PIXEL_UNPACK_BUFFER:  queryTarget = GL2.GL_PIXEL_UNPACK_BUFFER_BINDING;  break;
+        default:                          gotQueryTarget = false; break;
+      }
+      if (gotQueryTarget) {
+        caller.glGetIntegerv(queryTarget, bufTmp, 0);
+        if (DEBUG) {
+          System.err.println("GLBufferStateTracker.getBoundBufferObject(): queried bound buffer " +
+                             bufTmp[0] +
+                             " for query target 0x" + Integer.toHexString(queryTarget));
+        }
+        setBoundBufferObject(target, bufTmp[0]);
+        return bufTmp[0];
+      }
+      return 0;
+    }
+    return value;
+  }
+
+  /** Indicates whether the binding state for the specified target is
+      currently known, ie it could be bound or not but it must be tracked.<br>
+      Should be called after getBoundBufferObject()
+      because that method may change the answer for a given target. */
+  public boolean isBoundBufferObjectKnown(int target) {
+    return 0 < bindingMap.get(target) ;
+  }
+
+  /** Clears out the known/unknown state of the various buffer object
+      binding states. These will be refreshed later on an as-needed
+      basis. This is called by the implementations of
+      glPushClientAttrib / glPopClientAttrib. Might want to call this
+      from GLContext.makeCurrent() in the future to possibly increase
+      the robustness of these caches in the face of external native
+      code manipulating OpenGL state. */
+  public void clearBufferObjectState() {
+    bindingMap.clear();
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
new file mode 100644
index 0000000..d5059eb
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -0,0 +1,1044 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.jogamp.common.os.DynamicLookupHelper;
+import com.jogamp.common.util.ReflectionUtil;
+import com.jogamp.gluegen.runtime.FunctionAddressResolver;
+import com.jogamp.gluegen.runtime.ProcAddressTable;
+import com.jogamp.gluegen.runtime.opengl.GLExtensionNames;
+import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.opengl.GL;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawable;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+
+public abstract class GLContextImpl extends GLContext {
+  protected static final boolean DEBUG = Debug.debug("GLContext");
+
+  protected GLContextLock lock = new GLContextLock();
+
+  /**
+   * Context full qualified name: display_type + display_connection + major + minor + ctp.
+   * This is the key for all cached GL ProcAddressTables, etc, to support multi display/device setups.
+   */
+  private String contextFQN;
+
+  // Cache of the functions that are available to be called at the current
+  // moment in time
+  protected ExtensionAvailabilityCache extensionAvailability;
+  // Table that holds the addresses of the native C-language entry points for
+  // OpenGL functions.
+  private ProcAddressTable glProcAddressTable;
+
+  // Tracks creation and initialization of buffer objects to avoid
+  // repeated glGet calls upon glMapBuffer operations
+  private GLBufferSizeTracker bufferSizeTracker; // Singleton - Set by GLContextShareSet
+  private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker();
+  private GLStateTracker glStateTracker = new GLStateTracker();
+
+  protected GLDrawableImpl drawable;
+  protected GLDrawableImpl drawableRead;
+
+  protected GL gl;
+
+  protected static final Object mappedContextTypeObjectLock;
+  protected static final HashMap mappedExtensionAvailabilityCache;
+  protected static final HashMap mappedGLProcAddress;
+  protected static final HashMap mappedGLXProcAddress;
+
+  static {
+      mappedContextTypeObjectLock = new Object();
+      mappedExtensionAvailabilityCache = new HashMap();
+      mappedGLProcAddress = new HashMap();
+      mappedGLXProcAddress = new HashMap();
+  }
+
+  public GLContextImpl(GLDrawableImpl drawable, GLContext shareWith) {
+    super();
+
+    if (shareWith != null) {
+      GLContextShareSet.registerSharing(this, shareWith);
+    }
+    GLContextShareSet.registerForBufferObjectSharing(shareWith, this);
+
+    this.drawable = drawable;
+    this.drawableRead = drawable;
+  }
+
+  protected void resetStates() {
+      // Because we don't know how many other contexts we might be
+      // sharing with (and it seems too complicated to implement the
+      // GLObjectTracker's ref/unref scheme for the buffer-related
+      // optimizations), simply clear the cache of known buffers' sizes
+      // when we destroy contexts
+      if (bufferSizeTracker != null) {
+          bufferSizeTracker.clearCachedBufferSizes();
+      }
+
+      if (bufferStateTracker != null) {
+          bufferStateTracker.clearBufferObjectState();
+      }
+
+      if (glStateTracker != null) {
+          glStateTracker.clearStates(false);
+      }
+
+      extensionAvailability = null;
+      glProcAddressTable = null;
+      gl = null;
+      contextFQN = null;
+
+      super.resetStates();
+  }
+
+  public final void setGLReadDrawable(GLDrawable read) {
+    if(null!=read && drawable!=read && !isGLReadDrawableAvailable()) {
+        throw new GLException("GL Read Drawable not available");
+    }
+    boolean lockHeld = lock.isHeld();
+    if(lockHeld) {
+        release();
+    }
+    drawableRead = ( null != read ) ? (GLDrawableImpl) read : drawable;
+    if(lockHeld) {
+        makeCurrent();
+    }
+  }
+
+  public final GLDrawable getGLReadDrawable() {
+    return drawableRead;
+  }
+
+  public final GLDrawable getGLDrawable() {
+    return drawable;
+  }
+
+  public final GLDrawableImpl getDrawableImpl() {
+    return (GLDrawableImpl) getGLDrawable();
+  }
+
+  public final GL getGL() {
+    return gl;
+  }
+
+  public GL setGL(GL gl) {
+    if(DEBUG) {
+        String sgl1 = (null!=this.gl)?this.gl.getClass().getSimpleName()+", "+this.gl.toString():"<null>";
+        String sgl2 = (null!=gl)?gl.getClass().getSimpleName()+", "+gl.toString():"<null>";
+        Exception e = new Exception("Info: setGL (OpenGL "+getGLVersion()+"): "+Thread.currentThread().getName()+", "+sgl1+" -> "+sgl2);
+        e.printStackTrace();
+    }
+    this.gl = gl;
+    return gl;
+  }
+
+  // This is only needed for Mac OS X on-screen contexts
+  protected void update() throws GLException { }
+
+  public boolean isSynchronized() {
+    return !lock.getFailFastMode();
+  }
+
+  public void setSynchronized(boolean isSynchronized) {
+    lock.setFailFastMode(!isSynchronized);
+  }
+
+  public abstract Object getPlatformGLExtensions();
+
+  // Note: the surface is locked within [makeCurrent .. swap .. release]
+  public void release() throws GLException {
+    if (!lock.isHeld()) {
+      throw new GLException("Context not current on current thread");
+    }
+    setCurrent(null);
+    try {
+        releaseImpl();
+    } finally {
+      if (drawable.isSurfaceLocked()) {
+          drawable.unlockSurface();
+      }
+      lock.unlock();
+    }
+  }
+  protected abstract void releaseImpl() throws GLException;
+
+  public final void destroy() {
+    if (lock.isHeld()) {
+        // release current context 
+        release();
+    }
+
+    // Must hold the lock around the destroy operation to make sure we
+    // don't destroy the context out from under another thread rendering to it
+    lock.lock();
+    try {
+      /* FIXME: refactor dependence on Java 2D / JOGL bridge
+      if (tracker != null) {
+        // Don't need to do anything for contexts that haven't been
+        // created yet
+        if (isCreated()) {
+          // If we are tracking creation and destruction of server-side
+          // OpenGL objects, we must decrement the reference count of the
+          // GLObjectTracker upon context destruction.
+          //
+          // Note that we can only eagerly delete these server-side
+          // objects if there is another context currrent right now
+          // which shares textures and display lists with this one.
+          tracker.unref(deletedObjectTracker);
+        }
+      }
+      */
+
+      if (contextHandle != 0) {
+          int lockRes = drawable.lockSurface();
+          if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) {
+                // this would be odd ..
+                throw new GLException("Surface not ready to lock: "+drawable);
+          }
+          try {
+              destroyImpl();
+              contextHandle = 0;
+              GLContextShareSet.contextDestroyed(this);
+          } finally {
+              drawable.unlockSurface();
+          }
+      }
+    } finally {
+      lock.unlock();
+    }
+
+    resetStates();
+  }
+  protected abstract void destroyImpl() throws GLException;
+
+  public final void copy(GLContext source, int mask) throws GLException {
+    if (source.getHandle() == 0) {
+      throw new GLException("Source OpenGL context has not been created");
+    }
+    if (getHandle() == 0) {
+      throw new GLException("Destination OpenGL context has not been created");
+    }
+
+    int lockRes = drawable.lockSurface();
+    if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) {
+        // this would be odd ..
+        throw new GLException("Surface not ready to lock");
+    }
+    try {
+        copyImpl(source, mask);
+    } finally {
+      drawable.unlockSurface();
+    }
+  }
+  protected abstract void copyImpl(GLContext source, int mask) throws GLException;
+
+  //----------------------------------------------------------------------
+  //
+
+  /**
+   * MakeCurrent functionality, which also issues the creation of the actual OpenGL context.<br>
+   * The complete callgraph for general OpenGL context creation is:<br>
+   * <ul>
+   *    <li> {@link #makeCurrent} <i>GLContextImpl</i></li>
+   *    <li> {@link #makeCurrentImpl} <i>Platform Implementation</i></li>
+   *    <li> {@link #create} <i>Platform Implementation</i></li>
+   *    <li> If <code>ARB_create_context</code> is supported:
+   *    <ul>
+   *        <li> {@link #createContextARB} <i>GLContextImpl</i></li>
+   *        <li> {@link #createContextARBImpl} <i>Platform Implementation</i></li>
+   *    </ul></li>
+   * </ul><br>
+   *
+   * Once at startup, ie triggered by the singleton constructor of a {@link GLDrawableFactoryImpl} specialization,
+   * calling {@link #createContextARB} will query all available OpenGL versions:<br>
+   * <ul>
+   *    <li> <code>FOR ALL GL* DO</code>:
+   *    <ul>
+   *        <li> {@link #createContextARBMapVersionsAvailable}
+   *        <ul>
+   *            <li> {@link #createContextARBVersions}</li>
+   *        </ul></li>
+   *        <li> {@link #mapVersionAvailable}</li>
+   *    </ul></li>
+   * </ul><br>
+   *
+   * @see #makeCurrentImpl
+   * @see #create
+   * @see #createContextARB
+   * @see #createContextARBImpl
+   * @see #mapVersionAvailable
+   * @see #destroyContextARBImpl
+   */
+  public int makeCurrent() throws GLException {
+    // One context can only be current by one thread,
+    // and one thread can only have one context current!
+    GLContext current = getCurrent();
+    if (current != null) {
+      if (current == this) {
+        // Assume we don't need to make this context current again
+        // For Mac OS X, however, we need to update the context to track resizes
+        update();
+        return CONTEXT_CURRENT;
+      } else {
+        current.release();
+      }
+    }
+
+    if (GLWorkerThread.isStarted() &&
+        !GLWorkerThread.isWorkerThread()) {
+      // Kick the GLWorkerThread off its current context
+      GLWorkerThread.invokeLater(new Runnable() { public void run() {} });
+    }
+
+    if (!isCreated()) {
+        // verify if the drawable has chosen Capabilities
+        if (null == getGLDrawable().getChosenGLCapabilities()) {
+            throw new GLException("drawable has no chosen GLCapabilities: "+getGLDrawable());
+        }
+    }
+
+    lock.lock();
+    int res = 0;
+    try {
+      res = makeCurrentLocking();
+
+      /* FIXME: refactor dependence on Java 2D / JOGL bridge
+      if ((tracker != null) &&
+          (res == CONTEXT_CURRENT_NEW)) {
+        // Increase reference count of GLObjectTracker
+        tracker.ref();
+      }
+      */
+    } catch (GLException e) {
+      lock.unlock();
+      throw(e);
+    }
+    if (res == CONTEXT_NOT_CURRENT) {
+      lock.unlock();
+    } else {
+      if(res == CONTEXT_CURRENT_NEW) {
+        // check if the drawable's and the GL's GLProfile are equal
+        // throws an GLException if not 
+        getGLDrawable().getGLProfile().verifyEquality(gl.getGLProfile());
+      }
+      setCurrent(this);
+
+      /* FIXME: refactor dependence on Java 2D / JOGL bridge
+
+      // Try cleaning up any stale server-side OpenGL objects
+      // FIXME: not sure what to do here if this throws
+      if (deletedObjectTracker != null) {
+        deletedObjectTracker.clean(getGL());
+      }
+      */
+    }
+    return res;
+  }
+
+  // Note: the surface is locked within [makeCurrent .. swap .. release]
+  protected final int makeCurrentLocking() throws GLException {
+    boolean exceptionOccurred = false;
+    int lockRes = drawable.lockSurface();
+    try {
+      if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) {
+        return CONTEXT_NOT_CURRENT;
+      }
+      try {
+          if (NativeSurface.LOCK_SURFACE_CHANGED == lockRes) {
+            drawable.updateHandle();
+          }
+          if (0 == drawable.getHandle()) {
+              throw new GLException("drawable has invalid handle: "+drawable);
+          }
+          boolean newCreated = false;
+          if (!isCreated()) {
+            GLProfile.initProfiles(
+                    getGLDrawable().getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice());
+            newCreated = createImpl(); // may throws exception if fails!
+            if (DEBUG) {
+                if(newCreated) {
+                    System.err.println(getThreadName() + ": !!! Create GL context OK: " + toHexString(contextHandle) + " for " + getClass().getName());
+                } else {
+                    System.err.println(getThreadName() + ": !!! Create GL context FAILED for " + getClass().getName());
+                }
+            }
+            if(!newCreated) {
+                return CONTEXT_NOT_CURRENT;
+            }
+            GLContextShareSet.contextCreated(this);
+          }
+          makeCurrentImpl(newCreated);
+          return newCreated ? CONTEXT_CURRENT_NEW : CONTEXT_CURRENT ;
+      } catch (RuntimeException e) {
+        exceptionOccurred = true;
+        throw e;
+      }
+    } finally {
+      if (exceptionOccurred) {
+        drawable.unlockSurface();
+      }
+    }
+  }
+  protected abstract void makeCurrentImpl(boolean newCreatedContext) throws GLException;
+  protected abstract boolean createImpl() throws GLException ;
+
+  /** 
+   * Platform dependent but harmonized implementation of the <code>ARB_create_context</code>
+   * mechanism to create a context.<br>
+   *
+   * This method is called from {@link #createContextARB}.<br>
+   *
+   * The implementation shall verify this context with a 
+   * <code>MakeContextCurrent</code> call.<br>
+   *
+   * The implementation shall leave the context current.<br>
+   *
+   * @param share the shared context or null
+   * @param direct flag if direct is requested
+   * @param ctxOptionFlags <code>ARB_create_context</code> related, see references below
+   * @param major major number
+   * @param minor minor number
+   * @return the valid context if successfull, or null
+   *
+   * @see #makeCurrent
+   * @see #CTX_PROFILE_COMPAT
+   * @see #CTX_OPTION_FORWARD
+   * @see #CTX_OPTION_DEBUG
+   * @see #makeCurrentImpl
+   * @see #create
+   * @see #createContextARB
+   * @see #createContextARBImpl
+   * @see #destroyContextARBImpl
+   */
+  protected abstract long createContextARBImpl(long share, boolean direct, int ctxOptionFlags, 
+                                               int major, int minor);
+
+  /**
+   * Destroy the context created by {@link #createContextARBImpl}.
+   *
+   * @see #makeCurrent
+   * @see #makeCurrentImpl
+   * @see #create
+   * @see #createContextARB
+   * @see #createContextARBImpl
+   * @see #destroyContextARBImpl
+   */
+  protected abstract void destroyContextARBImpl(long context);
+
+  /**
+   * Platform independent part of using the <code>ARB_create_context</code>
+   * mechanism to create a context.<br>
+   *
+   * The implementation of {@link #create} shall use this protocol in case the platform supports <code>ARB_create_context</code>.<br>
+   *
+   * This method may call {@link #createContextARBImpl} and {@link #destroyContextARBImpl}. <br>
+   *
+   * This method will also query all available native OpenGL context when first called,<br>
+   * usually the first call should happen with the shared GLContext of the DrawableFactory.<br>
+   *
+   * The implementation makes the context current, if successful<br>
+   *
+   * @see #makeCurrentImpl
+   * @see #create
+   * @see #createContextARB
+   * @see #createContextARBImpl
+   * @see #destroyContextARBImpl
+   */
+  protected final long createContextARB(long share, boolean direct,
+                                        int major[], int minor[], int ctp[]) 
+  {
+    AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    AbstractGraphicsDevice device = config.getScreen().getDevice();
+    GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+    GLProfile glp = glCaps.getGLProfile();
+
+    if (DEBUG) {
+      System.err.println(getThreadName() + ": !!! createContextARB: mappedVersionsAvailableSet("+device.getConnection()+"): "+
+               GLContext.getAvailableGLVersionsSet(device));
+    }
+
+    if ( !GLContext.getAvailableGLVersionsSet(device) ) {
+        mapGLVersions(device);
+    }
+
+    int reqMajor;
+    if(glp.isGL4()) {
+        reqMajor=4;
+    } else if (glp.isGL3()) {
+        reqMajor=3;
+    } else /* if (glp.isGL2()) */ {
+        reqMajor=2;
+    }
+
+    boolean compat = glp.isGL2(); // incl GL3bc and GL4bc
+    int _major[] = { 0 };
+    int _minor[] = { 0 };
+    int _ctp[] = { 0 };
+    long _ctx = 0;
+
+    if( GLContext.getAvailableGLVersion(device, reqMajor, compat?CTX_PROFILE_COMPAT:CTX_PROFILE_CORE,
+                                        _major, _minor, _ctp)) {
+        _ctx = createContextARBImpl(share, direct, _ctp[0], _major[0], _minor[0]);
+        if(0!=_ctx) {
+            setGLFunctionAvailability(true, _major[0], _minor[0], _ctp[0]);
+        }
+    }
+    return _ctx;
+  }
+
+  private final void mapGLVersions(AbstractGraphicsDevice device) {    
+    synchronized (GLContext.deviceVersionAvailable) {
+        createContextARBMapVersionsAvailable(4, false /* core   */);  // GL4
+        createContextARBMapVersionsAvailable(4, true  /* compat */);  // GL4bc
+        createContextARBMapVersionsAvailable(3, false /* core   */);  // GL3
+        createContextARBMapVersionsAvailable(3, true  /* compat */);  // GL3bc
+        createContextARBMapVersionsAvailable(2, true  /* compat */);  // GL2
+        GLContext.setAvailableGLVersionsSet(device);
+    }
+  }
+
+  private final void createContextARBMapVersionsAvailable(int reqMajor, boolean compat)
+  {
+    resetStates();
+
+    long _context;
+    int reqProfile = compat ? CTX_PROFILE_COMPAT : CTX_PROFILE_CORE ;
+    int ctp = CTX_IS_ARB_CREATED | CTX_PROFILE_CORE | CTX_OPTION_ANY; // default
+    if(compat) {
+        ctp &= ~CTX_PROFILE_CORE ;
+        ctp |=  CTX_PROFILE_COMPAT ;
+    }
+
+    // To ensure GL profile compatibility within the JOGL application
+    // we always try to map against the highest GL version,
+    // so the user can always cast to the highest available one.
+    int majorMax, minorMax;
+    int majorMin, minorMin;
+    int major[] = new int[1];
+    int minor[] = new int[1];
+    if( 4 == reqMajor ) {
+        majorMax=4; minorMax=GLContext.getMaxMinor(majorMax);
+        majorMin=4; minorMin=0;
+    } else if( 3 == reqMajor ) {
+        majorMax=3; minorMax=GLContext.getMaxMinor(majorMax);
+        majorMin=3; minorMin=1;
+    } else /* if( glp.isGL2() ) */ {
+        majorMax=3; minorMax=0;
+        majorMin=1; minorMin=1; // our minimum desktop OpenGL runtime requirements
+    }
+    _context = createContextARBVersions(0, true, ctp, 
+                                        /* max */ majorMax, minorMax,
+                                        /* min */ majorMin, minorMin,
+                                        /* res */ major, minor);
+
+    if(0==_context && !compat) {
+        ctp &= ~CTX_PROFILE_COMPAT ;
+        ctp |=  CTX_PROFILE_CORE ;
+        ctp &= ~CTX_OPTION_ANY ;
+        ctp |=  CTX_OPTION_FORWARD ;
+        _context = createContextARBVersions(0, true, ctp, 
+                                            /* max */ majorMax, minorMax,
+                                            /* min */ majorMin, minorMin,
+                                            /* res */ major, minor);
+       if(0==_context) {
+            // Try a compatible one .. even though not requested .. last resort
+            ctp &= ~CTX_PROFILE_CORE ;
+            ctp |=  CTX_PROFILE_COMPAT ;
+            ctp &= ~CTX_OPTION_FORWARD ;
+            ctp |=  CTX_OPTION_ANY ;
+            _context = createContextARBVersions(0, true, ctp, 
+                                       /* max */ majorMax, minorMax,
+                                       /* min */ majorMin, minorMin,
+                                       /* res */ major, minor);
+       }
+    }
+    if(0!=_context) {
+        AbstractGraphicsDevice device = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice();
+        GLContext.mapAvailableGLVersion(device, reqMajor, reqProfile, major[0], minor[0], ctp);
+        setGLFunctionAvailability(true, major[0], minor[0], ctp);
+        destroyContextARBImpl(_context);
+        resetStates();
+        if (DEBUG) {
+          System.err.println(getThreadName() + ": !!! createContextARBMapVersionsAvailable HAVE: "+
+                  GLContext.getAvailableGLVersionAsString(device, reqMajor, reqProfile));
+        }
+    } else if (DEBUG) {
+        System.err.println(getThreadName() + ": !!! createContextARBMapVersionsAvailable NOPE: "+reqMajor+"."+reqProfile);
+    }
+  }
+
+  private final long createContextARBVersions(long share, boolean direct, int ctxOptionFlags, 
+                                              int majorMax, int minorMax, 
+                                              int majorMin, int minorMin, 
+                                              int major[], int minor[]) {
+    major[0]=majorMax;
+    minor[0]=minorMax;
+    long _context=0;
+
+    while ( 0==_context &&
+            GLContext.isValidGLVersion(major[0], minor[0]) &&
+            ( major[0]>majorMin || major[0]==majorMin && minor[0] >=minorMin ) ) {
+
+        if (DEBUG) {
+            System.err.println(getThreadName() + ": createContextARBVersions: share "+share+", direct "+direct+", version "+major[0]+"."+minor[0]);
+        }
+        _context = createContextARBImpl(share, direct, ctxOptionFlags, major[0], minor[0]);
+
+        if(0==_context) {
+            if(!GLContext.decrementGLVersion(major, minor)) break;
+        }
+    }
+    return _context;
+  }
+
+  //----------------------------------------------------------------------
+  // Managing the actual OpenGL version, usually figured at creation time.
+  // As a last resort, the GL_VERSION string may be used ..
+  //
+
+  /** 
+   * If major > 0 || minor > 0 : Use passed values, determined at creation time 
+   * If major==0 && minor == 0 : Use GL_VERSION
+   * Otherwise .. don't touch ..
+   */
+  private final void setContextVersion(int major, int minor, int ctp) {
+      if (0==ctp) {
+        throw new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
+      }
+      if(major>0 || minor>0) {
+          if (!GLContext.isValidGLVersion(major, minor)) {
+            GLException e = new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
+            throw e;
+          }
+          ctxMajorVersion = major;
+          ctxMinorVersion = minor;
+          ctxOptions = ctp;
+          ctxVersionString = getGLVersion(ctxMajorVersion, ctxMinorVersion, ctxOptions, getGL().glGetString(GL.GL_VERSION));
+          return;
+      }
+
+      if(major==0 && minor==0) {
+          String versionStr = getGL().glGetString(GL.GL_VERSION);
+          if(null==versionStr) {
+            throw new GLException("GL_VERSION is NULL: "+this);
+          }
+          ctxOptions = ctp;
+
+          // Set version
+          GLVersionNumber version = new GLVersionNumber(versionStr);
+          if (version.isValid()) {
+            ctxMajorVersion = version.getMajor();
+            ctxMinorVersion = version.getMinor();
+            // We cannot promote a non ARB context to >= 3.1,
+            // reduce it to 3.0 then.
+            if ( ( ctxMajorVersion>3 || ctxMajorVersion==3 && ctxMinorVersion>=1 )
+                 && 0 == (ctxOptions & CTX_IS_ARB_CREATED) ) {
+                ctxMajorVersion = 3;
+                ctxMinorVersion = 0;
+            }
+            ctxVersionString = getGLVersion(ctxMajorVersion, ctxMinorVersion, ctxOptions, versionStr);
+            return;
+          }
+      }
+  }
+
+  //----------------------------------------------------------------------
+  // Helpers for various context implementations
+  //
+
+  private Object createInstance(GLProfile glp, String suffix, Class[] cstrArgTypes, Object[] cstrArgs) {
+    return ReflectionUtil.createInstance(glp.getGLImplBaseClassName()+suffix, cstrArgTypes, cstrArgs, getClass().getClassLoader());
+  }
+
+  private boolean verifyInstance(GLProfile glp, String suffix, Object instance) {
+    return ReflectionUtil.instanceOf(instance, glp.getGLImplBaseClassName()+suffix);
+  }
+
+  /** Create the GL for this context. */
+  protected GL createGL(GLProfile glp) {
+    GL gl = (GL) createInstance(glp, "Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { glp, this } );
+
+    /* FIXME: refactor dependence on Java 2D / JOGL bridge
+    if (tracker != null) {
+      gl.setObjectTracker(tracker);
+    }
+    */
+    return gl;
+  }
+  
+  public final ProcAddressTable getGLProcAddressTable() {
+    return glProcAddressTable;
+  }
+  
+  /**
+   * Shall return the platform extension ProcAddressTable,
+   * ie for GLXExt, EGLExt, ..
+   */
+  public abstract ProcAddressTable getPlatformExtProcAddressTable();
+
+  /**
+   * Pbuffer support; given that this is a GLContext associated with a
+   * pbuffer, binds this pbuffer to its texture target.
+   */
+  public abstract void bindPbufferToTexture();
+
+  /**
+   * Pbuffer support; given that this is a GLContext associated with a
+   * pbuffer, releases this pbuffer from its texture target.
+   */
+  public abstract void releasePbufferFromTexture();
+
+  public abstract ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3);
+
+  public final void setSwapInterval(final int interval) {
+    GLContext current = getCurrent();
+    if (current != this) {
+        throw new GLException("This context is not current. Current context: "+current+
+                              ", this context "+this);
+    }
+    setSwapIntervalImpl(interval);
+  }
+  protected void setSwapIntervalImpl(final int interval) { /** nop per default .. **/  }
+  protected int currentSwapInterval = -1; // default: not set yet ..
+  public int getSwapInterval() {
+    return currentSwapInterval;
+  }
+
+  /** Maps the given "platform-independent" function name to a real function
+      name. Currently this is only used to map "glAllocateMemoryNV" and
+      associated routines to wglAllocateMemoryNV / glXAllocateMemoryNV. */
+  protected String mapToRealGLFunctionName(String glFunctionName) {
+    Map/*<String, String>*/ map = getFunctionNameMap();
+    String lookup = ( null != map ) ? (String) map.get(glFunctionName) : null;
+    if (lookup != null) {
+      return lookup;
+    }
+    return glFunctionName;
+  }
+  protected abstract Map/*<String, String>*/ getFunctionNameMap() ;
+
+  /** Maps the given "platform-independent" extension name to a real
+      function name. Currently this is only used to map
+      "GL_ARB_pbuffer"      to  "WGL_ARB_pbuffer/GLX_SGIX_pbuffer" and 
+      "GL_ARB_pixel_format" to  "WGL_ARB_pixel_format/n.a." 
+   */
+  protected String mapToRealGLExtensionName(String glExtensionName) {
+    Map/*<String, String>*/ map = getExtensionNameMap();
+    String lookup = ( null != map ) ? (String) map.get(glExtensionName) : null;
+    if (lookup != null) {
+      return lookup;
+    }
+    return glExtensionName;
+  }
+  protected abstract Map/*<String, String>*/ getExtensionNameMap() ;
+
+  /** Helper routine which resets a ProcAddressTable generated by the
+      GLEmitter by looking up anew all of its function pointers. */
+  protected void resetProcAddressTable(ProcAddressTable table) {
+    table.reset(getDrawableImpl().getGLDynamicLookupHelper() );
+  }
+
+  /**
+   * Sets the OpenGL implementation class and
+   * the cache of which GL functions are available for calling through this
+   * context. See {@link #isFunctionAvailable(String)} for more information on
+   * the definition of "available".
+   * <br>
+   * All ProcaddressTables are being determined, the GL version is being set
+   * and the extension cache is determined as well.
+   *
+   * @param force force the setting, even if is already being set.
+   *              This might be useful if you change the OpenGL implementation.
+   * @param major OpenGL major version
+   * @param minor OpenGL minor version
+   * @param ctxProfileBits OpenGL context profile and option bits, see {@link javax.media.opengl.GLContext#CTX_OPTION_ANY}
+   *
+   * @see #setContextVersion
+   * @see javax.media.opengl.GLContext#CTX_OPTION_ANY
+   * @see javax.media.opengl.GLContext#CTX_PROFILE_COMPAT
+   */
+  protected final void setGLFunctionAvailability(boolean force, int major, int minor, int ctxProfileBits) {
+    if(null!=this.gl && null!=glProcAddressTable && !force) {
+        return; // already done and not forced
+    }
+    if(null==this.gl || force) {
+        setGL(createGL(getGLDrawable().getGLProfile()));
+    }
+
+    updateGLXProcAddressTable();
+
+    AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice();
+    final int ctxImplBits = drawable.getChosenGLCapabilities().getHardwareAccelerated() ? GLContext.CTX_IMPL_ACCEL_HARD : GLContext.CTX_IMPL_ACCEL_SOFT;
+    contextFQN = getContextFQN(adevice, major, minor, ctxProfileBits, ctxImplBits);
+    if (DEBUG) {
+      System.err.println(getThreadName() + ": !!! Context FQN: "+contextFQN);
+    }
+
+    //
+    // UpdateGLProcAddressTable functionality
+    //
+    if(null==this.gl) {
+        throw new GLException("setGLFunctionAvailability not called yet");
+    }
+
+    ProcAddressTable table = null;
+    synchronized(mappedContextTypeObjectLock) {
+        table = (ProcAddressTable) mappedGLProcAddress.get( contextFQN );
+        if(null != table && !verifyInstance(gl.getGLProfile(), "ProcAddressTable", table)) {
+            throw new InternalError("GLContext GL ProcAddressTable mapped key("+contextFQN+") -> "+
+                  table.getClass().getName()+" not matching "+gl.getGLProfile().getGLImplBaseClassName());
+        }
+    }
+    if(null != table) {
+        glProcAddressTable = table;
+        if(DEBUG) {
+            System.err.println(getThreadName() + ": !!! GLContext GL ProcAddressTable reusing key("+contextFQN+") -> "+table.hashCode());
+        }
+    } else {
+        if (glProcAddressTable == null) {
+          glProcAddressTable = (ProcAddressTable) createInstance(gl.getGLProfile(), "ProcAddressTable",
+                                                                 new Class[] { FunctionAddressResolver.class } ,
+                                                                 new Object[] { new GLProcAddressResolver() } );
+        }
+        resetProcAddressTable(getGLProcAddressTable());
+        synchronized(mappedContextTypeObjectLock) {
+            mappedGLProcAddress.put(contextFQN, getGLProcAddressTable());
+            if(DEBUG) {
+                System.err.println(getThreadName() + ": !!! GLContext GL ProcAddressTable mapping key("+contextFQN+") -> "+getGLProcAddressTable().hashCode());
+            }
+        }
+    }
+
+    //
+    // Set GL Version
+    //
+    setContextVersion(major, minor, ctxProfileBits);
+
+    //
+    // Update ExtensionAvailabilityCache
+    //
+    ExtensionAvailabilityCache eCache;
+    synchronized(mappedContextTypeObjectLock) {
+        eCache = (ExtensionAvailabilityCache) mappedExtensionAvailabilityCache.get( contextFQN );
+    }
+    if(null !=  eCache) {
+        extensionAvailability = eCache;
+        if(DEBUG) {
+            System.err.println(getThreadName() + ": !!! GLContext GL ExtensionAvailabilityCache reusing key("+contextFQN+") -> "+eCache.hashCode());
+        }
+    } else {
+        if(null==extensionAvailability) {
+            extensionAvailability = new ExtensionAvailabilityCache(this);
+        }
+        extensionAvailability.reset();
+        synchronized(mappedContextTypeObjectLock) {
+            mappedExtensionAvailabilityCache.put(contextFQN, extensionAvailability);
+            if(DEBUG) {
+                System.err.println(getThreadName() + ": !!! GLContext GL ExtensionAvailabilityCache mapping key("+contextFQN+") -> "+extensionAvailability.hashCode());
+            }
+        }
+    }
+
+    hasNativeES2Methods = isGLES2() || isExtensionAvailable("GL_ARB_ES2_compatibility") ;
+  }
+
+  /**
+   * Updates the platform's 'GLX' function cache
+   */
+  protected abstract void updateGLXProcAddressTable();
+
+  protected boolean hasNativeES2Methods = false;
+
+  public final boolean hasNativeES2Methods() { return hasNativeES2Methods; }
+
+  /**
+   * Returns true if the specified OpenGL core- or extension-function can be
+   * successfully called using this GL context given the current host (OpenGL
+   * <i>client</i>) and display (OpenGL <i>server</i>) configuration.
+   *
+   * See {@link GL#isFunctionAvailable(String)} for more details.
+   *
+   * @param glFunctionName the name of the OpenGL function (e.g., use
+   * "glPolygonOffsetEXT" or "glPolygonOffset" to check if the {@link
+   * javax.media.opengl.GL#glPolygonOffset(float,float)} is available).
+   */
+  public boolean isFunctionAvailable(String glFunctionName) {
+    // Check GL 1st (cached)
+    ProcAddressTable pTable = getGLProcAddressTable(); // null if ctx not created once
+    if(null!=pTable) {
+        try {
+            if(0!=pTable.getAddressFor(glFunctionName)) {
+                return true;
+            }
+        } catch (Exception e) {}
+    }
+
+    // Check platform extensions 2nd (cached) - had to be enabled once
+    pTable = getPlatformExtProcAddressTable(); // null if ctx not created once
+    if(null!=pTable) {
+        try {
+            if(0!=pTable.getAddressFor(glFunctionName)) {
+                return true;
+            }
+        } catch (Exception e) {}
+    }
+
+    // dynamic function lookup at last incl name aliasing (not cached)
+    DynamicLookupHelper dynLookup = getDrawableImpl().getGLDynamicLookupHelper();
+    String tmpBase = GLExtensionNames.normalizeVEN(GLExtensionNames.normalizeARB(glFunctionName, true), true);
+    long addr = 0;
+    int  variants = GLExtensionNames.getFuncNamePermutationNumber(tmpBase);
+    for(int i = 0; 0==addr && i < variants; i++) {
+        String tmp = GLExtensionNames.getFuncNamePermutation(tmpBase, i);
+        try {
+            addr = dynLookup.dynamicLookupFunction(tmp);
+        } catch (Exception e) { }
+    }
+    if(0!=addr) {
+        return true;
+    }
+    return false;
+  }
+
+  /**
+   * Returns true if the specified OpenGL extension can be
+   * successfully called using this GL context given the current host (OpenGL
+   * <i>client</i>) and display (OpenGL <i>server</i>) configuration.
+   *
+   * See {@link GL#isExtensionAvailable(String)} for more details.
+   *
+   * @param glExtensionName the name of the OpenGL extension (e.g.,
+   * "GL_VERTEX_PROGRAM_ARB").
+   */
+  public boolean isExtensionAvailable(String glExtensionName) {
+      if(null!=extensionAvailability) {
+        return extensionAvailability.isExtensionAvailable(mapToRealGLExtensionName(glExtensionName));
+      }
+      return false;
+  }
+
+  public String getPlatformExtensionsString() {
+      if(null!=extensionAvailability) {
+        return extensionAvailability.getPlatformExtensionsString();
+      }
+      return null;
+  }
+
+  public String getGLExtensionsString() {
+      if(null!=extensionAvailability) {
+        return extensionAvailability.getGLExtensionsString();
+      }
+      return null;
+  }
+
+  public final boolean isExtensionCacheInitialized() {
+      if(null!=extensionAvailability) {
+        return extensionAvailability.isInitialized();
+      }
+      return false;
+  }
+
+  protected static String getContextFQN(AbstractGraphicsDevice device, int major, int minor, int ctxProfileBits, int ctxImplBits) {
+      return device.getUniqueID() + "-" + toHexString(compose8bit(major, minor, ctxProfileBits, ctxImplBits));
+  }
+
+  protected String getContextFQN() {
+      return contextFQN;
+  }
+
+  /** Indicates which floating-point pbuffer implementation is in
+      use. Returns one of GLPbuffer.APPLE_FLOAT, GLPbuffer.ATI_FLOAT,
+      or GLPbuffer.NV_FLOAT. */
+  public int getFloatingPointMode() throws GLException {
+    throw new GLException("Not supported on non-pbuffer contexts");
+  }
+
+  /** On some platforms the mismatch between OpenGL's coordinate
+      system (origin at bottom left) and the window system's
+      coordinate system (origin at top left) necessitates a vertical
+      flip of pixels read from offscreen contexts. */
+  public abstract boolean offscreenImageNeedsVerticalFlip();
+
+  /** Only called for offscreen contexts; needed by glReadPixels */
+  public abstract int getOffscreenContextPixelDataType();
+
+
+  //----------------------------------------------------------------------
+  // Helpers for buffer object optimizations
+  
+  public void setBufferSizeTracker(GLBufferSizeTracker bufferSizeTracker) {
+    this.bufferSizeTracker = bufferSizeTracker;
+  }
+
+  public GLBufferSizeTracker getBufferSizeTracker() {
+    return bufferSizeTracker;
+  }
+
+  public GLBufferStateTracker getBufferStateTracker() {
+    return bufferStateTracker;
+  }
+
+  public GLStateTracker getGLStateTracker() {
+    return glStateTracker;
+  }
+
+  //---------------------------------------------------------------------------
+  // Helpers for context optimization where the last context is left
+  // current on the OpenGL worker thread
+  //
+
+  public boolean hasWaiters() {
+    return lock.hasWaiters();
+  }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLContextLock.java b/src/jogl/classes/jogamp/opengl/GLContextLock.java
new file mode 100644
index 0000000..f725508
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLContextLock.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import javax.media.opengl.*;
+
+/** Implements the makeCurrent / release locking behavior of the
+    GLContext class. When "fail fast mode" is enabled, attempts to
+    lock the same GLContextLock on more than one thread cause
+    GLException to be raised. This lock is not recursive. Attempts to
+    lock it more than once on a given thread will cause GLException to
+    be raised. */
+
+public class GLContextLock {
+  protected static final boolean DEBUG = GLContextImpl.DEBUG;
+
+  static class SyncData {
+      boolean failFastMode = true;
+      Thread owner = null;
+      int waiters = 0;
+      Exception lockedStack = null; // only enabled if DEBUG
+  }
+  private SyncData sdata = new SyncData(); // synchronized (flow/mem)  mutable access
+
+  /** Locks this GLContextLock on the current thread. If fail fast
+      mode is enabled and the GLContextLock is already owned by
+      another thread, throws GLException. */
+  public final void lock() throws GLException {
+    synchronized(sdata) {
+      Thread current = Thread.currentThread();
+      if (sdata.owner == null) {
+        sdata.owner = current;
+        if(DEBUG) {
+            sdata.lockedStack = new Exception("Error: Previously made current (1) by "+sdata.owner+", lock: "+this);
+        }
+      } else if (sdata.owner != current) {
+        while (sdata.owner != null) {
+          if (sdata.failFastMode) {
+            if(null!=sdata.lockedStack) {
+                sdata.lockedStack.printStackTrace();
+            }
+            throw new GLException("Error: Attempt to make context current on thread " + current +
+                                  " which is already current on thread " + sdata.owner);
+          } else {
+            try {
+              ++sdata.waiters;
+              sdata.wait();
+            } catch (InterruptedException e) {
+              throw new GLException(e);
+            } finally {
+              --sdata.waiters;
+            }
+          }
+        }
+        sdata.owner = current;
+        if(DEBUG) {
+            sdata.lockedStack = new Exception("Previously made current (2) by "+sdata.owner+", lock: "+this);
+        }
+      } else {
+        throw new GLException("Attempt to make the same context current twice on thread " + current);
+      }
+    }
+  }
+
+  /** Unlocks this GLContextLock. */
+  public final void unlock() throws GLException {
+    synchronized (sdata) {
+      Thread current = Thread.currentThread();
+      if (sdata.owner == current) {
+        sdata.owner = null;
+        sdata.lockedStack = null;
+        // Assuming notify() implementation weaks up the longest waiting thread, to avoid starvation. 
+        // Otherwise we would need to have a Thread queue implemented, using sleep(timeout) and interrupt.
+        sdata.notify();
+      } else {
+        if (sdata.owner != null) {
+          throw new GLException("Attempt by thread " + current +
+                                " to release context owned by thread " + sdata.owner);
+        } else {
+          throw new GLException("Attempt by thread " + current +
+                                " to release unowned context");
+        }
+      }
+    }
+  }
+
+  /** Indicates whether this lock is held by the current thread. */
+  public final boolean isHeld() {
+    synchronized(sdata) {
+      return (Thread.currentThread() == sdata.owner);
+    }
+  }
+
+  public final void setFailFastMode(boolean onOrOff) {
+    synchronized(sdata) {
+        sdata.failFastMode = onOrOff;
+    }
+  }
+
+  public final boolean getFailFastMode() {
+    synchronized(sdata) {
+        return sdata.failFastMode;
+    }
+  }
+
+  public final boolean hasWaiters() {
+    synchronized(sdata) {
+        return (0 != sdata.waiters);
+    }
+  }
+
+  /** holding the owners stack trace when lock is acquired and DEBUG is true */
+  public final Exception getLockedStack() {
+    synchronized(sdata) {
+        return sdata.lockedStack;
+    }
+  }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLContextShareSet.java b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
new file mode 100644
index 0000000..bbb4614
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+// FIXME: refactor Java SE dependencies
+// import java.awt.GraphicsConfiguration;
+// import java.awt.GraphicsDevice;
+// import java.awt.GraphicsEnvironment;
+import java.lang.ref.*;
+import java.util.*;
+import javax.media.opengl.*;
+
+/** Provides a mechanism by which OpenGL contexts can share textures
+    and display lists in the face of multithreading and asynchronous
+    context creation as is inherent in the AWT and Swing. */
+
+public class GLContextShareSet {
+  // FIXME: refactor Java SE dependencies
+  //  private static boolean forceTracking = Debug.isPropertyDefined("jogl.glcontext.forcetracking");
+  private static final boolean DEBUG = Debug.debug("GLContext");
+
+  // This class is implemented with a WeakHashMap that goes from the
+  // contexts as keys to a complex data structure as value that tracks
+  // context creation and deletion.
+
+  private static Map/*<GLContext, ShareSet>*/ shareMap = new WeakHashMap();
+  private static Object dummyValue = new Object();
+
+  private static class ShareSet {
+    private Map allShares       = new WeakHashMap();
+    private Map createdShares   = new WeakHashMap();
+    private Map destroyedShares = new WeakHashMap();
+
+    public void add(GLContext ctx) {
+      if (allShares.put(ctx, dummyValue) == null) {
+        // FIXME: downcast to GLContextImpl undesirable
+        if (((GLContextImpl) ctx).isCreated()) {
+          createdShares.put(ctx, dummyValue);
+        } else {
+          destroyedShares.put(ctx, dummyValue);
+        }
+      }      
+    }
+
+    public GLContext getCreatedShare(GLContext ignore) {
+      for (Iterator iter = createdShares.keySet().iterator(); iter.hasNext(); ) {
+        GLContext ctx = (GLContext) iter.next();
+        if (ctx != ignore) {
+          return ctx;
+        }
+      }
+      return null;
+    }
+
+    public void contextCreated(GLContext ctx) {
+      Object res = destroyedShares.remove(ctx);
+      assert res != null : "State of ShareSet corrupted; thought context " +
+        ctx + " should have been in destroyed set but wasn't";
+      res = createdShares.put(ctx, dummyValue);
+      assert res == null : "State of ShareSet corrupted; thought context " +
+        ctx + " shouldn't have been in created set but was";
+    }
+
+    public void contextDestroyed(GLContext ctx) {
+      Object res = createdShares.remove(ctx);
+      assert res != null : "State of ShareSet corrupted; thought context " +
+        ctx + " should have been in created set but wasn't";
+      res = destroyedShares.put(ctx, dummyValue);
+      assert res == null : "State of ShareSet corrupted; thought context " +
+        ctx + " shouldn't have been in destroyed set but was";
+    }
+  }
+
+  /** Indicate that contexts <code>share1</code> and
+      <code>share2</code> will share textures and display lists. Both
+      must be non-null. */
+  public static synchronized void registerSharing(GLContext share1, GLContext share2) {
+    if (share1 == null || share2 == null) {
+      throw new IllegalArgumentException("Both share1 and share2 must be non-null");
+    }
+    ShareSet share = entryFor(share1);
+    if (share == null) {
+      share = entryFor(share2);
+    }
+    if (share == null) {
+      share = new ShareSet();
+    }
+    share.add(share1);
+    share.add(share2);
+    addEntry(share1, share);
+    addEntry(share2, share);
+  }
+
+  public static synchronized GLContext getShareContext(GLContext contextToCreate) {
+    ShareSet share = entryFor(contextToCreate);
+    if (share == null) {
+      return null;
+    }
+    return share.getCreatedShare(contextToCreate);
+  }
+
+  public static synchronized void contextCreated(GLContext context) {
+    ShareSet share = entryFor(context);
+    if (share != null) {
+      share.contextCreated(context);
+    }
+  }
+
+  public static synchronized void contextDestroyed(GLContext context) {
+    ShareSet share = entryFor(context);
+    if (share != null) {
+      share.contextDestroyed(context);
+    }
+  }
+
+  /** In order to avoid glGet calls for buffer object checks related
+      to glVertexPointer, etc. calls as well as glMapBuffer calls, we
+      need to share the same GLBufferSizeTracker object between
+      contexts sharing textures and display lists. For now we keep
+      this mechanism orthogonal to the GLObjectTracker to hopefully
+      keep things easier to understand. (The GLObjectTracker is
+      currently only needed in a fairly esoteric case, when the
+      Java2D/JOGL bridge is active, but the GLBufferSizeTracker
+      mechanism is now always required.) */
+  public static void registerForBufferObjectSharing(GLContext olderContextOrNull, GLContext newContext) {
+    // FIXME: downcasts to GLContextImpl undesirable
+    GLContextImpl older = (GLContextImpl) olderContextOrNull;
+    GLContextImpl newer = (GLContextImpl) newContext;
+    GLBufferSizeTracker tracker = null;
+    if (older != null) {
+      tracker = older.getBufferSizeTracker();
+      assert (tracker != null)
+        : "registerForBufferObjectSharing was not called properly for the older context, or has a bug in it";
+    }
+    if (tracker == null) {
+      tracker = new GLBufferSizeTracker();
+    }
+    newer.setBufferSizeTracker(tracker);
+  }
+
+  // FIXME: refactor Java SE dependencies
+  //  /** Indicates that the two supplied contexts (which must be able to
+  //      share textures and display lists) should be in the same
+  //      namespace for tracking of server-side object creation and
+  //      deletion. Because the sharing necessary behind the scenes is
+  //      different than that requested at the user level, the two notions
+  //      are different. This must be called immediately after the
+  //      creation of the new context (which is the second argument)
+  //      before any server-side OpenGL objects have been created in that
+  //      context. */
+  //  public static void registerForObjectTracking(GLContext olderContextOrNull,
+  //                                               GLContext newContext,
+  //                                               GLContext realShareContext) {
+  //    if (isObjectTrackingEnabled() || isObjectTrackingDebuggingEnabled()) {
+  //      GLContextImpl impl1 = null;      
+  //      GLContextImpl impl2 = null;      
+  //      GLObjectTracker tracker = null;
+  //
+  //      synchronized (GLContextShareSet.class) {
+  //        if (olderContextOrNull != null &&
+  //            newContext != null) {
+  //          if (entryFor(olderContextOrNull) != entryFor(newContext)) {
+  //            throw new IllegalArgumentException("old and new contexts must be able to share textures and display lists");
+  //          }
+  //        }
+  //
+  //        // FIXME: downcast to GLContextImpl undesirable
+  //        impl1 = (GLContextImpl) olderContextOrNull;
+  //        impl2 = (GLContextImpl) newContext;
+  //
+  //        GLObjectTracker deletedObjectTracker = null;
+  //        GLContextImpl shareImpl = (GLContextImpl) realShareContext;
+  //        // Before we zap the "user-level" object trackers, make sure
+  //        // that all contexts in the share set share the destroyed object
+  //        // tracker
+  //        if (shareImpl != null) {
+  //          deletedObjectTracker = shareImpl.getDeletedObjectTracker();
+  //        }
+  //        if (deletedObjectTracker == null) {
+  //          // Must create one and possibly set it up in the older context
+  //          deletedObjectTracker = new GLObjectTracker();
+  //          if (DEBUG) {
+  //            System.err.println("Created deletedObjectTracker " + deletedObjectTracker + " because " +
+  //                               ((shareImpl == null) ? "shareImpl was null" : "shareImpl's (" + shareImpl + ") deletedObjectTracker was null"));
+  //          }
+  //
+  //          if (shareImpl != null) {
+  //            // FIXME: think should really assert in this case
+  //            shareImpl.setDeletedObjectTracker(deletedObjectTracker);
+  //            if (DEBUG) {
+  //              System.err.println("Set deletedObjectTracker " + deletedObjectTracker + " in shareImpl context " + shareImpl);
+  //            }
+  //          }
+  //        }
+  //        impl2.setDeletedObjectTracker(deletedObjectTracker);
+  //        if (DEBUG) {
+  //          System.err.println("Set deletedObjectTracker " + deletedObjectTracker + " in impl2 context " + impl2);
+  //        }
+  //      }
+  //
+  //      // Must not hold lock around this operation
+  //      // Don't share object trackers with the primordial share context from Java2D
+  //      if (Java2D.isOGLPipelineActive()) {
+  //        // FIXME: probably need to do something different here
+  //        // Need to be able to figure out the GraphicsDevice for the
+  //        // older context if it's on-screen
+  //        GraphicsDevice device = GraphicsEnvironment.
+  //          getLocalGraphicsEnvironment().
+  //          getDefaultScreenDevice();
+  //        GLContext j2dShareContext = Java2D.getShareContext(device);
+  //        if (impl1 != null && impl1 == j2dShareContext) {
+  //          impl1 = null;
+  //        }
+  //      }
+  //
+  //      synchronized (GLContextShareSet.class) {
+  //        if (impl1 != null) {
+  //          tracker = impl1.getObjectTracker();
+  //          assert (tracker != null)
+  //            : "registerForObjectTracking was not called properly for the older context";
+  //        }
+  //        if (tracker == null) {
+  //          tracker = new GLObjectTracker();
+  //        }
+  //        // Note that we don't assert that the tracker is non-null for
+  //        // impl2 because the way we use this functionality we actually
+  //        // overwrite the initially-set object tracker in the new context
+  //        impl2.setObjectTracker(tracker);
+  //      }
+  //    }
+  //  }
+  
+  //----------------------------------------------------------------------
+  // Internals only below this point
+  
+
+  private static ShareSet entryFor(GLContext context) {
+    return (ShareSet) shareMap.get(context);
+  }
+
+  private static void addEntry(GLContext context, ShareSet share) {
+    if (shareMap.get(context) == null) {
+      shareMap.put(context, share);
+    }
+  }
+
+  // FIXME: refactor Java SE dependencies
+  //  private static boolean isObjectTrackingEnabled() {
+  //    return ((Java2D.isOGLPipelineActive() && Java2D.isFBOEnabled()) ||
+  //            isObjectTrackingDebuggingEnabled());
+  //  }
+  //
+  //  private static boolean isObjectTrackingDebuggingEnabled() {
+  //    return forceTracking;
+  //  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
new file mode 100644
index 0000000..e04ced6
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
@@ -0,0 +1,467 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import java.nio.*;
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+
+/** Extends GLDrawableFactory with a few methods for handling
+    typically software-accelerated offscreen rendering (Device
+    Independent Bitmaps on Windows, pixmaps on X11). Direct access to
+    these GLDrawables is not supplied directly to end users, though
+    they may be instantiated by the GLJPanel implementation. */
+public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
+  protected static final boolean DEBUG = GLDrawableImpl.DEBUG;
+
+  protected GLDrawableFactoryImpl() {
+    super();
+  }
+
+  /**
+   * Returns the shared device mapped to the <code>device</code> {@link AbstractGraphicsDevice#getConnection()},
+   * either a preexisting or newly created, or <code>null</code> if creation failed or not supported.<br>
+   * Creation of the shared context is tried only once.
+   *
+   * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared device to be used, may be <code>null</code> for the platform's default device.
+   */
+  protected final AbstractGraphicsDevice getOrCreateSharedDevice(AbstractGraphicsDevice device) {
+      if(null==device) {
+          device = getDefaultDevice();
+          if(null==device) {
+              throw new InternalError("no default device");
+          }
+          if (GLProfile.DEBUG) {
+              System.err.println("Info: GLDrawableFactoryImpl.getOrCreateSharedContext: using default device : "+device);
+          }
+      } else if( !getIsDeviceCompatible(device) ) {
+          if (GLProfile.DEBUG) {
+              System.err.println("Info: GLDrawableFactoryImpl.getOrCreateSharedContext: device not compatible : "+device);
+          }
+          return null;
+      }
+      return getOrCreateSharedDeviceImpl(device);
+  }
+  protected abstract AbstractGraphicsDevice getOrCreateSharedDeviceImpl(AbstractGraphicsDevice device);
+
+  /** 
+   * Returns the GLDynamicLookupHelper
+   * @param profile if EGL/ES, profile <code>1</code> refers to ES1 and <code>2</code> to ES2,
+   *        otherwise the profile is ignored.
+   */
+  public abstract GLDynamicLookupHelper getGLDynamicLookupHelper(int profile);
+
+  //---------------------------------------------------------------------------
+  // Dispatching GLDrawable construction in respect to the NativeSurface Capabilities
+  //
+  public GLDrawable createGLDrawable(NativeSurface target) {
+    if (target == null) {
+      throw new IllegalArgumentException("Null target");
+    }
+    AbstractGraphicsConfiguration config = target.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+    AbstractGraphicsDevice adevice = config.getScreen().getDevice();
+    GLDrawable result = null;
+    adevice.lock();
+    try {
+        if(caps.isOnscreen()) {
+            if(DEBUG) {
+                System.err.println("GLDrawableFactoryImpl.createGLDrawable -> OnscreenDrawable: "+target);
+            }
+            result = createOnscreenDrawableImpl(target);
+        } else {
+            if( ! ( target instanceof SurfaceChangeable ) ) {
+                throw new IllegalArgumentException("Passed NativeSurface must implement SurfaceChangeable for offscreen: "+target);
+            }
+            if(DEBUG) {
+                System.err.println("GLDrawableFactoryImpl.createGLDrawable -> OffScreenDrawable (PBuffer: "+caps.isPBuffer()+"): "+target);
+            }
+            result = createOffscreenDrawableImpl(target);
+        }
+    } finally {
+        adevice.unlock();
+    }
+    if(DEBUG) {
+        System.err.println("GLDrawableFactoryImpl.createGLDrawable: "+result);
+    }
+    return result;
+  }
+
+  //---------------------------------------------------------------------------
+  //
+  // Onscreen GLDrawable construction 
+  //
+
+  protected abstract GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target);
+
+  //---------------------------------------------------------------------------
+  //
+  // PBuffer GLDrawable construction 
+  //
+
+  public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device);
+
+  public GLPbuffer createGLPbuffer(AbstractGraphicsDevice deviceReq,
+                                   GLCapabilitiesImmutable capsRequested,
+                                   GLCapabilitiesChooser chooser,
+                                   int width,
+                                   int height,
+                                   GLContext shareWith) {
+    if(height<=0 || height<=0) {
+        throw new GLException("Width and height of pbuffer must be positive (were (" +
+                        width + ", " + height + "))");
+    }
+
+    AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
+    if(null == device) {
+        throw new GLException("No shared device for requested: "+deviceReq);
+    }
+
+    if (!canCreateGLPbuffer(device)) {
+        throw new GLException("Pbuffer support not available with device: "+device);
+    }
+    
+    GLCapabilitiesImmutable capsChosen = GLGraphicsConfigurationUtil.fixGLPBufferGLCapabilities(capsRequested);
+    GLDrawableImpl drawable = null;
+    device.lock();
+    try {
+        drawable = (GLDrawableImpl) createGLDrawable( createOffscreenSurfaceImpl(device, capsChosen, capsRequested, chooser, width, height) );
+    } finally {
+        device.unlock();
+    }
+
+    if(null==drawable) {
+        throw new GLException("Could not create Pbuffer drawable for: "+device+", "+capsChosen+", "+width+"x"+height);
+    }
+    return new GLPbufferImpl( drawable, shareWith);
+  }
+
+
+  //---------------------------------------------------------------------------
+  //
+  // Offscreen GLDrawable construction 
+  //
+
+  protected abstract GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) ;
+
+  public GLDrawable createOffscreenDrawable(AbstractGraphicsDevice deviceReq,
+                                            GLCapabilitiesImmutable capsRequested,
+                                            GLCapabilitiesChooser chooser,
+                                            int width,
+                                            int height) {
+    if(width<=0 || height<=0) {
+        throw new GLException("Width and height of pbuffer must be positive (were (" +
+                        width + ", " + height + "))");
+    }
+    AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
+    if(null == device) {
+        throw new GLException("No shared device for requested: "+deviceReq);
+    }
+    GLCapabilitiesImmutable capsChosen = GLGraphicsConfigurationUtil.fixOffScreenGLCapabilities(capsRequested, canCreateGLPbuffer(deviceReq));
+
+    device.lock();
+    try {
+        return createGLDrawable( createOffscreenSurfaceImpl(device, capsChosen, capsRequested, chooser, width, height) );
+    } finally {
+        device.unlock();
+    }
+  }
+
+  public NativeSurface createOffscreenSurface(AbstractGraphicsDevice deviceReq,
+                                              GLCapabilitiesImmutable capsRequested,
+                                              GLCapabilitiesChooser chooser,
+                                              int width, int height) {
+    AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
+    if(null == device) {
+        throw new GLException("No shared device for requested: "+deviceReq);
+    }
+    GLCapabilitiesImmutable capsChosen = GLGraphicsConfigurationUtil.fixOffScreenGLCapabilities(capsRequested, canCreateGLPbuffer(deviceReq));
+
+    device.lock();
+    try {
+        return createOffscreenSurfaceImpl(device, capsChosen, capsRequested, chooser, width, height);
+    } finally {
+        device.unlock();
+    }
+  }
+
+  /**
+   * creates an offscreen NativeSurface, which must implement SurfaceChangeable as well,
+   * so the windowing system related implementation is able to set the surface handle.
+   */
+  protected abstract NativeSurface createOffscreenSurfaceImpl(AbstractGraphicsDevice device,
+                                                              GLCapabilitiesImmutable capabilities, GLCapabilitiesImmutable capsRequested,
+                                                              GLCapabilitiesChooser chooser,
+                                                              int width, int height);
+
+  public ProxySurface createProxySurface(AbstractGraphicsDevice device, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+    if(null == device) {
+        throw new GLException("No shared device for requested: "+device);
+    }
+
+    device.lock();
+    try {
+        return createProxySurfaceImpl(device, windowHandle, capsRequested, chooser);
+    } finally {
+        device.unlock();
+    }
+  }  
+  
+  protected abstract ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice device, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser);
+
+  //---------------------------------------------------------------------------
+  //
+  // External GLDrawable construction
+  //
+
+  protected abstract GLContext createExternalGLContextImpl();
+  
+  public GLContext createExternalGLContext() {
+    NativeWindowFactory.getDefaultToolkitLock().lock();
+    try {
+        return createExternalGLContextImpl();
+    } finally {
+        NativeWindowFactory.getDefaultToolkitLock().unlock();
+    }
+  }
+
+  protected abstract GLDrawable createExternalGLDrawableImpl();
+
+  public GLDrawable createExternalGLDrawable() {
+    NativeWindowFactory.getDefaultToolkitLock().lock();
+    try {
+        return createExternalGLDrawableImpl();
+    } finally {
+        NativeWindowFactory.getDefaultToolkitLock().unlock();
+    }
+  }
+
+
+  //---------------------------------------------------------------------------
+  //
+  // GLDrawableFactoryImpl details
+  //
+
+  protected void maybeDoSingleThreadedWorkaround(Runnable action) {
+    if (Threading.isSingleThreaded() &&
+        !Threading.isOpenGLThread()) {
+      Threading.invokeOnOpenGLThread(action);
+    } else {
+      action.run();
+    }
+  }
+
+  /**
+   * Returns the sole GLDrawableFactoryImpl instance.
+   *
+   * @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
+   *                or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
+   */
+  public static GLDrawableFactoryImpl getFactoryImpl(GLProfile glp) {
+    return (GLDrawableFactoryImpl) getFactory(glp);
+  }
+
+  //---------------------------------------------------------------------------
+  // Support for Java2D/JOGL bridge on Mac OS X; the external
+  // GLDrawable mechanism in the public API is sufficient to
+  // implement this functionality on all other platforms
+  //
+
+  public abstract boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device);
+
+  public abstract GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+    throws GLException;
+
+  //----------------------------------------------------------------------
+  // Gamma adjustment support
+  // Thanks to the LWJGL team for illustrating how to make these
+  // adjustments on various OSs.
+
+  /*
+   * Portions Copyright (c) 2002-2004 LWJGL Project
+   * All rights reserved.
+   *
+   * Redistribution and use in source and binary forms, with or without
+   * modification, are permitted provided that the following conditions are
+   * met:
+   *
+   * * Redistributions of source code must retain the above copyright
+   *   notice, this list of conditions and the following disclaimer.
+   *
+   * * Redistributions in binary form must reproduce the above copyright
+   *   notice, this list of conditions and the following disclaimer in the
+   *   documentation and/or other materials provided with the distribution.
+   *
+   * * Neither the name of 'LWJGL' nor the names of
+   *   its contributors may be used to endorse or promote products derived
+   *   from this software without specific prior written permission.
+   *
+   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+   * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   */
+
+  /**
+   * Sets the gamma, brightness, and contrast of the current main
+   * display. Returns true if the settings were changed, false if
+   * not. If this method returns true, the display settings will
+   * automatically be reset upon JVM exit (assuming the JVM does not
+   * crash); if the user wishes to change the display settings back to
+   * normal ahead of time, use resetDisplayGamma(). Throws
+   * IllegalArgumentException if any of the parameters were
+   * out-of-bounds.
+   * 
+   * @param gamma The gamma value, typically > 1.0 (default value is
+   *   1.0)
+   * @param brightness The brightness value between -1.0 and 1.0,
+   *   inclusive (default value is 0)
+   * @param contrast The contrast, greater than 0.0 (default value is 1)
+   * @throws IllegalArgumentException if any of the parameters were
+   *   out-of-bounds
+   */
+  public boolean setDisplayGamma(float gamma, float brightness, float contrast) throws IllegalArgumentException {
+    if ((brightness < -1.0f) || (brightness > 1.0f)) {
+      throw new IllegalArgumentException("Brightness must be between -1.0 and 1.0");
+    }
+    if (contrast < 0) {
+      throw new IllegalArgumentException("Contrast must be greater than 0.0");
+    }
+    // FIXME: ensure gamma is > 1.0? Are smaller / negative values legal?
+    int rampLength = getGammaRampLength();
+    if (rampLength == 0) {
+      return false;
+    }
+    float[] gammaRamp = new float[rampLength];
+    for (int i = 0; i < rampLength; i++) {
+      float intensity = (float) i / (float) (rampLength - 1);
+      // apply gamma
+      float rampEntry = (float) java.lang.Math.pow(intensity, gamma);
+      // apply brightness
+      rampEntry += brightness;
+      // apply contrast
+      rampEntry = (rampEntry - 0.5f) * contrast + 0.5f;
+      // Clamp entry to [0, 1]
+      if (rampEntry > 1.0f)
+        rampEntry = 1.0f;
+      else if (rampEntry < 0.0f)
+        rampEntry = 0.0f;
+      gammaRamp[i] = rampEntry;
+    }
+    registerGammaShutdownHook();
+    return setGammaRamp(gammaRamp);
+  }
+
+  public synchronized void resetDisplayGamma() {
+    if (gammaShutdownHook == null) {
+      throw new IllegalArgumentException("Should not call this unless setDisplayGamma called first");
+    }
+    resetGammaRamp(originalGammaRamp);
+    unregisterGammaShutdownHook();
+  }
+
+  //------------------------------------------------------
+  // Gamma-related methods to be implemented by subclasses
+  //
+
+  /** Returns the length of the computed gamma ramp for this OS and
+      hardware. Returns 0 if gamma changes are not supported. */
+  protected int getGammaRampLength() {
+    return 0;
+  }
+
+  /** Sets the gamma ramp for the main screen. Returns false if gamma
+      ramp changes were not supported. */
+  protected boolean setGammaRamp(float[] ramp) {
+    return false;
+  }
+
+  /** Gets the current gamma ramp. This is basically an opaque value
+      used only on some platforms to reset the gamma ramp to its
+      original settings. */
+  protected Buffer getGammaRamp() {
+    return null;
+  }
+
+  /** Resets the gamma ramp, potentially using the specified Buffer as
+      data to restore the original values. */
+  protected void resetGammaRamp(Buffer originalGammaRamp) {
+  }
+
+  // Shutdown hook mechanism for resetting gamma
+  private boolean gammaShutdownHookRegistered;
+  private Thread  gammaShutdownHook;
+  private Buffer  originalGammaRamp;
+  private synchronized void registerGammaShutdownHook() {
+    if (gammaShutdownHookRegistered)
+      return;
+    if (gammaShutdownHook == null) {
+      gammaShutdownHook = new Thread(new Runnable() {
+          public void run() {
+            synchronized (GLDrawableFactoryImpl.this) {
+              resetGammaRamp(originalGammaRamp);
+            }
+          }
+        });
+      originalGammaRamp = getGammaRamp();
+    }
+    Runtime.getRuntime().addShutdownHook(gammaShutdownHook);
+    gammaShutdownHookRegistered = true;
+  }
+
+  private synchronized void unregisterGammaShutdownHook() {
+    if (!gammaShutdownHookRegistered)
+      return;
+    if (gammaShutdownHook == null) {
+      throw new InternalError("Error in gamma shutdown hook logic");
+    }
+    Runtime.getRuntime().removeShutdownHook(gammaShutdownHook);
+    gammaShutdownHookRegistered = false;
+    // Leave the original gamma ramp data alone
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
new file mode 100644
index 0000000..d079a1b
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
@@ -0,0 +1,387 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import java.util.*;
+import javax.media.opengl.*;
+
+/** Encapsulates the implementation of most of the GLAutoDrawable's
+    methods to be able to share it between GLCanvas and GLJPanel. */
+
+public class GLDrawableHelper {
+  protected static final boolean DEBUG = GLDrawableImpl.DEBUG;
+  private static final boolean VERBOSE = Debug.verbose();
+  private Object listenersLock = new Object();
+  private List listeners;
+  private volatile boolean listenersIter; // avoid java.util.ConcurrentModificationException
+  private Set listenersToBeInit;
+  private boolean autoSwapBufferMode;
+  private Object glRunnablesLock = new Object();
+  private ArrayList glRunnables;
+  private GLAnimatorControl animatorCtrl;
+
+  public GLDrawableHelper() {
+    reset();
+  }
+
+  public final void reset() {
+    synchronized(listenersLock) {
+        listeners = new ArrayList();
+        listenersIter = false;
+        listenersToBeInit = new HashSet();
+    }
+    autoSwapBufferMode = true;
+    synchronized(glRunnablesLock) {
+        glRunnables = new ArrayList();
+    }
+    animatorCtrl = null;
+  }
+
+  @Override
+  public final String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append("GLAnimatorControl: "+animatorCtrl+", ");
+    synchronized(listenersLock) {
+        sb.append("GLEventListeners num "+listeners.size()+" [");
+        listenersIter = true;
+        for (int i=0; i < listeners.size(); i++) {
+          Object l = listeners.get(i);
+          sb.append(l);
+          sb.append("[init ");
+          sb.append( !listenersToBeInit.contains(l) );
+          sb.append("], ");
+        }
+        listenersIter = false;
+    }
+    sb.append("]");
+    return sb.toString();
+  }
+
+  public final void addGLEventListener(GLEventListener listener) {
+    addGLEventListener(-1, listener);
+  }
+
+  public final void addGLEventListener(int index, GLEventListener listener) {
+    synchronized(listenersLock) {
+        if(0>index) {
+            index = listeners.size();
+        }
+        // GLEventListener may be added after context is created,
+        // hence we earmark initialization for the next display call.
+        listenersToBeInit.add(listener);
+        if(!listenersIter) {
+            // fast path
+            listeners.add(index, listener);
+        } else {
+            // copy mode in case this is issued while iterating, eg via init, display, ..
+            List newListeners = (List) ((ArrayList) listeners).clone();
+            newListeners.add(index, listener);
+            listeners = newListeners;
+        }
+    }
+  }
+  
+  public final void removeGLEventListener(GLEventListener listener) {
+    synchronized(listenersLock) {
+        if(!listenersIter) {
+            // fast path
+            listeners.remove(listener);
+        } else {
+            // copy mode in case this is issued while iterating, eg via init, display, ..
+            List newListeners = (List) ((ArrayList) listeners).clone();
+            newListeners.remove(listener);
+            listeners = newListeners;
+        }
+        listenersToBeInit.remove(listener);
+    }
+  }
+
+  /**
+   * Issues {@link javax.media.opengl.GLEventListener#dispose(javax.media.opengl.GLAutoDrawable)}
+   * to all listeners.
+   * @param drawable
+   */
+  public final void dispose(GLAutoDrawable drawable) {
+    synchronized(listenersLock) {
+        listenersIter = true;
+        for (int i=0; i < listeners.size(); i++) {
+          GLEventListener listener = (GLEventListener) listeners.get(i) ;
+          listener.dispose(drawable);
+        }
+        listenersIter = false;
+    }
+  }
+
+  private boolean init(GLEventListener l, GLAutoDrawable drawable, boolean sendReshape) {
+      if(listenersToBeInit.remove(l)) {
+          l.init(drawable);
+          if(sendReshape) {
+              reshape(l, drawable, 0, 0, drawable.getWidth(), drawable.getHeight(), true /* setViewport */);
+          }
+          return true;
+      }
+      return false;
+  }
+
+  public final void init(GLAutoDrawable drawable) {
+    synchronized(listenersLock) {
+        listenersIter = true;
+        for (int i=0; i < listeners.size(); i++) {
+          GLEventListener listener = (GLEventListener) listeners.get(i) ;
+
+          // If make current ctx, invoked by invokGL(..), results in a new ctx, init gets called.
+          // This may happen not just for initial setup, but for ctx recreation due to resource change (drawable/window),
+          // hence the must always be initialized unconditional.
+          listenersToBeInit.add(listener);
+
+          if ( ! init( listener, drawable, false ) ) {
+            throw new GLException("GLEventListener "+listener+" already initialized: "+drawable);
+          }
+        }
+        listenersIter = false;
+    }
+  }
+
+  public final void display(GLAutoDrawable drawable) {
+    synchronized(listenersLock) {
+        listenersIter = true;
+        for (int i=0; i < listeners.size(); i++) {
+          GLEventListener listener = (GLEventListener) listeners.get(i) ;
+          // GLEventListener may need to be init, 
+          // in case this one is added after the realization of the GLAutoDrawable
+          init( listener, drawable, true ) ; 
+          listener.display(drawable);
+        }
+        listenersIter = false;
+    }
+    execGLRunnables(drawable);
+  }
+
+  private void reshape(GLEventListener listener, GLAutoDrawable drawable,
+                             int x, int y, int width, int height, boolean setViewport) {
+    if(setViewport) {
+        drawable.getGL().glViewport(x, y, width, height);
+    }
+    listener.reshape(drawable, x, y, width, height);
+  }
+
+  public final void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    synchronized(listenersLock) {
+        listenersIter = true;
+        for (int i=0; i < listeners.size(); i++) {
+          reshape((GLEventListener) listeners.get(i), drawable, x, y, width, height, 0==i);
+        }
+        listenersIter = false;
+    }
+  }
+
+  private void execGLRunnables(GLAutoDrawable drawable) {
+    if(glRunnables.size()>0) {
+        // swap one-shot list asap
+        ArrayList _glRunnables = null;
+        synchronized(glRunnablesLock) {
+            if(glRunnables.size()>0) {
+                _glRunnables = glRunnables;
+                glRunnables = new ArrayList();
+            }
+        }
+        if(null!=_glRunnables) {
+            for (int i=0; i < _glRunnables.size(); i++) {
+              ((GLRunnable) _glRunnables.get(i)).run(drawable);
+            }
+        }
+    }
+  }
+
+  public final void setAnimator(GLAnimatorControl animator) throws GLException {
+    synchronized(glRunnablesLock) {
+        if(animatorCtrl!=animator && null!=animator && null!=animatorCtrl) {
+            throw new GLException("Trying to register GLAnimatorControl "+animator+", where "+animatorCtrl+" is already registered. Unregister first.");
+        }
+        animatorCtrl = animator;
+    }
+  }
+
+  public final GLAnimatorControl getAnimator() {
+    synchronized(glRunnablesLock) {
+        return animatorCtrl;
+    }
+  }
+
+  public final boolean isExternalAnimatorRunning() {
+    return ( null != animatorCtrl ) ? animatorCtrl.isStarted() && animatorCtrl.getThread() != Thread.currentThread() : false ;
+  }
+
+  public final boolean isExternalAnimatorAnimating() {
+    return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() && animatorCtrl.getThread() != Thread.currentThread() : false ;
+  }
+
+  public final void invoke(GLAutoDrawable drawable, boolean wait, GLRunnable glRunnable) {
+    if( null == drawable || null == glRunnable ) {
+        return;
+    }
+    Throwable throwable = null;
+    GLRunnableTask rTask = null;
+    Object rTaskLock = new Object();
+    synchronized(rTaskLock) {
+        boolean deferred;
+        synchronized(glRunnablesLock) {
+            deferred = isExternalAnimatorAnimating();
+            if(!deferred) {
+                wait = false; // don't wait if exec immediatly
+            }
+            rTask = new GLRunnableTask(glRunnable,
+                                       wait ? rTaskLock : null,
+                                       wait  /* catch Exceptions if waiting for result */);
+            glRunnables.add(rTask);
+        }
+        if( !deferred ) {
+            drawable.display();
+        } else if( wait ) {
+            try {
+                rTaskLock.wait(); // free lock, allow execution of rTask
+            } catch (InterruptedException ie) {
+                throwable = ie;
+            }
+            if(null==throwable) {
+                throwable = rTask.getThrowable();
+            }
+            if(null!=throwable) {
+                throw new RuntimeException(throwable);
+            }
+        }
+    }
+  }
+
+  public final void setAutoSwapBufferMode(boolean onOrOff) {
+    autoSwapBufferMode = onOrOff;
+  }
+
+  public final boolean getAutoSwapBufferMode() {
+    return autoSwapBufferMode;
+  }
+
+  private static final ThreadLocal perThreadInitAction = new ThreadLocal();
+
+  /** Principal helper method which runs a Runnable with the context
+      made current. This could have been made part of GLContext, but a
+      desired goal is to be able to implement GLAutoDrawable's in terms of
+      the GLContext's public APIs, and putting it into a separate
+      class helps ensure that we don't inadvertently use private
+      methods of the GLContext or its implementing classes.<br>
+   * <br>
+   * Remark: In case this method is called to dispose the GLDrawable/GLAutoDrawable,
+   * <code>initAction</code> shall be <code>null</code> to mark this cause.<br>
+   *
+   * @param drawable
+   * @param context
+   * @param runnable
+   * @param initAction
+   */
+  public final void invokeGL(GLDrawable drawable,
+                             GLContext context,
+                             Runnable  runnable,
+                             Runnable  initAction) {
+    if(null==context) {
+        if (DEBUG) {
+            Exception e = new GLException(Thread.currentThread().getName()+" Info: GLDrawableHelper " + this + ".invokeGL(): NULL GLContext");
+            e.printStackTrace();
+        }
+        return;
+    }
+
+    if(null==initAction) {
+        // disposal case
+        if(!context.isCreated()) {
+            throw new GLException(Thread.currentThread().getName()+" GLDrawableHelper " + this + ".invokeGL(): Dispose case (no init action given): Native context is not created: "+context);
+        }
+    }
+
+    // Support for recursive makeCurrent() calls as well as calling
+    // other drawables' display() methods from within another one's
+    GLContext lastContext    = GLContext.getCurrent();
+    Runnable  lastInitAction = (Runnable) perThreadInitAction.get();
+    if (lastContext != null) {
+      lastContext.release();
+    }
+  
+    int res = 0;
+    try {
+      res = context.makeCurrent();
+      if (res != GLContext.CONTEXT_NOT_CURRENT) {
+        if(null!=initAction) {
+            perThreadInitAction.set(initAction);
+            if (res == GLContext.CONTEXT_CURRENT_NEW) {
+              if (DEBUG) {
+                System.err.println("GLDrawableHelper " + this + ".invokeGL(): Running initAction");
+              }
+              initAction.run();
+            }
+        }
+        if(null!=runnable) {
+            if (DEBUG && VERBOSE) {
+              System.err.println("GLDrawableHelper " + this + ".invokeGL(): Running runnable");
+            }
+            runnable.run();
+            if (autoSwapBufferMode && null != initAction) {
+              if (drawable != null) {
+                drawable.swapBuffers();
+              }
+            }
+        }
+      }
+    } finally {
+      try {
+        if (res != GLContext.CONTEXT_NOT_CURRENT) {
+          context.release();
+        }
+      } catch (Exception e) {
+      }
+      if (lastContext != null) {
+        int res2 = lastContext.makeCurrent();
+        if (res2 == GLContext.CONTEXT_CURRENT_NEW) {
+          lastInitAction.run();
+        }
+      }
+    }
+  }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
new file mode 100644
index 0000000..af14e5f
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+
+public abstract class GLDrawableImpl implements GLDrawable {
+  protected static final boolean DEBUG = Debug.debug("GLDrawable");
+
+  protected GLDrawableImpl(GLDrawableFactory factory,
+                           NativeSurface comp,
+                           boolean realized) {
+      this.factory = factory;
+      this.surface = comp;
+      this.realized = realized;
+      this.requestedCapabilities = (GLCapabilitiesImmutable) surface.getGraphicsConfiguration().getNativeGraphicsConfiguration().getRequestedCapabilities();
+  }
+
+  /** 
+   * Returns the DynamicLookupHelper
+   */
+  public abstract GLDynamicLookupHelper getGLDynamicLookupHelper();
+
+  public GLDrawableFactoryImpl getFactoryImpl() {
+    return (GLDrawableFactoryImpl) getFactory();
+  }
+
+  /** For offscreen GLDrawables (pbuffers and "pixmap" drawables),
+      indicates that native resources should be reclaimed. */
+  public void destroy() {
+      surface.getGraphicsConfiguration().getScreen().getDevice().lock();
+      try {
+          destroyImpl();
+      } finally {
+          surface.getGraphicsConfiguration().getScreen().getDevice().unlock();
+      }
+  }
+  protected void destroyImpl() {
+    throw new GLException("Should not call this (should only be called for offscreen GLDrawables)");
+  }
+
+  public final void swapBuffers() throws GLException {
+    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)surface.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+    if ( caps.getDoubleBuffered() ) {
+        if(!surface.surfaceSwap()) {
+            int lockRes = lockSurface(); // it's recursive, so it's ok within [makeCurrent .. release]
+            if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) {
+                return;
+            }
+            try {
+                AbstractGraphicsDevice aDevice = getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
+                if (NativeSurface.LOCK_SURFACE_CHANGED == lockRes) {
+                    updateHandle();
+                }
+                swapBuffersImpl();
+            } finally {
+                unlockSurface();
+            }
+        }
+    } else {
+        GLContext ctx = GLContext.getCurrent();
+        if(null!=ctx && ctx.getGLDrawable()==this) { 
+            ctx.getGL().glFinish();
+        }
+    }
+    surface.surfaceUpdated(this, surface, System.currentTimeMillis());
+  }
+  protected abstract void swapBuffersImpl();
+
+  public static String toHexString(long hex) {
+    return "0x" + Long.toHexString(hex);
+  }
+
+  public GLProfile getGLProfile() {
+    return requestedCapabilities.getGLProfile();
+  }
+
+  public GLCapabilitiesImmutable getChosenGLCapabilities() {
+    return  (GLCapabilitiesImmutable) surface.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+  }
+
+  public GLCapabilitiesImmutable getRequestedGLCapabilities() {
+    return requestedCapabilities;
+  }
+
+  public NativeSurface getNativeSurface() {
+    return surface;
+  }
+
+  protected void destroyHandle() {}
+  protected void updateHandle() {}
+
+  public long getHandle() {
+    return surface.getSurfaceHandle();
+  }
+
+  public GLDrawableFactory getFactory() {
+    return factory;
+  }
+
+  public final synchronized void setRealized(boolean realizedArg) {
+    if ( realized != realizedArg ) {
+        if(DEBUG) {
+            System.err.println("setRealized: "+getClass().getName()+" "+realized+" -> "+realizedArg);
+        }
+        realized = realizedArg;
+        AbstractGraphicsDevice aDevice = surface.getGraphicsConfiguration().getScreen().getDevice();
+        if(realizedArg) {
+            if(NativeSurface.LOCK_SURFACE_NOT_READY >= lockSurface()) {
+                throw new GLException("GLDrawableImpl.setRealized(true): already realized, but surface not ready (lockSurface)");
+            }
+        } else {
+            aDevice.lock();
+        }
+        try {            
+            setRealizedImpl();
+            if(realizedArg) {
+                updateHandle();
+            } else {
+                destroyHandle();
+            }
+        } finally {
+            if(realizedArg) {
+                unlockSurface();
+            } else {
+                aDevice.unlock();
+            }
+        }
+    } else if(DEBUG) {
+        System.err.println("setRealized: "+getClass().getName()+" "+this.realized+" == "+realizedArg);
+    }
+  }
+  protected abstract void setRealizedImpl();
+  
+  public synchronized boolean isRealized() {
+    return realized;
+  }
+
+  public int getWidth() {
+    return surface.getWidth();
+  }
+  
+  public int getHeight() {
+    return surface.getHeight();
+  }
+
+  public int lockSurface() throws GLException {
+    return surface.lockSurface();
+  }
+
+  public void unlockSurface() {
+    surface.unlockSurface();
+  }
+
+  public boolean isSurfaceLocked() {
+    return surface.isSurfaceLocked();
+  }
+
+  public String toString() {
+    return getClass().getName()+"[Realized "+isRealized()+
+                ",\n\tFactory   "+getFactory()+
+                ",\n\thandle    "+toHexString(getHandle())+
+                ",\n\tWindow    "+getNativeSurface()+"]";
+  }
+
+  protected GLDrawableFactory factory;
+  protected NativeSurface surface;
+  protected GLCapabilitiesImmutable requestedCapabilities;
+
+  // Indicates whether the surface (if an onscreen context) has been
+  // realized. Plausibly, before the surface is realized the JAWT
+  // should return an error or NULL object from some of its
+  // operations; this appears to be the case on Win32 but is not true
+  // at least with Sun's current X11 implementation (1.4.x), which
+  // crashes with no other error reported if the DrawingSurfaceInfo is
+  // fetched from a locked DrawingSurface during the validation as a
+  // result of calling show() on the main thread. To work around this
+  // we prevent any JAWT or OpenGL operations from being done until
+  // addNotify() is called on the surface.
+  protected boolean realized;
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java
new file mode 100644
index 0000000..bedf431
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl;
+
+import com.jogamp.common.os.DynamicLibraryBundleInfo;
+import java.util.*;
+
+public abstract class GLDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
+    static List/*<String>*/ glueLibNamesPreload;
+    static {
+        glueLibNamesPreload = new ArrayList();
+        glueLibNamesPreload.add("nativewindow_x11");
+    }
+
+    protected GLDynamicLibraryBundleInfo() {
+    }
+
+    /** default **/
+    public boolean shallLinkGlobal() { return false; }
+
+    /** default **/
+    public boolean shallLookupGlobal() { return false; }
+
+    public static List/*<String>*/ getGlueLibNamesPreload() {
+        return glueLibNamesPreload;
+    }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java b/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
new file mode 100644
index 0000000..d2dac81
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl;
+
+import com.jogamp.common.os.DynamicLibraryBundle;
+
+public class GLDynamicLookupHelper extends DynamicLibraryBundle {
+
+    public GLDynamicLookupHelper(GLDynamicLibraryBundleInfo info) {
+        super(info);
+    }
+
+    public GLDynamicLibraryBundleInfo getGLBundleInfo() { return (GLDynamicLibraryBundleInfo) getBundleInfo(); }
+
+    /** NOP per default */
+    public boolean loadGLULibrary() { return false; }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java
new file mode 100644
index 0000000..e51e997
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java
@@ -0,0 +1,97 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.opengl;
+
+import java.util.List;
+import javax.media.nativewindow.CapabilitiesChooser;
+import javax.media.nativewindow.CapabilitiesImmutable;
+import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.opengl.DefaultGLCapabilitiesChooser;
+
+public abstract class GLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
+
+    protected static int chooseCapabilities(CapabilitiesChooser chooser, CapabilitiesImmutable capsRequested,
+                                            List /*<CapabilitiesImmutable>*/ availableCaps, int recommendedIndex) {
+        if (null == capsRequested) {
+            throw new NativeWindowException("Null requested capabilities");
+        }
+        if ( 0 == availableCaps.size() ) {
+            if (DEBUG) {
+                System.err.println("Empty available capabilities");
+            }
+            return -1; // none available
+        }
+
+        if(null == chooser && 0 <= recommendedIndex) {
+            if (DEBUG) {
+                System.err.println("chooseCapabilities: Using recommendedIndex: idx " + recommendedIndex);
+            }
+            return recommendedIndex;
+        }
+        int chosenIndex = recommendedIndex;
+
+        if (null == chooser) {
+            chooser = new DefaultGLCapabilitiesChooser();
+        }
+
+        try {
+            chosenIndex = chooser.chooseCapabilities(capsRequested, availableCaps, recommendedIndex);
+            if(0 <= chosenIndex) {
+                if (DEBUG) {
+                    System.err.println("chooseCapabilities: Chosen idx " + chosenIndex);
+                }
+                return chosenIndex;
+            }
+        } catch (NativeWindowException e) {
+            if (DEBUG) {
+                e.printStackTrace();
+            }
+        }
+
+        // keep on going ..
+        // seek first available one ..
+        for (chosenIndex = 0; chosenIndex < availableCaps.size() && availableCaps.get(chosenIndex) == null; chosenIndex++) {
+            // nop
+        }
+        if (chosenIndex == availableCaps.size()) {
+            // give up ..
+            if (DEBUG) {
+                System.err.println("chooseCapabilities: Failed .. nothing available, bail out");
+            }
+            return -1;
+        }
+        if (DEBUG) {
+            System.err.println("chooseCapabilities: Fall back to 1st available idx " + chosenIndex);
+        }
+
+        return chosenIndex;
+    }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
new file mode 100644
index 0000000..066ea81
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
@@ -0,0 +1,147 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.opengl;
+
+import java.util.ArrayList;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesImmutable;
+
+public class GLGraphicsConfigurationUtil {
+    public static final int WINDOW_BIT  = 1 << 0;
+    public static final int BITMAP_BIT  = 1 << 1;
+    public static final int PBUFFER_BIT = 1 << 2;
+    public static final int ALL_BITS    = WINDOW_BIT | BITMAP_BIT | PBUFFER_BIT ;
+
+    public static final StringBuffer winAttributeBits2String(StringBuffer sb, int winattrbits) {
+        if(null==sb) {
+            sb = new StringBuffer();
+        }
+        boolean seperator = false;
+        if( 0 != ( WINDOW_BIT & winattrbits )  )  {
+            sb.append("WINDOW");
+            seperator=true;
+        }
+        if( 0 != ( BITMAP_BIT & winattrbits )  )  {
+            if(seperator) {
+                sb.append(", ");
+            }
+            sb.append("BITMAP");
+            seperator=true;
+        }
+        if( 0 != ( PBUFFER_BIT & winattrbits )  )  {
+            if(seperator) {
+                sb.append(", ");
+            }
+            sb.append("PBUFFER");
+        }
+        return sb;
+    }
+
+    /**
+     * @return bitmask representing the input boolean in exclusive or logic, ie only one bit will be set
+     */
+    public static final int getWinAttributeBits(boolean isOnscreen, boolean isPBuffer) {
+        int winattrbits = 0;
+        if(isOnscreen) {
+            winattrbits |= WINDOW_BIT;
+        } else if (!isPBuffer) {
+            winattrbits |= BITMAP_BIT;
+        } else {
+            winattrbits |= PBUFFER_BIT;
+        }
+        return winattrbits;
+    }
+
+    /**
+     * @see #getWinAttributeBits(boolean, boolean)
+     */
+    public static final int getWinAttributeBits(GLCapabilitiesImmutable caps) {
+        return getWinAttributeBits(caps.isOnscreen(), caps.isPBuffer());
+    }
+
+    public static final boolean addGLCapabilitiesPermutations(ArrayList capsBucket, GLCapabilitiesImmutable temp, int winattrbits) {
+        int preSize = capsBucket.size();
+        if( 0 != ( WINDOW_BIT & winattrbits )  )  {
+            GLCapabilities cpy  = (GLCapabilities) temp.cloneMutable();
+            cpy.setOnscreen(true);
+            capsBucket.add(cpy);
+        }
+        if( 0 != ( PBUFFER_BIT & winattrbits )  )  {
+            GLCapabilities cpy  = (GLCapabilities) temp.cloneMutable();
+            cpy.setPBuffer(true);
+            capsBucket.add(cpy);
+        }
+        if( 0 != ( BITMAP_BIT & winattrbits )  )  {
+            GLCapabilities cpy  = (GLCapabilities) temp.cloneMutable();
+            cpy.setOnscreen(false);
+            cpy.setPBuffer(false);
+            capsBucket.add(cpy);
+        }
+        return capsBucket.size() > preSize;
+    }
+
+    public static GLCapabilitiesImmutable fixGLCapabilities(GLCapabilitiesImmutable capsRequested, boolean pbufferAvailable)
+    {
+        if( !capsRequested.isOnscreen() ) {
+            return fixOffScreenGLCapabilities(capsRequested, pbufferAvailable);
+        }
+        return capsRequested;
+    }
+
+    public static GLCapabilitiesImmutable fixOffScreenGLCapabilities(GLCapabilitiesImmutable capsRequested, boolean pbufferAvailable)
+    {
+        if( capsRequested.getDoubleBuffered() ||
+            capsRequested.isOnscreen() ||
+            ( !pbufferAvailable && capsRequested.isPBuffer() ) )
+        {
+            // fix caps ..
+            GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
+            caps2.setDoubleBuffered(false); // FIXME DBLBUFOFFSCRN
+            caps2.setOnscreen(false);
+            if(caps2.isPBuffer() && !pbufferAvailable) {
+                caps2.setPBuffer(false);
+            }
+            return caps2;
+        }
+        return capsRequested;
+    }
+
+    public static GLCapabilitiesImmutable fixGLPBufferGLCapabilities(GLCapabilitiesImmutable capsRequested)
+    {
+        if( capsRequested.getDoubleBuffered() || capsRequested.isOnscreen() || !capsRequested.isPBuffer()) {
+            // fix caps ..
+            GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
+            caps2.setDoubleBuffered(false); // FIXME DBLBUFOFFSCRN
+            caps2.setPBuffer(true);
+            return caps2;
+        }
+        return capsRequested;
+    }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
new file mode 100644
index 0000000..671390f
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
@@ -0,0 +1,299 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import com.jogamp.common.util.locks.RecursiveLock;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.opengl.GL;
+import javax.media.opengl.GLAnimatorControl;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawable;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLPbuffer;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLRunnable;
+
+/** Platform-independent class exposing pbuffer functionality to
+    applications. This class is not exposed in the public API as it
+    would probably add no value; however it implements the GLDrawable
+    interface so can be interacted with via its display() method. */
+
+public class GLPbufferImpl implements GLPbuffer {
+  private GLDrawableImpl pbufferDrawable;
+  private GLContextImpl context;
+  private GLDrawableHelper drawableHelper = new GLDrawableHelper();
+  private int floatMode;
+
+  public GLPbufferImpl(GLDrawableImpl pbufferDrawable,
+                       GLContext parentContext) {
+    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)
+         pbufferDrawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+    if(caps.isOnscreen()) {
+        if(caps.isPBuffer()) {
+            throw new IllegalArgumentException("Error: Given drawable is Onscreen and Pbuffer: "+pbufferDrawable);
+        }
+        throw new IllegalArgumentException("Error: Given drawable is Onscreen: "+pbufferDrawable);
+    } else {
+        if(!caps.isPBuffer()) {
+            throw new IllegalArgumentException("Error: Given drawable is not Pbuffer: "+pbufferDrawable);
+        }
+    }
+    this.pbufferDrawable = pbufferDrawable;
+    context = (GLContextImpl) pbufferDrawable.createContext(parentContext);
+    context.setSynchronized(true);
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    return pbufferDrawable.createContext(shareWith);
+  }
+
+  public void setRealized(boolean realized) {
+  }
+
+  public boolean isRealized() {
+    return true;
+  }
+
+  class DisposeAction implements Runnable {
+    public void run() {
+        // Lock: Covered by DestroyAction ..
+        drawableHelper.dispose(GLPbufferImpl.this);
+    }
+  }
+  DisposeAction disposeAction = new DisposeAction();
+
+  public void destroy() {
+    if(pbufferDrawable.isRealized()) {
+        if (null != context && context.isCreated()) {
+            try {
+                drawableHelper.invokeGL(pbufferDrawable, context, disposeAction, null);
+            } catch (GLException gle) {
+                gle.printStackTrace();
+            }
+            context.destroy();
+            // drawableHelper.reset();
+        }
+        pbufferDrawable.destroy();
+    }
+  }
+
+  public void setSize(int width, int height) {
+    // FIXME
+    throw new GLException("Not yet implemented");
+  }
+
+  public NativeSurface getNativeSurface() {
+      return pbufferDrawable.getNativeSurface();
+  }
+
+  public long getHandle() {
+    return pbufferDrawable.getHandle();
+  }
+
+  public GLDrawableFactory getFactory() {
+      return pbufferDrawable.getFactory();
+  }
+
+  public int getWidth() {
+    return pbufferDrawable.getWidth();
+  }
+
+  public int getHeight() {
+    return pbufferDrawable.getHeight();
+  }
+
+  public void display() {
+    invokeGL(displayAction);
+  }
+
+  public void repaint() {
+    display();
+  }
+
+  public void addGLEventListener(GLEventListener listener) {
+    drawableHelper.addGLEventListener(listener);
+  }
+
+  public void addGLEventListener(int index, GLEventListener listener) {
+    drawableHelper.addGLEventListener(index, listener);
+  }
+
+  public void removeGLEventListener(GLEventListener listener) {
+    drawableHelper.removeGLEventListener(listener);
+  }
+
+  public void setAnimator(GLAnimatorControl animatorControl) {
+    drawableHelper.setAnimator(animatorControl);
+  }
+
+  public GLAnimatorControl getAnimator() {
+    return drawableHelper.getAnimator();
+  }
+
+  public void invoke(boolean wait, GLRunnable glRunnable) {
+    drawableHelper.invoke(this, wait, glRunnable);
+  }
+
+  public void setContext(GLContext ctx) {
+    context=(GLContextImpl)ctx;
+  }
+
+  public GLContext getContext() {
+    return context;
+  }
+
+  public GLDrawable getDrawable() {
+    return pbufferDrawable;
+  }
+
+  public GL getGL() {
+    return getContext().getGL();
+  }
+
+  public GL setGL(GL gl) {
+    return getContext().setGL(gl);
+  }
+
+  public void setAutoSwapBufferMode(boolean onOrOff) {
+    drawableHelper.setAutoSwapBufferMode(onOrOff);
+  }
+
+  public boolean getAutoSwapBufferMode() {
+    return drawableHelper.getAutoSwapBufferMode();
+  }
+
+  public void swapBuffers() {
+    invokeGL(swapBuffersAction);
+  }
+
+  public void bindTexture() {
+    // Doesn't make much sense to try to do this on the event dispatch
+    // thread given that it has to be called while the context is current
+    context.bindPbufferToTexture();
+  }
+
+  public void releaseTexture() {
+    // Doesn't make much sense to try to do this on the event dispatch
+    // thread given that it has to be called while the context is current
+    context.releasePbufferFromTexture();
+  }
+
+  public GLCapabilitiesImmutable getChosenGLCapabilities() {
+    if (pbufferDrawable == null)
+      return null;
+
+    return pbufferDrawable.getChosenGLCapabilities();
+  }
+
+  public GLCapabilitiesImmutable getRequestedGLCapabilities() {
+    if (pbufferDrawable == null)
+      return null;
+
+    return pbufferDrawable.getRequestedGLCapabilities();
+  }
+
+  public GLProfile getGLProfile() {
+    if (pbufferDrawable == null)
+      return null;
+
+    return pbufferDrawable.getGLProfile();
+  }
+
+  private RecursiveLock recurLock = new RecursiveLock();
+
+  public int lockSurface() throws GLException {
+    recurLock.lock();
+    return NativeSurface.LOCK_SUCCESS;
+  }
+
+  public void unlockSurface() {
+    recurLock.unlock();
+  }
+
+  public boolean isSurfaceLocked() {
+    return recurLock.isLocked();
+  }
+
+  public Throwable getLockedStack() {
+    return recurLock.getLockedStack();
+  }
+
+  public int getFloatingPointMode() {
+    if (floatMode == 0) {
+      throw new GLException("Pbuffer not initialized, or floating-point support not requested");
+    }
+    return floatMode;
+  }
+
+  //----------------------------------------------------------------------
+  // Internals only below this point
+  //
+
+  private void invokeGL(Runnable invokeGLAction) {
+    drawableHelper.invokeGL(pbufferDrawable, context, invokeGLAction, initAction);
+  }
+
+
+  class InitAction implements Runnable {
+    public void run() {
+      floatMode = context.getFloatingPointMode();
+      drawableHelper.init(GLPbufferImpl.this);
+    }
+  }
+  private InitAction initAction = new InitAction();
+  
+  class DisplayAction implements Runnable {
+    public void run() {
+      drawableHelper.display(GLPbufferImpl.this);
+    }
+  }
+  private DisplayAction displayAction = new DisplayAction();
+
+  class SwapBuffersAction implements Runnable {
+    public void run() {
+      pbufferDrawable.swapBuffers();
+    }
+  }
+  private SwapBuffersAction swapBuffersAction = new SwapBuffersAction();
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
new file mode 100644
index 0000000..e5b66b9
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
@@ -0,0 +1,89 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl;
+
+import javax.media.opengl.GLRunnable;
+import javax.media.opengl.GLAutoDrawable;
+
+/**
+ * Helper class to provide a Runnable queue implementation with a Runnable wrapper
+ * which notifies after execution for the <code>invokeAndWait()</code> semantics.
+ */
+public class GLRunnableTask implements GLRunnable {
+    GLRunnable runnable;
+    Object notifyObject;
+    boolean catchExceptions;
+    boolean isExecuted;
+
+    Throwable runnableException;
+
+    public GLRunnableTask(GLRunnable runnable, Object notifyObject, boolean catchExceptions) {
+        this.runnable = runnable ;
+        this.notifyObject = notifyObject ;
+        this.catchExceptions = catchExceptions;
+        isExecuted = false;
+    }
+
+    public void run(GLAutoDrawable drawable) {
+        if(null == notifyObject) {
+            try {
+                runnable.run(drawable);
+            } catch (Throwable t) {
+                runnableException = t;
+                if(catchExceptions) {
+                    runnableException.printStackTrace();
+                } else {
+                    throw new RuntimeException(runnableException);
+                }
+            } finally {
+                isExecuted=true;
+            }
+        } else {
+            synchronized (notifyObject) {
+                try {
+                    runnable.run(drawable);
+                } catch (Throwable t) {
+                    runnableException = t;
+                    if(catchExceptions) {
+                        runnableException.printStackTrace();
+                    } else {
+                        throw new RuntimeException(runnableException);
+                    }
+                } finally {
+                    isExecuted=true;
+                    notifyObject.notifyAll();
+                }
+            }
+        }
+    }
+
+    public boolean isExecuted() { return isExecuted; }
+    public Throwable getThrowable() { return runnableException; }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/GLStateTracker.java b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
new file mode 100644
index 0000000..22874c0
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import java.util.List;
+import java.util.ArrayList;
+import javax.media.opengl.*;
+import com.jogamp.common.util.IntIntHashMap;
+
+/**
+ * Tracks as closely as possible OpenGL states.
+ * GLStateTracker objects are allocated on a per-OpenGL-context basis.
+ * <p>
+ * Currently supported states: PixelStorei
+ */
+
+public class GLStateTracker {
+  private static final boolean DEBUG = Debug.debug("GLStateTracker");
+
+  private volatile boolean enabled = true;
+
+  private IntIntHashMap pixelStateMap;
+
+  static class SavedState {
+    SavedState() {
+        this.pixelStateMap = null;
+    }
+    void putPixelStateMap(IntIntHashMap pixelStateMap) {
+        this.pixelStateMap = new IntIntHashMap();
+        this.pixelStateMap.setKeyNotFoundValue(-1);
+        this.pixelStateMap.putAll(pixelStateMap);
+    }
+    IntIntHashMap getPixelStateMap() { return pixelStateMap; }
+
+    private IntIntHashMap pixelStateMap;
+    // private Map otherStateMap;
+  }
+  private List/*<SavedState>*/ stack = new ArrayList();
+
+  public GLStateTracker() {
+    pixelStateMap = new IntIntHashMap();
+    pixelStateMap.setKeyNotFoundValue(-1);
+    resetStates();
+  }
+
+  public void clearStates(boolean enable) {
+    enabled = enable;    
+    pixelStateMap.clear();
+  }
+
+  public void setEnabled(boolean on) {
+    enabled = on;    
+  }
+
+  public boolean isEnabled() {
+    return enabled;
+  }
+
+  /** @return true if found in our map, otherwise false, 
+   *  which forces the caller to query GL. */
+  public boolean getInt(int pname, int[] params, int params_offset) {
+    if(enabled) {
+        int value = pixelStateMap.get(pname);
+        if(0 <= value) {
+            params[params_offset] = value;
+            return true;
+        }
+    }
+    return false;
+  }
+
+  /** @return true if found in our map, otherwise false, 
+   *  which forces the caller to query GL. */
+  public boolean getInt(int pname, java.nio.IntBuffer params, int dummy) {
+    if(enabled) {
+        int value = pixelStateMap.get(pname);
+        if(0 <= value) {
+            params.put(params.position(), value);
+            return true;
+        }
+    }
+    return false;
+  }
+
+  public void setInt(int pname, int param) {
+    if(enabled) {
+        pixelStateMap.put(pname, param);
+    }
+  }
+
+  public void pushAttrib(int flags) {
+    if(enabled) {
+        SavedState state = new SavedState();
+        if( 0 != (flags&GL2.GL_CLIENT_PIXEL_STORE_BIT) ) {
+            state.putPixelStateMap(pixelStateMap);
+        }
+        stack.add(0, state);
+    }
+  }
+
+  public void popAttrib() {
+    if(enabled) {
+        if(stack.size()==0) {
+            throw new GLException("stack contains no elements");
+        }
+        SavedState state = (SavedState) stack.remove(0);
+        if(null==state) {
+            throw new GLException("null stack element (remaining stack size "+stack.size()+")");
+        }
+
+        IntIntHashMap pixelStateMapNew = new IntIntHashMap();
+        pixelStateMapNew.setKeyNotFoundValue(-1);
+        if ( null != state.getPixelStateMap() ) {
+            pixelStateMapNew.putAll(state.getPixelStateMap());
+        }
+        pixelStateMap = pixelStateMapNew;
+    }
+  }
+
+  public void resetStates() {
+    pixelStateMap.clear();
+
+    pixelStateMap.put(GL.GL_PACK_ALIGNMENT,          4);
+    pixelStateMap.put(GL2GL3.GL_PACK_SWAP_BYTES,     0 /* GL_FALSE */);
+    pixelStateMap.put(GL2GL3.GL_PACK_LSB_FIRST,      0 /* GL_FALSE */);
+    pixelStateMap.put(GL2GL3.GL_PACK_ROW_LENGTH,     0);
+    pixelStateMap.put(GL2GL3.GL_PACK_SKIP_ROWS,      0);
+    pixelStateMap.put(GL2GL3.GL_PACK_SKIP_PIXELS,    0);
+    pixelStateMap.put(GL2GL3.GL_PACK_IMAGE_HEIGHT,   0);
+    pixelStateMap.put(GL2GL3.GL_PACK_SKIP_IMAGES,    0);
+
+    pixelStateMap.put(GL.GL_UNPACK_ALIGNMENT,        4);
+    pixelStateMap.put(GL2GL3.GL_UNPACK_SWAP_BYTES,   0 /* GL_FALSE */);
+    pixelStateMap.put(GL2GL3.GL_UNPACK_LSB_FIRST,    0 /* GL_FALSE */);
+    pixelStateMap.put(GL2GL3.GL_UNPACK_ROW_LENGTH,   0);
+    pixelStateMap.put(GL2GL3.GL_UNPACK_SKIP_ROWS,    0);
+    pixelStateMap.put(GL2GL3.GL_UNPACK_SKIP_PIXELS,  0);
+    pixelStateMap.put(GL2GL3.GL_UNPACK_IMAGE_HEIGHT, 0);
+    pixelStateMap.put(GL2GL3.GL_UNPACK_SKIP_IMAGES,  0);
+  }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
new file mode 100644
index 0000000..5bd008f
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
@@ -0,0 +1,123 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.opengl;
+
+import java.util.StringTokenizer;
+import com.jogamp.common.util.VersionNumber;
+
+/**
+ * A class for storing and comparing OpenGL version numbers.
+ * This only works for desktop OpenGL at the moment.
+ */
+class GLVersionNumber extends VersionNumber {
+
+    protected boolean valid;
+
+    public GLVersionNumber(int majorRev, int minorRev, int subMinorRev) {
+        super(majorRev, minorRev, subMinorRev);
+        valid = true;
+    }
+
+    public GLVersionNumber(String versionString) {
+        super();
+        valid = false;
+        try {
+            if (versionString.startsWith("GL_VERSION_")) {
+                StringTokenizer tok = new StringTokenizer(versionString, "_");
+                tok.nextToken(); // GL_
+                tok.nextToken(); // VERSION_
+                if (!tok.hasMoreTokens()) {
+                    major = 0;
+                    return;
+                }
+                major = Integer.valueOf(tok.nextToken()).intValue();
+                if (!tok.hasMoreTokens()) {
+                    minor = 0;
+                    return;
+                }
+                minor = Integer.valueOf(tok.nextToken()).intValue();
+                if (!tok.hasMoreTokens()) {
+                    sub = 0;
+                    return;
+                }
+                sub = Integer.valueOf(tok.nextToken()).intValue();
+            } else {
+                int radix = 10;
+                if (versionString.length() > 2) {
+                    if (Character.isDigit(versionString.charAt(0)) && versionString.charAt(1) == '.' && Character.isDigit(versionString.charAt(2))) {
+                        major = Character.digit(versionString.charAt(0), radix);
+                        minor = Character.digit(versionString.charAt(2), radix);
+                        // See if there's version-specific information which might
+                        // imply a more recent OpenGL version
+                        StringTokenizer tok = new StringTokenizer(versionString, " ");
+                        if (tok.hasMoreTokens()) {
+                            tok.nextToken();
+                            if (tok.hasMoreTokens()) {
+                                String token = tok.nextToken();
+                                int i = 0;
+                                while (i < token.length() && !Character.isDigit(token.charAt(i))) {
+                                    i++;
+                                }
+                                if (i < token.length() - 2 && Character.isDigit(token.charAt(i)) && token.charAt(i + 1) == '.' && Character.isDigit(token.charAt(i + 2))) {
+                                    int altMajor = Character.digit(token.charAt(i), radix);
+                                    int altMinor = Character.digit(token.charAt(i + 2), radix);
+                                    // Avoid possibly confusing situations by putting some
+                                    // constraints on the upgrades we do to the major and
+                                    // minor versions
+                                    if ((altMajor == major && altMinor > minor) || altMajor == major + 1) {
+                                        major = altMajor;
+                                        minor = altMinor;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            valid = true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            // FIXME: refactor desktop OpenGL dependencies and make this
+            // class work properly for OpenGL ES
+            System.err.println("Info: ExtensionAvailabilityCache: FunctionAvailabilityCache.Version.<init>: " + e);
+            major = 1;
+            minor = 0;
+            /*
+            throw (IllegalArgumentException)
+            new IllegalArgumentException(
+            "Illegally formatted version identifier: \"" + versionString + "\"")
+            .initCause(e);
+             */
+        }
+    }
+
+    public final boolean isValid() {
+        return valid;
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
new file mode 100644
index 0000000..ac9655f
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
@@ -0,0 +1,276 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.*;
+import javax.media.opengl.*;
+
+/** Singleton thread upon which all OpenGL work is performed by
+    default. Unfortunately many vendors' OpenGL drivers are not really
+    thread-safe and stability is much improved by performing OpenGL
+    work on at most one thread. This is the default behavior of the
+    GLAutoDrawable implementations according to the {@link
+    javax.media.opengl.Threading Threading} class. The GLWorkerThread
+    replaces the original AWT event queue thread-based mechanism for
+    two reasons: first, more than one AWT event queue thread may be
+    spawned, for example if a dialog is being shown; second, it avoids
+    blocking the AWT event queue thread during OpenGL rendering. */
+
+public class GLWorkerThread {
+  private static volatile boolean started;
+  private static volatile Thread thread;
+  private static Object lock;
+  private static volatile boolean shouldTerminate;
+  private static volatile Throwable exception;
+
+  // The Runnable to execute immediately on the worker thread
+  private static volatile Runnable work;
+  // Queue of Runnables to be asynchronously invoked
+  private static List queue = new LinkedList();
+  
+  /** Should only be called by Threading class if creation of the
+      GLWorkerThread was requested via the opengl.1thread system
+      property. <br>
+   * Start the GLWorkerThread iff not started yet!
+   */
+  public static void start() {
+    if (!started) { // volatile: ok
+      synchronized (GLWorkerThread.class) {
+        if (!started) {
+          lock = new Object();
+          thread = new Thread(new WorkerRunnable(),
+                              "JOGL GLWorkerThread");
+          thread.setDaemon(true);
+          started = true;
+          synchronized (lock) {
+            thread.start();
+            try {
+              lock.wait();
+            } catch (InterruptedException e) {
+            }
+          }
+
+          /*
+
+          // Note: it appears that there is a bug in NVidia's current
+          // drivers where if a context was ever made current on a
+          // given thread and that thread has exited before program
+          // exit, a crash occurs in the drivers. Releasing the
+          // context from the given thread does not work around the
+          // problem.
+          //
+          // For the time being, we're going to work around this
+          // problem by not terminating the GLWorkerThread. In theory,
+          // shutting down the GLWorkerThread cleanly could be a good
+          // general solution to the problem of needing to
+          // cooperatively terminate all Animators at program exit.
+          //
+          // It appears that this doesn't even work around all of the
+          // kinds of crashes. Causing the context to be unilaterally
+          // released from the GLWorkerThread after each invocation
+          // seems to work around all of the kinds of crashes seen.
+          //
+          // These appear to be similar to the kinds of crashes seen
+          // when the Java2D/OpenGL pipeline terminates, and those are
+          // a known issue being fixed, so presumably these will be
+          // fixed in NVidia's next driver set.
+
+          // Install shutdown hook to terminate daemon thread more or
+          // less cooperatively
+          AccessController.doPrivileged(new PrivilegedAction() {
+              public Object run() {
+                Runtime.getRuntime().addShutdownHook(new Thread() {
+                    public void run() {
+                      Object lockTemp = lock;
+                      if (lockTemp == null) {
+                        // Already terminating (?)
+                        return;
+                      }
+                      synchronized (lockTemp) {
+                        shouldTerminate = true;
+                        lockTemp.notifyAll();
+                        try {
+                          lockTemp.wait(500);
+                        } catch (InterruptedException e) {
+                        }
+                      }
+                    }
+                  });
+                return null;
+              }
+            });
+
+          */
+
+        } else {
+          throw new RuntimeException("Should not start GLWorkerThread twice");
+        }
+      }
+    }
+  }
+
+  public static void invokeAndWait(Runnable runnable)
+    throws InvocationTargetException, InterruptedException {
+    if (!started) {
+      throw new RuntimeException("May not invokeAndWait on worker thread without starting it first");
+    }
+
+    Object lockTemp = lock;
+    if (lockTemp == null) {
+      return; // Terminating
+    }
+
+    synchronized (lockTemp) {
+      if (thread == null) {
+        // Terminating
+        return;
+      }
+
+      work = runnable;
+      lockTemp.notifyAll();
+      lockTemp.wait();
+      if (exception != null) {
+        Throwable localException = exception;
+        exception = null;
+        throw new InvocationTargetException(localException);
+      }
+    }
+  }
+
+  public static void invokeLater(Runnable runnable) {
+    if (!started) {
+      throw new RuntimeException("May not invokeLater on worker thread without starting it first");
+    }
+
+    Object lockTemp = lock;
+    if (lockTemp == null) {
+      return; // Terminating
+    }
+
+    synchronized (lockTemp) {
+      if (thread == null) {
+        // Terminating
+        return;
+      }
+
+      queue.add(runnable);
+      lockTemp.notifyAll();
+    }
+  }
+
+  /** Indicates whether the OpenGL worker thread was started, i.e.,
+      whether it is currently in use. */
+  public static boolean isStarted() {
+    return started;
+  }
+
+  /** Indicates whether the current thread is the OpenGL worker
+      thread. */
+  public static boolean isWorkerThread() {
+    return (Thread.currentThread() == thread);
+  }
+
+  static class WorkerRunnable implements Runnable {
+    public void run() {
+      // Notify starting thread that we're ready
+      synchronized (lock) {
+        lock.notifyAll();
+      }
+
+      while (!shouldTerminate) {
+        synchronized (lock) {
+          while (!shouldTerminate &&
+                 (work == null) &&
+                 queue.isEmpty()) {
+            try {
+              // Avoid race conditions with wanting to release contexts on this thread
+              lock.wait(1000);
+            } catch (InterruptedException e) {
+            }
+
+            if (GLContext.getCurrent() != null) {
+              // Test later to see whether we need to release this context
+              break;
+            }
+          }
+          
+          if (shouldTerminate) {
+            lock.notifyAll();
+            thread = null;
+            lock = null;
+            return;
+          }
+
+          if (work != null) {
+            try {
+              work.run();
+            } catch (Throwable t) {
+              exception = t;
+            } finally {
+              work = null;
+              lock.notifyAll();
+            }
+          }
+
+          while (!queue.isEmpty()) {
+            try {
+              Runnable curAsync = (Runnable) queue.remove(0);
+              curAsync.run();
+            } catch (Throwable t) {
+              System.err.println("Exception occurred on JOGL OpenGL worker thread:");
+              t.printStackTrace();
+            }
+          }
+
+          // See about releasing current context
+          GLContext curContext = GLContext.getCurrent();
+          if (curContext != null &&
+              (curContext instanceof GLContextImpl)) {
+            GLContextImpl impl = (GLContextImpl) curContext;
+            if (impl.hasWaiters()) {
+              impl.release();
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/MemoryObject.java b/src/jogl/classes/jogamp/opengl/MemoryObject.java
new file mode 100644
index 0000000..71a6b49
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/MemoryObject.java
@@ -0,0 +1,142 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.opengl;
+
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+
+/**
+ *
+ */
+public class MemoryObject {
+    private long addr;
+    private long size;
+    private int  hash32;
+    private ByteBuffer buffer=null;
+
+    public MemoryObject(long addr, long size) {
+        this.addr = addr;
+        this.size = size;
+        this.hash32 = getHash32(addr, size);
+    }
+
+    public void setBuffer(ByteBuffer buffer) {
+        this.buffer = buffer;
+    }
+
+    public ByteBuffer getBuffer() {
+        return this.buffer;
+    }
+
+    /**
+     * @return the 32bit hash value generated via {@link #getHash32(long, long)}
+     */
+    public int hashCode() {
+        return hash32;
+    }
+
+    /**
+     * Ignores the optional attached <code>ByteBuffer</code> intentionally.<br>
+     * 
+     * @return true of reference is equal or <code>obj</code> is of type <code>MemoryObject</code>
+     *         and <code>addr</code> and <code>size</code> is equal.<br>
+     */
+    public boolean equals(Object obj) {
+        if(this == obj) { return true; }
+        if(obj instanceof MemoryObject) {
+            MemoryObject m = (MemoryObject) obj;
+            return addr == m.addr && size == m.size ;
+        }
+        return false;
+    }
+
+    /**
+     * Generates a 32bit hash value by <code>addr</code> and <code>size</code>.<br>
+     * Ignores the optional attached <code>ByteBuffer</code> intentionally.<br>
+     */
+    public static int getHash32(long addr, long size) {
+        // avoid xor collisions of eg low/high parts
+        // 31 * x == (x << 5) - x
+        int  hash = 31 +              (int)   addr          ; // lo addr
+        hash = ((hash << 5) - hash) + (int) ( addr >>> 32 ) ; // hi addr
+        hash = ((hash << 5) - hash) + (int)   size          ; // lo size
+        hash = ((hash << 5) - hash) + (int) ( size >>> 32 ) ; // hi size
+
+        return hash;
+    }
+
+    /**
+     * Generates a 64bit hash value by <code>addr</code> and <code>size</code>.<br>
+     * Ignores the optional attached <code>ByteBuffer</code> intentionally.<br>
+     */
+    public static long getHash64(long addr, long size) {
+        // 31 * x == (x << 5) - x
+        final long hash = 31 + addr;
+        return ((hash << 5) - hash) + size;
+    }
+
+    public String toString() {
+        return "MemoryObject[addr 0x"+Long.toHexString(addr)+", size 0x"+Long.toHexString(size)+", hash32: 0x"+Integer.toHexString(hash32)+"]";
+    }
+
+    /**
+     * Verifies the hash map operation, ie
+     * <ul>
+     *  <li>slow add: if !map.contains(obj0), the values are verified (slow)</li>
+     *  <li>fast get: if map.contains(obj0), the mapped value is compared with equals (fast) </li>
+     * </ul>
+     * In case the above verification fails, a RuntimeException is thrown.<br>
+     * In such case the calculation of the hash value should either be tuned,<br>
+     * or we just cannot use hash mapping.<br>
+     *
+     * @param map the identity HashMap mapping MemoryObject to MemoryObject
+     * @param obj0 the MemoryObject to get or add in the map
+     * @return either the already mapped one where <code>obj0</code> != <code>return</code>,
+     *         or the added <code>obj0</code> == <code>return</code>.
+     * @throws RuntimeException if hash collision occurs
+     */
+    public static MemoryObject getOrAddSafe(HashMap/*<MemoryObject,MemoryObject>*/ map, MemoryObject obj0) {
+        MemoryObject obj1 = (MemoryObject) map.get(obj0); // get identity (fast)
+        if(null == obj1) {
+            // verify hash collision (slow)
+            if( map.values().contains(obj0) ) {
+                throw new RuntimeException("Hash collision, hash !exist, but in values: "+obj0);
+            }
+            map.put(obj0, obj0);
+            obj1 = obj0;
+        } else {
+            // verify hash collision (ok)
+            if( !obj1.equals(obj0) ) {
+                throw new RuntimeException("Hash collision, hash equals, but objects not: query "+obj0+" != contained "+obj1);
+            }
+        }
+        return obj1;
+    }
+
+}
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/ProjectFloat.java b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
new file mode 100644
index 0000000..a6316b2
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
@@ -0,0 +1,1058 @@
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+** 
+** http://oss.sgi.com/projects/FreeB
+** 
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+** 
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** $Date: 2009-03-13 22:20:29 -0700 (Fri, 13 Mar 2009) $ $Revision: 1867 $
+** $Header$
+*/
+
+/* 
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are 
+ * met:
+ * 
+ * * Redistributions of source code must retain the above copyright 
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of 
+ *   its contributors may be used to endorse or promote products derived 
+ *   from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+package jogamp.opengl;
+
+import java.nio.*;
+
+import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+import com.jogamp.common.nio.Buffers;
+
+/**
+ * ProjectFloat.java
+ * <p/>
+ * <p/>
+ * Created 11-jan-2004
+ * 
+ * @author Erik Duijs
+ * @author Kenneth Russell
+ */
+public class ProjectFloat {
+  private static final float[] IDENTITY_MATRIX =
+    new float[] {
+      1.0f, 0.0f, 0.0f, 0.0f,
+      0.0f, 1.0f, 0.0f, 0.0f,
+      0.0f, 0.0f, 1.0f, 0.0f,
+      0.0f, 0.0f, 0.0f, 1.0f };
+
+  private static final float[] ZERO_MATRIX =
+    new float[] {
+      0.0f, 0.0f, 0.0f, 0.0f,
+      0.0f, 0.0f, 0.0f, 0.0f,
+      0.0f, 0.0f, 0.0f, 0.0f,
+      0.0f, 0.0f, 0.0f, 0.0f };
+
+  // Note that we have cloned parts of the implementation in order to
+  // support incoming Buffers. The reason for this is to avoid loading
+  // non-direct buffer subclasses unnecessarily, because doing so can
+  // cause performance decreases on direct buffer operations, at least
+  // on the current HotSpot JVM. It would be nicer (and make the code
+  // simpler) to simply have the array-based entry points delegate to
+  // the versions taking Buffers by wrapping the arrays.
+
+  // Array-based implementation
+  private final float[] matrix = new float[16];
+  private final float[][] tempInvertMatrix = new float[4][4];
+
+  private final float[] in = new float[4];
+  private final float[] out = new float[4];
+
+  private final float[] forward = new float[3];
+  private final float[] side = new float[3];
+  private final float[] up = new float[3];
+  
+  // Buffer-based implementation
+  private FloatBuffer locbuf;
+  private final FloatBuffer matrixBuf;
+  private final FloatBuffer tempInvertMatrixBuf;
+
+  private final FloatBuffer inBuf;
+  private final FloatBuffer outBuf;
+
+  private final FloatBuffer forwardBuf;
+  private final FloatBuffer sideBuf;
+  private final FloatBuffer upBuf;
+
+  public ProjectFloat() {
+    // Use direct buffers to avoid loading indirect buffer
+    // implementations for applications trying to avoid doing so.
+    // Slice up one big buffer because some NIO implementations
+    // allocate a huge amount of memory to back even the smallest of
+    // buffers.
+    locbuf = Buffers.newDirectFloatBuffer(2*16+2*4+3*3);
+    int pos = 0;
+    int sz = 16;
+    matrixBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    tempInvertMatrixBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    sz = 4;
+    inBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    outBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    sz = 3;
+    forwardBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    sideBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    upBuf = slice(locbuf, pos, sz);
+  }
+
+  public void destroy() {
+    if(locbuf!=null) {
+        locbuf.clear();
+        locbuf=null;
+    }
+  }
+
+  private static FloatBuffer slice(FloatBuffer buf, int pos, int len) {
+    buf.position(pos);
+    buf.limit(pos + len);
+    return buf.slice();
+  }
+
+  /**
+   * Make matrix an identity matrix
+   */
+  public static void gluMakeIdentityf(FloatBuffer m) {
+    int oldPos = m.position();
+    m.put(IDENTITY_MATRIX);
+    m.position(oldPos);
+  }
+
+  /**
+   * Make matrix an zero matrix
+   */
+  public static void gluMakeZero(FloatBuffer m) {
+    int oldPos = m.position();
+    m.put(ZERO_MATRIX);
+    m.position(oldPos);
+  }
+
+  /**
+   * Make matrix an identity matrix
+   */
+  public static void gluMakeIdentityf(float[] m) {
+    for (int i = 0; i < 16; i++) {
+      m[i] = IDENTITY_MATRIX[i];
+    }
+  }
+
+  /**
+   * Method __gluMultMatrixVecf
+   * 
+   * @param matrix
+   * @param in
+   * @param out
+   */
+  private void __gluMultMatrixVecf(float[] matrix, int matrix_offset, float[] in, float[] out) {
+    for (int i = 0; i < 4; i++) {
+      out[i] =
+        in[0] * matrix[0*4+i+matrix_offset] +
+        in[1] * matrix[1*4+i+matrix_offset] +
+        in[2] * matrix[2*4+i+matrix_offset] +
+        in[3] * matrix[3*4+i+matrix_offset];
+    }
+  }
+
+  /**
+   * Method __gluMultMatrixVecf
+   * 
+   * @param matrix
+   * @param in
+   * @param out
+   */
+  private void __gluMultMatrixVecf(FloatBuffer matrix, FloatBuffer in, FloatBuffer out) {
+    int inPos = in.position();
+    int outPos = out.position();
+    int matrixPos = matrix.position();
+    for (int i = 0; i < 4; i++) {
+      out.put(i + outPos,
+              in.get(0+inPos) * matrix.get(0*4+i+matrixPos) +
+              in.get(1+inPos) * matrix.get(1*4+i+matrixPos) +
+              in.get(2+inPos) * matrix.get(2*4+i+matrixPos) +
+              in.get(3+inPos) * matrix.get(3*4+i+matrixPos));
+    }
+  }
+
+  /**
+   * @param src
+   * @param inverse
+   * 
+   * @return
+   */
+  public boolean gluInvertMatrixf(float[] src, float[] inverse) {
+    int i, j, k, swap;
+    float t;
+    float[][] temp = tempInvertMatrix;
+
+    for (i = 0; i < 4; i++) {
+      for (j = 0; j < 4; j++) {
+        temp[i][j] = src[i*4+j];
+      }
+    }
+    gluMakeIdentityf(inverse);
+
+    for (i = 0; i < 4; i++) {
+      //
+      // Look for largest element in column
+      //
+      swap = i;
+      for (j = i + 1; j < 4; j++) {
+        if (Math.abs(temp[j][i]) > Math.abs(temp[i][i])) {
+          swap = j;
+        }
+      }
+
+      if (swap != i) {
+        //
+        // Swap rows.
+        //
+        for (k = 0; k < 4; k++) {
+          t = temp[i][k];
+          temp[i][k] = temp[swap][k];
+          temp[swap][k] = t;
+
+          t = inverse[i*4+k];
+          inverse[i*4+k] = inverse[swap*4+k];
+          inverse[swap*4+k] = t;
+        }
+      }
+
+      if (temp[i][i] == 0) {
+        //
+        // No non-zero pivot. The matrix is singular, which shouldn't
+        // happen. This means the user gave us a bad matrix.
+        //
+        return false;
+      }
+
+      t = temp[i][i];
+      for (k = 0; k < 4; k++) {
+        temp[i][k] /= t;
+        inverse[i*4+k] /= t;
+      }
+      for (j = 0; j < 4; j++) {
+        if (j != i) {
+          t = temp[j][i];
+          for (k = 0; k < 4; k++) {
+            temp[j][k] -= temp[i][k] * t;
+            inverse[j*4+k] -= inverse[i*4+k]*t;
+          }
+        }
+      }
+    }
+    return true;
+  }
+
+  /**
+   * @param src
+   * @param inverse
+   * 
+   * @return
+   */
+  public boolean gluInvertMatrixf(FloatBuffer src, FloatBuffer inverse) {
+    int i, j, k, swap;
+    float t;
+
+    int srcPos = src.position();
+    int invPos = inverse.position();
+
+    FloatBuffer temp = tempInvertMatrixBuf;
+
+    for (i = 0; i < 4; i++) {
+      for (j = 0; j < 4; j++) {
+        temp.put(i*4+j, src.get(i*4+j + srcPos));
+      }
+    }
+    gluMakeIdentityf(inverse);
+
+    for (i = 0; i < 4; i++) {
+      //
+      // Look for largest element in column
+      //
+      swap = i;
+      for (j = i + 1; j < 4; j++) {
+        if (Math.abs(temp.get(j*4+i)) > Math.abs(temp.get(i*4+i))) {
+          swap = j;
+        }
+      }
+
+      if (swap != i) {
+        //
+        // Swap rows.
+        //
+        for (k = 0; k < 4; k++) {
+          t = temp.get(i*4+k);
+          temp.put(i*4+k, temp.get(swap*4+k));
+          temp.put(swap*4+k, t);
+
+          t = inverse.get(i*4+k + invPos);
+          inverse.put(i*4+k + invPos, inverse.get(swap*4+k + invPos));
+          inverse.put(swap*4+k + invPos, t);
+        }
+      }
+
+      if (temp.get(i*4+i) == 0) {
+        //
+        // No non-zero pivot. The matrix is singular, which shouldn't
+        // happen. This means the user gave us a bad matrix.
+        //
+        return false;
+      }
+
+      t = temp.get(i*4+i);
+      for (k = 0; k < 4; k++) {
+        temp.put(i*4+k, temp.get(i*4+k) / t);
+        inverse.put(i*4+k + invPos, inverse.get(i*4+k + invPos) / t);
+      }
+      for (j = 0; j < 4; j++) {
+        if (j != i) {
+          t = temp.get(j*4+i);
+          for (k = 0; k < 4; k++) {
+            temp.put(j*4+k, temp.get(j*4+k) - temp.get(i*4+k) * t);
+            inverse.put(j*4+k + invPos, inverse.get(j*4+k + invPos) - inverse.get(i*4+k + invPos) * t);
+          }
+        }
+      }
+    }
+    return true;
+  }
+
+
+  /**
+   * @param a
+   * @param b
+   * @param r
+   */
+  private void gluMultMatricesf(float[] a, int a_offset, float[] b, int b_offset, float[] r) {
+    for (int i = 0; i < 4; i++) {
+      for (int j = 0; j < 4; j++) {
+        r[i*4+j] =
+          a[i*4+0+a_offset]*b[0*4+j+b_offset] +
+          a[i*4+1+a_offset]*b[1*4+j+b_offset] +
+          a[i*4+2+a_offset]*b[2*4+j+b_offset] +
+          a[i*4+3+a_offset]*b[3*4+j+b_offset];
+      }
+    }
+  }
+
+
+  /**
+   * @param a
+   * @param b
+   * @param r
+   */
+  public static void gluMultMatricesf(FloatBuffer a, FloatBuffer b, FloatBuffer r) {
+    int aPos = a.position();
+    int bPos = b.position();
+    int rPos = r.position();
+
+    for (int i = 0; i < 4; i++) {
+      for (int j = 0; j < 4; j++) {
+        r.put(i*4+j + rPos,
+          a.get(i*4+0+aPos)*b.get(0*4+j+bPos) +
+          a.get(i*4+1+aPos)*b.get(1*4+j+bPos) +
+          a.get(i*4+2+aPos)*b.get(2*4+j+bPos) +
+          a.get(i*4+3+aPos)*b.get(3*4+j+bPos));
+      }
+    }
+  }
+
+  /**
+   * Normalize vector
+   *
+   * @param v
+   */
+  public static void normalize(float[] v) {
+    float r;
+
+    r = (float) Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
+    if ( r == 0.0 || r == 1.0)
+      return;
+
+    r = 1.0f / r;
+
+    v[0] *= r;
+    v[1] *= r;
+    v[2] *= r;
+
+    return;
+  }
+
+  /**
+   * Normalize vector
+   *
+   * @param v
+   */
+  public static void normalize(FloatBuffer v) {
+    float r;
+
+    int vPos = v.position();
+
+    r = (float) Math.sqrt(v.get(0+vPos) * v.get(0+vPos) +
+                          v.get(1+vPos) * v.get(1+vPos) +
+                          v.get(2+vPos) * v.get(2+vPos));
+    if ( r == 0.0 || r == 1.0)
+      return;
+
+    r = 1.0f / r;
+
+    v.put(0+vPos, v.get(0+vPos) * r);
+    v.put(1+vPos, v.get(1+vPos) * r);
+    v.put(2+vPos, v.get(2+vPos) * r);
+
+    return;
+  }
+
+
+  /**
+   * Calculate cross-product
+   *
+   * @param v1
+   * @param v2
+   * @param result
+   */
+  private static void cross(float[] v1, float[] v2, float[] result) {
+    result[0] = v1[1] * v2[2] - v1[2] * v2[1];
+    result[1] = v1[2] * v2[0] - v1[0] * v2[2];
+    result[2] = v1[0] * v2[1] - v1[1] * v2[0];
+  }
+
+  /**
+   * Calculate cross-product
+   *
+   * @param v1
+   * @param v2
+   * @param result
+   */
+  private static void cross(FloatBuffer v1, FloatBuffer v2, FloatBuffer result) {
+    int v1Pos = v1.position();
+    int v2Pos = v2.position();
+    int rPos  = result.position();
+
+    result.put(0+rPos, v1.get(1+v1Pos) * v2.get(2+v2Pos) - v1.get(2+v1Pos) * v2.get(1+v2Pos));
+    result.put(1+rPos, v1.get(2+v1Pos) * v2.get(0+v2Pos) - v1.get(0+v1Pos) * v2.get(2+v2Pos));
+    result.put(2+rPos, v1.get(0+v1Pos) * v2.get(1+v2Pos) - v1.get(1+v1Pos) * v2.get(0+v2Pos));
+  }
+
+  /**
+   * Method gluOrtho2D.
+   * 
+   * @param left
+   * @param right
+   * @param bottom
+   * @param top
+   */
+  public void gluOrtho2D(GLMatrixFunc gl, float left, float right, float bottom, float top) {
+    gl.glOrthof(left, right, bottom, top, -1, 1);
+  }
+
+  /**
+   * Method gluPerspective.
+   * 
+   * @param fovy
+   * @param aspect
+   * @param zNear
+   * @param zFar
+   */
+  public void gluPerspective(GLMatrixFunc gl, float fovy, float aspect, float zNear, float zFar) {
+    float sine, cotangent, deltaZ;
+    float radians = fovy / 2 * (float) Math.PI / 180;
+
+    deltaZ = zFar - zNear;
+    sine = (float) Math.sin(radians);
+
+    if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) {
+      return;
+    }
+
+    cotangent = (float) Math.cos(radians) / sine;
+
+    gluMakeIdentityf(matrixBuf);
+
+    matrixBuf.put(0 * 4 + 0, cotangent / aspect);
+    matrixBuf.put(1 * 4 + 1, cotangent);
+    matrixBuf.put(2 * 4 + 2, - (zFar + zNear) / deltaZ);
+    matrixBuf.put(2 * 4 + 3, -1);
+    matrixBuf.put(3 * 4 + 2, -2 * zNear * zFar / deltaZ);
+    matrixBuf.put(3 * 4 + 3, 0);
+
+    gl.glMultMatrixf(matrixBuf);
+  }
+
+  /**
+   * Method gluLookAt
+   * 
+   * @param eyex
+   * @param eyey
+   * @param eyez
+   * @param centerx
+   * @param centery
+   * @param centerz
+   * @param upx
+   * @param upy
+   * @param upz
+   */
+  public void gluLookAt(GLMatrixFunc gl,
+                        float eyex,
+                        float eyey,
+                        float eyez,
+                        float centerx,
+                        float centery,
+                        float centerz,
+                        float upx,
+                        float upy,
+                        float upz) {
+    FloatBuffer forward = this.forwardBuf;
+    FloatBuffer side = this.sideBuf;
+    FloatBuffer up = this.upBuf;
+
+    forward.put(0, centerx - eyex);
+    forward.put(1, centery - eyey);
+    forward.put(2, centerz - eyez);
+
+    up.put(0, upx);
+    up.put(1, upy);
+    up.put(2, upz);
+
+    normalize(forward);
+
+    /* Side = forward x up */
+    cross(forward, up, side);
+    normalize(side);
+
+    /* Recompute up as: up = side x forward */
+    cross(side, forward, up);
+
+    gluMakeIdentityf(matrixBuf);
+    matrixBuf.put(0 * 4 + 0, side.get(0));
+    matrixBuf.put(1 * 4 + 0, side.get(1));
+    matrixBuf.put(2 * 4 + 0, side.get(2));
+
+    matrixBuf.put(0 * 4 + 1, up.get(0));
+    matrixBuf.put(1 * 4 + 1, up.get(1));
+    matrixBuf.put(2 * 4 + 1, up.get(2));
+
+    matrixBuf.put(0 * 4 + 2, -forward.get(0));
+    matrixBuf.put(1 * 4 + 2, -forward.get(1));
+    matrixBuf.put(2 * 4 + 2, -forward.get(2));
+
+    gl.glMultMatrixf(matrixBuf);
+    gl.glTranslatef(-eyex, -eyey, -eyez);
+  }
+
+  /**
+   * Method gluProject
+   * 
+   * @param objx
+   * @param objy
+   * @param objz
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param win_pos
+   * 
+   * @return
+   */
+  public boolean gluProject(float objx,
+                            float objy,
+                            float objz,
+                            float[] modelMatrix,
+                            int modelMatrix_offset,
+                            float[] projMatrix,
+                            int projMatrix_offset,
+                            int[] viewport,
+                            int viewport_offset,
+                            float[] win_pos,
+                            int win_pos_offset ) {
+
+    float[] in = this.in;
+    float[] out = this.out;
+
+    in[0] = objx;
+    in[1] = objy;
+    in[2] = objz;
+    in[3] = 1.0f;
+
+    __gluMultMatrixVecf(modelMatrix, modelMatrix_offset, in, out);
+    __gluMultMatrixVecf(projMatrix, projMatrix_offset, out, in);
+
+    if (in[3] == 0.0f)
+      return false;
+
+    in[3] = (1.0f / in[3]) * 0.5f;
+
+    // Map x, y and z to range 0-1
+    in[0] = in[0] * in[3] + 0.5f;
+    in[1] = in[1] * in[3] + 0.5f;
+    in[2] = in[2] * in[3] + 0.5f;
+
+    // Map x,y to viewport
+    win_pos[0+win_pos_offset] = in[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
+    win_pos[1+win_pos_offset] = in[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
+    win_pos[2+win_pos_offset] = in[2];
+
+    return true;
+  }
+
+  /**
+   * Method gluProject
+   * 
+   * @param objx
+   * @param objy
+   * @param objz
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param win_pos
+   * 
+   * @return
+   */
+  public boolean gluProject(float objx,
+                            float objy,
+                            float objz,
+                            FloatBuffer modelMatrix,
+                            FloatBuffer projMatrix,
+                            IntBuffer viewport,
+                            FloatBuffer win_pos) {
+
+    FloatBuffer in = this.inBuf;
+    FloatBuffer out = this.outBuf;
+
+    in.put(0, objx);
+    in.put(1, objy);
+    in.put(2, objz);
+    in.put(3, 1.0f);
+
+    __gluMultMatrixVecf(modelMatrix, in, out);
+    __gluMultMatrixVecf(projMatrix, out, in);
+
+    if (in.get(3) == 0.0f)
+      return false;
+
+    in.put(3, (1.0f / in.get(3)) * 0.5f);
+
+    // Map x, y and z to range 0-1
+    in.put(0, in.get(0) * in.get(3) + 0.5f);
+    in.put(1, in.get(1) * in.get(3) + 0.5f);
+    in.put(2, in.get(2) * in.get(3) + 0.5f);
+
+    // Map x,y to viewport
+    int vPos = viewport.position();
+    int wPos = win_pos.position();
+    win_pos.put(0+wPos, in.get(0) * viewport.get(2+vPos) + viewport.get(0+vPos));
+    win_pos.put(1+wPos, in.get(1) * viewport.get(3+vPos) + viewport.get(1+vPos));
+    win_pos.put(2+wPos, in.get(2));
+
+    return true;
+  }
+
+
+  /**
+   * Method gluUnproject
+   * 
+   * @param winx
+   * @param winy
+   * @param winz
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param obj_pos
+   * 
+   * @return
+   */
+  public boolean gluUnProject(float winx,
+                              float winy,
+                              float winz,
+                              float[] modelMatrix,
+                              int modelMatrix_offset,
+                              float[] projMatrix,
+                              int projMatrix_offset,
+                              int[] viewport,
+                              int viewport_offset,
+                              float[] obj_pos,
+                              int obj_pos_offset) {
+    float[] in = this.in;
+    float[] out = this.out;
+
+    gluMultMatricesf(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
+
+    if (!gluInvertMatrixf(matrix, matrix))
+      return false;
+
+    in[0] = winx;
+    in[1] = winy;
+    in[2] = winz;
+    in[3] = 1.0f;
+
+    // Map x and y from window coordinates
+    in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+    in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+
+    // Map to range -1 to 1
+    in[0] = in[0] * 2 - 1;
+    in[1] = in[1] * 2 - 1;
+    in[2] = in[2] * 2 - 1;
+
+    __gluMultMatrixVecf(matrix, 0, in, out);
+
+    if (out[3] == 0.0)
+      return false;
+
+    out[3] = 1.0f / out[3];
+
+    obj_pos[0+obj_pos_offset] = out[0] * out[3];
+    obj_pos[1+obj_pos_offset] = out[1] * out[3];
+    obj_pos[2+obj_pos_offset] = out[2] * out[3];
+
+    return true;
+  }
+
+
+  /**
+   * Method gluUnproject
+   * 
+   * @param winx
+   * @param winy
+   * @param winz
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param obj_pos
+   * 
+   * @return
+   */
+  public boolean gluUnProject(float winx,
+                              float winy,
+                              float winz,
+                              FloatBuffer modelMatrix,
+                              FloatBuffer projMatrix,
+                              IntBuffer viewport,
+                              FloatBuffer obj_pos) {
+    FloatBuffer in = this.inBuf;
+    FloatBuffer out = this.outBuf;
+
+    gluMultMatricesf(modelMatrix, projMatrix, matrixBuf);
+
+    if (!gluInvertMatrixf(matrixBuf, matrixBuf))
+      return false;
+
+    in.put(0, winx);
+    in.put(1, winy);
+    in.put(2, winz);
+    in.put(3, 1.0f);
+
+    // Map x and y from window coordinates
+    int vPos = viewport.position();
+    int oPos = obj_pos.position();
+    in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
+    in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
+
+    // Map to range -1 to 1
+    in.put(0, in.get(0) * 2 - 1);
+    in.put(1, in.get(1) * 2 - 1);
+    in.put(2, in.get(2) * 2 - 1);
+
+    __gluMultMatrixVecf(matrixBuf, in, out);
+
+    if (out.get(3) == 0.0f)
+      return false;
+
+    out.put(3, 1.0f / out.get(3));
+
+    obj_pos.put(0+oPos, out.get(0) * out.get(3));
+    obj_pos.put(1+oPos, out.get(1) * out.get(3));
+    obj_pos.put(2+oPos, out.get(2) * out.get(3));
+
+    return true;
+  }
+
+
+  /**
+   * Method gluUnproject4
+   * 
+   * @param winx
+   * @param winy
+   * @param winz
+   * @param clipw
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param near
+   * @param far
+   * @param obj_pos
+   * 
+   * @return
+   */
+  public boolean gluUnProject4(float winx,
+                               float winy,
+                               float winz,
+                               float clipw,
+                               float[] modelMatrix,
+                               int modelMatrix_offset,
+                               float[] projMatrix,
+                               int projMatrix_offset,
+                               int[] viewport,
+                               int viewport_offset,
+                               float near,
+                               float far,
+                               float[] obj_pos,
+                               int obj_pos_offset ) {
+    float[] in = this.in;
+    float[] out = this.out;
+
+    gluMultMatricesf(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
+
+    if (!gluInvertMatrixf(matrix, matrix))
+      return false;
+
+    in[0] = winx;
+    in[1] = winy;
+    in[2] = winz;
+    in[3] = clipw;
+
+    // Map x and y from window coordinates
+    in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+    in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+    in[2] = (in[2] - near) / (far - near);
+
+    // Map to range -1 to 1
+    in[0] = in[0] * 2 - 1;
+    in[1] = in[1] * 2 - 1;
+    in[2] = in[2] * 2 - 1;
+
+    __gluMultMatrixVecf(matrix, 0, in, out);
+
+    if (out[3] == 0.0f)
+      return false;
+
+    obj_pos[0+obj_pos_offset] = out[0];
+    obj_pos[1+obj_pos_offset] = out[1];
+    obj_pos[2+obj_pos_offset] = out[2];
+    obj_pos[3+obj_pos_offset] = out[3];
+    return true;
+  }
+
+  /**
+   * Method gluUnproject4
+   * 
+   * @param winx
+   * @param winy
+   * @param winz
+   * @param clipw
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param near
+   * @param far
+   * @param obj_pos
+   * 
+   * @return
+   */
+  public boolean gluUnProject4(float winx,
+                               float winy,
+                               float winz,
+                               float clipw,
+                               FloatBuffer modelMatrix,
+                               FloatBuffer projMatrix,
+                               IntBuffer viewport,
+                               float near,
+                               float far,
+                               FloatBuffer obj_pos) {
+    FloatBuffer in = this.inBuf;
+    FloatBuffer out = this.outBuf;
+
+    gluMultMatricesf(modelMatrix, projMatrix, matrixBuf);
+
+    if (!gluInvertMatrixf(matrixBuf, matrixBuf))
+      return false;
+
+    in.put(0, winx);
+    in.put(1, winy);
+    in.put(2, winz);
+    in.put(3, clipw);
+
+    // Map x and y from window coordinates
+    int vPos = viewport.position();
+    in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
+    in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
+    in.put(2, (in.get(2) - near) / (far - near));
+
+    // Map to range -1 to 1
+    in.put(0, in.get(0) * 2 - 1);
+    in.put(1, in.get(1) * 2 - 1);
+    in.put(2, in.get(2) * 2 - 1);
+
+    __gluMultMatrixVecf(matrixBuf, in, out);
+
+    if (out.get(3) == 0.0f)
+      return false;
+
+    int oPos = obj_pos.position();
+    obj_pos.put(0+oPos, out.get(0));
+    obj_pos.put(1+oPos, out.get(1));
+    obj_pos.put(2+oPos, out.get(2));
+    obj_pos.put(3+oPos, out.get(3));
+    return true;
+  }
+
+
+  /**
+   * Method gluPickMatrix
+   * 
+   * @param x
+   * @param y
+   * @param deltaX
+   * @param deltaY
+   * @param viewport
+   */
+  public void gluPickMatrix(GLMatrixFunc gl,
+                            float x,
+                            float y,
+                            float deltaX,
+                            float deltaY,
+                            IntBuffer viewport) {
+    if (deltaX <= 0 || deltaY <= 0) {
+      return;
+    }
+
+    /* Translate and scale the picked region to the entire window */
+    int vPos = viewport.position();
+    gl.glTranslatef((viewport.get(2+vPos) - 2 * (x - viewport.get(0+vPos))) / deltaX,
+                    (viewport.get(3+vPos) - 2 * (y - viewport.get(1+vPos))) / deltaY,
+                    0);
+    gl.glScalef(viewport.get(2) / deltaX, viewport.get(3) / deltaY, 1.0f);
+  }
+
+  /**
+   * Method gluPickMatrix
+   * 
+   * @param x
+   * @param y
+   * @param deltaX
+   * @param deltaY
+   * @param viewport
+   * @param viewport_offset
+   */
+  public void gluPickMatrix(GLMatrixFunc gl,
+                            float x,
+                            float y,
+                            float deltaX,
+                            float deltaY,
+                            int[] viewport,
+                            int viewport_offset) {
+    if (deltaX <= 0 || deltaY <= 0) {
+      return;
+    }
+
+    /* Translate and scale the picked region to the entire window */
+    gl.glTranslatef((viewport[2+viewport_offset] - 2 * (x - viewport[0+viewport_offset])) / deltaX,
+                    (viewport[3+viewport_offset] - 2 * (y - viewport[1+viewport_offset])) / deltaY,
+                    0);
+    gl.glScalef(viewport[2+viewport_offset] / deltaX, viewport[3+viewport_offset] / deltaY, 1.0f);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
new file mode 100644
index 0000000..3866799
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
@@ -0,0 +1,249 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsScreen;
+
+public class SharedResourceRunner implements Runnable {
+    protected static final boolean DEBUG = GLDrawableImpl.DEBUG;
+
+    public static interface Resource {
+      AbstractGraphicsDevice getDevice();
+      AbstractGraphicsScreen getScreen();
+      GLDrawableImpl getDrawable();
+      GLContextImpl getContext();
+    }
+
+    public static interface Implementation {
+        Resource createSharedResource(String connection);
+        void releaseSharedResource(Resource shared);
+        void clear();
+
+        Resource mapPut(String connection, Resource resource);
+        Resource mapGet(String connection);
+        Collection/*<Resource>*/ mapValues();
+    }
+
+    Implementation impl = null;
+
+    boolean ready = false;
+    boolean released = false;
+    boolean shouldRelease = false;
+    String initConnection = null;
+    String releaseConnection = null;
+
+    HashSet devicesTried = new HashSet();
+
+    private boolean getDeviceTried(String connection) {
+        synchronized (devicesTried) {
+            return devicesTried.contains(connection);
+        }
+    }
+    private void addDeviceTried(String connection) {
+        synchronized (devicesTried) {
+            devicesTried.add(connection);
+        }
+    }
+    private void removeDeviceTried(String connection) {
+        synchronized (devicesTried) {
+            devicesTried.remove(connection);
+        }
+    }
+
+    public SharedResourceRunner(Implementation impl) {
+        this.impl = impl;
+    }
+
+    public SharedResourceRunner.Resource getShared(AbstractGraphicsDevice device) {
+        String connection = device.getConnection();
+        return impl.mapGet(connection);
+    }
+
+    public SharedResourceRunner.Resource getOrCreateShared(AbstractGraphicsDevice device) {
+        String connection = device.getConnection();
+        SharedResourceRunner.Resource sr = impl.mapGet(connection);
+
+        if (null == sr && !getDeviceTried(connection)) {
+            addDeviceTried(connection);
+            if (DEBUG) {
+                System.err.println("getOrCreateShared() " + connection + ": trying");
+            }
+            doAndWait(connection, null);
+            sr = impl.mapGet(connection);
+            if (DEBUG) {
+                Throwable t = new Throwable("getOrCreateSharedl() " + connection + ": done");
+                t.printStackTrace();
+            }
+        }
+        return sr;
+    }
+
+    public SharedResourceRunner.Resource releaseShared(AbstractGraphicsDevice device) {
+        String connection = device.getConnection();
+        SharedResourceRunner.Resource sr = impl.mapGet(connection);
+
+        if (null != sr) {
+            removeDeviceTried(connection);
+            if (DEBUG) {
+                System.err.println("releaseShared() " + connection + ": trying");
+            }
+            doAndWait(null, connection);
+            if (DEBUG) {
+                Throwable t = new Throwable("releaseSharedl() " + connection + ": done");
+                t.printStackTrace();
+            }
+        }
+        return sr;
+    }
+
+    private final void doAndWait(String initConnection, String releaseConnection) {
+        // wait until thread becomes ready to init new device,
+        // pass the device and release the sync
+        String threadName = Thread.currentThread().getName();
+        if (DEBUG) {
+            System.err.println(threadName + " doAndWait START init: " + initConnection + ", release: "+releaseConnection);
+        }
+        synchronized (this) {
+            while (!ready) {
+                try {
+                    this.wait();
+                } catch (InterruptedException ex) {
+                }
+            }
+            if (DEBUG) {
+                System.err.println(threadName + " initializeAndWait set command init: " + initConnection + ", release: "+releaseConnection);
+            }
+            this.initConnection = initConnection;
+            this.releaseConnection = releaseConnection;
+            this.notifyAll();
+
+            // wait until thread has init/released the device
+            while (!ready || null != this.initConnection || null != this.releaseConnection) {
+                try {
+                    this.wait();
+                } catch (InterruptedException ex) {
+                }
+            }
+            if (DEBUG) {
+                System.err.println(threadName + " initializeAndWait END init: " + initConnection + ", release: "+releaseConnection);
+            }
+        }
+        // done
+    }
+
+    public final void releaseAndWait() {
+        synchronized (this) {
+            shouldRelease = true;
+            this.notifyAll();
+
+            while (!released) {
+                try {
+                    this.wait();
+                } catch (InterruptedException ex) {
+                }
+            }
+        }
+    }
+
+    public final void run() {
+        String threadName = Thread.currentThread().getName();
+
+        if (DEBUG) {
+            System.err.println(threadName + " STARTED");
+        }
+
+        synchronized (this) {
+            while (!shouldRelease) {
+                try {
+                    // wait for stop or init
+                    ready = true;
+                    if (DEBUG) {
+                        System.err.println(threadName + " -> ready");
+                    }
+                    notifyAll();
+                    this.wait();
+                } catch (InterruptedException ex) { }
+                ready = false;
+
+                if (!shouldRelease) {
+                    if (DEBUG) {
+                        System.err.println(threadName + " woke up for device connection init: " + initConnection +
+                                                        ", release: " + releaseConnection);
+                    }
+                    if(null != initConnection) {
+                        if (DEBUG) {
+                            System.err.println(threadName + " create Shared for: " + initConnection);
+                        }
+                        Resource sr = impl.createSharedResource(initConnection);
+                        if (null != sr) {
+                            impl.mapPut(initConnection, sr);
+                        }
+                    }
+                    if(null != releaseConnection) {
+                        if (DEBUG) {
+                            System.err.println(threadName + " release Shared for: " + releaseConnection);
+                        }
+                        Resource sr = impl.mapPut(releaseConnection, null);
+                        if (null != sr) {
+                            impl.releaseSharedResource(sr);
+                        }
+                    }
+                }
+                initConnection = null;
+                releaseConnection = null;
+            }
+
+            if (DEBUG) {
+                System.err.println(threadName + " release START");
+            }
+
+            releaseSharedResources();
+
+            if (DEBUG) {
+                System.err.println(threadName + " release END");
+            }
+
+            released = true;
+            ready = false;
+            notifyAll();
+        }
+    }
+
+    private void releaseSharedResources() {
+        Collection/*<Resource>*/ sharedResources = impl.mapValues();
+        for (Iterator iter = sharedResources.iterator(); iter.hasNext();) {
+            Resource sr = (Resource) iter.next();
+            impl.releaseSharedResource(sr);
+        }
+        impl.clear();
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/SystemUtil.java b/src/jogl/classes/jogamp/opengl/SystemUtil.java
new file mode 100644
index 0000000..befe1a3
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/SystemUtil.java
@@ -0,0 +1,18 @@
+package jogamp.opengl;
+
+public class SystemUtil {
+
+    private static volatile boolean getenvSupported = true;
+    /** Wrapper for System.getenv(), which doesn't work on platforms
+        earlier than JDK 5 */
+    public static String getenv(String variableName) {
+        if (getenvSupported) {
+            try {
+                return System.getenv(variableName);
+            } catch (Error e) {
+                getenvSupported = false;
+            }
+        }
+        return null;
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
new file mode 100644
index 0000000..67a9501
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.opengl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import com.jogamp.common.JogampRuntimeException;
+import com.jogamp.common.util.*;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+
+/** Implementation of the {@link javax.media.opengl.Threading} class. */
+
+public class ThreadingImpl {
+    public static final int AWT    = 1;
+    public static final int WORKER = 2;
+
+    protected static final boolean DEBUG = Debug.debug("Threading");
+
+    private static boolean singleThreaded = true;
+    private static int mode;
+    private static boolean hasAWT;
+    // We need to know whether we're running on X11 platforms to change
+    // our behavior when the Java2D/JOGL bridge is active
+    private static boolean _isX11;
+
+    private static final ThreadingPlugin threadingPlugin;
+  
+    static {
+        Object threadingPluginTmp =
+            AccessController.doPrivileged(new PrivilegedAction() {
+                    public Object run() {
+                        String workaround = Debug.getProperty("jogl.1thread", true);
+                        ClassLoader cl = ThreadingImpl.class.getClassLoader();
+                        // Default to using the AWT thread on all platforms except
+                        // Windows. On OS X there is instability apparently due to
+                        // using the JAWT on non-AWT threads. On X11 platforms there
+                        // are potential deadlocks which can be caused if the AWT
+                        // EventQueue thread hands work off to the GLWorkerThread
+                        // while holding the AWT lock. The optimization of
+                        // makeCurrent / release calls isn't worth these stability
+                        // problems.
+                        hasAWT = GLProfile.isAWTAvailable();
+
+                        String osType = NativeWindowFactory.getNativeWindowType(false);
+                        _isX11 = NativeWindowFactory.TYPE_X11.equals(osType);
+
+                        int defaultMode = ( hasAWT ? AWT : WORKER );
+
+                        mode = defaultMode;
+                        if (workaround != null) {
+                            workaround = workaround.toLowerCase();
+                            if (workaround.equals("true") ||
+                                workaround.equals("auto")) {
+                                // Nothing to do; singleThreaded and mode already set up
+                            } else if (workaround.equals("worker")) {
+                                singleThreaded = true;
+                                mode = WORKER;
+                            } else if (hasAWT && workaround.equals("awt")) {
+                                singleThreaded = true;
+                                mode = AWT;
+                            } else {
+                                singleThreaded = false;
+                            }
+                        }
+                        printWorkaroundNotice();
+
+                        Object threadingPluginObj=null;
+                        if(hasAWT) {
+                            // try to fetch the AWTThreadingPlugin
+                            Exception error=null;
+                            try {
+                                threadingPluginObj = ReflectionUtil.createInstance("jogamp.opengl.awt.AWTThreadingPlugin", cl);
+                            } catch (JogampRuntimeException jre) { error = jre; }
+                            if(AWT == mode && null==threadingPluginObj) {                                
+                                throw new GLException("Mode is AWT, but class 'jogamp.opengl.awt.AWTThreadingPlugin' is not available", error);
+                            }
+                        }
+                        return threadingPluginObj;
+                    }
+                });
+        threadingPlugin = (ThreadingPlugin) threadingPluginTmp;
+        if(DEBUG) {
+            System.err.println("Threading: hasAWT "+hasAWT+", mode "+((mode==AWT)?"AWT":"WORKER")+", plugin "+threadingPlugin);
+        }
+    }
+
+    /** No reason to ever instantiate this class */
+    private ThreadingImpl() {}
+
+    public static boolean isX11() { return _isX11; }
+    public static int getMode() { return mode; }
+
+    /** If an implementation of the javax.media.opengl APIs offers a 
+        multithreading option but the default behavior is single-threading, 
+        this API provides a mechanism for end users to disable single-threading 
+        in this implementation.  Users are strongly discouraged from
+        calling this method unless they are aware of all of the
+        consequences and are prepared to enforce some amount of
+        threading restrictions in their applications. Disabling
+        single-threading, for example, may have unintended consequences
+        on GLAutoDrawable implementations such as GLCanvas, GLJPanel and
+        GLPbuffer. Currently there is no supported way to re-enable it
+        once disabled, partly to discourage careless use of this
+        method. This method should be called as early as possible in an
+        application. */ 
+    public static void disableSingleThreading() {
+        singleThreaded = false;
+        if (Debug.verbose()) {
+            System.err.println("Application forced disabling of single-threading of javax.media.opengl implementation");
+        }
+    }
+
+    /** Indicates whether OpenGL work is being automatically forced to a
+        single thread in this implementation. */
+    public static boolean isSingleThreaded() {
+        return singleThreaded;
+    }
+
+    /** Indicates whether the current thread is the single thread on
+        which this implementation of the javax.media.opengl APIs
+        performs all of its OpenGL-related work. This method should only
+        be called if the single-thread model is in effect. */
+    public static boolean isOpenGLThread() throws GLException {
+        if (!isSingleThreaded()) {
+            throw new GLException("Should only call this in single-threaded mode");
+        }
+
+        if(null!=threadingPlugin) {
+            return threadingPlugin.isOpenGLThread();
+        }
+
+        switch (mode) {
+            case AWT:
+                throw new InternalError();
+            case WORKER:
+                return GLWorkerThread.isWorkerThread();
+            default:
+                throw new InternalError("Illegal single-threading mode " + mode);
+        }
+    }
+
+    /** Executes the passed Runnable on the single thread used for all
+        OpenGL work in this javax.media.opengl API implementation. It is
+        not specified exactly which thread is used for this
+        purpose. This method should only be called if the single-thread
+        model is in use and if the current thread is not the OpenGL
+        thread (i.e., if <code>isOpenGLThread()</code> returns
+        false). It is up to the end user to check to see whether the
+        current thread is the OpenGL thread and either execute the
+        Runnable directly or perform the work inside it. */
+    public static void invokeOnOpenGLThread(Runnable r) throws GLException {
+        if (!isSingleThreaded()) {
+            throw new GLException ("Should only call this in single-threaded mode");
+        }
+
+        if (isOpenGLThread()) {
+            throw new GLException ("Should only call this from other threads than the OpenGL thread");
+        }    
+
+        if(null!=threadingPlugin) {
+            threadingPlugin.invokeOnOpenGLThread(r);
+            return;
+        }
+
+        switch (mode) {
+            case AWT:
+                throw new InternalError();
+
+            case WORKER:
+                GLWorkerThread.start(); // singleton start via volatile-dbl-checked-locking
+                try {
+                    GLWorkerThread.invokeAndWait(r);
+                } catch (InvocationTargetException e) {
+                    throw new GLException(e.getTargetException());
+                } catch (InterruptedException e) {
+                    throw new GLException(e);
+                }
+                break;
+
+            default:
+                throw new InternalError("Illegal single-threading mode " + mode);
+        }
+    }
+
+    /** This is a workaround for AWT-related deadlocks which only seem
+        to show up in the context of applets */
+    public static boolean isAWTMode() {
+        return (mode == AWT);
+    }
+
+    private static void printWorkaroundNotice() {
+        if (singleThreaded && Debug.verbose()) {
+            System.err.println("Using " +
+                               (mode == AWT ? "AWT" : "OpenGL worker") +
+                               " thread for performing OpenGL work in javax.media.opengl implementation");
+        }
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/ThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/ThreadingPlugin.java
new file mode 100644
index 0000000..0b0748b
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/ThreadingPlugin.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl;
+
+import javax.media.opengl.*;
+
+public interface ThreadingPlugin {
+  /** Indicates whether the current thread is the single thread on
+      which this implementation of the javax.media.opengl APIs
+      performs all of its OpenGL-related work. This method should only
+      be called if the single-thread model is in effect. */
+  public boolean isOpenGLThread() throws GLException;
+
+  /** Executes the passed Runnable on the single thread used for all
+      OpenGL work in this javax.media.opengl API implementation. It is
+      not specified exactly which thread is used for this
+      purpose. This method should only be called if the single-thread
+      model is in use and if the current thread is not the OpenGL
+      thread (i.e., if <code>isOpenGLThread()</code> returns
+      false). It is up to the end user to check to see whether the
+      current thread is the OpenGL thread and either execute the
+      Runnable directly or perform the work inside it. */
+  public void invokeOnOpenGLThread(Runnable r) throws GLException;
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
new file mode 100644
index 0000000..dd493f5
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.awt;
+
+import javax.media.opengl.*;
+
+import java.awt.event.*;
+
+import java.awt.EventQueue;
+import java.lang.reflect.InvocationTargetException;
+
+import jogamp.opengl.*;
+
+public class AWTThreadingPlugin implements ThreadingPlugin {
+
+  public AWTThreadingPlugin() {}
+
+  public boolean isOpenGLThread() throws GLException {
+    switch (ThreadingImpl.getMode()) {
+      case ThreadingImpl.AWT:
+        // FIXME: See the FIXME below in 'invokeOnOpenGLThread'
+        if (Java2D.isOGLPipelineActive() && !ThreadingImpl.isX11()) {
+          return Java2D.isQueueFlusherThread();
+        } else {
+          return EventQueue.isDispatchThread();
+        }
+      case ThreadingImpl.WORKER:
+        if (Java2D.isOGLPipelineActive()) {
+          // FIXME: ideally only the QFT would be considered to be the
+          // "OpenGL thread", but we can not currently run all of
+          // JOGL's OpenGL work on that thread. See the FIXME in
+          // invokeOnOpenGLThread.
+          return (Java2D.isQueueFlusherThread() ||
+                  (ThreadingImpl.isX11() && GLWorkerThread.isWorkerThread()));
+        } else {
+          return GLWorkerThread.isWorkerThread();
+        }
+      default:
+        throw new InternalError("Illegal single-threading mode " + ThreadingImpl.getMode());
+    }
+  }
+
+  public void invokeOnOpenGLThread(Runnable r) throws GLException {
+    switch (ThreadingImpl.getMode()) {
+      case ThreadingImpl.AWT:
+        // FIXME: ideally should run all OpenGL work on the Java2D QFT
+        // thread when it's enabled, but unfortunately there are
+        // deadlock issues on X11 platforms when making our
+        // heavyweight OpenGL contexts current on the QFT because we
+        // perform the JAWT lock inside the makeCurrent()
+        // implementation, which attempts to grab the AWT lock on the
+        // QFT which is not allowed. For now, on X11 platforms,
+        // continue to perform this work on the EDT.
+        if (Java2D.isOGLPipelineActive() && !ThreadingImpl.isX11()) {
+          Java2D.invokeWithOGLContextCurrent(null, r);
+        } else {
+          try {
+            EventQueue.invokeAndWait(r);
+          } catch (InvocationTargetException e) {
+            throw new GLException(e.getTargetException());
+          } catch (InterruptedException e) {
+            throw new GLException(e);
+          }
+        }
+        break;
+
+      case ThreadingImpl.WORKER:
+        GLWorkerThread.start(); // singleton start via volatile-dbl-checked-locking
+        try {
+          GLWorkerThread.invokeAndWait(r);
+        } catch (InvocationTargetException e) {
+          throw new GLException(e.getTargetException());
+        } catch (InterruptedException e) {
+          throw new GLException(e);
+        }
+        break;
+
+      default:
+        throw new InternalError("Illegal single-threading mode " + ThreadingImpl.getMode());
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
new file mode 100644
index 0000000..51143ab
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package jogamp.opengl.awt;
+
+import jogamp.nativewindow.jawt.*;
+
+import javax.media.opengl.*;
+
+import java.lang.reflect.*;
+import java.awt.GraphicsEnvironment;
+
+public class AWTUtil {
+  // See whether we're running in headless mode
+  private static boolean headlessMode;
+  private static Class j2dClazz = null;
+  private static Method isOGLPipelineActive = null;
+  private static Method isQueueFlusherThread = null;
+  private static boolean j2dOk = false;
+
+  static {
+    lockedToolkit = false;
+    headlessMode = GraphicsEnvironment.isHeadless();
+    if(!headlessMode) {
+        try {
+            j2dClazz = Class.forName("jogamp.opengl.awt.Java2D");
+            isOGLPipelineActive = j2dClazz.getMethod("isOGLPipelineActive", (Class[])null);
+            isQueueFlusherThread = j2dClazz.getMethod("isQueueFlusherThread", (Class[])null);
+            j2dOk = true;
+        } catch (Exception e) {}
+    }
+  }
+
+  private static boolean lockedToolkit;
+
+  public static synchronized void lockToolkit() throws GLException {
+    if (lockedToolkit) {
+      throw new GLException("Toolkit already locked");
+    }
+    lockedToolkit = true;
+
+    if (headlessMode) {
+      // Workaround for running (to some degree) in headless
+      // environments but still supporting rendering via pbuffers
+      // For full correctness, would need to implement a Lock class
+      return;
+    }
+
+    if(j2dOk) {
+      try {
+        if( !((Boolean)isOGLPipelineActive.invoke(null, (Object[])null)).booleanValue() ||
+            !((Boolean)isQueueFlusherThread.invoke(null, (Object[])null)).booleanValue() ) {
+          JAWTUtil.lockToolkit();
+        }
+      } catch (Exception e) { j2dOk=false; }
+    } 
+    if(!j2dOk) {
+      JAWTUtil.lockToolkit();
+    }
+  }
+
+  public static synchronized void unlockToolkit() {
+    if (lockedToolkit) {
+        lockedToolkit = false;
+        if (headlessMode) {
+          // Workaround for running (to some degree) in headless
+          // environments but still supporting rendering via pbuffers
+          // For full correctness, would need to implement a Lock class
+          return;
+        }
+
+        if(j2dOk) {
+          try {
+            if( !((Boolean)isOGLPipelineActive.invoke(null, (Object[])null)).booleanValue() ||
+                !((Boolean)isQueueFlusherThread.invoke(null, (Object[])null)).booleanValue() ) {
+              JAWTUtil.unlockToolkit();
+            }
+          } catch (Exception e) { j2dOk=false; }
+        } 
+        if(!j2dOk) {
+          JAWTUtil.unlockToolkit();
+        }
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2D.java b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
new file mode 100644
index 0000000..e240169
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
@@ -0,0 +1,569 @@
+/*
+ * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.awt;
+
+import jogamp.opengl.*;
+
+import java.awt.*;
+import java.awt.image.*;
+import java.lang.reflect.*;
+import java.security.*;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.awt.*;
+
+/** Defines integration with the Java2D OpenGL pipeline. This
+    integration is only supported in 1.6 and is highly experimental. */
+
+public class Java2D {
+  private static boolean DEBUG = Debug.debug("Java2D");
+  private static boolean VERBOSE = Debug.verbose();
+  private static boolean isHeadless;
+  private static boolean isOGLPipelineActive;
+  private static Method invokeWithOGLContextCurrentMethod;
+  private static Method isQueueFlusherThreadMethod;
+  private static Method getOGLViewportMethod;
+  private static Method getOGLScissorBoxMethod;
+  private static Method getOGLSurfaceIdentifierMethod;
+  // This one is currently optional and is only in very recent Mustang builds
+  private static Method getOGLTextureTypeMethod;
+
+  // The following methods and fields are needed for proper support of
+  // Frame Buffer Objects in the Java2D/OpenGL pipeline
+  // (-Dsun.java2d.opengl.fbobject=true)
+  private static boolean fbObjectSupportInitialized;
+  private static Method invokeWithOGLSharedContextCurrentMethod;
+  private static Method getOGLSurfaceTypeMethod;
+
+  // Publicly-visible constants for OpenGL surface types
+  public static final int UNDEFINED       = getOGLUtilitiesIntField("UNDEFINED");
+  public static final int WINDOW          = getOGLUtilitiesIntField("WINDOW");
+  public static final int PBUFFER         = getOGLUtilitiesIntField("PBUFFER");
+  public static final int TEXTURE         = getOGLUtilitiesIntField("TEXTURE");
+  public static final int FLIP_BACKBUFFER = getOGLUtilitiesIntField("FLIP_BACKBUFFER");
+  public static final int FBOBJECT        = getOGLUtilitiesIntField("FBOBJECT");
+
+  // If FBOs are enabled in the Java2D/OpenGL pipeline, all contexts
+  // created by JOGL must share textures and display lists with the
+  // Java2D contexts in order to access the frame buffer object for
+  // potential rendering, and to simultaneously support sharing of
+  // textures and display lists with one another. Java2D has the
+  // notion of a single shared context with which all other contexts
+  // (on the same display device?) share textures and display lists;
+  // this is an approximation to that notion which will be refined
+  // later.
+  private static boolean initializedJ2DFBOShareContext;
+  private static GLContext j2dFBOShareContext;
+
+  // Accessors for new methods in sun.java2d.opengl.CGLSurfaceData
+  // class on OS X for enabling bridge
+  //  public static long    createOGLContextOnSurface(Graphics g, long ctx);
+  //  public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx);
+  //  public static void    destroyOGLContext(long ctx);
+  private static Method createOGLContextOnSurfaceMethod;
+  private static Method makeOGLContextCurrentOnSurfaceMethod;
+  private static Method destroyOGLContextMethod;
+
+  static {
+    AccessController.doPrivileged(new PrivilegedAction() {
+        public Object run() {
+          if (DEBUG && VERBOSE) {
+            System.err.println("Checking for Java2D/OpenGL support");
+          }
+          try {
+            isHeadless = true;
+            // Figure out whether the default graphics configuration is an
+            // OpenGL graphics configuration
+            GraphicsConfiguration cfg =
+              GraphicsEnvironment.getLocalGraphicsEnvironment().
+              getDefaultScreenDevice().
+              getDefaultConfiguration();
+            // If we get here, we aren't running in headless mode
+            isHeadless = false;
+            String name = cfg.getClass().getName();
+            if (DEBUG && VERBOSE) {
+              System.err.println("Java2D support: default GraphicsConfiguration = " + name);
+            }
+            isOGLPipelineActive = (name.startsWith("sun.java2d.opengl"));
+
+            if (isOGLPipelineActive) {
+              try {
+                // Try to get methods we need to integrate
+                Class utils = Class.forName("sun.java2d.opengl.OGLUtilities");
+                invokeWithOGLContextCurrentMethod = utils.getDeclaredMethod("invokeWithOGLContextCurrent",
+                                                                            new Class[] {
+                                                                              Graphics.class,
+                                                                              Runnable.class
+                                                                            });
+                invokeWithOGLContextCurrentMethod.setAccessible(true);
+
+                isQueueFlusherThreadMethod = utils.getDeclaredMethod("isQueueFlusherThread",
+                                                                     new Class[] {});
+                isQueueFlusherThreadMethod.setAccessible(true);
+
+                getOGLViewportMethod = utils.getDeclaredMethod("getOGLViewport",
+                                                               new Class[] {
+                                                                 Graphics.class,
+                                                                 Integer.TYPE,
+                                                                 Integer.TYPE
+                                                               });
+                getOGLViewportMethod.setAccessible(true);
+
+                getOGLScissorBoxMethod = utils.getDeclaredMethod("getOGLScissorBox",
+                                                                 new Class[] {
+                                                                   Graphics.class
+                                                                 });
+                getOGLScissorBoxMethod.setAccessible(true);
+
+                getOGLSurfaceIdentifierMethod = utils.getDeclaredMethod("getOGLSurfaceIdentifier",
+                                                                        new Class[] {
+                                                                          Graphics.class
+                                                                        });
+                getOGLSurfaceIdentifierMethod.setAccessible(true);
+
+                // Try to get additional methods required for proper FBO support
+                fbObjectSupportInitialized = true;
+                try {
+                  invokeWithOGLSharedContextCurrentMethod = utils.getDeclaredMethod("invokeWithOGLSharedContextCurrent",
+                                                                                    new Class[] {
+                                                                                      GraphicsConfiguration.class,
+                                                                                      Runnable.class
+                                                                                    });
+                  invokeWithOGLSharedContextCurrentMethod.setAccessible(true);
+
+                  getOGLSurfaceTypeMethod = utils.getDeclaredMethod("getOGLSurfaceType",
+                                                                    new Class[] {
+                                                                      Graphics.class
+                                                                    });
+                  getOGLSurfaceTypeMethod.setAccessible(true);
+                } catch (Exception e) {
+                  fbObjectSupportInitialized = false;
+                  if (DEBUG && VERBOSE) {
+                    e.printStackTrace();
+                    System.err.println("Info: Disabling Java2D/JOGL FBO support");
+                  }
+                }
+
+                // Try to get an additional method for FBO support in recent Mustang builds
+                try {
+                  getOGLTextureTypeMethod = utils.getDeclaredMethod("getOGLTextureType",
+                                                                    new Class[] {
+                                                                      Graphics.class
+                                                                    });
+                  getOGLTextureTypeMethod.setAccessible(true);
+                } catch (Exception e) {
+                  if (DEBUG && VERBOSE) {
+                    e.printStackTrace();
+                    System.err.println("Info: GL_ARB_texture_rectangle FBO support disabled");
+                  }
+                }
+
+                // Try to set up APIs for enabling the bridge on OS X,
+                // where it isn't possible to create generalized
+                // external GLDrawables
+                Class cglSurfaceData = null;
+                try {
+                  cglSurfaceData = Class.forName("sun.java2d.opengl.CGLSurfaceData");
+                } catch (Exception e) {
+                  if (DEBUG && VERBOSE) {
+                    e.printStackTrace();
+                    System.err.println("Info: Unable to find class sun.java2d.opengl.CGLSurfaceData for OS X");
+                  }
+                }
+                if (cglSurfaceData != null) {
+                  // FIXME: for now, assume that FBO support is not enabled on OS X
+                  fbObjectSupportInitialized = false;
+
+                  // We need to find these methods in order to make the bridge work on OS X
+                  createOGLContextOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("createOGLContextOnSurface",
+                                                                                     new Class[] {
+                                                                                       Graphics.class,
+                                                                                       Long.TYPE
+                                                                                     });
+                  createOGLContextOnSurfaceMethod.setAccessible(true);
+
+                  makeOGLContextCurrentOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("makeOGLContextCurrentOnSurface",
+                                                                                          new Class[] {
+                                                                                            Graphics.class,
+                                                                                            Long.TYPE
+                                                                                          });
+                  makeOGLContextCurrentOnSurfaceMethod.setAccessible(true);
+
+                  destroyOGLContextMethod = cglSurfaceData.getDeclaredMethod("destroyOGLContext",
+                                                                             new Class[] {
+                                                                               Long.TYPE
+                                                                             });
+                  destroyOGLContextMethod.setAccessible(true);
+                }
+              } catch (Exception e) {
+                if (DEBUG && VERBOSE) {
+                  e.printStackTrace();
+                  System.err.println("Info: Disabling Java2D/JOGL integration");
+                }
+                isOGLPipelineActive = false;
+              }
+            }
+          } catch (HeadlessException e) {
+            // The AWT is running in headless mode, so the Java 2D / JOGL bridge is clearly disabled
+          }
+
+          if (DEBUG) {
+            System.err.println("JOGL/Java2D integration " + (isOGLPipelineActive ? "enabled" : "disabled"));
+          }
+          return null;
+        }
+      });
+  }
+
+  public static boolean isOGLPipelineActive() {
+    return isOGLPipelineActive;
+  }
+
+  public static boolean isFBOEnabled() {
+    return fbObjectSupportInitialized;
+  }
+
+  public static boolean isQueueFlusherThread() {
+    checkActive();
+
+    try {
+      return ((Boolean) isQueueFlusherThreadMethod.invoke(null, (Object[])null)).booleanValue();
+    } catch (InvocationTargetException e) {
+      throw new GLException(e.getTargetException());
+    } catch (Exception e) {
+      throw (InternalError) new InternalError().initCause(e);
+    }
+  }
+  
+  /** Makes current the OpenGL context associated with the passed
+      Graphics object and runs the given Runnable on the Queue
+      Flushing Thread in one atomic action. */
+  public static void invokeWithOGLContextCurrent(Graphics g, Runnable r) throws GLException {
+    checkActive();
+
+    try {
+      // FIXME: this may need adjustment
+      // This seems to be needed in many applications which don't
+      // initialize an OpenGL context before this and which would
+      // otherwise cause initFBOShareContext to be called from the
+      // Queue Flusher Thread, which isn't allowed
+      initFBOShareContext(GraphicsEnvironment.
+                          getLocalGraphicsEnvironment().
+                          getDefaultScreenDevice());
+
+      AWTUtil.lockToolkit();
+      try {
+        invokeWithOGLContextCurrentMethod.invoke(null, new Object[] {g, r});
+      } finally {
+        AWTUtil.unlockToolkit();
+      }
+    } catch (InvocationTargetException e) {
+      throw new GLException(e.getTargetException());
+    } catch (Exception e) {
+      throw (InternalError) new InternalError().initCause(e);
+    }
+  }
+
+  /** Makes current the "shared" OpenGL context associated with the
+      given GraphicsConfiguration object, allowing JOGL to share
+      server-side OpenGL objects like textures and display lists with
+      this context when necessary. This is needed when Java2D's FBO
+      support is enabled, because in order to render into that FBO,
+      JOGL must share textures and display lists with it. Returns
+      false if the passed GraphicsConfiguration was not an OpenGL
+      GraphicsConfiguration. */
+  public static boolean invokeWithOGLSharedContextCurrent(GraphicsConfiguration g, Runnable r) throws GLException {
+    checkActive();
+
+    try {
+      AWTUtil.lockToolkit();
+      try {
+        return ((Boolean) invokeWithOGLSharedContextCurrentMethod.invoke(null, new Object[] {g, r})).booleanValue();
+      } finally {
+        AWTUtil.unlockToolkit();
+      }
+    } catch (InvocationTargetException e) {
+      throw new GLException(e.getTargetException());
+    } catch (Exception e) {
+      throw (InternalError) new InternalError().initCause(e);
+    }
+  }
+
+  /** Returns the OpenGL viewport associated with the given Graphics
+      object, assuming that the Graphics object is associated with a
+      component of the specified width and height. The user should
+      call glViewport() with the returned rectangle's bounds in order
+      to get correct rendering results. Should only be called from the
+      Queue Flusher Thread. */
+  public static Rectangle getOGLViewport(Graphics g,
+                                         int componentWidth,
+                                         int componentHeight) {
+    checkActive();
+
+    try {
+      return (Rectangle) getOGLViewportMethod.invoke(null, new Object[] {g,
+                                                                         new Integer(componentWidth),
+                                                                         new Integer(componentHeight)});
+    } catch (InvocationTargetException e) {
+      throw new GLException(e.getTargetException());
+    } catch (Exception e) {
+      throw (InternalError) new InternalError().initCause(e);
+    }
+  }
+
+  /** Returns the OpenGL scissor region associated with the given
+      Graphics object, taking into account all clipping regions, etc.
+      To avoid destroying Java2D's previous rendering results, this
+      method should be called and the resulting rectangle's bounds
+      passed to a call to glScissor(). Should only be called from the
+      Queue Flusher Thread. */
+  public static Rectangle getOGLScissorBox(Graphics g) {
+    checkActive();
+
+    try {
+      return (Rectangle) getOGLScissorBoxMethod.invoke(null, new Object[] {g});
+    } catch (InvocationTargetException e) {
+      throw new GLException(e.getTargetException());
+    } catch (Exception e) {
+      throw (InternalError) new InternalError().initCause(e);
+    }
+  }
+
+  /** Returns an opaque "surface identifier" associated with the given
+      Graphics object. If this changes from invocation to invocation,
+      the underlying OpenGL drawable for the Graphics object has
+      changed and a new external GLDrawable and GLContext should be
+      created (and the old ones destroyed). Should only be called from
+      the Queue Flusher Thread.*/
+  public static Object getOGLSurfaceIdentifier(Graphics g) {
+    checkActive();
+
+    try {
+      return getOGLSurfaceIdentifierMethod.invoke(null, new Object[] {g});
+    } catch (InvocationTargetException e) {
+      throw new GLException(e.getTargetException());
+    } catch (Exception e) {
+      throw (InternalError) new InternalError().initCause(e);
+    }
+  }
+
+  /** Returns the underlying surface type for the given Graphics
+      object. This indicates, in particular, whether Java2D is
+      currently rendering into a pbuffer or FBO. */
+  public static int getOGLSurfaceType(Graphics g) {
+    checkActive();
+
+    try {
+      // FIXME: fallback path for pre-b73 (?) Mustang builds -- remove
+      // once fbobject support is in OGLUtilities
+      if (!fbObjectSupportInitialized) {
+        return 0;
+      }
+
+      return ((Integer) getOGLSurfaceTypeMethod.invoke(null, new Object[] { g })).intValue();
+    } catch (InvocationTargetException e) {
+      throw new GLException(e.getTargetException());
+    } catch (Exception e) {
+      throw (InternalError) new InternalError().initCause(e);
+    }
+  }
+
+  /** Returns the underlying texture target of the given Graphics
+      object assuming it is rendering to an FBO. Returns either
+      GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB. */
+  public static int getOGLTextureType(Graphics g) {
+    checkActive();
+
+    if (getOGLTextureTypeMethod == null) {
+      return GL.GL_TEXTURE_2D;
+    }
+
+    try {
+      return ((Integer) getOGLTextureTypeMethod.invoke(null, new Object[] { g })).intValue();
+    } catch (InvocationTargetException e) {
+      throw new GLException(e.getTargetException());
+    } catch (Exception e) {
+      throw (InternalError) new InternalError().initCause(e);
+    }
+  }
+
+  /** Returns either the given GLContext or a substitute one with
+      which clients should share textures and display lists. Needed
+      when the Java2D/OpenGL pipeline is active and FBOs are being
+      used for rendering. FIXME: may need to alter the API in the
+      future to indicate which GraphicsDevice the source context is
+      associated with. */
+  public static GLContext filterShareContext(GLContext shareContext) {
+    if (isHeadless)
+      return shareContext;
+
+    // FIXME: this may need adjustment
+    initFBOShareContext(GraphicsEnvironment.
+                        getLocalGraphicsEnvironment().
+                        getDefaultScreenDevice());
+    if (j2dFBOShareContext != null) {
+      return j2dFBOShareContext;
+    }
+    return shareContext;
+  }
+
+  /** Returns the GLContext associated with the Java2D "share
+      context", with which all contexts created by JOGL must share
+      textures and display lists when the FBO option is enabled for
+      the Java2D/OpenGL pipeline. */
+  public static GLContext getShareContext(GraphicsDevice device) {
+    initFBOShareContext(device);
+    // FIXME: for full generality probably need to have multiple of
+    // these, one per GraphicsConfiguration seen?
+    return j2dFBOShareContext;
+  }
+
+  //----------------------------------------------------------------------
+  // Mac OS X-specific methods
+  //
+
+  /** (Mac OS X-specific) Creates a new OpenGL context on the surface
+      associated with the given Graphics object, sharing textures and
+      display lists with the specified (CGLContextObj) share context. */
+  public static long createOGLContextOnSurface(Graphics g, long shareCtx) {
+    checkActive();
+
+    try {
+      return ((Long) createOGLContextOnSurfaceMethod.invoke(null, new Object[] { g, new Long(shareCtx) })).longValue();
+    } catch (InvocationTargetException e) {
+      throw new GLException(e.getTargetException());
+    } catch (Exception e) {
+      throw (InternalError) new InternalError().initCause(e);
+    }
+  }
+
+  /** (Mac OS X-specific) Makes the given OpenGL context current on
+      the surface associated with the given Graphics object. */
+  public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx) {
+    checkActive();
+
+    try {
+      return ((Boolean) makeOGLContextCurrentOnSurfaceMethod.invoke(null, new Object[] { g, new Long(ctx) })).booleanValue();
+    } catch (InvocationTargetException e) {
+      throw new GLException(e.getTargetException());
+    } catch (Exception e) {
+      throw (InternalError) new InternalError().initCause(e);
+    }
+  }
+
+  /** (Mac OS X-specific) Destroys the given OpenGL context. */
+  public static void destroyOGLContext(long ctx) {
+    checkActive();
+
+    try {
+      destroyOGLContextMethod.invoke(null, new Object[] { new Long(ctx) });
+    } catch (InvocationTargetException e) {
+      throw new GLException(e.getTargetException());
+    } catch (Exception e) {
+      throw (InternalError) new InternalError().initCause(e);
+    }
+  }
+
+  //----------------------------------------------------------------------
+  // Internals only below this point
+  //
+
+  private static void checkActive() {
+    if (!isOGLPipelineActive()) {
+      throw new GLException("Java2D OpenGL pipeline not active (or necessary support not present)");
+    }
+  }
+
+  private static int getOGLUtilitiesIntField(final String name) {
+    Integer i = (Integer) AccessController.doPrivileged(new PrivilegedAction() {
+        public Object run() {
+          try {
+            Class utils = Class.forName("sun.java2d.opengl.OGLUtilities");
+            Field f = utils.getField(name);
+            f.setAccessible(true);
+            return f.get(null);
+          } catch (Exception e) {
+            if (DEBUG && VERBOSE) {
+              e.printStackTrace();
+            }
+            return null;
+          }
+        }
+      });
+    if (i == null)
+      return 0;
+    if (DEBUG && VERBOSE) {
+      System.err.println("OGLUtilities." + name + " = " + i.intValue());
+    }
+    return i.intValue();
+  }
+
+  private static void initFBOShareContext(final GraphicsDevice device) {
+    // Note 1: this must not be done in the static initalizer due to
+    // deadlock problems.
+
+    // Note 2: the first execution of this method must not be from the
+    // Java2D Queue Flusher Thread.
+
+    if (isOGLPipelineActive() &&
+        isFBOEnabled() &&
+        !initializedJ2DFBOShareContext) {
+
+      // FIXME: this technique is probably not adequate in multi-head
+      // situations. Ideally we would keep track of a given share
+      // context on a per-GraphicsConfiguration basis or something
+      // similar rather than keeping one share context in a global
+      // variable.
+      initializedJ2DFBOShareContext = true;
+      if (DEBUG) {
+        System.err.println("Starting initialization of J2D FBO share context");
+      }
+      invokeWithOGLSharedContextCurrent(device.getDefaultConfiguration(), new Runnable() {
+          public void run() {
+            j2dFBOShareContext = GLDrawableFactory.getFactory(GLProfile.getDefault(GLProfile.getDefaultDesktopDevice())).createExternalGLContext();
+          }
+        });
+      if (DEBUG) {
+        System.err.println("Ending initialization of J2D FBO share context");
+      }
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2DGLContext.java b/src/jogl/classes/jogamp/opengl/awt/Java2DGLContext.java
new file mode 100644
index 0000000..4a5b1db
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/awt/Java2DGLContext.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.awt;
+
+import jogamp.opengl.*;
+import java.awt.Graphics;
+
+/** Provides a construct by which the shared GLJPanel code can
+ * interact with a few methods in the Mac OS X-specific Java2D/JOGL
+ * bridge implementation.
+ */
+
+public interface Java2DGLContext {
+  public void setGraphics(Graphics g);
+}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
new file mode 100644
index 0000000..864b958
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
@@ -0,0 +1,279 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.egl;
+
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+import com.jogamp.gluegen.runtime.ProcAddressTable;
+import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
+import java.nio.*;
+import java.util.*;
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+
+public abstract class EGLContext extends GLContextImpl {
+    private boolean eglQueryStringInitialized;
+    private boolean eglQueryStringAvailable;
+    private EGLExt eglExt;
+    // Table that holds the addresses of the native C-language entry points for
+    // EGL extension functions.
+    private EGLExtProcAddressTable eglExtProcAddressTable;
+
+    EGLContext(GLDrawableImpl drawable,
+               GLContext shareWith) {
+        super(drawable, shareWith);
+    }
+
+    public Object getPlatformGLExtensions() {
+      return getEGLExt();
+    }
+
+    public EGLExt getEGLExt() {
+      if (eglExt == null) {
+        eglExt = new EGLExtImpl(this);
+      }
+      return eglExt;
+    }
+
+    public final ProcAddressTable getPlatformExtProcAddressTable() {
+        return eglExtProcAddressTable;
+    }
+
+    public final EGLExtProcAddressTable getEGLExtProcAddressTable() {
+        return eglExtProcAddressTable;
+    }
+
+    protected Map/*<String, String>*/ getFunctionNameMap() { return null; }
+
+    protected Map/*<String, String>*/ getExtensionNameMap() { return null; }
+
+    public final boolean isGLReadDrawableAvailable() {
+        return true;
+    }
+
+    protected void makeCurrentImpl(boolean newCreated) throws GLException {
+        if(EGL.EGL_NO_DISPLAY==((EGLDrawable)drawable).getDisplay() ) {
+            throw new GLException("drawable not properly initialized, NO DISPLAY: "+drawable);
+        }
+        if (EGL.eglGetCurrentContext() != contextHandle) {
+            if (!EGL.eglMakeCurrent(((EGLDrawable)drawable).getDisplay(),
+                                    drawable.getHandle(),
+                                    drawableRead.getHandle(),
+                                    contextHandle)) {
+                throw new GLException("Error making context 0x" +
+                                      Long.toHexString(contextHandle) + " current: error code " + EGL.eglGetError());
+            }
+        }
+    }
+
+    protected void releaseImpl() throws GLException {
+      if (!EGL.eglMakeCurrent(((EGLDrawable)drawable).getDisplay(),
+                              EGL.EGL_NO_SURFACE,
+                              EGL.EGL_NO_SURFACE,
+                              EGL.EGL_NO_CONTEXT)) {
+            throw new GLException("Error freeing OpenGL context 0x" +
+                                  Long.toHexString(contextHandle) + ": error code " + EGL.eglGetError());
+      }
+    }
+
+    protected void destroyImpl() throws GLException {
+      if (!EGL.eglDestroyContext(((EGLDrawable)drawable).getDisplay(), contextHandle)) {
+          throw new GLException("Error destroying OpenGL context 0x" +
+                                Long.toHexString(contextHandle) + ": error code " + EGL.eglGetError());
+      }
+    }
+
+    protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+        return 0; // FIXME
+    }
+
+    protected void destroyContextARBImpl(long _context) {
+        // FIXME
+    }
+
+    protected boolean createImpl() throws GLException {
+        long eglDisplay = ((EGLDrawable)drawable).getDisplay();
+        EGLGraphicsConfiguration config = ((EGLDrawable)drawable).getGraphicsConfiguration();
+        GLProfile glProfile = drawable.getGLProfile();
+        long eglConfig = config.getNativeConfig();
+        long shareWith = EGL.EGL_NO_CONTEXT;
+
+        if (eglDisplay == 0) {
+            throw new GLException("Error: attempted to create an OpenGL context without a display connection");
+        }
+        if (eglConfig == 0) {
+            throw new GLException("Error: attempted to create an OpenGL context without a graphics configuration");
+        }
+
+        try {
+            // might be unavailable on EGL < 1.2
+            if(!EGL.eglBindAPI(EGL.EGL_OPENGL_ES_API)) {
+                throw new GLException("eglBindAPI to ES failed , error 0x"+Integer.toHexString(EGL.eglGetError()));
+            }
+        } catch (GLException glex) {
+            if (DEBUG) {
+                glex.printStackTrace();
+            }
+        }
+
+        EGLContext other = (EGLContext) GLContextShareSet.getShareContext(this);
+        if (other != null) {
+            shareWith = other.getHandle();
+            if (shareWith == 0) {
+                throw new GLException("GLContextShareSet returned an invalid OpenGL context");
+            }
+        }
+
+        int[] contextAttrs = new int[] {
+                EGL.EGL_CONTEXT_CLIENT_VERSION, -1,
+                EGL.EGL_NONE
+        };
+        if (glProfile.usesNativeGLES2()) {
+            contextAttrs[1] = 2;
+        } else if (glProfile.usesNativeGLES1()) {
+            contextAttrs[1] = 1;
+        } else {
+            throw new GLException("Error creating OpenGL context - invalid GLProfile: "+glProfile);
+        }
+        contextHandle = EGL.eglCreateContext(eglDisplay, eglConfig, shareWith, contextAttrs, 0);
+        if (contextHandle == 0) {
+            throw new GLException("Error creating OpenGL context: eglDisplay 0x"+Long.toHexString(eglDisplay)+
+                                  ", "+glProfile+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+        }
+        GLContextShareSet.contextCreated(this);
+        if (DEBUG) {
+            System.err.println(getThreadName() + ": !!! Created OpenGL context 0x" +
+                               Long.toHexString(contextHandle) + 
+                               ",\n\twrite surface 0x" + Long.toHexString(drawable.getHandle()) +
+                               ",\n\tread  surface 0x" + Long.toHexString(drawableRead.getHandle())+
+                               ",\n\t"+this+
+                               ",\n\tsharing with 0x" + Long.toHexString(shareWith));
+        }
+        if (!EGL.eglMakeCurrent(((EGLDrawable)drawable).getDisplay(),
+                                drawable.getHandle(),
+                                drawableRead.getHandle(),
+                                contextHandle)) {
+            throw new GLException("Error making context 0x" +
+                                  Long.toHexString(contextHandle) + " current: error code " + EGL.eglGetError());
+        }
+        setGLFunctionAvailability(true, glProfile.usesNativeGLES2()?2:1, 0, CTX_PROFILE_ES|CTX_OPTION_ANY);
+        return true;
+    }
+
+    protected final void updateGLXProcAddressTable() {
+        AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+        AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice();
+        String key = adevice.getUniqueID();
+        if (DEBUG) {
+          System.err.println(getThreadName() + ": !!! Initializing EGLextension address table: "+key);
+        }
+        eglQueryStringInitialized = false;
+        eglQueryStringAvailable = false;
+
+        EGLExtProcAddressTable table = null;
+        synchronized(mappedContextTypeObjectLock) {
+            table = (EGLExtProcAddressTable) mappedGLXProcAddress.get( key );
+        }
+        if(null != table) {
+            eglExtProcAddressTable = table;
+            if(DEBUG) {
+                System.err.println(getThreadName() + ": !!! GLContext EGL ProcAddressTable reusing key("+key+") -> "+table.hashCode());
+            }
+        } else {
+            if (eglExtProcAddressTable == null) {
+              // FIXME: cache ProcAddressTables by capability bits so we can
+              // share them among contexts with the same capabilities
+              eglExtProcAddressTable = new EGLExtProcAddressTable(new GLProcAddressResolver());
+            }
+            resetProcAddressTable(getEGLExtProcAddressTable());
+            synchronized(mappedContextTypeObjectLock) {
+                mappedGLXProcAddress.put(key, getEGLExtProcAddressTable());
+                if(DEBUG) {
+                    System.err.println(getThreadName() + ": !!! GLContext EGL ProcAddressTable mapping key("+key+") -> "+getEGLExtProcAddressTable().hashCode());
+                }
+            }
+        }
+    }
+  
+    public synchronized String getPlatformExtensionsString() {
+        if (!eglQueryStringInitialized) {
+          eglQueryStringAvailable =
+            getDrawableImpl().getGLDynamicLookupHelper().dynamicLookupFunction("eglQueryString") != 0;
+          eglQueryStringInitialized = true;
+        }
+        if (eglQueryStringAvailable) {
+            String ret = EGL.eglQueryString(((EGLDrawable)drawable).getDisplay(), 
+                                            EGL.EGL_EXTENSIONS);
+            if (DEBUG) {
+              System.err.println("!!! EGL extensions: " + ret);
+            }
+            return ret;
+        } else {
+          return "";
+        }
+    }
+
+    protected void setSwapIntervalImpl(int interval) {
+        if (EGL.eglSwapInterval(((EGLDrawable)drawable).getDisplay(), interval)) {
+            currentSwapInterval = interval ;
+        }
+    }
+
+    public abstract void bindPbufferToTexture();
+
+    public abstract void releasePbufferFromTexture();
+
+    //----------------------------------------------------------------------
+    // Currently unimplemented stuff
+    //
+
+    protected void copyImpl(GLContext source, int mask) throws GLException {
+        throw new GLException("Not yet implemented");
+    }
+
+
+    public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+        throw new GLException("Should not call this");
+    }
+
+    public boolean offscreenImageNeedsVerticalFlip() {
+        throw new GLException("Should not call this");
+    }
+
+    public int getOffscreenContextPixelDataType() {
+        throw new GLException("Should not call this");
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
new file mode 100644
index 0000000..7ffbf90
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.egl;
+
+import jogamp.opengl.GLDynamicLookupHelper;
+import jogamp.opengl.GLDrawableImpl;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.egl.*;
+import javax.media.opengl.*;
+
+public abstract class EGLDrawable extends GLDrawableImpl {
+    protected boolean ownEGLDisplay = false; // for destruction
+    protected boolean ownEGLSurface = false; // for destruction
+    private EGLGraphicsConfiguration eglConfig;
+    protected long eglDisplay;
+    protected long eglSurface;
+
+    protected EGLDrawable(EGLDrawableFactory factory,
+                       NativeSurface component) throws GLException {
+        super(factory, component, false);
+        eglSurface=EGL.EGL_NO_SURFACE;
+        eglDisplay=0;
+    }
+
+    public long getDisplay() {
+        return eglDisplay;
+    }
+
+    public long getHandle() {
+        return eglSurface;
+    }
+
+    public EGLGraphicsConfiguration getGraphicsConfiguration() {
+        return eglConfig;
+    }
+
+    public GLCapabilitiesImmutable getChosenGLCapabilities() {
+        return (null==eglConfig)?super.getChosenGLCapabilities():(GLCapabilitiesImmutable)eglConfig.getChosenCapabilities();
+    }
+
+    public abstract GLContext createContext(GLContext shareWith);
+
+    protected abstract long createSurface(long eglDpy, long eglNativeCfg, long surfaceHandle);
+
+    private void recreateSurface() {
+        // create a new EGLSurface ..
+        if(EGL.EGL_NO_SURFACE!=eglSurface) {
+            EGL.eglDestroySurface(eglDisplay, eglSurface);
+        }
+
+        if(DEBUG) {
+            System.err.println("createSurface using eglDisplay 0x"+Long.toHexString(eglDisplay)+", "+eglConfig);
+        }
+
+        eglSurface = createSurface(eglDisplay, eglConfig.getNativeConfig(), surface.getSurfaceHandle());
+        if (EGL.EGL_NO_SURFACE==eglSurface) {
+            throw new GLException("Creation of window surface failed: "+eglConfig+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+        }
+
+        if(DEBUG) {
+            System.err.println("setSurface using component: handle 0x"+Long.toHexString(surface.getSurfaceHandle())+" -> 0x"+Long.toHexString(eglSurface));
+        }
+    }
+
+    protected void setRealizedImpl() {
+        if (realized) {
+            AbstractGraphicsConfiguration aConfig = surface.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+            AbstractGraphicsDevice aDevice = aConfig.getScreen().getDevice();
+            if(aDevice instanceof EGLGraphicsDevice) {
+                if(DEBUG) {
+                    System.err.println("EGLDrawable.setRealized: using existing EGL config: "+this);
+                }
+                // just fetch the data .. trust but verify ..
+                eglDisplay = aDevice.getHandle();
+                if (eglDisplay == EGL.EGL_NO_DISPLAY) {
+                    throw new GLException("Invalid EGL display in EGLGraphicsDevice from "+aDevice);
+                }
+                if(aConfig instanceof EGLGraphicsConfiguration) {
+                    eglConfig = (EGLGraphicsConfiguration) aConfig; // done ..
+                    if (null == eglConfig) {
+                        throw new GLException("Null EGLGraphicsConfiguration from "+aConfig);
+                    }
+
+                    int[] tmp = new int[1];
+                    if ( 0 != surface.getSurfaceHandle() &&
+                         EGL.eglQuerySurface(eglDisplay, surface.getSurfaceHandle(), EGL.EGL_CONFIG_ID, tmp, 0) ) {
+                        // surface holds static EGLSurface
+                        eglSurface = surface.getSurfaceHandle();
+                        if(DEBUG) {
+                            System.err.println("setSurface re-using component's EGLSurface: handle 0x"+Long.toHexString(eglSurface));
+                        }
+                    } else {
+                        // EGLSurface is ours ..
+                        ownEGLSurface=true;
+                        
+                        eglConfig.updateGraphicsConfiguration();
+
+                        recreateSurface();
+                    }
+                } else {
+                    throw new GLException("EGLGraphicsDevice hold by non EGLGraphicsConfiguration: "+aConfig);
+                }
+            } else {
+                if(DEBUG) {
+                    System.err.println("EGLDrawable.setRealized: creating new EGL config: "+this);
+                }
+                // create a new EGL config ..
+                ownEGLDisplay=true;
+                // EGLSurface is ours ..
+                ownEGLSurface=true;
+
+                long nDisplay=0;
+                if( NativeWindowFactory.TYPE_WINDOWS.equals(NativeWindowFactory.getNativeWindowType(false)) ) {
+                    nDisplay = surface.getSurfaceHandle(); // don't even ask ..
+                } else {
+                    nDisplay = aDevice.getHandle(); // 0 == EGL.EGL_DEFAULT_DISPLAY
+                }
+                eglDisplay = EGL.eglGetDisplay(nDisplay);
+                if (eglDisplay == EGL.EGL_NO_DISPLAY) {
+                    if(DEBUG) {
+                        System.err.println("eglDisplay("+Long.toHexString(nDisplay)+" <surfaceHandle>): failed, using EGL_DEFAULT_DISPLAY");
+                    }
+                    nDisplay = EGL.EGL_DEFAULT_DISPLAY;
+                    eglDisplay = EGL.eglGetDisplay(nDisplay);
+                }
+                if (eglDisplay == EGL.EGL_NO_DISPLAY) {
+                    throw new GLException("Failed to created EGL display: nhandle 0x"+Long.toHexString(nDisplay)+", "+aDevice+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+                } else if(DEBUG) {
+                    System.err.println("eglDisplay("+Long.toHexString(nDisplay)+"): 0x"+Long.toHexString(eglDisplay));
+                }
+                if (!EGL.eglInitialize(eglDisplay, null, null)) {
+                    throw new GLException("eglInitialize failed"+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+                }
+                EGLGraphicsDevice e = new EGLGraphicsDevice(eglDisplay, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
+                DefaultGraphicsScreen s = new DefaultGraphicsScreen(e, aConfig.getScreen().getIndex());
+                // yes, use the already choosen/requested Capabilities (x11,win32,..)
+                GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) aConfig.getChosenCapabilities();
+                GLCapabilitiesImmutable capsRequested = (GLCapabilitiesImmutable) aConfig.getRequestedCapabilities();
+                eglConfig = (EGLGraphicsConfiguration) GraphicsConfigurationFactory.getFactory(e).chooseGraphicsConfiguration(
+                        capsChosen, capsRequested, null, s);
+                if (null == eglConfig) {
+                    throw new GLException("Couldn't create EGLGraphicsConfiguration from "+s);
+                } else if(DEBUG) {
+                    System.err.println("Chosen eglConfig: "+eglConfig);
+                }
+                recreateSurface();
+            }
+        } else if (ownEGLSurface && eglSurface != EGL.EGL_NO_SURFACE) {
+            // Destroy the window surface
+            if (!EGL.eglDestroySurface(eglDisplay, eglSurface)) {
+                throw new GLException("Error destroying window surface (eglDestroySurface)");
+            }
+            eglSurface = EGL.EGL_NO_SURFACE;
+            if (ownEGLDisplay && EGL.EGL_NO_DISPLAY!=eglDisplay) {
+                EGL.eglTerminate(eglDisplay);
+            }
+            eglDisplay=EGL.EGL_NO_DISPLAY;
+            eglConfig=null;
+        }
+    }
+
+    public int getWidth() {
+        int[] tmp = new int[1];
+        if (!EGL.eglQuerySurface(eglDisplay, eglSurface, EGL.EGL_WIDTH, tmp, 0)) {
+            throw new GLException("Error querying surface width");
+        }
+        return tmp[0];
+    }
+
+    public int getHeight() {
+        int[] tmp = new int[1];
+        if (!EGL.eglQuerySurface(eglDisplay, eglSurface, EGL.EGL_HEIGHT, tmp, 0)) {
+            throw new GLException("Error querying surface height");
+        }
+        return tmp[0];
+    }
+
+    public GLDynamicLookupHelper getGLDynamicLookupHelper() {
+        if (getGLProfile().usesNativeGLES2()) {
+            return getFactoryImpl().getGLDynamicLookupHelper(2);
+        } else if (getGLProfile().usesNativeGLES1()) {
+            return getFactoryImpl().getGLDynamicLookupHelper(1);
+        } else {
+            throw new GLException("Unsupported: "+getGLProfile());
+        }
+    }
+
+    public String toString() {
+        return getClass().getName()+"[realized "+isRealized()+
+                    ",\n\tfactory    "+getFactory()+
+                    ",\n\tsurface    "+getNativeSurface()+
+                    ",\n\teglSurface  0x"+Long.toHexString(eglSurface)+
+                    ",\n\teglConfig  "+eglConfig+
+                    ",\n\trequested  "+getRequestedGLCapabilities()+
+                    ",\n\tchosen     "+getChosenGLCapabilities()+"]";
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
new file mode 100644
index 0000000..b6599de
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.egl;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.egl.EGLGraphicsDevice;
+import javax.media.opengl.*;
+
+import com.jogamp.common.JogampRuntimeException;
+import com.jogamp.common.util.*;
+import jogamp.opengl.*;
+import jogamp.nativewindow.WrappedSurface;
+
+import java.util.HashMap;
+import java.util.List;
+
+public class EGLDrawableFactory extends GLDrawableFactoryImpl {
+  
+    private static final GLDynamicLookupHelper eglES1DynamicLookupHelper;
+    private static final GLDynamicLookupHelper eglES2DynamicLookupHelper;
+
+    static {
+        // Register our GraphicsConfigurationFactory implementations
+        // The act of constructing them causes them to be registered
+        new EGLGraphicsConfigurationFactory();
+
+        // Check for other underlying stuff ..
+        if(NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(true))) {
+            try {
+                ReflectionUtil.createInstance("jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory", EGLDrawableFactory.class.getClassLoader());
+            } catch (JogampRuntimeException jre) { /* n/a .. */ }
+        }
+
+        // FIXME: Probably need to move EGL from a static model 
+        // to a dynamic one, where there can be 2 instances 
+        // for each ES profile with their own ProcAddressTable.
+
+        GLDynamicLookupHelper tmp=null;
+        try {
+            tmp = new GLDynamicLookupHelper(new EGLES1DynamicLibraryBundleInfo());
+        } catch (GLException gle) {
+            if(DEBUG) {
+                gle.printStackTrace();
+            }
+        }
+        eglES1DynamicLookupHelper = tmp;
+        if(null!=eglES1DynamicLookupHelper && eglES1DynamicLookupHelper.isLibComplete()) {
+            EGL.resetProcAddressTable(eglES1DynamicLookupHelper);
+        }
+
+        tmp=null;
+        try {
+            tmp = new GLDynamicLookupHelper(new EGLES2DynamicLibraryBundleInfo());
+        } catch (GLException gle) {
+            if(DEBUG) {
+                gle.printStackTrace();
+            }
+        }
+        eglES2DynamicLookupHelper = tmp;
+        if(null!=eglES2DynamicLookupHelper && eglES2DynamicLookupHelper.isLibComplete()) {
+            EGL.resetProcAddressTable(eglES2DynamicLookupHelper);
+        }
+    }
+
+    public EGLDrawableFactory() {
+        super();
+        defaultDevice = new EGLGraphicsDevice(AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
+    }
+
+    static class SharedResource {
+      private EGLGraphicsDevice device;
+      //private EGLDrawable drawable;
+      //private EGLContext context;
+
+      SharedResource(EGLGraphicsDevice dev /*, EGLDrawable draw, EGLContext ctx */) {
+          device = dev;
+          // drawable = draw;
+          // context = ctx;
+      }
+      EGLGraphicsDevice getDevice() { return device; }
+    }
+    HashMap/*<connection, SharedResource>*/ sharedMap = new HashMap();
+    EGLGraphicsDevice defaultDevice;
+
+    public final AbstractGraphicsDevice getDefaultDevice() {
+      return defaultDevice;
+    }
+
+    public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+      if(device instanceof EGLGraphicsDevice) {
+          return true;
+      }
+      return false;
+    }
+
+    private SharedResource getOrCreateShared(AbstractGraphicsDevice device) {
+        String connection = device.getConnection();
+        SharedResource sr;
+        synchronized(sharedMap) {
+            sr = (SharedResource) sharedMap.get(connection);
+        }
+        if(null==sr) {
+            long eglDisplay = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
+            if (eglDisplay == EGL.EGL_NO_DISPLAY) {
+                throw new GLException("Failed to created EGL default display: error 0x"+Integer.toHexString(EGL.eglGetError()));
+            } else if(DEBUG) {
+                System.err.println("eglDisplay(EGL_DEFAULT_DISPLAY): 0x"+Long.toHexString(eglDisplay));
+            }
+            if (!EGL.eglInitialize(eglDisplay, null, null)) {
+                throw new GLException("eglInitialize failed"+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+            }
+            EGLGraphicsDevice sharedDevice = new EGLGraphicsDevice(eglDisplay, connection, device.getUnitID());
+            sr = new SharedResource(sharedDevice);
+            synchronized(sharedMap) {
+                sharedMap.put(connection, sr);
+            }
+            if (DEBUG) {
+              System.err.println("!!! SharedDevice: "+sharedDevice);
+            }
+        }
+        return sr;
+    }
+
+
+    protected final GLContext getOrCreateSharedContextImpl(AbstractGraphicsDevice device) {
+        // FIXME: not implemented .. needs a dummy EGL surface - NEEDED ?
+        return null;
+    }
+
+    protected AbstractGraphicsDevice getOrCreateSharedDeviceImpl(AbstractGraphicsDevice device) {
+        SharedResource sr = getOrCreateShared(device);
+        if(null!=sr) {
+            return sr.getDevice();
+        }
+        return null;
+    }
+
+    SharedResource getOrCreateSharedResource(AbstractGraphicsDevice device) {
+        return (SharedResource) getOrCreateShared(device);
+    }
+
+    public GLDynamicLookupHelper getGLDynamicLookupHelper(int esProfile) {
+        if (2==esProfile) {
+            if(null==eglES2DynamicLookupHelper) {
+                throw new GLException("GLDynamicLookupHelper for ES2 not available");
+            }
+            return eglES2DynamicLookupHelper;
+        } else if (1==esProfile) {
+            if(null==eglES1DynamicLookupHelper) {
+                throw new GLException("GLDynamicLookupHelper for ES1 not available");
+            }
+            return eglES1DynamicLookupHelper;
+        } else {
+            throw new GLException("Unsupported: ES"+esProfile);
+        }
+    }
+
+    protected final void shutdownInstance() {}
+
+    protected List/*GLCapabilitiesImmutable*/ getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+        return EGLGraphicsConfigurationFactory.getAvailableCapabilities(this, device);
+    }
+
+    protected GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+        if (target == null) {
+          throw new IllegalArgumentException("Null target");
+        }
+        return new EGLOnscreenDrawable(this, target);
+    }
+
+    protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
+        if (target == null) {
+          throw new IllegalArgumentException("Null target");
+        }
+        AbstractGraphicsConfiguration config = target.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+        GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+        if(!caps.isPBuffer()) {
+            throw new GLException("Not yet implemented");
+        }
+        // PBuffer GLDrawable Creation
+        return new EGLPbufferDrawable(this, target);
+    }
+
+    public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) {
+        return true;
+    }
+
+    protected NativeSurface createOffscreenSurfaceImpl(AbstractGraphicsDevice device, GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, int width, int height) {
+        WrappedSurface ns = new WrappedSurface(EGLGraphicsConfigurationFactory.createOffscreenGraphicsConfiguration(device, capsChosen, capsRequested, chooser));
+        ns.setSize(width, height);
+        return ns;
+    }
+
+    protected ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice device, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {    
+        WrappedSurface ns = new WrappedSurface(EGLGraphicsConfigurationFactory.createOffscreenGraphicsConfiguration(device, capsRequested, capsRequested, chooser), windowHandle);
+        return ns;
+    }    
+    
+    protected GLContext createExternalGLContextImpl() {
+        AbstractGraphicsScreen absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_EGL);
+        return new EGLExternalContext(absScreen);
+    }
+
+    public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+        return false;
+    }
+
+    protected GLDrawable createExternalGLDrawableImpl() {
+        throw new GLException("Not yet implemented");
+    }
+
+    public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) {
+        return false;
+    }
+
+    public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+        throws GLException {
+        throw new GLException("Unimplemented on this platform");
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
new file mode 100644
index 0000000..22d39fd
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl.egl;
+
+import com.jogamp.common.os.DynamicLookupHelper;
+import com.jogamp.common.os.NativeLibrary;
+import java.util.*;
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+import java.security.*;
+
+/**
+ * Abstract implementation of the DynamicLookupHelper for EGL,
+ * which decouples it's dependencies to EGLDrawable.
+ *
+ * Currently two implementations exist, one for ES1 and one for ES2.
+ */
+public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundleInfo {
+
+    protected EGLDynamicLibraryBundleInfo() {
+        super();
+    }
+
+    /** Might be a desktop GL library, and might need to allow symbol access to subsequent libs */
+    public boolean shallLinkGlobal() { return true; }
+
+    public final List getToolGetProcAddressFuncNameList() {
+        List res = new ArrayList();
+        res.add("eglGetProcAddress");
+        return res;
+    }
+
+    public final long toolDynamicLookupFunction(long toolGetProcAddressHandle, String funcName) {
+        return EGL.eglGetProcAddress(toolGetProcAddressHandle, funcName);
+    }
+
+    protected List/*<String>*/ getEGLLibNamesList() {
+        List/*<String>*/ eglLibNames = new ArrayList();
+        // EGL
+        eglLibNames.add("EGL");
+        // for windows distributions using the 'unlike' lib prefix, 
+        // where our tool does not add it.
+        eglLibNames.add("libEGL");
+        return eglLibNames;
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
new file mode 100644
index 0000000..a62c847
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl.egl;
+
+import java.util.*;
+import jogamp.opengl.*;
+
+public class EGLES1DynamicLibraryBundleInfo extends EGLDynamicLibraryBundleInfo {
+    static List/*<String>*/ glueLibNames;
+    static {
+        glueLibNames = new ArrayList();
+        glueLibNames.addAll(GLDynamicLibraryBundleInfo.getGlueLibNamesPreload());
+        glueLibNames.add("jogl_es1");
+    }
+
+    protected EGLES1DynamicLibraryBundleInfo() {
+        super();
+    }
+
+    public List getToolLibNames() {
+        List/*<List>*/ libNames = new ArrayList();
+
+        List/*<String>*/ glesLibNames = new ArrayList();
+        glesLibNames.add("GLES_CM");
+        glesLibNames.add("GLES_CL");
+        glesLibNames.add("GLESv1_CM");
+        // for windows distributions using the 'unlike' lib prefix, 
+        // where our tool does not add it.
+        glesLibNames.add("libGLES_CM");
+        glesLibNames.add("libGLES_CL");
+        glesLibNames.add("libGLESv1_CM");
+        // last but not least, we may even use the desktop GL library,
+        // which would be eg Mesa + Gallium EGL ..
+        glesLibNames.add("libGL.so.1");
+        glesLibNames.add("libGL.so");
+        glesLibNames.add("GL");
+
+        libNames.add(glesLibNames);
+        libNames.add(getEGLLibNamesList());
+        return libNames;
+    }
+
+    public List/*<String>*/ getGlueLibNames() {
+        return glueLibNames;
+    }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
new file mode 100644
index 0000000..0477fc2
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl.egl;
+
+import java.util.*;
+import jogamp.opengl.*;
+
+public class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundleInfo {
+    static List/*<String>*/ glueLibNames;
+    static {
+        glueLibNames = new ArrayList();
+        glueLibNames.addAll(GLDynamicLibraryBundleInfo.getGlueLibNamesPreload());
+        glueLibNames.add("jogl_es2");
+    }
+  
+    protected EGLES2DynamicLibraryBundleInfo() {
+        super();
+    }
+
+    public List getToolLibNames() {
+        List/*<List>*/ libNames = new ArrayList();
+
+        List/*<String>*/ glesLibNames = new ArrayList();
+        glesLibNames.add("GLES20");
+        glesLibNames.add("GLESv2");
+        glesLibNames.add("GLESv2_CM");
+        // for windows distributions using the 'unlike' lib prefix
+        // where our tool does not add it.
+        glesLibNames.add("libGLES20"); 
+        glesLibNames.add("libGLESv2");
+        glesLibNames.add("libGLESv2_CM");
+        // last but not least, we may even use the desktop GL library,
+        // which would be eg Mesa + Gallium EGL ..
+        glesLibNames.add("libGL.so.1");
+        glesLibNames.add("libGL.so");
+        glesLibNames.add("GL");
+
+        libNames.add(glesLibNames);
+        libNames.add(getEGLLibNamesList());
+        return libNames;
+    }
+
+    public List/*<String>*/ getGlueLibNames() {
+        return glueLibNames;
+    }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java
new file mode 100644
index 0000000..dd06dc1
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.egl;
+
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+import javax.media.nativewindow.*;
+
+public class EGLExternalContext extends EGLContext {
+    private GLContext lastContext;
+
+    public EGLExternalContext(AbstractGraphicsScreen screen) {
+        super(null, null);
+        GLContextShareSet.contextCreated(this);
+        setGLFunctionAvailability(false, 0, 0, CTX_IS_ARB_CREATED|CTX_PROFILE_ES|CTX_OPTION_ANY);
+        getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
+    }
+
+    public int makeCurrent() throws GLException {
+        // Save last context if necessary to allow external GLContexts to
+        // talk to other GLContexts created by this library
+        GLContext cur = getCurrent();
+        if (cur != null && cur != this) {
+            lastContext = cur;
+            setCurrent(null);
+        }
+        return super.makeCurrent();
+    }  
+
+    public void release() throws GLException {
+        super.release();
+        setCurrent(lastContext);
+        lastContext = null;
+    }
+
+    protected void makeCurrentImpl(boolean newCreated) throws GLException {
+    }
+
+    protected void releaseImpl() throws GLException {
+    }
+
+    protected void destroyImpl() throws GLException {
+    }
+
+    public void bindPbufferToTexture() {
+        throw new GLException("Should not call this");
+    }
+
+    public void releasePbufferFromTexture() {
+        throw new GLException("Should not call this");
+    }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
new file mode 100644
index 0000000..cead035
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.opengl.egl;
+
+import java.util.Comparator;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+
+public class EGLGLCapabilities extends GLCapabilities {
+  long eglcfg;
+  int  eglcfgid;
+
+  /** Comparing EGLConfig ID only */
+  public static class EglCfgIDComparator implements Comparator {
+
+      public int compare(Object o1, Object o2) {
+        if ( ! ( o1 instanceof EGLGLCapabilities ) ) {
+            Class c = (null != o1) ? o1.getClass() : null ;
+            throw new ClassCastException("arg1 not a EGLGLCapabilities object: " + c);
+        }
+        if ( ! ( o2 instanceof EGLGLCapabilities ) ) {
+            Class c = (null != o2) ? o2.getClass() : null ;
+            throw new ClassCastException("arg2 not a EGLGLCapabilities object: " + c);
+        }
+
+        final EGLGLCapabilities caps1 = (EGLGLCapabilities) o1;
+        final long id1 = caps1.getEGLConfigID();
+
+        final EGLGLCapabilities caps2 = (EGLGLCapabilities) o2;
+        final long id2 = caps2.getEGLConfigID();
+
+        if(id1 > id2) {
+            return 1;
+        } else if(id1 < id2) {
+            return -1;
+        }
+        return 0;
+      }
+  }
+
+  public EGLGLCapabilities(long eglcfg, int eglcfgid, GLProfile glp) {
+      super(glp);
+      this.eglcfg = eglcfg;
+      this.eglcfgid = eglcfgid;
+  }
+
+  public Object cloneMutable() {
+    return clone();
+  }
+
+  public Object clone() {
+    try {
+      return super.clone();
+    } catch (RuntimeException e) {
+      throw new GLException(e);
+    }
+  }
+
+  final public long getEGLConfig() { return eglcfg; }
+  final public int getEGLConfigID() { return eglcfgid; }
+  
+  public StringBuffer toString(StringBuffer sink) {
+    if(null == sink) {
+        sink = new StringBuffer();
+    }
+    sink.append("0x").append(Long.toHexString(eglcfgid)).append(": ");
+    return super.toString(sink);
+  }
+}
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
new file mode 100644
index 0000000..4d8f2ac
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
@@ -0,0 +1,313 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.egl;
+
+import java.util.ArrayList;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.egl.*;
+import javax.media.opengl.*;
+import com.jogamp.common.nio.PointerBuffer;
+import jogamp.opengl.*;
+
+public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
+    protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
+
+    public final long getNativeConfig() {
+        return ((EGLGLCapabilities)capabilitiesChosen).getEGLConfig();
+    }
+
+    public final int getNativeConfigID() {
+        return ((EGLGLCapabilities)capabilitiesChosen).getEGLConfigID();
+    }
+
+    EGLGraphicsConfiguration(AbstractGraphicsScreen absScreen, 
+                             EGLGLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+        super(absScreen, capsChosen, capsRequested);
+        this.chooser = chooser;
+    }
+
+    public static EGLGraphicsConfiguration create(GLCapabilitiesImmutable capsRequested, AbstractGraphicsScreen absScreen, int cfgID) {
+        AbstractGraphicsDevice absDevice = absScreen.getDevice();
+        if(null==absDevice || !(absDevice instanceof EGLGraphicsDevice)) {
+            throw new GLException("GraphicsDevice must be a valid EGLGraphicsDevice");
+        }
+        long dpy = absDevice.getHandle();
+        if (dpy == EGL.EGL_NO_DISPLAY) {
+            throw new GLException("Invalid EGL display: "+absDevice);
+        }
+        GLProfile glp = capsRequested.getGLProfile();
+        long cfg = EGLConfigId2EGLConfig(glp, dpy, cfgID);
+        EGLGLCapabilities caps = EGLConfig2Capabilities(glp, dpy, cfg, false, capsRequested.isOnscreen(), capsRequested.isPBuffer());
+        return new EGLGraphicsConfiguration(absScreen, caps, capsRequested, new DefaultGLCapabilitiesChooser());
+    }
+
+    @Override
+    public Object clone() {
+        return super.clone();
+    }
+
+    void updateGraphicsConfiguration() {
+        EGLGraphicsConfiguration newConfig = (EGLGraphicsConfiguration)
+            GraphicsConfigurationFactory.getFactory(getScreen().getDevice()).chooseGraphicsConfiguration(
+                getChosenCapabilities(), getRequestedCapabilities(), chooser, getScreen());
+        if(null!=newConfig) {
+            // FIXME: setScreen( ... );
+            setChosenCapabilities(newConfig.getChosenCapabilities());
+            if(DEBUG) {
+                System.err.println("!!! updateGraphicsConfiguration: "+this);
+            }
+        }
+    }
+
+    public static long EGLConfigId2EGLConfig(GLProfile glp, long display, int configID) {
+        int[] attrs = new int[] {
+                EGL.EGL_CONFIG_ID, configID,
+                EGL.EGL_NONE
+            };
+        PointerBuffer configs = PointerBuffer.allocateDirect(1);
+        int[] numConfigs = new int[1];
+        if (!EGL.eglChooseConfig(display,
+                                 attrs, 0,
+                                 configs, 1,
+                                 numConfigs, 0)) {
+            return 0;
+        }
+        if (numConfigs[0] == 0) {
+            return 0;
+        }
+        return configs.get(0);
+    }
+
+    static int EGLConfigDrawableTypeBits(final long display, final long config) {
+        int val = 0;
+
+        int[] stype = new int[1];
+        if(! EGL.eglGetConfigAttrib(display, config, EGL.EGL_SURFACE_TYPE, stype, 0)) {
+            throw new GLException("Could not determine EGL_SURFACE_TYPE !!!");
+        }
+
+        if ( 0 != ( stype[0] & EGL.EGL_WINDOW_BIT ) ) {
+            val |= GLGraphicsConfigurationUtil.WINDOW_BIT;
+        }
+        if ( 0 != ( stype[0] & EGL.EGL_PIXMAP_BIT ) ) {
+            val |= GLGraphicsConfigurationUtil.BITMAP_BIT;
+        }
+        if ( 0 != ( stype[0] & EGL.EGL_PBUFFER_BIT ) ) {
+            val |= GLGraphicsConfigurationUtil.PBUFFER_BIT;
+        }
+
+        return val;
+    }
+
+    public static EGLGLCapabilities EGLConfig2Capabilities(GLProfile glp, long display, long config,
+                                                                 boolean relaxed, boolean onscreen, boolean usePBuffer) {
+        ArrayList bucket = new ArrayList();
+        final int winattrmask = GLGraphicsConfigurationUtil.getWinAttributeBits(onscreen, usePBuffer);
+        if( EGLConfig2Capabilities(bucket, glp, display, config, winattrmask) ) {
+            return (EGLGLCapabilities) bucket.get(0);
+        } else if ( relaxed && EGLConfig2Capabilities(bucket, glp, display, config, GLGraphicsConfigurationUtil.ALL_BITS) ) {
+            return (EGLGLCapabilities) bucket.get(0);
+        }
+        return null;
+    }
+
+    public static boolean EGLConfig2Capabilities(ArrayList capsBucket,
+                                                 GLProfile glp, long display, long config,
+                                                 int winattrmask) {
+        final int allDrawableTypeBits = EGLConfigDrawableTypeBits(display, config);
+        final int drawableTypeBits = winattrmask & allDrawableTypeBits;
+
+        if( 0 == drawableTypeBits ) {
+            return false;
+        }
+
+        int[] val = new int[1];
+
+        // get the configID
+        if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_ID, val, 0)) {
+            if(DEBUG) {
+                // FIXME: this happens on a ATI PC Emulation ..
+                System.err.println("EGL couldn't retrieve ConfigID for config "+toHexString(config)+", error "+toHexString(EGL.eglGetError()));
+            }
+            return false;
+        }
+        GLCapabilities caps = new EGLGLCapabilities(config, val[0], glp);
+
+        // Read the actual configuration into the choosen caps
+        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_RED_SIZE, val, 0)) {
+            caps.setRedBits(val[0]);
+        }
+        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_GREEN_SIZE, val, 0)) {
+            caps.setGreenBits(val[0]);
+        }
+        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_BLUE_SIZE, val, 0)) {
+            caps.setBlueBits(val[0]);
+        }
+        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_ALPHA_SIZE, val, 0)) {
+            caps.setAlphaBits(val[0]);
+        }
+        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_STENCIL_SIZE, val, 0)) {
+            caps.setStencilBits(val[0]);
+        }
+        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_DEPTH_SIZE, val, 0)) {
+            caps.setDepthBits(val[0]);
+        }
+        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_SAMPLES, val, 0)) {
+            caps.setSampleBuffers(val[0]>0?true:false);
+            caps.setNumSamples(val[0]);
+        }
+        if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_TYPE, val, 0)) {
+            caps.setBackgroundOpaque(val[0] != EGL.EGL_TRANSPARENT_RGB);
+        }
+        if(!caps.isBackgroundOpaque()) {
+            if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_RED_VALUE, val, 0)) {
+                caps.setTransparentRedValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
+            }
+            if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_GREEN_VALUE, val, 0)) {
+                caps.setTransparentGreenValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
+            }
+            if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_BLUE_VALUE, val, 0)) {
+                caps.setTransparentBlueValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
+            }
+            /** Not defined in EGL 
+            if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_ALPHA_VALUE, val, 0)) {
+                caps.setTransparentAlphaValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
+            } */
+        }
+        return GLGraphicsConfigurationUtil.addGLCapabilitiesPermutations(capsBucket, caps, drawableTypeBits );
+    }
+
+    public static int[] GLCapabilities2AttribList(GLCapabilitiesImmutable caps) {
+        int[] attrs = new int[32];
+        int idx=0;
+
+        attrs[idx++] = EGL.EGL_SURFACE_TYPE;
+        attrs[idx++] = caps.isOnscreen() ? ( EGL.EGL_WINDOW_BIT ) : ( caps.isPBuffer() ? EGL.EGL_PBUFFER_BIT : EGL.EGL_PIXMAP_BIT ) ;
+
+        attrs[idx++] = EGL.EGL_RED_SIZE;
+        attrs[idx++] = caps.getRedBits();
+
+        attrs[idx++] = EGL.EGL_GREEN_SIZE;
+        attrs[idx++] = caps.getGreenBits();
+
+        attrs[idx++] = EGL.EGL_BLUE_SIZE;
+        attrs[idx++] = caps.getBlueBits();
+
+        attrs[idx++] = EGL.EGL_ALPHA_SIZE;
+        attrs[idx++] = caps.getAlphaBits() > 0 ? caps.getAlphaBits() : EGL.EGL_DONT_CARE;
+
+        attrs[idx++] = EGL.EGL_STENCIL_SIZE;
+        attrs[idx++] = caps.getStencilBits() > 0 ? caps.getStencilBits() : EGL.EGL_DONT_CARE;
+
+        attrs[idx++] = EGL.EGL_DEPTH_SIZE;
+        attrs[idx++] = caps.getDepthBits();
+
+        attrs[idx++] = EGL.EGL_SAMPLES;
+        attrs[idx++] = caps.getSampleBuffers() ? caps.getNumSamples() : 1;
+
+        attrs[idx++] = EGL.EGL_TRANSPARENT_TYPE;
+        attrs[idx++] = caps.isBackgroundOpaque() ? EGL.EGL_NONE : EGL.EGL_TRANSPARENT_TYPE;
+
+        // 20
+
+        if(!caps.isBackgroundOpaque()) {
+            attrs[idx++] = EGL.EGL_TRANSPARENT_RED_VALUE;
+            attrs[idx++] = caps.getTransparentRedValue()>=0?caps.getTransparentRedValue():EGL.EGL_DONT_CARE;
+
+            attrs[idx++] = EGL.EGL_TRANSPARENT_GREEN_VALUE;
+            attrs[idx++] = caps.getTransparentGreenValue()>=0?caps.getTransparentGreenValue():EGL.EGL_DONT_CARE;
+
+            attrs[idx++] = EGL.EGL_TRANSPARENT_BLUE_VALUE;
+            attrs[idx++] = caps.getTransparentBlueValue()>=0?caps.getTransparentBlueValue():EGL.EGL_DONT_CARE;
+
+            /** Not define in EGL
+            attrs[idx++] = EGL.EGL_TRANSPARENT_ALPHA_VALUE;
+            attrs[idx++] = caps.getTransparentAlphaValue()>=0?caps.getTransparentAlphaValue():EGL.EGL_DONT_CARE; */
+        }
+
+        // 26 
+
+        attrs[idx++] = EGL.EGL_RENDERABLE_TYPE;
+        if(caps.getGLProfile().usesNativeGLES1()) {
+            attrs[idx++] = EGL.EGL_OPENGL_ES_BIT;
+        }
+        else if(caps.getGLProfile().usesNativeGLES2()) {
+            attrs[idx++] = EGL.EGL_OPENGL_ES2_BIT;
+        } else {
+            attrs[idx++] = EGL.EGL_OPENGL_BIT;
+        }
+
+        // 28
+
+        attrs[idx++] = EGL.EGL_NONE;
+
+        return attrs;
+    }
+
+    public static int[] CreatePBufferSurfaceAttribList(int width, int height, int texFormat) {
+        int[] attrs = new int[16];
+        int idx=0;
+
+        attrs[idx++] = EGL.EGL_WIDTH;
+        attrs[idx++] = width;
+
+        attrs[idx++] = EGL.EGL_HEIGHT;
+        attrs[idx++] = height;
+
+        attrs[idx++] = EGL.EGL_TEXTURE_FORMAT;
+        attrs[idx++] = texFormat;
+
+        attrs[idx++] = EGL.EGL_TEXTURE_TARGET;
+        attrs[idx++] = EGL.EGL_NO_TEXTURE==texFormat ? EGL.EGL_NO_TEXTURE : EGL.EGL_TEXTURE_2D;
+
+        attrs[idx++] = EGL.EGL_NONE;
+
+        return attrs;
+    }
+
+    @Override
+    public String toString() {
+        return getClass().getSimpleName()+"["+getScreen()+", eglConfigID "+toHexString(getNativeConfigID())+
+                                     ",\n\trequested " + getRequestedCapabilities()+
+                                     ",\n\tchosen    " + getChosenCapabilities()+
+                                     "]";
+
+    }
+
+    private GLCapabilitiesChooser chooser;
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
new file mode 100644
index 0000000..78c0da6
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
@@ -0,0 +1,343 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.opengl.egl;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.CapabilitiesChooser;
+import javax.media.nativewindow.CapabilitiesImmutable;
+import javax.media.nativewindow.DefaultGraphicsScreen;
+import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.nativewindow.egl.EGLGraphicsDevice;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLDrawableFactory;
+
+import com.jogamp.common.nio.PointerBuffer;
+import jogamp.opengl.GLGraphicsConfigurationFactory;
+import jogamp.opengl.GLGraphicsConfigurationUtil;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.io.PrintStream;
+
+
+/** Subclass of GraphicsConfigurationFactory used when non-AWT tookits
+    are used on X11 platforms. Toolkits will likely need to delegate
+    to this one to change the accepted and returned types of the
+    GraphicsDevice and GraphicsConfiguration abstractions. */
+
+public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFactory {
+    protected static final boolean DEBUG = GraphicsConfigurationFactory.DEBUG || jogamp.opengl.Debug.debug("EGL");
+    static EGLGLCapabilities.EglCfgIDComparator EglCfgIDComparator = new EGLGLCapabilities.EglCfgIDComparator();
+
+    EGLGraphicsConfigurationFactory() {
+        // become the selector for KD/EGL ..
+        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.egl.EGLGraphicsDevice.class, this);
+    }
+
+    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl (
+            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
+            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
+        if (absScreen == null) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only AbstractGraphicsDevice objects");
+        }
+
+        if (! (capsChosen instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - chosen");
+        }
+
+        if (! (capsRequested instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - requested");
+        }
+
+        if (chooser != null &&
+            !(chooser instanceof GLCapabilitiesChooser)) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
+        }
+
+        return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable) capsChosen,
+                                                 (GLCapabilitiesImmutable) capsRequested,
+                                                 (GLCapabilitiesChooser) chooser,
+                                                 absScreen);
+    }
+
+    protected static List/*<EGLGLCapabilities>*/ getAvailableCapabilities(EGLDrawableFactory factory, AbstractGraphicsDevice device) {
+        EGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResource(device);
+        if(null == sharedResource) {
+            throw new GLException("Shared resource for device n/a: "+device);
+        }
+        EGLGraphicsDevice eglDevice = sharedResource.getDevice();
+        long eglDisplay = eglDevice.getHandle();
+
+        List/*<EGLGLCapabilities>*/ availableCaps = null;
+        int[] maxConfigs = new int[1];
+
+        if(!EGL.eglGetConfigs(eglDisplay, null, 0, maxConfigs, 0)) {
+            throw new GLException("Graphics configuration get maxConfigs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
+        }
+        if(0 == maxConfigs[0]) {
+            throw new GLException("Graphics configuration get maxConfigs (eglGetConfigs) no configs");
+        }
+
+        PointerBuffer configs = PointerBuffer.allocateDirect(maxConfigs[0]);
+        int[] numConfigs = new int[1];
+
+        if(!EGL.eglGetConfigs(eglDisplay, configs, configs.capacity(), numConfigs, 0)) {
+            throw new GLException("Graphics configuration get all configs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
+        }
+        if (numConfigs[0] > 0) {
+            GLProfile glp = GLProfile.getDefault(device);
+            availableCaps = eglConfigs2GLCaps(glp, eglDisplay, configs, numConfigs[0], GLGraphicsConfigurationUtil.ALL_BITS);
+            if( null != availableCaps ) {
+                Collections.sort(availableCaps, EglCfgIDComparator);
+            }
+        }
+
+        return availableCaps;
+    }
+
+    private static EGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
+                                                                              GLCapabilitiesImmutable capsReq,
+                                                                              GLCapabilitiesChooser chooser,
+                                                                              AbstractGraphicsScreen absScreen) {
+        if (capsChosen == null) {
+            capsChosen = new GLCapabilities(null);
+        }
+
+        if(null==absScreen) {
+            throw new GLException("Null AbstractGraphicsScreen");
+        }
+        AbstractGraphicsDevice absDevice = absScreen.getDevice();
+
+        if(null==absDevice || !(absDevice instanceof EGLGraphicsDevice)) {
+            throw new GLException("GraphicsDevice must be a valid EGLGraphicsDevice");
+        }
+        long eglDisplay = absDevice.getHandle();
+
+        if (eglDisplay == EGL.EGL_NO_DISPLAY) {
+            throw new GLException("Invalid EGL display: "+absDevice);
+        }
+
+        EGLDrawableFactory factory = (EGLDrawableFactory) GLDrawableFactory.getEGLFactory();
+        capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities( capsChosen, factory.canCreateGLPbuffer(absDevice) );
+
+        GLProfile glp = capsChosen.getGLProfile();
+
+        EGLGraphicsConfiguration res = eglChooseConfig(eglDisplay, capsChosen, capsReq, chooser, absScreen);
+        if(null!=res) {
+            return res;
+        }
+        if(DEBUG) {
+            System.err.println("eglChooseConfig failed with given capabilities "+capsChosen);
+        }
+
+        // Last try .. add a fixed embedded profile [ATI, Nokia, Intel, ..]
+        //
+        // rgb888 - d16, s4
+        GLCapabilities fixedCaps = new GLCapabilities(glp);
+        fixedCaps.setRedBits(8);
+        fixedCaps.setGreenBits(8);
+        fixedCaps.setBlueBits(8);
+        fixedCaps.setDepthBits(16);
+        fixedCaps.setSampleBuffers(true);
+        fixedCaps.setNumSamples(4);
+        if(DEBUG) {
+            System.err.println("trying fixed caps (1): "+fixedCaps);
+        }
+        res = eglChooseConfig(eglDisplay, fixedCaps, capsReq, chooser, absScreen);
+        if(null!=res) {
+            return res;
+        }
+
+        //
+        // rgb565 - d16, s0
+        fixedCaps = new GLCapabilities(glp);
+        fixedCaps.setRedBits(5);
+        fixedCaps.setGreenBits(6);
+        fixedCaps.setBlueBits(5);
+        fixedCaps.setDepthBits(16);
+        if(DEBUG) {
+            System.err.println("trying fixed caps (2): "+fixedCaps);
+        }
+        res = eglChooseConfig(eglDisplay, fixedCaps, capsReq, chooser, absScreen);
+        if(null!=res) {
+            return res;
+        }
+
+        //
+        // rgb565 - d16, s4
+        fixedCaps = new GLCapabilities(glp);
+        fixedCaps.setRedBits(5);
+        fixedCaps.setGreenBits(6);
+        fixedCaps.setBlueBits(5);
+        fixedCaps.setDepthBits(16);
+        fixedCaps.setSampleBuffers(true);
+        fixedCaps.setNumSamples(4);
+        if(DEBUG) {
+            System.err.println("trying fixed caps (3): "+fixedCaps);
+        }
+        res = eglChooseConfig(eglDisplay, fixedCaps, capsReq, chooser, absScreen);
+        if(null!=res) {
+            return res;
+        }
+        throw new GLException("Graphics configuration failed [direct caps, eglGetConfig/chooser and fixed-caps(1-3)]");
+    }
+
+    static EGLGraphicsConfiguration eglChooseConfig(long eglDisplay, 
+                                                    GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
+                                                    GLCapabilitiesChooser chooser,
+                                                    AbstractGraphicsScreen absScreen) {
+        GLProfile glp = capsChosen.getGLProfile();
+        boolean onscreen = capsChosen.isOnscreen();
+        boolean usePBuffer = capsChosen.isPBuffer();
+        List/*<EGLGLCapabilities>*/ availableCaps = null;
+        final int winattrmask = GLGraphicsConfigurationUtil.getWinAttributeBits(onscreen, usePBuffer);
+        int recommendedIndex = -1;
+        long recommendedEGLConfig = -1;
+        int[] maxConfigs = new int[1];
+
+        if(!EGL.eglGetConfigs(eglDisplay, null, 0, maxConfigs, 0)) {
+            throw new GLException("Graphics configuration get maxConfigs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
+        }
+        if(0 == maxConfigs[0]) {
+            throw new GLException("Graphics configuration get maxConfigs (eglGetConfigs) no configs");
+        }
+        if (DEBUG) {
+            System.err.println("!!! eglChooseConfig maxConfigs: "+maxConfigs[0]);
+        }
+
+        int[] attrs = EGLGraphicsConfiguration.GLCapabilities2AttribList(capsChosen);
+        PointerBuffer configs = PointerBuffer.allocateDirect(maxConfigs[0]);
+        int[] numConfigs = new int[1];
+
+        // 1st choice: get GLCapabilities based on users GLCapabilities setting recommendedIndex as preferred choice
+        if (!EGL.eglChooseConfig(eglDisplay,
+                                 attrs, 0,
+                                 configs, configs.capacity(),
+                                 numConfigs, 0)) {
+            throw new GLException("Graphics configuration selection (eglChooseConfig) failed for "+capsChosen+", error "+toHexString(EGL.eglGetError()));
+        }
+        if (numConfigs[0] > 0) {
+            availableCaps = eglConfigs2GLCaps(glp, eglDisplay, configs, numConfigs[0], winattrmask);
+            if(availableCaps.size() > 0) {
+                recommendedEGLConfig =  configs.get(0);
+                recommendedIndex = 0;
+                if (DEBUG) {
+                    System.err.println("!!! eglChooseConfig recommended fbcfg " + toHexString(recommendedEGLConfig) + ", idx " + recommendedIndex);
+                    System.err.println("!!! user  caps " + capsChosen);
+                    System.err.println("!!! fbcfg caps " + availableCaps.get(recommendedIndex));
+                }
+            } else if (DEBUG) {
+                System.err.println("!!! eglChooseConfig no caps for recommended fbcfg " + toHexString(configs.get(0)));
+                System.err.println("!!! user  caps " + capsChosen);
+            }
+        }
+
+        // 2nd choice: get all GLCapabilities available, no preferred recommendedIndex available
+        if( null == availableCaps || 0 == availableCaps.size() ) {
+            // reset ..
+            recommendedEGLConfig = -1;
+            recommendedIndex = -1;
+
+            if(!EGL.eglGetConfigs(eglDisplay, configs, configs.capacity(), numConfigs, 0)) {
+                throw new GLException("Graphics configuration get all configs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
+            }
+            if (numConfigs[0] > 0) {
+                availableCaps = eglConfigs2GLCaps(glp, eglDisplay, configs, numConfigs[0], winattrmask);
+            }
+        }
+
+        if( null == availableCaps || 0 == availableCaps.size() ) {
+            if(DEBUG) {
+                // FIXME: this happens on a ATI PC Emulation ..
+                System.err.println("Graphics configuration 1st choice and 2nd choice failed - no configs");
+            }
+            return null;
+        }
+
+        int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex);
+        if ( 0 > chosenIndex ) {
+            if (DEBUG) {
+                Thread.dumpStack();
+            }
+            return null;
+        }
+        EGLGLCapabilities chosenCaps = (EGLGLCapabilities) availableCaps.get(chosenIndex);
+
+        return new EGLGraphicsConfiguration(absScreen, chosenCaps, capsRequested, chooser);
+    }
+
+    static List/*<GLCapabilitiesImmutable>*/ eglConfigs2GLCaps(GLProfile glp, long eglDisplay, PointerBuffer configs, int num, int winattrmask) {
+        ArrayList caps = new ArrayList(num);
+        for(int i=0; i<num; i++) {
+            EGLGraphicsConfiguration.EGLConfig2Capabilities(caps, glp, eglDisplay, configs.get(i), winattrmask);
+        }
+        return caps;
+    }
+
+    static void printCaps(String prefix, List/*GLCapabilitiesImmutable*/ caps, PrintStream out) {
+        for(int i=0; i<caps.size(); i++) {
+            out.println(prefix+"["+i+"] "+caps.get(i));
+        }
+    }
+
+    static EGLGraphicsConfiguration createOffscreenGraphicsConfiguration(AbstractGraphicsDevice device, GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsReq, GLCapabilitiesChooser chooser) {
+        if(capsChosen.isOnscreen()) {
+            throw new GLException("Error: Onscreen set: "+capsChosen);
+        }
+
+        if(capsChosen.getDoubleBuffered()) {
+            // OFFSCREEN !DOUBLE_BUFFER // FIXME DBLBUFOFFSCRN
+            GLCapabilities caps2 = (GLCapabilities) capsChosen.cloneMutable();
+            caps2.setDoubleBuffered(false);
+            capsChosen = caps2;
+        }
+
+        DefaultGraphicsScreen screen = new DefaultGraphicsScreen(device, 0);
+        EGLGraphicsConfiguration eglConfig = chooseGraphicsConfigurationStatic(capsChosen, capsReq, chooser, screen);
+        if (null == eglConfig) {
+            throw new GLException("Couldn't create EGLGraphicsConfiguration from "+screen);
+        } else if(DEBUG) {
+            System.err.println("Chosen eglConfig: "+eglConfig);
+        }
+        return eglConfig;
+    }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenContext.java
new file mode 100644
index 0000000..dd0a3db
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenContext.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.egl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+import com.jogamp.gluegen.runtime.ProcAddressTable;
+import java.nio.*;
+import java.util.*;
+
+public class EGLOnscreenContext extends EGLContext {
+    public EGLOnscreenContext(EGLOnscreenDrawable drawable, GLContext shareWith) {
+        super(drawable, shareWith);
+    }
+
+    public void bindPbufferToTexture() {
+        throw new GLException("Should not call this");
+    }
+
+    public void releasePbufferFromTexture() {
+        throw new GLException("Should not call this");
+    }
+
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java
new file mode 100644
index 0000000..4359f2a
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.egl;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+
+public class EGLOnscreenDrawable extends EGLDrawable {
+    protected EGLOnscreenDrawable(EGLDrawableFactory factory, NativeSurface component) throws GLException {
+        super(factory, component);
+    }
+
+    public GLContext createContext(GLContext shareWith) {
+        return new EGLOnscreenContext(this, shareWith);
+    }
+
+    protected long createSurface(long eglDpy, long eglNativeCfg, long surfaceHandle) {
+        return EGL.eglCreateWindowSurface(eglDpy, eglNativeCfg, surfaceHandle, null);
+    }
+
+    protected void swapBuffersImpl() {
+        EGL.eglSwapBuffers(eglDisplay, eglSurface);
+    }
+
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLPbufferContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLPbufferContext.java
new file mode 100644
index 0000000..2cad7da
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLPbufferContext.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.egl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+import com.jogamp.gluegen.runtime.ProcAddressTable;
+import java.nio.*;
+import java.util.*;
+
+public class EGLPbufferContext extends EGLContext {
+    public EGLPbufferContext(EGLPbufferDrawable drawable, GLContext shareWith) {
+        super(drawable, shareWith);
+    }
+
+    public int getFloatingPointMode() {
+        return 0; // FIXME ??
+    }
+
+    public void bindPbufferToTexture() {
+        throw new GLException("Not yet implemented");
+    }
+
+    public void releasePbufferFromTexture() {
+        throw new GLException("Not yet implemented");
+    }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java
new file mode 100644
index 0000000..6cbd1ee
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.egl;
+
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.SurfaceChangeable;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLException;
+
+public class EGLPbufferDrawable extends EGLDrawable {
+    private int texFormat;
+    protected static final boolean useTexture = false; // No yet ..
+
+    protected EGLPbufferDrawable(EGLDrawableFactory factory, NativeSurface target) {
+        super(factory, target);
+        ownEGLDisplay = true;
+
+        // get choosen ones ..
+        GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)
+                   getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+
+        if(useTexture) {
+            this.texFormat = caps.getAlphaBits() > 0 ? EGL.EGL_TEXTURE_RGBA : EGL.EGL_TEXTURE_RGB ;
+        } else {
+            this.texFormat = EGL.EGL_NO_TEXTURE;
+        }
+
+        if (DEBUG) {
+          System.out.println("Pbuffer config: " + getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration());
+        }
+
+        setRealized(true);
+
+        if (DEBUG) {
+          System.out.println("Created pbuffer: " + this);
+        }
+
+    }
+
+    protected long createSurface(long eglDpy, long eglNativeCfg, long surfaceHandle) {
+        NativeSurface nw = getNativeSurface();
+        int[] attrs = EGLGraphicsConfiguration.CreatePBufferSurfaceAttribList(nw.getWidth(), nw.getHeight(), texFormat);
+        long surf = EGL.eglCreatePbufferSurface(eglDpy, eglNativeCfg, attrs, 0);
+        if (EGL.EGL_NO_SURFACE==surf) {
+            throw new GLException("Creation of window surface (eglCreatePbufferSurface) failed, dim "+nw.getWidth()+"x"+nw.getHeight()+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+        } else if(DEBUG) {
+            System.err.println("PBuffer setSurface result: eglSurface 0x"+Long.toHexString(surf));
+        }
+        ((SurfaceChangeable)nw).setSurfaceHandle(surf);
+        return surf;
+    }
+
+    public GLContext createContext(GLContext shareWith) {
+        return new EGLPbufferContext(this, shareWith);
+    }
+
+    protected void swapBuffersImpl() { 
+        if(DEBUG) {
+            System.err.println("unhandled swapBuffersImpl() called for: "+this);
+        }
+    }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
new file mode 100644
index 0000000..9165dbc
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
@@ -0,0 +1,1042 @@
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+** 
+** http://oss.sgi.com/projects/FreeB
+** 
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+** 
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** $Date: 2009-03-13 22:20:29 -0700 (Fri, 13 Mar 2009) $ $Revision: 1867 $
+** $Header$
+*/
+
+/* 
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are 
+ * met:
+ * 
+ * * Redistributions of source code must retain the above copyright 
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of 
+ *   its contributors may be used to endorse or promote products derived 
+ *   from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+package jogamp.opengl.gl2;
+
+import java.nio.*;
+
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+import com.jogamp.common.nio.Buffers;
+
+/**
+ * Project.java
+ * <p/>
+ * <p/>
+ * Created 11-jan-2004
+ * 
+ * @author Erik Duijs
+ * @author Kenneth Russell
+ */
+public class ProjectDouble {
+  private static final double[] IDENTITY_MATRIX =
+    new double[] {
+      1.0, 0.0, 0.0, 0.0,
+      0.0, 1.0, 0.0, 0.0,
+      0.0, 0.0, 1.0, 0.0,
+      0.0, 0.0, 0.0, 1.0 };
+
+  // Note that we have cloned parts of the implementation in order to
+  // support incoming Buffers. The reason for this is to avoid loading
+  // non-direct buffer subclasses unnecessarily, because doing so can
+  // cause performance decreases on direct buffer operations, at least
+  // on the current HotSpot JVM. It would be nicer (and make the code
+  // simpler) to simply have the array-based entry points delegate to
+  // the versions taking Buffers by wrapping the arrays.
+
+  // Array-based implementation
+  private final double[] matrix = new double[16];
+
+  private final double[][] tempMatrix = new double[4][4];
+  private final double[] in = new double[4];
+  private final double[] out = new double[4];
+
+  private final double[] forward = new double[3];
+  private final double[] side = new double[3];
+  private final double[] up = new double[3];
+  
+  // Buffer-based implementation
+  private DoubleBuffer locbuf;
+  private final DoubleBuffer matrixBuf;
+
+  private final DoubleBuffer tempMatrixBuf;
+  private final DoubleBuffer inBuf;
+  private final DoubleBuffer outBuf;
+
+  private final DoubleBuffer forwardBuf;
+  private final DoubleBuffer sideBuf;
+  private final DoubleBuffer upBuf;
+
+  public ProjectDouble() {
+    // Use direct buffers to avoid loading indirect buffer
+    // implementations for applications trying to avoid doing so.
+    // Slice up one big buffer because some NIO implementations
+    // allocate a huge amount of memory to back even the smallest of
+    // buffers.
+    DoubleBuffer locbuf = Buffers.newDirectDoubleBuffer(128);
+    int pos = 0;
+    int sz = 16;
+    matrixBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    tempMatrixBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    sz = 4;
+    inBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    outBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    sz = 3;
+    forwardBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    sideBuf = slice(locbuf, pos, sz);
+    pos += sz;
+    upBuf = slice(locbuf, pos, sz);
+  }
+
+  public void destroy() {
+    if(locbuf!=null) {
+        locbuf.clear();
+        locbuf=null;
+    }
+  }
+
+  private static DoubleBuffer slice(DoubleBuffer buf, int pos, int len) {
+    buf.position(pos);
+    buf.limit(pos + len);
+    return buf.slice();
+  }
+
+  /**
+   * Make matrix an identity matrix
+   */
+  private void __gluMakeIdentityd(DoubleBuffer m) {
+    int oldPos = m.position();
+    m.put(IDENTITY_MATRIX);
+    m.position(oldPos);
+  }
+
+  /**
+   * Make matrix an identity matrix
+   */
+  private void __gluMakeIdentityd(double[] m) {
+    for (int i = 0; i < 16; i++) {
+      m[i] = IDENTITY_MATRIX[i];
+    }
+  }
+
+  /**
+   * Method __gluMultMatrixVecd
+   * 
+   * @param matrix
+   * @param in
+   * @param out
+   */
+  private void __gluMultMatrixVecd(double[] matrix, int matrix_offset, double[] in, double[] out) {
+    for (int i = 0; i < 4; i++) {
+      out[i] =
+        in[0] * matrix[0*4+i+matrix_offset] +
+        in[1] * matrix[1*4+i+matrix_offset] +
+        in[2] * matrix[2*4+i+matrix_offset] +
+        in[3] * matrix[3*4+i+matrix_offset];
+    }
+  }
+
+  /**
+   * Method __gluMultMatrixVecd
+   * 
+   * @param matrix
+   * @param in
+   * @param out
+   */
+  private void __gluMultMatrixVecd(DoubleBuffer matrix, DoubleBuffer in, DoubleBuffer out) {
+    int inPos = in.position();
+    int outPos = out.position();
+    int matrixPos = matrix.position();
+    for (int i = 0; i < 4; i++) {
+      out.put(i + outPos,
+              in.get(0+inPos) * matrix.get(0*4+i+matrixPos) +
+              in.get(1+inPos) * matrix.get(1*4+i+matrixPos) +
+              in.get(2+inPos) * matrix.get(2*4+i+matrixPos) +
+              in.get(3+inPos) * matrix.get(3*4+i+matrixPos));
+    }
+  }
+
+  /**
+   * @param src
+   * @param inverse
+   * 
+   * @return
+   */
+  private boolean __gluInvertMatrixd(double[] src, double[] inverse) {
+    int i, j, k, swap;
+    double t;
+    double[][] temp = tempMatrix;
+
+    for (i = 0; i < 4; i++) {
+      for (j = 0; j < 4; j++) {
+        temp[i][j] = src[i*4+j];
+      }
+    }
+    __gluMakeIdentityd(inverse);
+
+    for (i = 0; i < 4; i++) {
+      //
+      // Look for largest element in column
+      //
+      swap = i;
+      for (j = i + 1; j < 4; j++) {
+        if (Math.abs(temp[j][i]) > Math.abs(temp[i][i])) {
+          swap = j;
+        }
+      }
+
+      if (swap != i) {
+        //
+        // Swap rows.
+        //
+        for (k = 0; k < 4; k++) {
+          t = temp[i][k];
+          temp[i][k] = temp[swap][k];
+          temp[swap][k] = t;
+
+          t = inverse[i*4+k];
+          inverse[i*4+k] = inverse[swap*4+k];
+          inverse[swap*4+k] = t;
+        }
+      }
+
+      if (temp[i][i] == 0) {
+        //
+        // No non-zero pivot. The matrix is singular, which shouldn't
+        // happen. This means the user gave us a bad matrix.
+        //
+        return false;
+      }
+
+      t = temp[i][i];
+      for (k = 0; k < 4; k++) {
+        temp[i][k] /= t;
+        inverse[i*4+k] /= t;
+      }
+      for (j = 0; j < 4; j++) {
+        if (j != i) {
+          t = temp[j][i];
+          for (k = 0; k < 4; k++) {
+            temp[j][k] -= temp[i][k] * t;
+            inverse[j*4+k] -= inverse[i*4+k]*t;
+          }
+        }
+      }
+    }
+    return true;
+  }
+
+  /**
+   * @param src
+   * @param inverse
+   * 
+   * @return
+   */
+  private boolean __gluInvertMatrixd(DoubleBuffer src, DoubleBuffer inverse) {
+    int i, j, k, swap;
+    double t;
+
+    int srcPos = src.position();
+    int invPos = inverse.position();
+
+    DoubleBuffer temp = tempMatrixBuf;
+
+    for (i = 0; i < 4; i++) {
+      for (j = 0; j < 4; j++) {
+        temp.put(i*4+j, src.get(i*4+j + srcPos));
+      }
+    }
+    __gluMakeIdentityd(inverse);
+
+    for (i = 0; i < 4; i++) {
+      //
+      // Look for largest element in column
+      //
+      swap = i;
+      for (j = i + 1; j < 4; j++) {
+        if (Math.abs(temp.get(j*4+i)) > Math.abs(temp.get(i*4+i))) {
+          swap = j;
+        }
+      }
+
+      if (swap != i) {
+        //
+        // Swap rows.
+        //
+        for (k = 0; k < 4; k++) {
+          t = temp.get(i*4+k);
+          temp.put(i*4+k, temp.get(swap*4+k));
+          temp.put(swap*4+k, t);
+
+          t = inverse.get(i*4+k + invPos);
+          inverse.put(i*4+k + invPos, inverse.get(swap*4+k + invPos));
+          inverse.put(swap*4+k + invPos, t);
+        }
+      }
+
+      if (temp.get(i*4+i) == 0) {
+        //
+        // No non-zero pivot. The matrix is singular, which shouldn't
+        // happen. This means the user gave us a bad matrix.
+        //
+        return false;
+      }
+
+      t = temp.get(i*4+i);
+      for (k = 0; k < 4; k++) {
+        temp.put(i*4+k, temp.get(i*4+k) / t);
+        inverse.put(i*4+k + invPos, inverse.get(i*4+k + invPos) / t);
+      }
+      for (j = 0; j < 4; j++) {
+        if (j != i) {
+          t = temp.get(j*4+i);
+          for (k = 0; k < 4; k++) {
+            temp.put(j*4+k, temp.get(j*4+k) - temp.get(i*4+k) * t);
+            inverse.put(j*4+k + invPos, inverse.get(j*4+k + invPos) - inverse.get(i*4+k + invPos) * t);
+          }
+        }
+      }
+    }
+    return true;
+  }
+
+
+  /**
+   * @param a
+   * @param b
+   * @param r
+   */
+  private void __gluMultMatricesd(double[] a, int a_offset, double[] b, int b_offset, double[] r) {
+    for (int i = 0; i < 4; i++) {
+      for (int j = 0; j < 4; j++) {
+        r[i*4+j] =
+          a[i*4+0+a_offset]*b[0*4+j+b_offset] +
+          a[i*4+1+a_offset]*b[1*4+j+b_offset] +
+          a[i*4+2+a_offset]*b[2*4+j+b_offset] +
+          a[i*4+3+a_offset]*b[3*4+j+b_offset];
+      }
+    }
+  }
+
+
+  /**
+   * @param a
+   * @param b
+   * @param r
+   */
+  private void __gluMultMatricesd(DoubleBuffer a, DoubleBuffer b, DoubleBuffer r) {
+    int aPos = a.position();
+    int bPos = b.position();
+    int rPos = r.position();
+
+    for (int i = 0; i < 4; i++) {
+      for (int j = 0; j < 4; j++) {
+        r.put(i*4+j + rPos,
+          a.get(i*4+0+aPos)*b.get(0*4+j+bPos) +
+          a.get(i*4+1+aPos)*b.get(1*4+j+bPos) +
+          a.get(i*4+2+aPos)*b.get(2*4+j+bPos) +
+          a.get(i*4+3+aPos)*b.get(3*4+j+bPos));
+      }
+    }
+  }
+
+  /**
+   * Normalize vector
+   *
+   * @param v
+   */
+  private static void normalize(double[] v) {
+    double r;
+
+    r = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
+    if ( r == 0.0 )
+      return;
+
+    r = 1.0 / r;
+
+    v[0] *= r;
+    v[1] *= r;
+    v[2] *= r;
+
+    return;
+  }
+
+  /**
+   * Normalize vector
+   *
+   * @param v
+   */
+  private static void normalize(DoubleBuffer v) {
+    double r;
+
+    int vPos = v.position();
+
+    r = Math.sqrt(v.get(0+vPos) * v.get(0+vPos) +
+                  v.get(1+vPos) * v.get(1+vPos) +
+                  v.get(2+vPos) * v.get(2+vPos));
+    if ( r == 0.0 )
+      return;
+
+    r = 1.0 / r;
+
+    v.put(0+vPos, v.get(0+vPos) * r);
+    v.put(1+vPos, v.get(1+vPos) * r);
+    v.put(2+vPos, v.get(2+vPos) * r);
+
+    return;
+  }
+
+
+  /**
+   * Calculate cross-product
+   *
+   * @param v1
+   * @param v2
+   * @param result
+   */
+  private static void cross(double[] v1, double[] v2, double[] result) {
+    result[0] = v1[1] * v2[2] - v1[2] * v2[1];
+    result[1] = v1[2] * v2[0] - v1[0] * v2[2];
+    result[2] = v1[0] * v2[1] - v1[1] * v2[0];
+  }
+
+  /**
+   * Calculate cross-product
+   *
+   * @param v1
+   * @param v2
+   * @param result
+   */
+  private static void cross(DoubleBuffer v1, DoubleBuffer v2, DoubleBuffer result) {
+    int v1Pos = v1.position();
+    int v2Pos = v2.position();
+    int rPos  = result.position();
+
+    result.put(0+rPos, v1.get(1+v1Pos) * v2.get(2+v2Pos) - v1.get(2+v1Pos) * v2.get(1+v2Pos));
+    result.put(1+rPos, v1.get(2+v1Pos) * v2.get(0+v2Pos) - v1.get(0+v1Pos) * v2.get(2+v2Pos));
+    result.put(2+rPos, v1.get(0+v1Pos) * v2.get(1+v2Pos) - v1.get(1+v1Pos) * v2.get(0+v2Pos));
+  }
+
+  /**
+   * Method gluOrtho2D.
+   * 
+   * @param left
+   * @param right
+   * @param bottom
+   * @param top
+   */
+  public void gluOrtho2D(GL2 gl, double left, double right, double bottom, double top) {
+    gl.glOrtho(left, right, bottom, top, -1, 1);
+  }
+
+  /**
+   * Method gluPerspective.
+   * 
+   * @param fovy
+   * @param aspect
+   * @param zNear
+   * @param zFar
+   */
+  public void gluPerspective(GL2 gl, double fovy, double aspect, double zNear, double zFar) {
+    double sine, cotangent, deltaZ;
+    double radians = fovy / 2 * Math.PI / 180;
+
+    deltaZ = zFar - zNear;
+    sine = Math.sin(radians);
+
+    if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) {
+      return;
+    }
+
+    cotangent = Math.cos(radians) / sine;
+
+    __gluMakeIdentityd(matrixBuf);
+
+    matrixBuf.put(0 * 4 + 0, cotangent / aspect);
+    matrixBuf.put(1 * 4 + 1, cotangent);
+    matrixBuf.put(2 * 4 + 2, - (zFar + zNear) / deltaZ);
+    matrixBuf.put(2 * 4 + 3, -1);
+    matrixBuf.put(3 * 4 + 2, -2 * zNear * zFar / deltaZ);
+    matrixBuf.put(3 * 4 + 3, 0);
+
+    gl.glMultMatrixd(matrixBuf);
+  }
+
+  /**
+   * Method gluLookAt
+   * 
+   * @param eyex
+   * @param eyey
+   * @param eyez
+   * @param centerx
+   * @param centery
+   * @param centerz
+   * @param upx
+   * @param upy
+   * @param upz
+   */
+  public void gluLookAt(GL2 gl,
+                        double eyex,
+                        double eyey,
+                        double eyez,
+                        double centerx,
+                        double centery,
+                        double centerz,
+                        double upx,
+                        double upy,
+                        double upz) {
+    DoubleBuffer forward = this.forwardBuf;
+    DoubleBuffer side = this.sideBuf;
+    DoubleBuffer up = this.upBuf;
+
+    forward.put(0, centerx - eyex);
+    forward.put(1, centery - eyey);
+    forward.put(2, centerz - eyez);
+
+    up.put(0, upx);
+    up.put(1, upy);
+    up.put(2, upz);
+
+    normalize(forward);
+
+    /* Side = forward x up */
+    cross(forward, up, side);
+    normalize(side);
+
+    /* Recompute up as: up = side x forward */
+    cross(side, forward, up);
+
+    __gluMakeIdentityd(matrixBuf);
+    matrixBuf.put(0 * 4 + 0, side.get(0));
+    matrixBuf.put(1 * 4 + 0, side.get(1));
+    matrixBuf.put(2 * 4 + 0, side.get(2));
+
+    matrixBuf.put(0 * 4 + 1, up.get(0));
+    matrixBuf.put(1 * 4 + 1, up.get(1));
+    matrixBuf.put(2 * 4 + 1, up.get(2));
+
+    matrixBuf.put(0 * 4 + 2, -forward.get(0));
+    matrixBuf.put(1 * 4 + 2, -forward.get(1));
+    matrixBuf.put(2 * 4 + 2, -forward.get(2));
+
+    gl.glMultMatrixd(matrixBuf);
+    gl.glTranslated(-eyex, -eyey, -eyez);
+  }
+
+  /**
+   * Method gluProject
+   * 
+   * @param objx
+   * @param objy
+   * @param objz
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param win_pos
+   * 
+   * @return
+   */
+  public boolean gluProject(double objx,
+                            double objy,
+                            double objz,
+                            double[] modelMatrix,
+                            int modelMatrix_offset,
+                            double[] projMatrix,
+                            int projMatrix_offset,
+                            int[] viewport,
+                            int viewport_offset,
+                            double[] win_pos,
+                            int win_pos_offset ) {
+
+    double[] in = this.in;
+    double[] out = this.out;
+
+    in[0] = objx;
+    in[1] = objy;
+    in[2] = objz;
+    in[3] = 1.0;
+
+    __gluMultMatrixVecd(modelMatrix, modelMatrix_offset, in, out);
+    __gluMultMatrixVecd(projMatrix, projMatrix_offset, out, in);
+
+    if (in[3] == 0.0)
+      return false;
+
+    in[3] = (1.0 / in[3]) * 0.5;
+
+    // Map x, y and z to range 0-1
+    in[0] = in[0] * in[3] + 0.5f;
+    in[1] = in[1] * in[3] + 0.5f;
+    in[2] = in[2] * in[3] + 0.5f;
+
+    // Map x,y to viewport
+    win_pos[0+win_pos_offset] = in[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
+    win_pos[1+win_pos_offset] = in[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
+    win_pos[2+win_pos_offset] = in[2];
+
+    return true;
+  }
+
+  /**
+   * Method gluProject
+   * 
+   * @param objx
+   * @param objy
+   * @param objz
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param win_pos
+   * 
+   * @return
+   */
+  public boolean gluProject(double objx,
+                            double objy,
+                            double objz,
+                            DoubleBuffer modelMatrix,
+                            DoubleBuffer projMatrix,
+                            IntBuffer viewport,
+                            DoubleBuffer win_pos) {
+
+    DoubleBuffer in = this.inBuf;
+    DoubleBuffer out = this.outBuf;
+
+    in.put(0, objx);
+    in.put(1, objy);
+    in.put(2, objz);
+    in.put(3, 1.0);
+
+    __gluMultMatrixVecd(modelMatrix, in, out);
+    __gluMultMatrixVecd(projMatrix, out, in);
+
+    if (in.get(3) == 0.0)
+      return false;
+
+    in.put(3, (1.0 / in.get(3)) * 0.5);
+
+    // Map x, y and z to range 0-1
+    in.put(0, in.get(0) * in.get(3) + 0.5f);
+    in.put(1, in.get(1) * in.get(3) + 0.5f);
+    in.put(2, in.get(2) * in.get(3) + 0.5f);
+
+    // Map x,y to viewport
+    int vPos = viewport.position();
+    int wPos = win_pos.position();
+    win_pos.put(0+wPos, in.get(0) * viewport.get(2+vPos) + viewport.get(0+vPos));
+    win_pos.put(1+wPos, in.get(1) * viewport.get(3+vPos) + viewport.get(1+vPos));
+    win_pos.put(2+wPos, in.get(2));
+
+    return true;
+  }
+
+
+  /**
+   * Method gluUnproject
+   * 
+   * @param winx
+   * @param winy
+   * @param winz
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param obj_pos
+   * 
+   * @return
+   */
+  public boolean gluUnProject(double winx,
+                              double winy,
+                              double winz,
+                              double[] modelMatrix,
+                              int modelMatrix_offset,
+                              double[] projMatrix,
+                              int projMatrix_offset,
+                              int[] viewport,
+                              int viewport_offset,
+                              double[] obj_pos,
+                              int obj_pos_offset) {
+    double[] in = this.in;
+    double[] out = this.out;
+
+    __gluMultMatricesd(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
+
+    if (!__gluInvertMatrixd(matrix, matrix))
+      return false;
+
+    in[0] = winx;
+    in[1] = winy;
+    in[2] = winz;
+    in[3] = 1.0;
+
+    // Map x and y from window coordinates
+    in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+    in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+
+    // Map to range -1 to 1
+    in[0] = in[0] * 2 - 1;
+    in[1] = in[1] * 2 - 1;
+    in[2] = in[2] * 2 - 1;
+
+    __gluMultMatrixVecd(matrix, 0, in, out);
+
+    if (out[3] == 0.0)
+      return false;
+
+    out[3] = 1.0 / out[3];
+
+    obj_pos[0+obj_pos_offset] = out[0] * out[3];
+    obj_pos[1+obj_pos_offset] = out[1] * out[3];
+    obj_pos[2+obj_pos_offset] = out[2] * out[3];
+
+    return true;
+  }
+
+
+  /**
+   * Method gluUnproject
+   * 
+   * @param winx
+   * @param winy
+   * @param winz
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param obj_pos
+   * 
+   * @return
+   */
+  public boolean gluUnProject(double winx,
+                              double winy,
+                              double winz,
+                              DoubleBuffer modelMatrix,
+                              DoubleBuffer projMatrix,
+                              IntBuffer viewport,
+                              DoubleBuffer obj_pos) {
+    DoubleBuffer in = this.inBuf;
+    DoubleBuffer out = this.outBuf;
+
+    __gluMultMatricesd(modelMatrix, projMatrix, matrixBuf);
+
+    if (!__gluInvertMatrixd(matrixBuf, matrixBuf))
+      return false;
+
+    in.put(0, winx);
+    in.put(1, winy);
+    in.put(2, winz);
+    in.put(3, 1.0);
+
+    // Map x and y from window coordinates
+    int vPos = viewport.position();
+    int oPos = obj_pos.position();
+    in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
+    in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
+
+    // Map to range -1 to 1
+    in.put(0, in.get(0) * 2 - 1);
+    in.put(1, in.get(1) * 2 - 1);
+    in.put(2, in.get(2) * 2 - 1);
+
+    __gluMultMatrixVecd(matrixBuf, in, out);
+
+    if (out.get(3) == 0.0)
+      return false;
+
+    out.put(3, 1.0 / out.get(3));
+
+    obj_pos.put(0+oPos, out.get(0) * out.get(3));
+    obj_pos.put(1+oPos, out.get(1) * out.get(3));
+    obj_pos.put(2+oPos, out.get(2) * out.get(3));
+
+    return true;
+  }
+
+
+  /**
+   * Method gluUnproject4
+   * 
+   * @param winx
+   * @param winy
+   * @param winz
+   * @param clipw
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param near
+   * @param far
+   * @param obj_pos
+   * 
+   * @return
+   */
+  public boolean gluUnProject4(double winx,
+                               double winy,
+                               double winz,
+                               double clipw,
+                               double[] modelMatrix,
+                               int modelMatrix_offset,
+                               double[] projMatrix,
+                               int projMatrix_offset,
+                               int[] viewport,
+                               int viewport_offset,
+                               double near,
+                               double far,
+                               double[] obj_pos,
+                               int obj_pos_offset ) {
+    double[] in = this.in;
+    double[] out = this.out;
+
+    __gluMultMatricesd(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
+
+    if (!__gluInvertMatrixd(matrix, matrix))
+      return false;
+
+    in[0] = winx;
+    in[1] = winy;
+    in[2] = winz;
+    in[3] = clipw;
+
+    // Map x and y from window coordinates
+    in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+    in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+    in[2] = (in[2] - near) / (far - near);
+
+    // Map to range -1 to 1
+    in[0] = in[0] * 2 - 1;
+    in[1] = in[1] * 2 - 1;
+    in[2] = in[2] * 2 - 1;
+
+    __gluMultMatrixVecd(matrix, 0, in, out);
+
+    if (out[3] == 0.0)
+      return false;
+
+    obj_pos[0+obj_pos_offset] = out[0];
+    obj_pos[1+obj_pos_offset] = out[1];
+    obj_pos[2+obj_pos_offset] = out[2];
+    obj_pos[3+obj_pos_offset] = out[3];
+    return true;
+  }
+
+  /**
+   * Method gluUnproject4
+   * 
+   * @param winx
+   * @param winy
+   * @param winz
+   * @param clipw
+   * @param modelMatrix
+   * @param projMatrix
+   * @param viewport
+   * @param near
+   * @param far
+   * @param obj_pos
+   * 
+   * @return
+   */
+  public boolean gluUnProject4(double winx,
+                               double winy,
+                               double winz,
+                               double clipw,
+                               DoubleBuffer modelMatrix,
+                               DoubleBuffer projMatrix,
+                               IntBuffer viewport,
+                               double near,
+                               double far,
+                               DoubleBuffer obj_pos) {
+    DoubleBuffer in = this.inBuf;
+    DoubleBuffer out = this.outBuf;
+
+    __gluMultMatricesd(modelMatrix, projMatrix, matrixBuf);
+
+    if (!__gluInvertMatrixd(matrixBuf, matrixBuf))
+      return false;
+
+    in.put(0, winx);
+    in.put(1, winy);
+    in.put(2, winz);
+    in.put(3, clipw);
+
+    // Map x and y from window coordinates
+    int vPos = viewport.position();
+    in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
+    in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
+    in.put(2, (in.get(2) - near) / (far - near));
+
+    // Map to range -1 to 1
+    in.put(0, in.get(0) * 2 - 1);
+    in.put(1, in.get(1) * 2 - 1);
+    in.put(2, in.get(2) * 2 - 1);
+
+    __gluMultMatrixVecd(matrixBuf, in, out);
+
+    if (out.get(3) == 0.0)
+      return false;
+
+    int oPos = obj_pos.position();
+    obj_pos.put(0+oPos, out.get(0));
+    obj_pos.put(1+oPos, out.get(1));
+    obj_pos.put(2+oPos, out.get(2));
+    obj_pos.put(3+oPos, out.get(3));
+    return true;
+  }
+
+
+  /**
+   * Method gluPickMatrix
+   * 
+   * @param x
+   * @param y
+   * @param deltaX
+   * @param deltaY
+   * @param viewport
+   */
+  public void gluPickMatrix(GL2 gl,
+                            double x,
+                            double y,
+                            double deltaX,
+                            double deltaY,
+                            IntBuffer viewport) {
+    if (deltaX <= 0 || deltaY <= 0) {
+      return;
+    }
+
+    /* Translate and scale the picked region to the entire window */
+    int vPos = viewport.position();
+    gl.glTranslated((viewport.get(2+vPos) - 2 * (x - viewport.get(0+vPos))) / deltaX,
+                    (viewport.get(3+vPos) - 2 * (y - viewport.get(1+vPos))) / deltaY,
+                    0);
+    gl.glScaled(viewport.get(2) / deltaX, viewport.get(3) / deltaY, 1.0);
+  }
+
+  /**
+   * Method gluPickMatrix
+   * 
+   * @param x
+   * @param y
+   * @param deltaX
+   * @param deltaY
+   * @param viewport
+   * @param viewport_offset
+   */
+  public void gluPickMatrix(GL2 gl,
+                            double x,
+                            double y,
+                            double deltaX,
+                            double deltaY,
+                            int[] viewport,
+                            int viewport_offset) {
+    if (deltaX <= 0 || deltaY <= 0) {
+      return;
+    }
+
+    /* Translate and scale the picked region to the entire window */
+    gl.glTranslated((viewport[2+viewport_offset] - 2 * (x - viewport[0+viewport_offset])) / deltaX,
+                    (viewport[3+viewport_offset] - 2 * (y - viewport[1+viewport_offset])) / deltaY,
+                    0);
+    gl.glScaled(viewport[2+viewport_offset] / deltaX, viewport[3+viewport_offset] / deltaY, 1.0);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/gl2/Util.java b/src/jogl/classes/jogamp/opengl/gl2/Util.java
new file mode 100644
index 0000000..83f98a6
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/gl2/Util.java
@@ -0,0 +1,244 @@
+/* 
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are 
+ * met:
+ * 
+ * * Redistributions of source code must retain the above copyright 
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of 
+ *   its contributors may be used to endorse or promote products derived 
+ *   from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package jogamp.opengl.gl2;
+
+import jogamp.opengl.*;
+
+import java.nio.IntBuffer;
+import javax.media.opengl.*;
+
+/**
+ * Util.java
+ * <p/>
+ * <p/>
+ * Created 7-jan-2004
+ *
+ * @author Erik Duijs
+ */
+class Util {
+
+  /**
+   * temp int[] of one for getting an int from some GL functions
+   */
+  private int[] scratch = new int[1];
+
+  /**
+   * Return ceiling of integer division
+   *
+   * @param a
+   * @param b
+   *
+   * @return int
+   */
+  protected static int ceil(int a, int b) {
+    return (a % b == 0 ? a / b : a / b + 1);
+  }
+
+  /**
+   * Method compPerPix.
+   *
+   * @param format
+   *
+   * @return int
+   */
+  protected static int compPerPix(int format) {
+    /* Determine number of components per pixel */
+    switch ( format ) {
+    case GL2.GL_COLOR_INDEX:
+    case GL2.GL_STENCIL_INDEX:
+    case GL2.GL_DEPTH_COMPONENT:
+    case GL2.GL_RED:
+    case GL2.GL_GREEN:
+    case GL2.GL_BLUE:
+    case GL2.GL_ALPHA:
+    case GL2.GL_LUMINANCE:
+      return 1;
+    case GL2.GL_LUMINANCE_ALPHA:
+      return 2;
+    case GL2.GL_RGB:
+    case GL2.GL_BGR:
+      return 3;
+    case GL2.GL_RGBA:
+    case GL2.GL_BGRA:
+      return 4;
+    default :
+      return -1;
+    }
+  }
+
+  /**
+   * Method nearestPower.
+   * <p/>
+   * Compute the nearest power of 2 number.  This algorithm is a little strange, but it works quite well.
+   *
+   * @param value
+   *
+   * @return int
+   */
+  protected static int nearestPower(int value) {
+    int i;
+
+    i = 1;
+
+    /* Error! */
+    if ( value == 0 )
+      return -1;
+
+    for ( ; ; ) {
+      if ( value == 1 ) {
+        return i;
+      } else if ( value == 3 ) {
+        return i << 2;
+      }
+      value >>= 1;
+      i <<= 1;
+    }
+  }
+
+  /**
+   * Method bytesPerPixel.
+   *
+   * @param format
+   * @param type
+   *
+   * @return int
+   */
+  protected static int bytesPerPixel(int format, int type) {
+    int n, m;
+
+    switch ( format ) {
+    case GL2.GL_COLOR_INDEX:
+    case GL2.GL_STENCIL_INDEX:
+    case GL2.GL_DEPTH_COMPONENT:
+    case GL2.GL_RED:
+    case GL2.GL_GREEN:
+    case GL2.GL_BLUE:
+    case GL2.GL_ALPHA:
+    case GL2.GL_LUMINANCE:
+      n = 1;
+      break;
+    case GL2.GL_LUMINANCE_ALPHA:
+      n = 2;
+      break;
+    case GL2.GL_RGB:
+    case GL2.GL_BGR:
+      n = 3;
+      break;
+    case GL2.GL_RGBA:
+    case GL2.GL_BGRA:
+      n = 4;
+      break;
+    default :
+      n = 0;
+    }
+
+    switch ( type ) {
+    case GL2.GL_UNSIGNED_BYTE:
+      m = 1;
+      break;
+    case GL2.GL_BYTE:
+      m = 1;
+      break;
+    case GL2.GL_BITMAP:
+      m = 1;
+      break;
+    case GL2.GL_UNSIGNED_SHORT:
+      m = 2;
+      break;
+    case GL2.GL_SHORT:
+      m = 2;
+      break;
+    case GL2.GL_UNSIGNED_INT:
+      m = 4;
+      break;
+    case GL2.GL_INT:
+      m = 4;
+      break;
+    case GL2.GL_FLOAT:
+      m = 4;
+      break;
+    default :
+      m = 0;
+    }
+
+    return n * m;
+  }
+
+  /**
+   * Convenience method for returning an int, rather than getting it out of a buffer yourself.
+   *
+   * @param what
+   *
+   * @return int
+   */
+  protected int glGetIntegerv(GL gl, int what) {
+    gl.glGetIntegerv(what, scratch, 0);
+    return scratch[0];
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/gl2/fixme/GLObjectTracker.java b/src/jogl/classes/jogamp/opengl/gl2/fixme/GLObjectTracker.java
new file mode 100644
index 0000000..903a82f
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/gl2/fixme/GLObjectTracker.java
@@ -0,0 +1,835 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.gl2;
+
+import jogamp.opengl.*;
+
+import java.nio.*;
+import javax.media.opengl.*;
+
+/** 
+ * Tracks the creation of server-side OpenGL objects which can be
+ * shared between contexts. Ordinarily, when an OpenGL context is
+ * deleted and no other contexts are sharing server-side objects with
+ * it, all of the server-side objects are automatically deleted by the
+ * OpenGL implementation. It is not necessary for the end user to
+ * explicitly delete these objects. However, when the Java2D/OpenGL
+ * pipeline is active and frame buffer objects are being used for
+ * rendering, it is necessary for all OpenGL contexts created by JOGL
+ * to share server-side objects with the Java2D OpenGL context. This
+ * means that these objects "leak" into the namespace used by Java2D.
+ * In order to prevent memory leaks and to present the same
+ * programming model to the end user, it is necessary to track the
+ * creation and destruction of all of these server-side OpenGL objects
+ * and to explicitly release them when all of the JOGL-created
+ * contexts which can see them have been released. <P>
+ *
+ * The {@link #ref ref} and {@link #unref unref} methods should be
+ * used during the creation and destruction of OpenGL contexts by JOGL
+ * in order to update the liveness of the objects being tracked. The
+ * various other methods should be called by the OpenGL binding in the
+ * various named methods.
+ */
+
+public class GLObjectTracker {
+  private static final boolean DEBUG = Debug.debug("GLStatusTracker");
+
+  //----------------------------------------------------------------------
+  // Adders
+  //
+
+  // glGenBuffers
+  public synchronized void addBuffers(int n, IntBuffer ids) {
+    add(getList(BUFFERS), n, ids);
+  }
+
+  // glGenBuffers
+  public synchronized void addBuffers(int n, int[] ids, int ids_offset) {
+    add(getList(BUFFERS), n, ids, ids_offset);
+  }
+
+  // glGenBuffersARB
+  public synchronized void addBuffersARB(int n, IntBuffer ids) {
+    add(getList(BUFFERS_ARB), n, ids);
+  }
+
+  // glGenBuffersARB
+  public synchronized void addBuffersARB(int n, int[] ids, int ids_offset) {
+    add(getList(BUFFERS_ARB), n, ids, ids_offset);
+  }
+
+  // glGenFencesAPPLE
+  public synchronized void addFencesAPPLE(int n, IntBuffer ids) {
+    add(getList(FENCES_APPLE), n, ids);
+  }
+
+  // glGenFencesAPPLE
+  public synchronized void addFencesAPPLE(int n, int[] ids, int ids_offset) {
+    add(getList(FENCES_APPLE), n, ids, ids_offset);
+  }
+
+  // glGenFencesNV
+  public synchronized void addFencesNV(int n, IntBuffer ids) {
+    add(getList(FENCES_NV), n, ids);
+  }
+
+  // glGenFencesNV
+  public synchronized void addFencesNV(int n, int[] ids, int ids_offset) {
+    add(getList(FENCES_NV), n, ids, ids_offset);
+  }
+
+  // glGenFragmentShadersATI
+  public synchronized void addFragmentShadersATI(int start, int n) {
+    add(getList(FRAGMENT_SHADERS_ATI), start, n);
+  }
+
+  // glGenFramebuffersEXT
+  public synchronized void addFramebuffersEXT(int n, IntBuffer ids) {
+    add(getList(FRAMEBUFFERS_EXT), n, ids);
+  }
+
+  // glGenFramebuffersEXT
+  public synchronized void addFramebuffersEXT(int n, int[] ids, int ids_offset) {
+    add(getList(FRAMEBUFFERS_EXT), n, ids, ids_offset);
+  }
+  
+  // glGenLists
+  public synchronized void addLists(int start, int n) {
+    add(getList(LISTS), start, n);
+  }
+
+  // glGenOcclusionQueriesNV
+  public synchronized void addOcclusionQueriesNV(int n, IntBuffer ids) {
+    add(getList(OCCLUSION_QUERIES_NV), n, ids);
+  }
+
+  // glGenOcclusionQueriesNV
+  public synchronized void addOcclusionQueriesNV(int n, int[] ids, int ids_offset) {
+    add(getList(OCCLUSION_QUERIES_NV), n, ids, ids_offset);
+  }
+
+  // glCreateProgram
+  public synchronized void addProgramObject(int obj) {
+    add(getList(PROGRAM_OBJECTS), obj, 1);
+  }
+
+  // glCreateProgramObjectARB
+  public synchronized void addProgramObjectARB(int obj) {
+    add(getList(PROGRAM_AND_SHADER_OBJECTS_ARB), obj, 1);
+  }
+
+  // glGenProgramsARB
+  public synchronized void addProgramsARB(int n, IntBuffer ids) {
+    add(getList(PROGRAMS_ARB), n, ids);
+  }
+
+  // glGenProgramsARB
+  public synchronized void addProgramsARB(int n, int[] ids, int ids_offset) {
+    add(getList(PROGRAMS_ARB), n, ids, ids_offset);
+  }
+
+  // glGenProgramsNV
+  public synchronized void addProgramsNV(int n, IntBuffer ids) {
+    add(getList(PROGRAMS_NV), n, ids);
+  }
+
+  // glGenProgramsNV
+  public synchronized void addProgramsNV(int n, int[] ids, int ids_offset) {
+    add(getList(PROGRAMS_NV), n, ids, ids_offset);
+  }
+
+  // glGenQueries
+  public synchronized void addQueries(int n, IntBuffer ids) {
+    add(getList(QUERIES), n, ids);
+  }
+
+  // glGenQueries
+  public synchronized void addQueries(int n, int[] ids, int ids_offset) {
+    add(getList(QUERIES), n, ids, ids_offset);
+  }
+
+  // glGenQueriesARB
+  public synchronized void addQueriesARB(int n, IntBuffer ids) {
+    add(getList(QUERIES_ARB), n, ids);
+  }
+
+  // glGenQueriesARB
+  public synchronized void addQueriesARB(int n, int[] ids, int ids_offset) {
+    add(getList(QUERIES_ARB), n, ids, ids_offset);
+  }
+
+  // glGenRenderbuffersEXT
+  public synchronized void addRenderbuffersEXT(int n, IntBuffer ids) {
+    add(getList(RENDERBUFFERS_EXT), n, ids);
+  }
+
+  // glGenRenderbuffersEXT
+  public synchronized void addRenderbuffersEXT(int n, int[] ids, int ids_offset) {
+    add(getList(RENDERBUFFERS_EXT), n, ids, ids_offset);
+  }
+
+  // glCreateShader
+  public synchronized void addShaderObject(int obj) {
+    add(getList(SHADER_OBJECTS), obj, 1);
+  }
+
+  // glCreateShaderObjectARB
+  public synchronized void addShaderObjectARB(int obj) {
+    add(getList(PROGRAM_AND_SHADER_OBJECTS_ARB), obj, 1);
+  }
+
+  // glGenTextures
+  public synchronized void addTextures(int n, IntBuffer ids) {
+    add(getList(TEXTURES), n, ids);
+  }
+
+  // glGenTextures
+  public synchronized void addTextures(int n, int[] ids, int ids_offset) {
+    add(getList(TEXTURES), n, ids, ids_offset);
+  }
+
+  // glGenVertexArraysAPPLE
+  public synchronized void addVertexArraysAPPLE(int n, IntBuffer ids) {
+    add(getList(VERTEX_ARRAYS_APPLE), n, ids);
+  }
+
+  // glGenVertexArraysAPPLE
+  public synchronized void addVertexArraysAPPLE(int n, int[] ids, int ids_offset) {
+    add(getList(VERTEX_ARRAYS_APPLE), n, ids, ids_offset);
+  }
+
+  // glGenVertexShadersEXT
+  public synchronized void addVertexShadersEXT(int start, int n) {
+    add(getList(VERTEX_SHADERS_EXT), start, n);
+  }
+
+  //----------------------------------------------------------------------
+  // Removers
+  //
+
+  // glDeleteBuffers
+  public synchronized void removeBuffers(int n, IntBuffer ids) {
+    remove(getList(BUFFERS), n, ids);
+  }
+
+  // glDeleteBuffers
+  public synchronized void removeBuffers(int n, int[] ids, int ids_offset) {
+    remove(getList(BUFFERS), n, ids, ids_offset);
+  }
+
+  // glDeleteBuffersARB
+  public synchronized void removeBuffersARB(int n, IntBuffer ids) {
+    remove(getList(BUFFERS_ARB), n, ids);
+  }
+
+  // glDeleteBuffersARB
+  public synchronized void removeBuffersARB(int n, int[] ids, int ids_offset) {
+    remove(getList(BUFFERS_ARB), n, ids, ids_offset);
+  }
+
+  // glDeleteFencesAPPLE
+  public synchronized void removeFencesAPPLE(int n, IntBuffer ids) {
+    remove(getList(FENCES_APPLE), n, ids);
+  }
+
+  // glDeleteFencesAPPLE
+  public synchronized void removeFencesAPPLE(int n, int[] ids, int ids_offset) {
+    remove(getList(FENCES_APPLE), n, ids, ids_offset);
+  }
+
+  // glDeleteFencesNV
+  public synchronized void removeFencesNV(int n, IntBuffer ids) {
+    remove(getList(FENCES_NV), n, ids);
+  }
+
+  // glDeleteFencesNV
+  public synchronized void removeFencesNV(int n, int[] ids, int ids_offset) {
+    remove(getList(FENCES_NV), n, ids, ids_offset);
+  }
+
+  // glDeleteFragmentShaderATI
+  public synchronized void removeFragmentShaderATI(int obj) {
+    remove(getList(FRAGMENT_SHADERS_ATI), obj, 1);
+  }
+
+  // glDeleteFramebuffersEXT
+  public synchronized void removeFramebuffersEXT(int n, IntBuffer ids) {
+    remove(getList(FRAMEBUFFERS_EXT), n, ids);
+  }
+
+  // glDeleteFramebuffersEXT
+  public synchronized void removeFramebuffersEXT(int n, int[] ids, int ids_offset) {
+    remove(getList(FRAMEBUFFERS_EXT), n, ids, ids_offset);
+  }
+  
+  // glDeleteLists
+  public synchronized void removeLists(int start, int n) {
+    remove(getList(LISTS), start, n);
+  }
+
+  // glDeleteOcclusionQueriesNV
+  public synchronized void removeOcclusionQueriesNV(int n, IntBuffer ids) {
+    remove(getList(OCCLUSION_QUERIES_NV), n, ids);
+  }
+
+  // glDeleteOcclusionQueriesNV
+  public synchronized void removeOcclusionQueriesNV(int n, int[] ids, int ids_offset) {
+    remove(getList(OCCLUSION_QUERIES_NV), n, ids, ids_offset);
+  }
+
+  // glDeleteProgram
+  public synchronized void removeProgramObject(int obj) {
+    remove(getList(PROGRAM_OBJECTS), obj, 1);
+  }
+
+  // glDeleteObjectARB
+  public synchronized void removeProgramOrShaderObjectARB(int obj) {
+    remove(getList(PROGRAM_AND_SHADER_OBJECTS_ARB), obj, 1);
+  }
+
+  // glDeleteProgramsARB
+  public synchronized void removeProgramsARB(int n, IntBuffer ids) {
+    remove(getList(PROGRAMS_ARB), n, ids);
+  }
+
+  // glDeleteProgramsARB
+  public synchronized void removeProgramsARB(int n, int[] ids, int ids_offset) {
+    remove(getList(PROGRAMS_ARB), n, ids, ids_offset);
+  }
+
+  // glDeleteProgramsNV
+  public synchronized void removeProgramsNV(int n, IntBuffer ids) {
+    remove(getList(PROGRAMS_NV), n, ids);
+  }
+
+  // glDeleteProgramsNV
+  public synchronized void removeProgramsNV(int n, int[] ids, int ids_offset) {
+    remove(getList(PROGRAMS_NV), n, ids, ids_offset);
+  }
+
+  // glDeleteQueries
+  public synchronized void removeQueries(int n, IntBuffer ids) {
+    remove(getList(QUERIES), n, ids);
+  }
+
+  // glDeleteQueries
+  public synchronized void removeQueries(int n, int[] ids, int ids_offset) {
+    remove(getList(QUERIES), n, ids, ids_offset);
+  }
+
+  // glDeleteQueriesARB
+  public synchronized void removeQueriesARB(int n, IntBuffer ids) {
+    remove(getList(QUERIES_ARB), n, ids);
+  }
+
+  // glDeleteQueriesARB
+  public synchronized void removeQueriesARB(int n, int[] ids, int ids_offset) {
+    remove(getList(QUERIES_ARB), n, ids, ids_offset);
+  }
+
+  // glDeleteRenderbuffersEXT
+  public synchronized void removeRenderbuffersEXT(int n, IntBuffer ids) {
+    remove(getList(RENDERBUFFERS_EXT), n, ids);
+  }
+
+  // glDeleteRenderbuffersEXT
+  public synchronized void removeRenderbuffersEXT(int n, int[] ids, int ids_offset) {
+    remove(getList(RENDERBUFFERS_EXT), n, ids, ids_offset);
+  }
+
+  // glDeleteShader
+  public synchronized void removeShaderObject(int obj) {
+    remove(getList(SHADER_OBJECTS), obj, 1);
+  }
+
+  // glDeleteTextures
+  public synchronized void removeTextures(int n, IntBuffer ids) {
+    remove(getList(TEXTURES), n, ids);
+  }
+
+  // glDeleteTextures
+  public synchronized void removeTextures(int n, int[] ids, int ids_offset) {
+    remove(getList(TEXTURES), n, ids, ids_offset);
+  }
+
+  // glDeleteVertexArraysAPPLE
+  public synchronized void removeVertexArraysAPPLE(int n, IntBuffer ids) {
+    remove(getList(VERTEX_ARRAYS_APPLE), n, ids);
+  }
+
+  // glDeleteVertexArraysAPPLE
+  public synchronized void removeVertexArraysAPPLE(int n, int[] ids, int ids_offset) {
+    remove(getList(VERTEX_ARRAYS_APPLE), n, ids, ids_offset);
+  }
+
+  // glDeleteVertexShaderEXT
+  public synchronized void removeVertexShaderEXT(int obj) {
+    remove(getList(VERTEX_SHADERS_EXT), obj, 1);
+  }
+
+  //----------------------------------------------------------------------
+  // Reference count maintenance and manual deletion
+  //
+
+  public synchronized void transferAll(GLObjectTracker other) {
+    for (int i = 0; i < lists.length; i++) {
+      getList(i).addAll(other.lists[i]);
+      if (other.lists[i] != null) {
+        other.lists[i].clear();
+      }
+    }
+    dirty = true;
+  }
+
+  public synchronized void ref() {
+    ++refCount;
+  }
+
+  public void unref(GLObjectTracker deletedObjectPool) {
+    boolean tryDelete = false;
+    synchronized (this) {
+      if (--refCount == 0) {
+        tryDelete = true;
+      }
+    }
+    if (tryDelete) {
+      // See whether we should try to do the work now or whether we
+      // have to postpone
+      GLContext cur = GLContext.getCurrent();
+      if ((cur != null) &&
+          (cur instanceof GLContextImpl)) {
+        GLContextImpl curImpl = (GLContextImpl) cur;
+        if (deletedObjectPool != null &&
+            deletedObjectPool == curImpl.getDeletedObjectTracker()) {
+          // Should be safe to delete these objects now
+          try {
+            delete((GL2)curImpl.getGL());
+            return;
+          } catch (GLException e) {
+            // Shouldn't happen, but if it does, transfer all objects
+            // to the deleted object pool hoping we can later clean
+            // them up
+            deletedObjectPool.transferAll(this);
+            throw(e);
+          }
+        }
+      }
+      // If we get here, we couldn't attempt to delete the objects
+      // right now; instead try to transfer them to the
+      // deletedObjectPool for later cleanup (FIXME: should consider
+      // throwing an exception if deletedObjectPool is null, since
+      // that shouldn't happen)
+      if (DEBUG) {
+        String s = null;
+        if (cur == null) {
+          s = "current context was null";
+        } else if (!(cur instanceof GLContextImpl)) {
+          s = "current context was not a GLContextImpl";
+        } else if (deletedObjectPool == null) {
+          s = "no current deletedObjectPool";
+        } else if (deletedObjectPool != ((GLContextImpl) cur).getDeletedObjectTracker()) {
+          s = "deletedObjectTracker didn't match";
+          if (((GLContextImpl) cur).getDeletedObjectTracker() == null) {
+            s += " (other was null)";
+          }
+        } else {
+          s = "unknown reason";
+        }
+        System.err.println("Deferred destruction of server-side OpenGL objects into " + deletedObjectPool + ": " + s);
+      }
+
+      if (deletedObjectPool != null) {
+        deletedObjectPool.transferAll(this);
+      }
+    }
+  }
+
+  public void clean(GL2 gl) {
+    if (dirty) {
+      try {
+        delete(gl);
+        dirty = false;
+      } catch (GLException e) {
+        // FIXME: not sure what to do here; probably a bad idea to be
+        // throwing exceptions during an otherwise-successful makeCurrent
+      }
+    }
+  }
+
+
+  //----------------------------------------------------------------------
+  // Internals only below this point
+  //
+
+  // Kinds of sharable server-side OpenGL objects this class tracks
+  private static final int BUFFERS                        = 0;
+  private static final int BUFFERS_ARB                    = 1;
+  private static final int FENCES_APPLE                   = 2;
+  private static final int FENCES_NV                      = 3;
+  private static final int FRAGMENT_SHADERS_ATI           = 4;
+  private static final int FRAMEBUFFERS_EXT               = 5;
+  private static final int LISTS                          = 6;
+  private static final int OCCLUSION_QUERIES_NV           = 7;
+  private static final int PROGRAM_AND_SHADER_OBJECTS_ARB = 8;
+  private static final int PROGRAM_OBJECTS                = 9;
+  private static final int PROGRAMS_ARB                   = 10;
+  private static final int PROGRAMS_NV                    = 11;
+  private static final int QUERIES                        = 12;
+  private static final int QUERIES_ARB                    = 13;
+  private static final int RENDERBUFFERS_EXT              = 14;
+  private static final int SHADER_OBJECTS                 = 15;
+  private static final int TEXTURES                       = 16;
+  private static final int VERTEX_ARRAYS_APPLE            = 17;
+  private static final int VERTEX_SHADERS_EXT             = 18;
+  private static final int NUM_OBJECT_TYPES               = 19;
+
+  static abstract class Deleter {
+    public abstract void delete(GL2 gl, int obj);
+  }
+
+  static class ObjectList {
+    private static final int MIN_CAPACITY = 4;
+
+    private int size;
+    private int capacity;
+    private int[] data;
+    private Deleter deleter;
+    private String name;
+
+    public ObjectList(Deleter deleter) {
+      this.deleter = deleter;
+      clear();
+    }
+
+    public void add(int obj) {
+      if (size == capacity) {
+        int newCapacity = 2 * capacity;
+        int[] newData = new int[newCapacity];
+        System.arraycopy(data, 0, newData, 0, size);
+        data = newData;
+        capacity = newCapacity;
+      }
+
+      data[size++] = obj;
+    }
+
+    public void addAll(ObjectList other) {
+      if (other == null) {
+        return;
+      }
+      for (int i = 0; i < other.size; i++) {
+        add(other.data[i]);
+      }
+    }
+
+    public boolean remove(int value) {
+      for (int i = 0; i < size; i++) {
+        if (data[i] == value) {
+          if (i < size - 1) {
+            System.arraycopy(data, i+1, data, i, size - i - 1);
+          }
+          --size;
+          if ((size < capacity / 4) &&
+              (capacity > MIN_CAPACITY)) {
+            int newCapacity = capacity / 4;
+            if (newCapacity < MIN_CAPACITY) {
+              newCapacity = MIN_CAPACITY;
+            }
+            int[] newData = new int[newCapacity];
+            System.arraycopy(data, 0, newData, 0, size);
+            data = newData;
+            capacity = newCapacity;
+          }
+          return true;
+        }
+      }
+      return false;
+    }
+
+    public void setName(String name) {
+      if (DEBUG) {
+        this.name = name;
+      }
+    }
+
+    public void delete(GL2 gl) {
+      // Just in case we start throwing exceptions during deletion,
+      // make sure we make progress rather than going into an infinite
+      // loop
+      while (size > 0) {
+        int obj = data[size - 1];
+        --size;
+        if (DEBUG) {
+          System.err.println("Deleting server-side OpenGL object " + obj +
+                             ((name != null) ? (" (" + name + ")") : ""));
+        }
+        deleter.delete(gl, obj);
+      }
+    }
+
+    public void clear() {
+      size = 0;
+      capacity = MIN_CAPACITY;
+      data = new int[capacity];
+    }
+  }
+
+  private ObjectList[] lists = new ObjectList[NUM_OBJECT_TYPES];
+  private int refCount;
+  private boolean dirty;
+
+  private void add(ObjectList list, int n, IntBuffer ids) {
+    int pos = ids.position();
+    for (int i = 0; i < n; i++) {
+      list.add(ids.get(pos + i));
+    }
+  }
+
+  private void add(ObjectList list, int n, int[] ids, int ids_offset) {
+    for (int i = 0; i < n; i++) {
+      list.add(ids[i + ids_offset]);
+    }
+  }
+
+  private void add(ObjectList list, int start, int n) {
+    for (int i = 0; i < n; i++) {
+      list.add(start + i);
+    }
+  }
+
+  private void remove(ObjectList list, int n, IntBuffer ids) {
+    int pos = ids.position();
+    for (int i = 0; i < n; i++) {
+      list.remove(ids.get(pos + i));
+    }
+  }
+
+  private void remove(ObjectList list, int n, int[] ids, int ids_offset) {
+    for (int i = 0; i < n; i++) {
+      list.remove(ids[i + ids_offset]);
+    }
+  }
+
+  private void remove(ObjectList list, int start, int n) {
+    for (int i = 0; i < n; i++) {
+      list.remove(start + i);
+    }
+  }
+
+  private ObjectList getList(int which) {
+    ObjectList list = lists[which];
+    if (list == null) {
+      Deleter deleter = null;
+      String name = null;
+      // Figure out which deleter we need
+      switch (which) {
+        case BUFFERS:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteBuffers(1, new int[] { obj }, 0);
+              }
+            };
+          name = "buffer";
+          break;
+        case BUFFERS_ARB:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteBuffersARB(1, new int[] { obj }, 0);
+              }
+            };
+          name = "ARB buffer";
+          break;
+        case FENCES_APPLE:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteFencesAPPLE(1, new int[] { obj }, 0);
+              }
+            };
+          name = "APPLE fence";
+          break;
+        case FENCES_NV:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteFencesNV(1, new int[] { obj }, 0);
+              }
+            };
+          name = "NV fence";
+          break;
+        case FRAGMENT_SHADERS_ATI:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteFragmentShaderATI(obj);
+              }
+            };
+          name = "ATI fragment shader";
+          break;
+        case FRAMEBUFFERS_EXT:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteFramebuffersEXT(1, new int[] { obj }, 0);
+              }
+            };
+          name = "EXT framebuffer";
+          break;
+        case LISTS:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteLists(obj, 1);
+              }
+            };
+          name = "display list";
+          break;
+        case OCCLUSION_QUERIES_NV:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteOcclusionQueriesNV(1, new int[] { obj }, 0);
+              }
+            };
+          name = "NV occlusion query";
+          break;
+        case PROGRAM_AND_SHADER_OBJECTS_ARB:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteObjectARB(obj);
+              }
+            };
+          name = "ARB program or shader object";
+          break;
+        case PROGRAM_OBJECTS:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteProgram(obj);
+              }
+            };
+          name = "program object";
+          break;
+        case PROGRAMS_ARB:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteProgramsARB(1, new int[] { obj }, 0);
+              }
+            };
+          name = "ARB program object";
+          break;
+        case PROGRAMS_NV:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteProgramsNV(1, new int[] { obj }, 0);
+              }
+            };
+          name = "NV program";
+          break;
+        case QUERIES:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteQueries(1, new int[] { obj }, 0);
+              }
+            };
+          name = "query";
+          break;
+        case QUERIES_ARB:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteQueriesARB(1, new int[] { obj }, 0);
+              }
+            };
+          name = "ARB query";
+          break;
+        case RENDERBUFFERS_EXT:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteRenderbuffersEXT(1, new int[] { obj }, 0);
+              }
+            };
+          name = "EXT renderbuffer";
+          break;
+        case SHADER_OBJECTS:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteShader(obj);
+              }
+            };
+          name = "shader object";
+          break;
+        case TEXTURES:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteTextures(1, new int[] { obj }, 0);
+              }
+            };
+          name = "texture";
+          break;
+        case VERTEX_ARRAYS_APPLE:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteVertexArraysAPPLE(1, new int[] { obj }, 0);
+              }
+            };
+          name = "APPLE vertex array";
+          break;
+        case VERTEX_SHADERS_EXT:
+          deleter = new Deleter() {
+              public void delete(GL2 gl, int obj) {
+                gl.glDeleteVertexShaderEXT(obj);
+              }
+            };
+          name = "EXT vertex shader";
+          break;
+        default:
+          throw new InternalError("Unexpected OpenGL object type " + which);
+      }
+
+      list = new ObjectList(deleter);
+      list.setName(name);
+      lists[which] = list;
+    }
+    return list;
+  }
+
+  private void delete(GL2 gl) {
+    for (int i = 0; i < lists.length; i++) {
+      ObjectList list = lists[i];
+      if (list != null) {
+        list.delete(gl);
+        lists[i] = null;
+      }
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
new file mode 100644
index 0000000..5eb73cd
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
@@ -0,0 +1,1212 @@
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+** 
+** http://oss.sgi.com/projects/FreeB
+** 
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+** 
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+** 
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** $Date: 2009-03-04 17:23:34 -0800 (Wed, 04 Mar 2009) $ $Revision: 1856 $
+** $Header$
+*/
+
+/* 
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are 
+ * met:
+ * 
+ * * Redistributions of source code must retain the above copyright 
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of 
+ *   its contributors may be used to endorse or promote products derived 
+ *   from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package jogamp.opengl.glu;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import com.jogamp.opengl.util.ImmModeSink;
+import java.nio.*;
+
+/**
+ * GLUquadricImpl.java
+ * 
+ * 
+ * Created 22-dec-2003 (originally Quadric.java)
+ * @author Erik Duijs
+ * @author Kenneth Russell, Sven Gothel
+ */
+
+public class GLUquadricImpl implements GLUquadric {
+  private boolean useGLSL;
+  private int drawStyle;
+  private int orientation;
+  private boolean textureFlag;
+  private int normals;
+  private boolean immModeSinkEnabled;
+  private boolean immModeSinkImmediate;
+  public int normalType;
+  public GL gl;
+
+  public static final boolean USE_NORM = true;
+  public static final boolean USE_TEXT = false;
+
+  private ImmModeSink immModeSink=null;
+
+  public GLUquadricImpl(GL gl, boolean useGLSL) {
+    this.gl=gl;
+    this.useGLSL = useGLSL;
+    drawStyle = GLU.GLU_FILL;
+    orientation = GLU.GLU_OUTSIDE;
+    textureFlag = false;
+    normals = GLU.GLU_SMOOTH;
+    normalType = gl.isGLES1()?GL.GL_BYTE:GL.GL_FLOAT;
+    immModeSinkImmediate=true;
+    immModeSinkEnabled=!gl.isGL2();
+    replaceImmModeSink();
+  }
+
+  public void enableImmModeSink(boolean val) {
+    if(gl.isGL2()) {
+        immModeSinkEnabled=val;
+    } else {
+        immModeSinkEnabled=true;
+    }
+    if(null==immModeSink && immModeSinkEnabled) {
+      replaceImmModeSink();
+    }
+  }
+
+  public boolean isImmModeSinkEnabled() {
+    return immModeSinkEnabled;
+  }
+
+  public void setImmMode(boolean val) {
+    if(immModeSinkEnabled) {
+        immModeSinkImmediate=val;
+    } else {
+        immModeSinkImmediate=true;
+    }
+  }
+
+  public boolean getImmMode() {
+    return immModeSinkImmediate;
+  }
+
+  public ImmModeSink replaceImmModeSink() {
+    if(!immModeSinkEnabled) return null;
+
+    ImmModeSink res = immModeSink;
+    if(useGLSL) {
+        immModeSink = ImmModeSink.createGLSL (gl, GL.GL_STATIC_DRAW, 32, 
+                                              3, GL.GL_FLOAT,  // vertex
+                                              0, GL.GL_FLOAT,  // color
+                                              USE_NORM?3:0, normalType,// normal
+                                              USE_TEXT?2:0, GL.GL_FLOAT); // texture
+    } else {
+        immModeSink = ImmModeSink.createFixed(gl, GL.GL_STATIC_DRAW, 32, 
+                                              3, GL.GL_FLOAT,  // vertex
+                                              0, GL.GL_FLOAT,  // color
+                                              USE_NORM?3:0, normalType,// normal
+                                              USE_TEXT?2:0, GL.GL_FLOAT); // texture
+    }
+    return res;
+  }
+
+  public void resetImmModeSink(GL gl) {
+    if(immModeSinkEnabled) {
+        immModeSink.reset(gl);
+    }
+  }
+
+  /**
+   * specifies the draw style for quadrics.  
+   *
+   * The legal values are as follows:
+   *
+   * GLU.FILL:       Quadrics are rendered with polygon primitives. The polygons
+   *                 are drawn in a counterclockwise fashion with respect to
+   *                 their normals (as defined with glu.quadricOrientation).
+   *
+   * GLU.LINE:       Quadrics are rendered as a set of lines.
+   *
+   * GLU.SILHOUETTE: Quadrics are rendered as a set of lines, except that edges
+   * 		   separating coplanar faces will not be drawn.
+   *
+   * GLU.POINT:       Quadrics are rendered as a set of points.
+   * 
+   * @param drawStyle The drawStyle to set
+   */
+  public void setDrawStyle(int drawStyle) {
+    this.drawStyle = drawStyle;
+  }
+
+  /**
+   * specifies what kind	of normals are desired for quadrics.
+   * The legal values	are as follows:
+   *
+   * GLU.NONE:     No normals are generated.
+   *
+   * GLU.FLAT:     One normal is generated for every facet of a quadric.
+   *
+   * GLU.SMOOTH:   One normal is generated for every vertex of a quadric.  This
+   *               is the default.
+   * 
+   * @param normals The normals to set
+   */
+  public void setNormals(int normals) {
+    this.normals = normals;
+  }
+
+  /**
+   * specifies what kind of orientation is desired for.
+   * The orientation	values are as follows:
+   *
+   * GLU.OUTSIDE:  Quadrics are drawn with normals pointing outward.
+   *
+   * GLU.INSIDE:   Normals point inward. The default is GLU.OUTSIDE.
+   *
+   * Note that the interpretation of outward and inward depends on the quadric
+   * being drawn.
+   * 
+   * @param orientation The orientation to set
+   */
+  public void setOrientation(int orientation) {
+    this.orientation = orientation;
+  }
+
+  /**
+   * specifies if texture coordinates should be generated for
+   * quadrics rendered with qobj. If the value of textureCoords is true,
+   * then texture coordinates are generated, and if textureCoords is false,
+   * they are not.. The default is false.
+   *
+   * The manner in which texture coordinates are generated depends upon the
+   * specific quadric rendered.
+   * 
+   * @param textureFlag The textureFlag to set
+   */
+  public void setTextureFlag(boolean textureFlag) {
+    this.textureFlag = textureFlag;
+  }
+
+  /**
+   * Returns the drawStyle.
+   * @return int
+   */
+  public int getDrawStyle() {
+    return drawStyle;
+  }
+
+  /**
+   * Returns the normals.
+   * @return int
+   */
+  public int getNormals() {
+    return normals;
+  }
+
+  /**
+   * Returns the orientation.
+   * @return int
+   */
+  public int getOrientation() {
+    return orientation;
+  }
+
+  /**
+   * Returns the textureFlag.
+   * @return boolean
+   */
+  public boolean getTextureFlag() {
+    return textureFlag;
+  }
+
+
+  /**
+   * draws a cylinder oriented along the z axis. The base of the
+   * cylinder is placed at z = 0, and the top at z=height. Like a sphere, a
+   * cylinder is subdivided around the z axis into slices, and along the z axis
+   * into stacks.
+   *
+   * Note that if topRadius is set to zero, then this routine will generate a
+   * cone.
+   *
+   * If the orientation is set to GLU.OUTSIDE (with glu.quadricOrientation), then
+   * any generated normals point away from the z axis. Otherwise, they point
+   * toward the z axis.
+   *
+   * If texturing is turned on (with glu.quadricTexture), then texture
+   * coordinates are generated so that t ranges linearly from 0.0 at z = 0 to
+   * 1.0 at z = height, and s ranges from 0.0 at the +y axis, to 0.25 at the +x
+   * axis, to 0.5 at the -y axis, to 0.75 at the -x axis, and back to 1.0 at the
+   * +y axis.
+   *
+   * @param baseRadius  Specifies the radius of the cylinder at z = 0.
+   * @param topRadius   Specifies the radius of the cylinder at z = height.
+   * @param height      Specifies the height of the cylinder.
+   * @param slices      Specifies the number of subdivisions around the z axis.
+   * @param stacks      Specifies the number of subdivisions along the z axis.
+   */
+  public void drawCylinder(GL gl, float baseRadius, float topRadius, float height, int slices, int stacks) {
+
+    float da, r, dr, dz;
+    float x, y, z, nz, nsign;
+    int i, j;
+
+    if (orientation == GLU.GLU_INSIDE) {
+      nsign = -1.0f;
+    } else {
+      nsign = 1.0f;
+    }
+
+    da = 2.0f * PI / slices;
+    dr = (topRadius - baseRadius) / stacks;
+    dz = height / stacks;
+    nz = (baseRadius - topRadius) / height;
+    // Z component of normal vectors
+
+    if (drawStyle == GLU.GLU_POINT) {
+      glBegin(gl, GL.GL_POINTS);
+      for (i = 0; i < slices; i++) {
+        x = cos((i * da));
+        y = sin((i * da));
+        normal3f(gl, x * nsign, y * nsign, nz * nsign);
+
+        z = 0.0f;
+        r = baseRadius;
+        for (j = 0; j <= stacks; j++) {
+          glVertex3f(gl, (x * r), (y * r), z);
+          z += dz;
+          r += dr;
+        }
+      }
+      glEnd(gl);
+    } else if (drawStyle == GLU.GLU_LINE || drawStyle == GLU.GLU_SILHOUETTE) {
+      // Draw rings
+      if (drawStyle == GLU.GLU_LINE) {
+        z = 0.0f;
+        r = baseRadius;
+        for (j = 0; j <= stacks; j++) {
+          glBegin(gl, GL.GL_LINE_LOOP);
+          for (i = 0; i < slices; i++) {
+            x = cos((i * da));
+            y = sin((i * da));
+            normal3f(gl, x * nsign, y * nsign, nz * nsign);
+            glVertex3f(gl, (x * r), (y * r), z);
+          }
+          glEnd(gl);
+          z += dz;
+          r += dr;
+        }
+      } else {
+        // draw one ring at each end
+        if (baseRadius != 0.0) {
+          glBegin(gl, GL.GL_LINE_LOOP);
+          for (i = 0; i < slices; i++) {
+            x = cos((i * da));
+            y = sin((i * da));
+            normal3f(gl, x * nsign, y * nsign, nz * nsign);
+            glVertex3f(gl, (x * baseRadius), (y * baseRadius), 0.0f);
+          }
+          glEnd(gl);
+          glBegin(gl, GL.GL_LINE_LOOP);
+          for (i = 0; i < slices; i++) {
+            x = cos((i * da));
+            y = sin((i * da));
+            normal3f(gl, x * nsign, y * nsign, nz * nsign);
+            glVertex3f(gl, (x * topRadius), (y * topRadius), height);
+          }
+          glEnd(gl);
+        }
+      }
+      // draw length lines
+      glBegin(gl, GL.GL_LINES);
+      for (i = 0; i < slices; i++) {
+        x = cos((i * da));
+        y = sin((i * da));
+        normal3f(gl, x * nsign, y * nsign, nz * nsign);
+        glVertex3f(gl, (x * baseRadius), (y * baseRadius), 0.0f);
+        glVertex3f(gl, (x * topRadius), (y * topRadius), (height));
+      }
+      glEnd(gl);
+    } else if (drawStyle == GLU.GLU_FILL) {
+      float ds = 1.0f / slices;
+      float dt = 1.0f / stacks;
+      float t = 0.0f;
+      z = 0.0f;
+      r = baseRadius;
+      for (j = 0; j < stacks; j++) {
+        float s = 0.0f;
+        glBegin(gl, immModeSink.GL_QUAD_STRIP);
+        for (i = 0; i <= slices; i++) {
+          if (i == slices) {
+            x = sin(0.0f);
+            y = cos(0.0f);
+          } else {
+            x = sin((i * da));
+            y = cos((i * da));
+          }
+          if (nsign == 1.0f) {
+            normal3f(gl, (x * nsign), (y * nsign), (nz * nsign));
+            TXTR_COORD(gl, s, t);
+            glVertex3f(gl, (x * r), (y * r), z);
+            normal3f(gl, (x * nsign), (y * nsign), (nz * nsign));
+            TXTR_COORD(gl, s, t + dt);
+            glVertex3f(gl, (x * (r + dr)), (y * (r + dr)), (z + dz));
+          } else {
+            normal3f(gl, x * nsign, y * nsign, nz * nsign);
+            TXTR_COORD(gl, s, t);
+            glVertex3f(gl, (x * r), (y * r), z);
+            normal3f(gl, x * nsign, y * nsign, nz * nsign);
+            TXTR_COORD(gl, s, t + dt);
+            glVertex3f(gl, (x * (r + dr)), (y * (r + dr)), (z + dz));
+          }
+          s += ds;
+        } // for slices
+        glEnd(gl);
+        r += dr;
+        t += dt;
+        z += dz;
+      } // for stacks
+    }
+  }
+
+  /**
+   * renders a disk on the z = 0  plane.  The disk has a radius of
+   * outerRadius, and contains a concentric circular hole with a radius of
+   * innerRadius. If innerRadius is 0, then no hole is generated. The disk is
+   * subdivided around the z axis into slices (like pizza slices), and also
+   * about the z axis into rings (as specified by slices and loops,
+   * respectively).
+   *
+   * With respect to orientation, the +z side of the disk is considered to be
+   * "outside" (see glu.quadricOrientation).  This means that if the orientation
+   * is set to GLU.OUTSIDE, then any normals generated point along the +z axis.
+   * Otherwise, they point along the -z axis.
+   *
+   * If texturing is turned on (with glu.quadricTexture), texture coordinates are
+   * generated linearly such that where r=outerRadius, the value at (r, 0, 0) is
+   * (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5), and at
+   * (0, -r, 0) it is (0.5, 0).
+   */
+  public void drawDisk(GL gl, float innerRadius, float outerRadius, int slices, int loops)
+  {
+    float da, dr;
+
+    /* Normal vectors */
+    if (normals != GLU.GLU_NONE) {
+      if (orientation == GLU.GLU_OUTSIDE) {
+        glNormal3f(gl, 0.0f, 0.0f, +1.0f);
+      }
+      else {
+        glNormal3f(gl, 0.0f, 0.0f, -1.0f);
+      }
+    }
+	
+    da = 2.0f * PI / slices;
+    dr = (outerRadius - innerRadius) /  loops;
+	
+    switch (drawStyle) {
+    case GLU.GLU_FILL:
+      {
+        /* texture of a gluDisk is a cut out of the texture unit square
+         * x, y in [-outerRadius, +outerRadius]; s, t in [0, 1]
+         * (linear mapping)
+         */
+        float dtc = 2.0f * outerRadius;
+        float sa, ca;
+        float r1 = innerRadius;
+        int l;
+        for (l = 0; l < loops; l++) {
+          float r2 = r1 + dr;
+          if (orientation == GLU.GLU_OUTSIDE) {
+            int s;
+            glBegin(gl, immModeSink.GL_QUAD_STRIP);
+            for (s = 0; s <= slices; s++) {
+              float a;
+              if (s == slices)
+                a = 0.0f;
+              else
+                a = s * da;
+              sa = sin(a);
+              ca = cos(a);
+              TXTR_COORD(gl, 0.5f + sa * r2 / dtc, 0.5f + ca * r2 / dtc);
+              glVertex2f(gl, r2 * sa, r2 * ca);
+              TXTR_COORD(gl, 0.5f + sa * r1 / dtc, 0.5f + ca * r1 / dtc);
+              glVertex2f(gl, r1 * sa, r1 * ca);
+            }
+            glEnd(gl);
+          }
+          else {
+            int s;
+            glBegin(gl, immModeSink.GL_QUAD_STRIP);
+            for (s = slices; s >= 0; s--) {
+              float a;
+              if (s == slices)
+                a = 0.0f;
+              else
+                a = s * da;
+              sa = sin(a);
+              ca = cos(a);
+              TXTR_COORD(gl, 0.5f - sa * r2 / dtc, 0.5f + ca * r2 / dtc);
+              glVertex2f(gl, r2 * sa, r2 * ca);
+              TXTR_COORD(gl, 0.5f - sa * r1 / dtc, 0.5f + ca * r1 / dtc);
+              glVertex2f(gl, r1 * sa, r1 * ca);
+            }
+            glEnd(gl);
+          }
+          r1 = r2;
+        }
+        break;
+      }
+    case GLU.GLU_LINE:
+      {
+        int l, s;
+        /* draw loops */
+        for (l = 0; l <= loops; l++) {
+          float r = innerRadius + l * dr;
+          glBegin(gl, GL.GL_LINE_LOOP);
+          for (s = 0; s < slices; s++) {
+            float a = s * da;
+            glVertex2f(gl, r * sin(a), r * cos(a));
+          }
+          glEnd(gl);
+        }
+        /* draw spokes */
+        for (s = 0; s < slices; s++) {
+          float a = s * da;
+          float x = sin(a);
+          float y = cos(a);
+          glBegin(gl, GL.GL_LINE_STRIP);
+          for (l = 0; l <= loops; l++) {
+            float r = innerRadius + l * dr;
+            glVertex2f(gl, r * x, r * y);
+          }
+          glEnd(gl);
+        }
+        break;
+      }
+    case GLU.GLU_POINT:
+      {
+        int s;
+        glBegin(gl, GL.GL_POINTS);
+        for (s = 0; s < slices; s++) {
+          float a = s * da;
+          float x = sin(a);
+          float y = cos(a);
+          int l;
+          for (l = 0; l <= loops; l++) {
+            float r = innerRadius * l * dr;
+            glVertex2f(gl, r * x, r * y);
+          }
+        }
+        glEnd(gl);
+        break;
+      }
+    case GLU.GLU_SILHOUETTE:
+      {
+        if (innerRadius != 0.0) {
+          float a;
+          glBegin(gl, GL.GL_LINE_LOOP);
+          for (a = 0.0f; a < 2.0 * PI; a += da) {
+            float x = innerRadius * sin(a);
+            float y = innerRadius * cos(a);
+            glVertex2f(gl, x, y);
+          }
+          glEnd(gl);
+        }
+        {
+          float a;
+          glBegin(gl, GL.GL_LINE_LOOP);
+          for (a = 0; a < 2.0f * PI; a += da) {
+            float x = outerRadius * sin(a);
+            float y = outerRadius * cos(a);
+            glVertex2f(gl, x, y);
+          }
+          glEnd(gl);
+        }
+        break;
+      }
+    default:
+      return;
+    }
+  }
+
+  /**
+   * renders a partial disk on the z=0 plane. A partial disk is similar to a
+   * full disk, except that only the subset of the disk from startAngle
+   * through startAngle + sweepAngle is included (where 0 degrees is along
+   * the +y axis, 90 degrees along the +x axis, 180 along the -y axis, and
+   * 270 along the -x axis).
+   * 
+   * The partial disk has a radius of outerRadius, and contains a concentric
+   * circular hole with a radius of innerRadius. If innerRadius is zero, then
+   * no hole is generated. The partial disk is subdivided around the z axis
+   * into slices (like pizza slices), and also about the z axis into rings
+   * (as specified by slices and loops, respectively).
+   * 
+   * With respect to orientation, the +z side of the partial disk is
+   * considered to be outside (see gluQuadricOrientation). This means that if
+   * the orientation is set to GLU.GLU_OUTSIDE, then any normals generated point
+   * along the +z axis. Otherwise, they point along the -z axis.
+   * 
+   * If texturing is turned on (with gluQuadricTexture), texture coordinates
+   * are generated linearly such that where r=outerRadius, the value at (r, 0, 0)
+   * is (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5),
+   * and at (0, -r, 0) it is (0.5, 0).
+   */
+  public void drawPartialDisk(GL gl,
+                              float innerRadius,
+                              float outerRadius,
+                              int slices,
+                              int loops,
+                              float startAngle,
+                              float sweepAngle) {
+    int i, j, max;
+    float[] sinCache = new float[CACHE_SIZE];
+    float[] cosCache = new float[CACHE_SIZE];
+    float angle;
+    float x, y;
+    float sintemp, costemp;
+    float deltaRadius;
+    float radiusLow, radiusHigh;
+    float texLow = 0, texHigh = 0;
+    float angleOffset;
+    int slices2;
+    int finish;
+
+    if (slices >= CACHE_SIZE)
+      slices = CACHE_SIZE - 1;
+    if (slices < 2
+        || loops < 1
+        || outerRadius <= 0.0f
+        || innerRadius < 0.0f
+        || innerRadius > outerRadius) {
+      //gluQuadricError(qobj, GLU.GLU_INVALID_VALUE);
+      System.err.println("PartialDisk: GLU_INVALID_VALUE");
+      return;
+    }
+
+    if (sweepAngle < -360.0f)
+      sweepAngle = 360.0f;
+    if (sweepAngle > 360.0f)
+      sweepAngle = 360.0f;
+    if (sweepAngle < 0) {
+      startAngle += sweepAngle;
+      sweepAngle = -sweepAngle;
+    }
+
+    if (sweepAngle == 360.0f) {
+      slices2 = slices;
+    } else {
+      slices2 = slices + 1;
+    }
+
+    /* Compute length (needed for normal calculations) */
+    deltaRadius = outerRadius - innerRadius;
+
+    /* Cache is the vertex locations cache */
+
+    angleOffset = startAngle / 180.0f * PI;
+    for (i = 0; i <= slices; i++) {
+      angle = angleOffset + ((PI * sweepAngle) / 180.0f) * i / slices;
+      sinCache[i] = sin(angle);
+      cosCache[i] = cos(angle);
+    }
+
+    if (sweepAngle == 360.0f) {
+      sinCache[slices] = sinCache[0];
+      cosCache[slices] = cosCache[0];
+    }
+
+    switch (normals) {
+    case GLU.GLU_FLAT :
+    case GLU.GLU_SMOOTH :
+      if (orientation == GLU.GLU_OUTSIDE) {
+        glNormal3f(gl, 0.0f, 0.0f, 1.0f);
+      } else {
+        glNormal3f(gl, 0.0f, 0.0f, -1.0f);
+      }
+      break;
+    default :
+    case GLU.GLU_NONE :
+      break;
+    }
+
+    switch (drawStyle) {
+    case GLU.GLU_FILL :
+      if (innerRadius == .0f) {
+        finish = loops - 1;
+        /* Triangle strip for inner polygons */
+        glBegin(gl, GL.GL_TRIANGLE_FAN);
+        if (textureFlag) {
+          glTexCoord2f(gl, 0.5f, 0.5f);
+        }
+        glVertex3f(gl, 0.0f, 0.0f, 0.0f);
+        radiusLow = outerRadius - deltaRadius * ((float) (loops - 1) / loops);
+        if (textureFlag) {
+          texLow = radiusLow / outerRadius / 2;
+        }
+
+        if (orientation == GLU.GLU_OUTSIDE) {
+          for (i = slices; i >= 0; i--) {
+            if (textureFlag) {
+              glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+                              texLow * cosCache[i] + 0.5f);
+            }
+            glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+          }
+        } else {
+          for (i = 0; i <= slices; i++) {
+            if (textureFlag) {
+              glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+                              texLow * cosCache[i] + 0.5f);
+            }
+            glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+          }
+        }
+        glEnd(gl);
+      } else {
+        finish = loops;
+      }
+      for (j = 0; j < finish; j++) {
+        radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+        radiusHigh = outerRadius - deltaRadius * ((float) (j + 1) / loops);
+        if (textureFlag) {
+          texLow = radiusLow / outerRadius / 2;
+          texHigh = radiusHigh / outerRadius / 2;
+        }
+
+        glBegin(gl, immModeSink.GL_QUAD_STRIP);
+        for (i = 0; i <= slices; i++) {
+          if (orientation == GLU.GLU_OUTSIDE) {
+            if (textureFlag) {
+              glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+                              texLow * cosCache[i] + 0.5f);
+            }
+            glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+
+            if (textureFlag) {
+              glTexCoord2f(gl, texHigh * sinCache[i] + 0.5f,
+                              texHigh * cosCache[i] + 0.5f);
+            }
+            glVertex3f(gl, radiusHigh * sinCache[i],
+                          radiusHigh * cosCache[i],
+                          0.0f);
+          } else {
+            if (textureFlag) {
+              glTexCoord2f(gl, texHigh * sinCache[i] + 0.5f,
+                              texHigh * cosCache[i] + 0.5f);
+            }
+            glVertex3f(gl, radiusHigh * sinCache[i],
+                          radiusHigh * cosCache[i],
+                          0.0f);
+
+            if (textureFlag) {
+              glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+                              texLow * cosCache[i] + 0.5f);
+            }
+            glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+          }
+        }
+        glEnd(gl);
+      }
+      break;
+    case GLU.GLU_POINT :
+      glBegin(gl, GL.GL_POINTS);
+      for (i = 0; i < slices2; i++) {
+        sintemp = sinCache[i];
+        costemp = cosCache[i];
+        for (j = 0; j <= loops; j++) {
+          radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+
+          if (textureFlag) {
+            texLow = radiusLow / outerRadius / 2;
+
+            glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+                            texLow * cosCache[i] + 0.5f);
+          }
+          glVertex3f(gl, radiusLow * sintemp, radiusLow * costemp, 0.0f);
+        }
+      }
+      glEnd(gl);
+      break;
+    case GLU.GLU_LINE :
+      if (innerRadius == outerRadius) {
+        glBegin(gl, GL.GL_LINE_STRIP);
+
+        for (i = 0; i <= slices; i++) {
+          if (textureFlag) {
+            glTexCoord2f(gl, sinCache[i] / 2 + 0.5f, cosCache[i] / 2 + 0.5f);
+          }
+          glVertex3f(gl, innerRadius * sinCache[i], innerRadius * cosCache[i], 0.0f);
+        }
+        glEnd(gl);
+        break;
+      }
+      for (j = 0; j <= loops; j++) {
+        radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+        if (textureFlag) {
+          texLow = radiusLow / outerRadius / 2;
+        }
+
+        glBegin(gl, GL.GL_LINE_STRIP);
+        for (i = 0; i <= slices; i++) {
+          if (textureFlag) {
+            glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+                            texLow * cosCache[i] + 0.5f);
+          }
+          glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+        }
+        glEnd(gl);
+      }
+      for (i = 0; i < slices2; i++) {
+        sintemp = sinCache[i];
+        costemp = cosCache[i];
+        glBegin(gl, GL.GL_LINE_STRIP);
+        for (j = 0; j <= loops; j++) {
+          radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+          if (textureFlag) {
+            texLow = radiusLow / outerRadius / 2;
+          }
+
+          if (textureFlag) {
+            glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+                            texLow * cosCache[i] + 0.5f);
+          }
+          glVertex3f(gl, radiusLow * sintemp, radiusLow * costemp, 0.0f);
+        }
+        glEnd(gl);
+      }
+      break;
+    case GLU.GLU_SILHOUETTE :
+      if (sweepAngle < 360.0f) {
+        for (i = 0; i <= slices; i += slices) {
+          sintemp = sinCache[i];
+          costemp = cosCache[i];
+          glBegin(gl, GL.GL_LINE_STRIP);
+          for (j = 0; j <= loops; j++) {
+            radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+
+            if (textureFlag) {
+              texLow = radiusLow / outerRadius / 2;
+              glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+                              texLow * cosCache[i] + 0.5f);
+            }
+            glVertex3f(gl, radiusLow * sintemp, radiusLow * costemp, 0.0f);
+          }
+          glEnd(gl);
+        }
+      }
+      for (j = 0; j <= loops; j += loops) {
+        radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+        if (textureFlag) {
+          texLow = radiusLow / outerRadius / 2;
+        }
+
+        glBegin(gl, GL.GL_LINE_STRIP);
+        for (i = 0; i <= slices; i++) {
+          if (textureFlag) {
+            glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+                            texLow * cosCache[i] + 0.5f);
+          }
+          glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+        }
+        glEnd(gl);
+        if (innerRadius == outerRadius)
+          break;
+      }
+      break;
+    default :
+      break;
+    }
+  }
+
+  /**
+   * draws a sphere of the given	radius centered	around the origin.
+   * The sphere is subdivided around the z axis into slices and along the z axis
+   * into stacks (similar to lines of longitude and latitude).
+   *
+   * If the orientation is set to GLU.OUTSIDE (with glu.quadricOrientation), then
+   * any normals generated point away from the center of the sphere. Otherwise,
+   * they point toward the center of the sphere.
+
+   * If texturing is turned on (with glu.quadricTexture), then texture
+   * coordinates are generated so that t ranges from 0.0 at z=-radius to 1.0 at
+   * z=radius (t increases linearly along longitudinal lines), and s ranges from
+   * 0.0 at the +y axis, to 0.25 at the +x axis, to 0.5 at the -y axis, to 0.75
+   * at the -x axis, and back to 1.0 at the +y axis.
+   */
+  public void drawSphere(GL gl, float radius, int slices, int stacks) {
+    // TODO
+
+    float rho, drho, theta, dtheta;
+    float x, y, z;
+    float s, t, ds, dt;
+    int i, j, imin, imax;
+    boolean normals;
+    float nsign;
+
+    normals = (this.normals != GLU.GLU_NONE);
+
+    if (orientation == GLU.GLU_INSIDE) {
+      nsign = -1.0f;
+    } else {
+      nsign = 1.0f;
+    }
+
+    drho = PI / stacks;
+    dtheta = 2.0f * PI / slices;
+
+    if (drawStyle == GLU.GLU_FILL) {
+      if (!textureFlag) {
+        // draw +Z end as a triangle fan
+        glBegin(gl, GL.GL_TRIANGLE_FAN);
+        glNormal3f(gl, 0.0f, 0.0f, 1.0f);
+        glVertex3f(gl, 0.0f, 0.0f, nsign * radius);
+        for (j = 0; j <= slices; j++) {
+          theta = (j == slices) ? 0.0f : j * dtheta;
+          x = -sin(theta) * sin(drho);
+          y = cos(theta) * sin(drho);
+          z = nsign * cos(drho);
+          if (normals) {
+            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+          }
+          glVertex3f(gl, x * radius, y * radius, z * radius);
+        }
+        glEnd(gl);
+      }
+
+      ds = 1.0f / slices;
+      dt = 1.0f / stacks;
+      t = 1.0f; // because loop now runs from 0
+      if (textureFlag) {
+        imin = 0;
+        imax = stacks;
+      } else {
+        imin = 1;
+        imax = stacks - 1;
+      }
+
+      // draw intermediate stacks as quad strips
+      for (i = imin; i < imax; i++) {
+        rho = i * drho;
+        glBegin(gl, immModeSink.GL_QUAD_STRIP);
+        s = 0.0f;
+        for (j = 0; j <= slices; j++) {
+          theta = (j == slices) ? 0.0f : j * dtheta;
+          x = -sin(theta) * sin(rho);
+          y = cos(theta) * sin(rho);
+          z = nsign * cos(rho);
+          if (normals) {
+            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+          }
+          TXTR_COORD(gl, s, t);
+          glVertex3f(gl, x * radius, y * radius, z * radius);
+          x = -sin(theta) * sin(rho + drho);
+          y = cos(theta) * sin(rho + drho);
+          z = nsign * cos(rho + drho);
+          if (normals) {
+            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+          }
+          TXTR_COORD(gl, s, t - dt);
+          s += ds;
+          glVertex3f(gl, x * radius, y * radius, z * radius);
+        }
+        glEnd(gl);
+        t -= dt;
+      }
+
+      if (!textureFlag) {
+        // draw -Z end as a triangle fan
+        glBegin(gl, GL.GL_TRIANGLE_FAN);
+        glNormal3f(gl, 0.0f, 0.0f, -1.0f);
+        glVertex3f(gl, 0.0f, 0.0f, -radius * nsign);
+        rho = PI - drho;
+        s = 1.0f;
+        for (j = slices; j >= 0; j--) {
+          theta = (j == slices) ? 0.0f : j * dtheta;
+          x = -sin(theta) * sin(rho);
+          y = cos(theta) * sin(rho);
+          z = nsign * cos(rho);
+          if (normals)
+            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+          s -= ds;
+          glVertex3f(gl, x * radius, y * radius, z * radius);
+        }
+        glEnd(gl);
+      }
+    } else if (
+               drawStyle == GLU.GLU_LINE
+               || drawStyle == GLU.GLU_SILHOUETTE) {
+      // draw stack lines
+      for (i = 1;
+           i < stacks;
+           i++) { // stack line at i==stacks-1 was missing here
+        rho = i * drho;
+        glBegin(gl, GL.GL_LINE_LOOP);
+        for (j = 0; j < slices; j++) {
+          theta = j * dtheta;
+          x = cos(theta) * sin(rho);
+          y = sin(theta) * sin(rho);
+          z = cos(rho);
+          if (normals)
+            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+          glVertex3f(gl, x * radius, y * radius, z * radius);
+        }
+        glEnd(gl);
+      }
+      // draw slice lines
+      for (j = 0; j < slices; j++) {
+        theta = j * dtheta;
+        glBegin(gl, GL.GL_LINE_STRIP);
+        for (i = 0; i <= stacks; i++) {
+          rho = i * drho;
+          x = cos(theta) * sin(rho);
+          y = sin(theta) * sin(rho);
+          z = cos(rho);
+          if (normals)
+            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+          glVertex3f(gl, x * radius, y * radius, z * radius);
+        }
+        glEnd(gl);
+      }
+    } else if (drawStyle == GLU.GLU_POINT) {
+      // top and bottom-most points
+      glBegin(gl, GL.GL_POINTS);
+      if (normals)
+        glNormal3f(gl, 0.0f, 0.0f, nsign);
+      glVertex3f(gl, 0.0f, 0.0f, radius);
+      if (normals)
+        glNormal3f(gl, 0.0f, 0.0f, -nsign);
+      glVertex3f(gl, 0.0f, 0.0f, -radius);
+
+      // loop over stacks
+      for (i = 1; i < stacks - 1; i++) {
+        rho = i * drho;
+        for (j = 0; j < slices; j++) {
+          theta = j * dtheta;
+          x = cos(theta) * sin(rho);
+          y = sin(theta) * sin(rho);
+          z = cos(rho);
+          if (normals)
+            glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+          glVertex3f(gl, x * radius, y * radius, z * radius);
+        }
+      }
+      glEnd(gl);
+    }
+  }
+
+
+  //----------------------------------------------------------------------
+  // Internals only below this point
+  //
+
+  private static final float PI = (float)Math.PI;
+  private static final int CACHE_SIZE = 240;
+
+  private final void glBegin(GL gl, int mode) {
+      if(immModeSinkEnabled) {
+          immModeSink.glBegin(mode);
+      } else {
+          gl.getGL2().glBegin(mode);
+      }
+  }
+
+  private final void glEnd(GL gl) {
+      if(immModeSinkEnabled) {
+          immModeSink.glEnd(gl, immModeSinkImmediate);
+      } else {
+          gl.getGL2().glEnd();
+      }
+  }
+
+  private final void glVertex2f(GL gl, float x, float y) {
+      if(immModeSinkEnabled) {
+          immModeSink.glVertex2f(x, y);
+      } else {
+          gl.getGL2().glVertex2f(x, y);
+      }
+  }
+
+  private final void glVertex3f(GL gl, float x, float y, float z) {
+      if(immModeSinkEnabled) {
+          immModeSink.glVertex3f(x, y, z);
+      } else {
+          gl.getGL2().glVertex3f(x, y, z);
+      }
+  }
+
+  private final void glNormal3f_s(GL gl, float x, float y, float z) {
+      short a=(short)(x*0xFFFF);
+      short b=(short)(y*0xFFFF);
+      short c=(short)(z*0xFFFF);
+      if(immModeSinkEnabled) {
+          immModeSink.glNormal3s(a, b, c);
+      } else {
+          gl.getGL2().glNormal3s(a, b, c);
+      }
+  }
+
+  private final void glNormal3f_b(GL gl, float x, float y, float z) {
+      byte a=(byte)(x*0xFF);
+      byte b=(byte)(y*0xFF);
+      byte c=(byte)(z*0xFF);
+      if(immModeSinkEnabled) {
+          immModeSink.glNormal3b(a, b, c);
+      } else {
+          gl.getGL2().glNormal3b(a, b, c);
+      }
+  }
+
+  private final void glNormal3f(GL gl, float x, float y, float z) {
+    switch(normalType) {
+        case GL.GL_FLOAT:
+            if(immModeSinkEnabled) {
+                immModeSink.glNormal3f(x,y,z);
+            } else {
+                gl.getGL2().glNormal3f(x,y,z);
+            }
+            break;
+        case GL.GL_SHORT:
+            glNormal3f_s(gl, x, y, z);
+            break;
+        case GL.GL_BYTE:
+            glNormal3f_b(gl, x, y, z);
+            break;
+    }
+  }
+
+  private final void glTexCoord2f(GL gl, float x, float y) {
+      if(immModeSinkEnabled) {
+          immModeSink.glTexCoord2f(x, y);
+      } else {
+          gl.getGL2().glTexCoord2f(x, y);
+      }
+  }
+
+  /**
+   * Call glNormal3f after scaling normal to unit length.
+   *
+   * @param x
+   * @param y
+   * @param z
+   */
+  private void normal3f(GL gl, float x, float y, float z) {
+    float mag;
+	
+    mag = (float)Math.sqrt(x * x + y * y + z * z);
+    if (mag > 0.00001F) {
+      x /= mag;
+      y /= mag;
+      z /= mag;
+    }
+    glNormal3f(gl, x, y, z);
+  }
+
+  private final void TXTR_COORD(GL gl, float x, float y) {
+    if (textureFlag) glTexCoord2f(gl, x,y);
+  }
+
+  private float sin(float r) {
+    return (float)Math.sin(r);
+  }
+
+  private float cos(float r) {
+    return (float)Math.cos(r);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/Glue.java b/src/jogl/classes/jogamp/opengl/glu/Glue.java
new file mode 100644
index 0000000..636d17f
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/Glue.java
@@ -0,0 +1,114 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu;
+
+/**
+ *
+ * @author  Administrator
+ */
+public class Glue {
+  private static String[] __gluNurbsErrors = {
+    " ",
+    "spline order un-supported",
+    "too few knots",
+    "valid knot range is empty",
+    "decreasing knot sequence knot",
+    "knot multiplicity greater than order of spline",
+    "gluEndCurve() must follow gluBeginCurve()",
+    "gluBeginCurve() must precede gluEndCurve()",
+    "missing or extra geometric data",
+    "can't draw piecewise linear trimming curves",
+    "missing or extra domain data",
+    "missing or extra domain data",
+    "gluEndTrim() must precede gluEndSurface()",
+    "gluBeginSurface() must precede gluEndSurface()",
+    "curve of improper type passed as trim curve",
+    "gluBeginSurface() must precede gluBeginTrim()",
+    "gluEndTrim() must follow gluBeginTrim()",
+    "gluBeginTrim() must follow gluEndTrim()",
+    "invalid or missing trim curve",
+    "gluBeginTrim() must precede gluPwlCurve()",
+    "piecewise linear trimming curve referenced twice",
+    "piecewise linear trimming curve and nurbs curve mixed",
+    "improper usage of trim data type",
+    "nurbs curve referenced twice",
+    "nurbs curve and piecewise linear trimming curve mixed",
+    "nurbs surface referenced twice",
+    "invalid property",
+    "gluEndSurface() must follow gluBeginSurface()",
+    "intersecting or misoriented trim curve",
+    "intersecting trim curves",
+    "UNUSED",
+    "inconnected trim curves",
+    "unknown knot error",
+    "negative vertex count encountered",
+    "negative byte-stride encountered",
+    "unknown type descriptor",
+    "null control point reference",
+    "duplicate point on piecewise linear trimming curve"
+  } ;
+  
+  /** Creates a new instance of Glue */
+  public Glue() {
+  }
+  
+  public static String __gluNURBSErrorString( int errno ) {
+    return( __gluNurbsErrors[ errno ] );
+  }
+  
+  private static String[] __gluTessErrors = {
+    " ",
+    "gluTessBeginPolygon() must precede a gluTessEndPolygon",
+    "gluTessBeginContour() must precede a gluTessEndContour()",
+    "gluTessEndPolygon() must follow a gluTessBeginPolygon()",
+    "gluTessEndContour() must follow a gluTessBeginContour()",
+    "a coordinate is too large",
+    "need combine callback"
+  };
+  
+  public static String __gluTessErrorString( int errno ) {
+    return( __gluTessErrors[ errno ] );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/error/Error.java b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
new file mode 100644
index 0000000..2f49db9
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
@@ -0,0 +1,100 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ * 
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.error;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.glu.GLU;
+import jogamp.opengl.glu.Glue;
+
+/**
+ *
+ * @author  Administrator
+ */
+public class Error {
+  
+  private static String[] glErrorStrings = {
+    "invalid enumerant",
+    "invalid value",
+    "invalid operation",
+    "stack overflow",
+    "stack underflow",
+    "out of memory",
+    "invalid framebuffer operation"
+  };
+  
+  private static String[] gluErrorStrings = {
+    "invalid enumerant",
+    "invalid value",
+    "out of memory",
+    "",
+    "invalid operation"
+  };
+  
+  /** Creates a new instance of Error */
+  public Error() {
+  }
+  
+  public static String gluErrorString( int errorCode ) {
+    if( errorCode == 0 ) {
+      return( "no error" );
+    }
+    if( (errorCode >= GL.GL_INVALID_ENUM) && (errorCode <= GL.GL_INVALID_FRAMEBUFFER_OPERATION) ) {
+      return( glErrorStrings[ errorCode - GL.GL_INVALID_ENUM ] );
+    }
+    if( errorCode == 0x8031 /* GL.GL_TABLE_TOO_LARGE */ ) {
+      return( "table too large" );
+    }
+    if( (errorCode >= GLU.GLU_INVALID_ENUM) && (errorCode <= GLU.GLU_INVALID_OPERATION) ) {
+      return( gluErrorStrings[ errorCode - GLU.GLU_INVALID_ENUM ] );
+    }
+//    if( (errorCode >= GLU.GLU_NURBS_ERROR1) && (errorCode <= GLU.GLU_NURBS_ERROR37) ) {
+//      return( gluErrorStrings[ errorCode - (GLU.GLU_NURBS_ERROR1 - 1) ] );
+//    }
+    if( (errorCode >= GLU.GLU_TESS_ERROR1) && (errorCode <= GLU.GLU_TESS_ERROR8) ) {
+        return( Glue.__gluTessErrorString(errorCode - (GLU.GLU_TESS_ERROR1 - 1)) );
+    }
+    return( "error ("+errorCode+")" );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2Backend.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2Backend.java
new file mode 100644
index 0000000..2cc5e06
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2Backend.java
@@ -0,0 +1,49 @@
+package jogamp.opengl.glu.gl2.nurbs;
+import jogamp.opengl.glu.nurbs.*;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class responsible for rendering
+ * @author Tomas Hrasky
+ *
+ */
+public class GL2Backend extends Backend {
+  public GL2Backend() {
+    super();
+    curveEvaluator = new GL2CurveEvaluator();
+    surfaceEvaluator = new GL2SurfaceEvaluator();
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
new file mode 100644
index 0000000..043edac
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
@@ -0,0 +1,205 @@
+package jogamp.opengl.glu.gl2.nurbs;
+import jogamp.opengl.glu.nurbs.*;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.glu.GLU;
+import javax.media.opengl.glu.gl2.GLUgl2;
+
+/**
+ * Class rendering curves with OpenGL
+ * @author Tomáš Hráský
+ *
+ */
+class GL2CurveEvaluator implements CurveEvaluator {
+
+  /**
+   * Output triangles (for callback) or render curve 
+   */
+  private boolean output_triangles;
+
+  /**
+   * OpenGL object
+   */
+  private GL2 gl;
+
+  /**
+   * Not used
+   */
+  private int vertex_flag;
+
+  /**
+   * Not used
+   */
+  private int normal_flag;
+
+  /**
+   * Not used
+   */
+  private int color_flag;
+
+  /**
+   * Not used
+   */
+  private int texcoord_flag;
+
+  /**
+   * Number of bezier arc - used for color distinguishing of arcs forming NURBS curve
+   */
+  private int poradi;
+
+  /**
+   * Makes new Evaluator
+   */
+  public GL2CurveEvaluator() {
+    gl = GLUgl2.getCurrentGL2();
+  }
+
+  /**
+   * Pushes eval bit
+   */
+  public void bgnmap1f() {
+    // DONE
+    if (output_triangles) {
+      vertex_flag = 0;
+      normal_flag = 0;
+      color_flag = 0;
+      texcoord_flag = 0;
+    } else {
+      gl.glPushAttrib(GL2.GL_EVAL_BIT);
+    }
+
+  }
+
+  /**
+   * Pops all OpenGL attributes
+   */
+  public void endmap1f() {
+    // DONE
+    if (output_triangles) {
+
+    } else {
+      gl.glPopAttrib();
+    }
+
+  }
+
+  /**
+   * Initializes opengl evaluator
+   * @param type curve type
+   * @param ulo lowest u
+   * @param uhi highest u
+   * @param stride control point coords
+   * @param order curve order
+   * @param ps control points
+   */
+  public void map1f(int type, float ulo, float uhi, int stride, int order,
+                    CArrayOfFloats ps) {
+    if (output_triangles) {
+      // TODO code for callback (output_triangles probably indicates callback)
+      //				System.out.println("TODO curveevaluator.map1f-output_triangles");
+    } else {
+      gl.glMap1f(type, ulo, uhi, stride, order, ps.getArray(), ps
+                 .getPointer());
+
+      // DEBUG - drawing bézier control points
+      // gl.glColor3d(.5,.5,.5);
+      // gl.glPointSize(5);
+      // gl.glBegin(GL2.GL_POINTS);
+      // float[] ctrlpoints=ps.getArray();
+      // for(int i=ps.getPointer();i<ps.getPointer()+order;i++){
+      // gl.glVertex3d(ctrlpoints[i * 4], ctrlpoints[i * 4 + 1],0);
+      // }
+      // gl.glEnd();
+    }
+
+  }
+
+  /**
+   * Calls opengl enable
+   * @param type what to enable
+   */
+  public void enable(int type) {
+    // DONE
+    gl.glEnable(type);
+  }
+
+  /**
+   * Calls glMapGrid1f
+   * @param nu steps
+   * @param u1 low u
+   * @param u2 high u
+   */
+  public void mapgrid1f(int nu, float u1, float u2) {
+    if (output_triangles) {
+      //				System.out.println("TODO curveevaluator.mapgrid1f");
+    } else
+      gl.glMapGrid1f(nu, u1, u2);
+    //			// System.out.println("upravit NU");
+    // gl.glMapGrid1f(50,u1,u2);
+  }
+
+  /**
+   * Evaluates a curve using glEvalMesh1f
+   * @param style Backend.N_MESHFILL/N_MESHLINE/N_MESHPOINT
+   * @param from lowest param
+   * @param to highest param
+   */
+  public void mapmesh1f(int style, int from, int to) {
+    /* //DEBUG drawing control points
+       this.poradi++;
+       if (poradi % 2 == 0)
+       gl.glColor3f(1, 0, 0);
+       else
+       gl.glColor3f(0, 1, 0);
+    */
+    if (output_triangles) {
+      // TODO code for callback
+      //			System.out.println("TODO openglcurveevaluator.mapmesh1f output_triangles");
+    } else {
+      switch (style) {
+      case Backend.N_MESHFILL:
+      case Backend.N_MESHLINE:
+        gl.glEvalMesh1(GL2.GL_LINE, from, to);
+        break;
+      case Backend.N_MESHPOINT:
+        gl.glEvalMesh1(GL2.GL_POINT, from, to);
+        break;
+      }
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
new file mode 100644
index 0000000..bc63994
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
@@ -0,0 +1,217 @@
+package jogamp.opengl.glu.gl2.nurbs;
+import jogamp.opengl.glu.nurbs.*;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.glu.GLU;
+import javax.media.opengl.glu.gl2.GLUgl2;
+
+/**
+ * Class rendering surfaces with OpenGL
+ * @author Tomas Hrasky
+ *
+ */
+class GL2SurfaceEvaluator implements SurfaceEvaluator {
+
+  /**
+   * JOGL OpenGL object
+   */
+  private GL2 gl;
+
+  /**
+   * Output triangles (callback)
+   */
+  private boolean output_triangles;
+
+  /**
+   * Number of patch - used for distinguishing bezier plates forming NURBS surface with different colors
+   */
+  private int poradi;
+
+  /**
+   * Creates new evaluator
+   */
+  public GL2SurfaceEvaluator() {
+    gl = GLUgl2.getCurrentGL2();
+  }
+
+  /**
+   * Pushes eval bit
+   */
+  public void bgnmap2f() {
+
+    if (output_triangles) {
+      // TODO outp triangles surfaceevaluator bgnmap2f
+      //			System.out.println("TODO surfaceevaluator.bgnmap2f output triangles");
+    } else {
+      gl.glPushAttrib(GL2.GL_EVAL_BIT);
+      //				System.out.println("TODO surfaceevaluator.bgnmap2f glgetintegerv");
+    }
+
+  }
+
+  /**
+   * Sets  glPolygonMode
+   * @param style polygon mode (N_MESHFILL/N_MESHLINE/N_MESHPOINT)
+   */
+  public void polymode(int style) {
+    if (!output_triangles) {
+      switch (style) {
+      default:
+      case NurbsConsts.N_MESHFILL:
+        gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
+        break;
+      case NurbsConsts.N_MESHLINE:
+        gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
+        break;
+      case NurbsConsts.N_MESHPOINT:
+        gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_POINT);
+        break;
+      }
+    }
+
+  }
+
+  /**
+   * Pops all attributes
+   */
+  public void endmap2f() {
+    // TODO Auto-generated method stub
+    if (output_triangles) {
+      //			System.out.println("TODO surfaceevaluator.endmap2f output triangles");
+    } else {
+      gl.glPopAttrib();
+      // TODO use LOD
+    }
+  }
+
+  /**
+   * Empty method
+   * @param ulo
+   * @param uhi
+   * @param vlo
+   * @param vhi
+   */
+  public void domain2f(float ulo, float uhi, float vlo, float vhi) {
+    // DONE
+  }
+
+  /**
+   * Defines 2D mesh
+   * @param nu number of steps in u direction
+   * @param u0 lowest u
+   * @param u1 highest u
+   * @param nv number of steps in v direction
+   * @param v0 lowest v
+   * @param v1 highest v
+   */
+  public void mapgrid2f(int nu, float u0, float u1, int nv, float v0, float v1) {
+
+    if (output_triangles) {
+      //			System.out.println("TODO openglsurfaceavaluator.mapgrid2f output_triangles");
+    } else {
+      gl.glMapGrid2d(nu, u0, u1, nv, v0, v1);
+    }
+
+  }
+
+  /**
+   * Evaluates surface
+   * @param style surface style
+   * @param umin minimum U
+   * @param umax maximum U
+   * @param vmin minimum V
+   * @param vmax maximum V
+   */
+  public void mapmesh2f(int style, int umin, int umax, int vmin, int vmax) {
+    if (output_triangles) {
+      //			System.out.println("TODO openglsurfaceavaluator.mapmesh2f output_triangles");
+    } else {
+      /* //DEBUG - draw control points
+         this.poradi++;
+         if (poradi % 2 == 0)
+         gl.glColor3f(1, 0, 0);
+         else if (poradi % 2 == 1)
+         gl.glColor3f(0, 1, 0);
+      */
+      switch (style) {
+      case NurbsConsts.N_MESHFILL:
+        gl.glEvalMesh2(GL2.GL_FILL, umin, umax, vmin, vmax);
+        break;
+      case NurbsConsts.N_MESHLINE:
+        gl.glEvalMesh2(GL2.GL_LINE, umin, umax, vmin, vmax);
+        break;
+      case NurbsConsts.N_MESHPOINT:
+        gl.glEvalMesh2(GL2.GL_POINT, umin, umax, vmin, vmax);
+        break;
+      }
+    }
+  }
+
+  /**
+   * Initializes evaluator
+   * @param type surface type
+   * @param ulo lowest u
+   * @param uhi highest u
+   * @param ustride number of objects between control points in u direction
+   * @param uorder surface order in u direction
+   * @param vlo lowest v
+   * @param vhi highest v
+   * @param vstride number of control points' coords
+   * @param vorder surface order in v direction
+   * @param pts control points
+   */
+  public void map2f(int type, float ulo, float uhi, int ustride, int uorder,
+                    float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) {
+    // TODO Auto-generated method stub
+    if (output_triangles) {
+      //			System.out.println("TODO openglsurfaceevaluator.map2f output_triangles");
+    } else {
+      gl.glMap2f(type, ulo, uhi, ustride, uorder, vlo, vhi, vstride,
+                 vorder, pts.getArray(), pts.getPointer());
+    }
+  }
+
+  /**
+   * Calls opengl enable
+   * @param type what to enable
+   */
+  public void enable(int type) {
+    //DONE
+    gl.glEnable(type);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
new file mode 100644
index 0000000..bd0eaf7
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
@@ -0,0 +1,862 @@
+package jogamp.opengl.glu.gl2.nurbs;
+import jogamp.opengl.glu.nurbs.*;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+import java.lang.reflect.Method;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.glu.GLUnurbs;
+
+/**
+ * Base object for working with NURBS curves and surfaces
+ * 
+ * @author Tomas Hrasky
+ * 
+ */
+public class GLUgl2nurbsImpl implements GLUnurbs {
+
+  /**
+   * Curve type - no type
+   */
+  public static final int CT_NONE = 0;
+
+  /**
+   * Curve type - NURBS curve
+   */
+  public static final int CT_NURBSCURVE = 1;
+
+  /**
+   * Curve type - picewise linear curve
+   */
+  public static final int CT_NPWLCURVE = 2;
+
+  /**
+   * Matrixes autoloading
+   */
+  private boolean autoloadmode;
+
+  /**
+   * Using callback
+   */
+  private int callBackFlag;
+
+  /**
+   * Object for error call backs
+   */
+  private Object errorCallback;
+
+  /**
+   * List of map definitions
+   */
+  Maplist maplist;
+
+  /**
+   * Indicates validity of data
+   */
+  private int isDataValid;
+
+  /**
+   * Are we in the middle of curve processing
+   */
+  private int inCurve;
+
+  /**
+   * Current curve
+   */
+  private O_curve currentCurve;
+
+  /**
+   * Are we in trim
+   */
+  private boolean inTrim;
+
+  /**
+   * Are we playbacking curve/surface rendering
+   */
+  private boolean playBack;
+
+  /**
+   * Next curve in linked list
+   */
+  private O_curve nextCurve;
+
+  /**
+   * Is curve modified
+   */
+  private int isCurveModified;
+
+  /**
+   * Object holding rendering settings
+   */
+  private Renderhints renderhints;
+
+  /**
+   * Display list
+   */
+  private DisplayList dl;
+
+  /**
+   * Object for subdividing curves and surfaces
+   */
+  private Subdivider subdivider;
+
+  /**
+   * Object responsible for rendering
+   */
+  private Backend backend;
+
+  /**
+   * Next picewise linear curve in linked list
+   */
+  private O_pwlcurve nextPwlcurve;
+
+  /**
+   * Next trimming NURBS curve in linked list
+   */
+  private O_nurbscurve nextNurbscurve;
+
+  /**
+   * Are we in the middle of surface processing
+   */
+  private int inSurface;
+
+  /**
+   * Are there any changes in trimming
+   */
+  private boolean isTrimModified;
+
+  /**
+   * Are there any changes in surface data
+   */
+  private boolean isDataSurfaceModified;
+
+  /**
+   * Nurber of trmims of processed surface
+   */
+  private int numTrims;
+
+  /**
+   * Current processed surface
+   */
+  private O_surface currentSurface;
+
+  /**
+   * Next trimming curve
+   */
+  private O_trim nextTrim;
+
+  /**
+   * Nextr surface in linked list
+   */
+  private O_nurbssurface nextNurbssurface;
+
+  /**
+   * Are there any changes in surface
+   */
+  private boolean isSurfaceModified;
+
+  /**
+   * Initializes default GLUgl2nurbs object
+   */
+  public GLUgl2nurbsImpl() {
+    // DONE
+    maplist = new Maplist(backend);
+    renderhints = new Renderhints();
+    subdivider = new Subdivider();
+    // original code
+
+    redefineMaps();
+
+    defineMap(GL2.GL_MAP2_NORMAL, 0, 3);
+    defineMap(GL2.GL_MAP1_NORMAL, 0, 3);
+    defineMap(GL2.GL_MAP2_TEXTURE_COORD_1, 0, 1);
+    defineMap(GL2.GL_MAP1_TEXTURE_COORD_1, 0, 1);
+    defineMap(GL2.GL_MAP2_TEXTURE_COORD_2, 0, 2);
+    defineMap(GL2.GL_MAP1_TEXTURE_COORD_2, 0, 2);
+    defineMap(GL2.GL_MAP2_TEXTURE_COORD_3, 0, 3);
+    defineMap(GL2.GL_MAP1_TEXTURE_COORD_3, 0, 3);
+    defineMap(GL2.GL_MAP2_TEXTURE_COORD_4, 1, 4);
+    defineMap(GL2.GL_MAP1_TEXTURE_COORD_4, 1, 4);
+    defineMap(GL2.GL_MAP2_VERTEX_4, 1, 4);
+    defineMap(GL2.GL_MAP1_VERTEX_4, 1, 4);
+    defineMap(GL2.GL_MAP2_VERTEX_3, 0, 3);
+    defineMap(GL2.GL_MAP1_VERTEX_3, 0, 3);
+    defineMap(GL2.GL_MAP2_COLOR_4, 0, 4);
+    defineMap(GL2.GL_MAP1_COLOR_4, 0, 4);
+    defineMap(GL2.GL_MAP2_INDEX, 0, 1);
+    defineMap(GL2.GL_MAP1_INDEX, 0, 1);
+
+    setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
+                     (float) NurbsConsts.N_PATHLENGTH);
+    setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_SAMPLINGMETHOD,
+                     (float) NurbsConsts.N_PATHLENGTH);
+    setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
+                     (float) NurbsConsts.N_PATHLENGTH);
+    setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_SAMPLINGMETHOD,
+                     (float) NurbsConsts.N_PATHLENGTH);
+
+    setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_PIXEL_TOLERANCE,
+                     (float) 50.0);
+    setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_PIXEL_TOLERANCE,
+                     (float) 50.0);
+    setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_PIXEL_TOLERANCE,
+                     (float) 50.0);
+    setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_PIXEL_TOLERANCE,
+                     (float) 50.0);
+
+    setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_ERROR_TOLERANCE,
+                     (float) 0.50);
+    setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_ERROR_TOLERANCE,
+                     (float) 0.50);
+    setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_ERROR_TOLERANCE,
+                     (float) 0.50);
+    setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_ERROR_TOLERANCE,
+                     (float) 0.50);
+
+    setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_S_STEPS,
+                     (float) 100.0);
+    setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_S_STEPS,
+                     (float) 100.0);
+    setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_S_STEPS,
+                     (float) 100.0);
+    setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_S_STEPS,
+                     (float) 100.0);
+
+    setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
+                     NurbsConsts.N_PATHLENGTH);
+
+    set_domain_distance_u_rate(100.0);
+    set_domain_distance_v_rate(100.0);
+    set_is_domain_distance_sampling(0);
+
+    this.autoloadmode = true;
+
+    this.callBackFlag = 0;
+
+    this.errorCallback = null;
+  }
+
+  /**
+   * Sets domain distance for dom.dist. sampling in u direction
+   * 
+   * @param d
+   *            distance
+   */
+  private void set_domain_distance_u_rate(double d) {
+    // DONE
+    subdivider.set_domain_distance_u_rate(d);
+  }
+
+  /**
+   * Sets domain distance for dom.dist. sampling in v direction
+   * 
+   * @param d
+   *            distance
+   */
+  private void set_domain_distance_v_rate(double d) {
+    // DONE
+    subdivider.set_domain_distance_v_rate(d);
+  }
+
+  /**
+   * Begins new NURBS curve
+   */
+  public void bgncurve() {
+    // DONE
+    O_curve o_curve = new O_curve();
+    thread("do_bgncurve", o_curve);
+  }
+
+  /**
+   * Calls a method with given name and passes argumet
+   * 
+   * @param name
+   *            name of a method to be called
+   * @param arg
+   *            parameter to be passed to called method
+   */
+  private void thread(String name, Object arg) {
+    // DONE
+    Class partype[] = new Class[1];
+    partype[0] = arg.getClass();
+    Method m;
+    try {
+      m = this.getClass().getMethod(name, partype);
+      if (dl != null) {
+        dl.append(this, m, arg);
+      } else {
+        m.invoke(this, new Object[] { arg });
+      }
+    } catch (Throwable e) {
+      e.printStackTrace();
+    }
+
+  }
+
+  /**
+   * Calls a method with given name
+   * 
+   * @param name
+   *            name of a method to be called
+   */
+  private void thread2(String name) {
+    // DONE
+    try {
+      Method m = this.getClass().getMethod(name, (Class[]) null);
+      if (dl != null) {
+        dl.append(this, m, null);
+      } else {
+        m.invoke(this, (Object[]) null);
+      }
+    } catch (Throwable e) {
+      e.printStackTrace();
+    }
+  }
+
+  /**
+   * Begins a NURBS curve
+   * 
+   * @param o_curve
+   *            curve object
+   */
+  public void do_bgncurve(O_curve o_curve) {
+    if (inCurve > 0) {
+      do_nurbserror(6);
+      endcurve();
+    }
+    inCurve = 1;
+    currentCurve = o_curve;
+
+    currentCurve.curvetype = CT_NONE;
+
+    if (inTrim) {
+      if (!nextCurve.equals(o_curve)) {
+        isCurveModified = 1;
+        nextCurve = o_curve;
+      }
+    } else {
+      if (!playBack)
+        bgnrender();
+      isDataValid = 1;
+    }
+    nextCurve = o_curve.next;
+    // kind of solution of union
+    nextPwlcurve = o_curve.o_pwlcurve;
+    nextNurbscurve = o_curve.o_nurbscurve;
+  }
+
+  /**
+   * Begins new surface
+   * 
+   * @param o_surface
+   *            surface object
+   */
+  public void do_bgnsurface(O_surface o_surface) {
+    // DONE
+    if (inSurface > 0) {
+      do_nurbserror(27);
+      endsurface();
+    }
+    inSurface = 1;
+    if (!playBack)
+      bgnrender();
+
+    isTrimModified = false;
+    isDataSurfaceModified = false;
+    isDataValid = 1;
+    numTrims = 0;
+    currentSurface = o_surface;
+    nextTrim = o_surface.o_trim;
+    nextNurbssurface = o_surface.o_nurbssurface;
+  }
+
+  /**
+   * End a curve
+   */
+  public void endcurve() {
+    // DONE
+    thread2("do_endcurve");
+  }
+
+  /**
+   * Ends surface
+   */
+  public void do_endsurface() {
+    // DONE
+    if (inTrim) {
+      do_nurbserror(12);
+      endtrim();
+    }
+
+    if (inSurface <= 0) {
+      do_nurbserror(13);
+      return;
+    }
+
+    inSurface = 0;
+
+    nextNurbssurface = null;
+
+    if (isDataValid <= 0) {
+      return;
+    }
+
+    if (nextTrim != null) {
+      isTrimModified = true;
+      nextTrim = null;
+    }
+
+    // TODO errval ??
+    if (numTrims > 0) {
+      //				System.out.println("TODO glunurbs.do_endsurface - numtrims > 0");
+    }
+
+    subdivider.beginQuilts(new GL2Backend());
+    for (O_nurbssurface n = currentSurface.o_nurbssurface; n != null; n = n.next) {
+      subdivider.addQuilt(n.bezier_patches);
+    }
+    subdivider.endQuilts();
+    subdivider.drawSurfaces();
+    if (!playBack)
+      endrender();
+
+  }
+
+  /**
+   * Ends a curve
+   */
+  public void do_endcurve() {
+    // DONE
+    //			// System.out.println("do_endcurve");
+    if (inCurve <= 0) {
+      do_nurbserror(7);
+      return;
+    }
+    inCurve = 0;
+
+    nextCurve = null;
+
+    if (currentCurve.curvetype == CT_NURBSCURVE) {
+      // nextNurbscurve = null;
+      // currentCurve.o_nurbscurve=null;
+    } else {
+      // nextPwlcurve = null;
+      // currentCurve.o_pwlcurve=null;
+    }
+    if (!inTrim) {
+      if (isDataValid <= 0) {
+        return;
+      }
+      // TODO errval?
+      if (currentCurve.curvetype == CT_NURBSCURVE) {
+        subdivider.beginQuilts(new GL2Backend());
+
+        for (O_nurbscurve n = currentCurve.o_nurbscurve; n != null; n = n.next)
+          subdivider.addQuilt(n.bezier_curves);
+
+        subdivider.endQuilts();
+        subdivider.drawCurves();
+        if (!playBack)
+          endrender();
+      } else {
+        if (!playBack)
+          endrender();
+        do_nurbserror(9);
+      }
+    }
+
+  }
+
+  /**
+   * Method for handling error codes
+   * 
+   * @param i
+   *            error code
+   */
+  private void do_nurbserror(int i) {
+    // TODO nurberror
+    //			System.out.println("TODO nurbserror " + i);
+  }
+
+  /**
+   * Begin rendering
+   */
+  private void bgnrender() {
+    // DONE
+    if (autoloadmode) {
+      loadGLMatrices();
+    }
+  }
+
+  /**
+   * Load matrices from OpenGL state machine
+   */
+  private void loadGLMatrices() {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO glunurbs.loadGLMatrices");
+  }
+
+  /**
+   * End rendering
+   */
+  private void endrender() {
+    // DONE
+  }
+
+  /**
+   * Make a NURBS curve
+   * 
+   * @param nknots
+   *            number of knots in knot vector
+   * @param knot
+   *            knot vector
+   * @param stride
+   *            number of control points coordinates
+   * @param ctlarray
+   *            control points
+   * @param order
+   *            order of the curve
+   * @param realType
+   *            type of the curve
+   */
+  public void nurbscurve(int nknots, float[] knot, int stride,
+                         float[] ctlarray, int order, int realType) {
+    // DONE
+    Mapdesc mapdesc = maplist.locate(realType);
+    if (mapdesc == null) {
+      do_nurbserror(35);
+      isDataValid = 0;
+      return;
+    }
+    if (ctlarray == null) {
+      do_nurbserror(36);
+      isDataValid = 0;
+      return;
+    }
+    if (stride < 0) {
+      do_nurbserror(34);
+      isDataValid = 0;
+      return;
+    }
+    Knotvector knots = new Knotvector(nknots, stride, order, knot);
+
+    if (!do_check_knots(knots, "curve"))
+      return;
+
+    O_nurbscurve o_nurbscurve = new O_nurbscurve(realType);
+    o_nurbscurve.bezier_curves = new Quilt(mapdesc);
+    CArrayOfFloats ctrlcarr = new CArrayOfFloats(ctlarray);
+    o_nurbscurve.bezier_curves.toBezier(knots, ctrlcarr, mapdesc
+                                        .getNCoords());
+    thread("do_nurbscurve", o_nurbscurve);
+  }
+
+  /**
+   * Check knot vector specification
+   * 
+   * @param knots
+   *            knot vector
+   * @param msg
+   *            error message
+   * @return knot vector is / is not valid
+   */
+  public boolean do_check_knots(Knotvector knots, String msg) {
+    // DONE
+    int status = knots.validate();
+    if (status > 0) {
+      do_nurbserror(status);
+      if (renderhints.errorchecking != NurbsConsts.N_NOMSG)
+        knots.show(msg);
+    }
+    return (status > 0) ? false : true;
+  }
+
+  /**
+   * Draw a curve
+   * 
+   * @param o_nurbscurve
+   *            NURBS curve object
+   */
+  public void do_nurbscurve(O_nurbscurve o_nurbscurve) {
+    // DONE
+
+    if (inCurve <= 0) {
+      bgncurve();
+      inCurve = 2;
+    }
+
+    if (o_nurbscurve.used) {
+      do_nurbserror(23);
+      isDataValid = 0;
+      return;
+    } else
+      o_nurbscurve.used = true;
+
+    if (currentCurve.curvetype == CT_NONE) {
+      currentCurve.curvetype = CT_NURBSCURVE;
+    } else if (currentCurve.curvetype != CT_NURBSCURVE) {
+      do_nurbserror(24);
+      isDataValid = 0;
+      return;
+    }
+
+    // it was necessary to overcome problem with pointer to pointer here
+
+    // if(!o_nurbscurve.equals(nextNurbscurve)){
+    if (!o_nurbscurve.equals(currentCurve.o_nurbscurve)) {
+      isCurveModified = 1;
+      currentCurve.o_nurbscurve = o_nurbscurve;
+      // nextNurbscurve=o_nurbscurve;
+
+    }
+
+    nextNurbscurve = o_nurbscurve.next;
+
+    if (!currentCurve.equals(o_nurbscurve.owner)) {
+      isCurveModified = 1;
+      o_nurbscurve.owner = currentCurve;
+    }
+
+    if (o_nurbscurve.owner == null)
+      isCurveModified = 1;
+
+    if (inCurve == 2)
+      endcurve();
+  }
+
+  /**
+   * Draw NURBS surface
+   * 
+   * @param o_nurbssurface
+   *            NURBS surface object
+   */
+  public void do_nurbssurface(O_nurbssurface o_nurbssurface) {
+    // DONE
+    if (inSurface <= 0) {
+      bgnsurface();
+      inSurface = 2;
+    }
+    if (o_nurbssurface.used) {
+      do_nurbserror(25);
+      isDataValid = 0;
+      return;
+    } else
+      o_nurbssurface.used = true;
+
+    if (!o_nurbssurface.equals(nextNurbscurve)) {
+      isSurfaceModified = true;
+      // nextNurbssurface=o_nurbssurface;
+      currentSurface.o_nurbssurface = o_nurbssurface;
+    }
+
+    if (!currentSurface.equals(o_nurbssurface.owner)) {
+      isSurfaceModified = true;
+      o_nurbssurface.owner = currentSurface;
+    }
+
+    nextNurbssurface = o_nurbssurface.next;
+
+    if (inSurface == 2)
+      endsurface();
+  }
+
+  /**
+   * (Re)Inicialize maps
+   */
+  public void redefineMaps() {
+    // DONE
+    maplist.initialize();
+  }
+
+  /**
+   * Define a map of given properties
+   * 
+   * @param type
+   *            map type
+   * @param rational
+   *            is rational
+   * @param ncoords
+   *            number of control point coordinates
+   */
+  public void defineMap(int type, int rational, int ncoords) {
+    // DONE
+    maplist.define(type, rational, ncoords);
+  }
+
+  /**
+   * Set NURBS property
+   * 
+   * @param type
+   *            property type
+   * @param tag
+   *            property tag
+   * @param value
+   *            property value
+   */
+  public void setnurbsproperty(int type, int tag, float value) {
+    // DONE
+    Mapdesc mapdesc = maplist.locate(type);
+    if (mapdesc == null) {
+      do_nurbserror(35);
+      return;
+    }
+    if (!mapdesc.isProperty(tag)) {
+      do_nurbserror(26);
+      return;
+    }
+    Property prop = new Property(type, tag, value);
+    thread("do_setnurbsproperty2", prop);
+  }
+
+  /**
+   * Set parameters of existing property
+   * 
+   * @param prop
+   *            property
+   */
+  public void do_setnurbsproperty2(Property prop) {
+    Mapdesc mapdesc = maplist.find(prop.type);
+    mapdesc.setProperty(prop.tag, prop.value);
+  }
+
+  /**
+   * Set given property to rendering hints
+   * 
+   * @param prop
+   *            property to be set
+   */
+  public void do_setnurbsproperty(Property prop) {
+    // DONE
+    renderhints.setProperty(prop);
+    // TODO freeproperty?
+  }
+
+  /**
+   * Sets wheteher we use domain distance sampling
+   * 
+   * @param i
+   *            domain distance sampling flag
+   */
+  public void set_is_domain_distance_sampling(int i) {
+    // DONE
+    subdivider.set_is_domain_distance_sampling(i);
+  }
+
+  /**
+   * Begin new surface
+   */
+  public void bgnsurface() {
+    // DONE
+    O_surface o_surface = new O_surface();
+    // TODO nuid
+    //			System.out.println("TODO glunurbs.bgnsurface nuid");
+    thread("do_bgnsurface", o_surface);
+  }
+
+  /**
+   * End current surface
+   */
+  public void endsurface() {
+    // DONE
+    thread2("do_endsurface");
+  }
+
+  /**
+   * End surface trimming
+   */
+  private void endtrim() {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO glunurbs.endtrim");
+  }
+
+  /**
+   * Make NURBS surface
+   * 
+   * @param sknot_count
+   *            number of knots in s direction
+   * @param sknot
+   *            knot vector in s direction
+   * @param tknot_count
+   *            number of knots in t direction
+   * @param tknot
+   *            knot vector in t direction
+   * @param s_stride
+   *            number of coords of control points in s direction
+   * @param t_stride
+   *            number of coords of control points in t direction
+   * @param ctlarray
+   *            control points
+   * @param sorder
+   *            order of curve in s direction
+   * @param torder
+   *            order of curve in t direction
+   * @param type
+   *            NURBS surface type (rational,...)
+   */
+  public void nurbssurface(int sknot_count, float[] sknot, int tknot_count,
+                           float[] tknot, int s_stride, int t_stride, float[] ctlarray,
+                           int sorder, int torder, int type) {
+    // DONE
+    Mapdesc mapdesc = maplist.locate(type);
+    if (mapdesc == null) {
+      do_nurbserror(35);
+      isDataValid = 0;
+      return;
+    }
+    if (s_stride < 0 || t_stride < 0) {
+      do_nurbserror(34);
+      isDataValid = 0;
+      return;
+    }
+    Knotvector sknotvector = new Knotvector(sknot_count, s_stride, sorder,
+                                            sknot);
+    if (!do_check_knots(sknotvector, "surface"))
+      return;
+    Knotvector tknotvector = new Knotvector(tknot_count, t_stride, torder,
+                                            tknot);
+    if (!do_check_knots(tknotvector, "surface"))
+      return;
+
+    O_nurbssurface o_nurbssurface = new O_nurbssurface(type);
+    o_nurbssurface.bezier_patches = new Quilt(mapdesc);
+
+    CArrayOfFloats ctrlarr = new CArrayOfFloats(ctlarray);
+    o_nurbssurface.bezier_patches.toBezier(sknotvector, tknotvector,
+                                           ctrlarr, mapdesc.getNCoords());
+    thread("do_nurbssurface", o_nurbssurface);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
new file mode 100644
index 0000000..f5fe17a
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
@@ -0,0 +1,1597 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.glu.GLU;
+import jogamp.opengl.Debug;
+import com.jogamp.common.nio.Buffers;
+import java.nio.*;
+import java.io.*;
+
+/**
+ *
+ * @author  Administrator
+ */
+public class BuildMipmap {
+
+  private static final boolean DEBUG = Debug.debug("BuildMipmap");
+  private static final boolean VERBOSE = Debug.verbose();
+
+  /** Creates a new instance of BuildMipmap */
+  public BuildMipmap() {
+  }
+  
+  public static int gluBuild1DMipmapLevelsCore( GL gl, int target, int internalFormat,
+                  int width, int widthPowerOf2, int format, int type, int userLevel,
+                  int baseLevel, int maxLevel, ByteBuffer data ) {
+    int newwidth;
+    int level, levels;
+    ShortBuffer newImage = null;
+    int newImage_width;
+    ShortBuffer otherImage = null;
+    ShortBuffer imageTemp = null;
+    int memReq;
+    int maxsize;
+    int cmpts;
+    PixelStorageModes psm = new PixelStorageModes();
+    
+    assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
+    assert( width >= 1 );
+    
+    newwidth = widthPowerOf2;
+    levels = Mipmap.computeLog( newwidth );
+    
+    levels += userLevel;
+    
+    Mipmap.retrieveStoreModes( gl, psm );
+    try {
+      newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, 1, format, 
+            GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+    } catch( OutOfMemoryError ome ) {
+      return( GLU.GLU_OUT_OF_MEMORY );
+    }
+    newImage_width = width;
+    
+    Image.fill_image( psm, width, 1, format, type, Mipmap.is_index( format ), data, newImage );
+    cmpts = Mipmap.elements_per_group( format, type );
+    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+    
+    // if swap_bytes was set, swapping occurred in fill_image
+    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+    
+    for( level = userLevel; level <= levels; level++ ) {
+      if( newImage_width == newwidth ) {
+        // user newimage for this level
+        if( baseLevel <= level && level <= maxLevel ) {
+          gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0, format,
+                        GL2.GL_UNSIGNED_SHORT, newImage );
+        }
+      } else {
+        if( otherImage == null ) {
+          memReq = Mipmap.image_size( newwidth, 1, format, GL2.GL_UNSIGNED_SHORT );
+          try {
+            otherImage = Buffers.newDirectByteBuffer( memReq ).asShortBuffer();
+          } catch( OutOfMemoryError ome ) {
+            gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+            gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+            gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+            return( GLU.GLU_OUT_OF_MEMORY );
+          }
+        }
+        ScaleInternal.scale_internal( cmpts, newImage_width, 1, newImage, newwidth, 1, otherImage );
+        // swap newImage and otherImage
+        imageTemp = otherImage;
+        otherImage = newImage;
+        newImage = imageTemp;
+        
+        newImage_width = newwidth;
+        if( baseLevel <= level && level <= maxLevel ) {
+          gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0, 
+                            format, GL2.GL_UNSIGNED_SHORT, newImage );
+        }
+      }
+      if( newwidth > 1 ) {
+        newwidth /= 2;
+      }
+    }
+    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+    
+    return( 0 );
+  }
+  
+  public static int bitmapBuild2DMipmaps( GL gl, int target, int internalFormat,
+            int width, int height, int format, int type, ByteBuffer data ) {
+    int newwidth[] = new int[1];
+    int newheight[] = new int[1];
+    int level, levels;
+    ShortBuffer newImage = null;
+    int newImage_width;
+    int newImage_height;
+    ShortBuffer otherImage = null;
+    ShortBuffer tempImage = null;
+    int memReq;
+    int maxsize;
+    int cmpts;
+    PixelStorageModes psm = new PixelStorageModes();
+    
+    Mipmap.retrieveStoreModes( gl, psm );
+    
+    Mipmap.closestFit( gl, target, width, height, internalFormat, format, type, newwidth, newheight );
+    
+    levels = Mipmap.computeLog( newwidth[0] );
+    level = Mipmap.computeLog( newheight[0] );
+    if( level > levels ) {
+      levels = level;
+    }
+    
+    try {
+      newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, height, 
+            format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+    } catch( OutOfMemoryError ome ) {
+      return( GLU.GLU_OUT_OF_MEMORY );
+    }
+    newImage_width = width;
+    newImage_height = height;
+    
+    Image.fill_image( psm, width, height, format, type, Mipmap.is_index( format ), data, newImage );
+    
+    cmpts = Mipmap.elements_per_group( format, type );
+    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+    
+    // if swap_bytes is set, swapping occurred in fill_image
+    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+    
+    for( level = 0; level < levels; level++ ) {
+      if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
+        newImage.rewind();
+        gl.glTexImage2D( target, level, internalFormat, newImage_width,
+            newImage_height, 0, format, GL2.GL_UNSIGNED_SHORT, newImage );
+      } else {
+        if( otherImage == null ) {
+          memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_SHORT );
+          try {
+            otherImage = Buffers.newDirectByteBuffer( memReq ).asShortBuffer();
+          } catch( OutOfMemoryError ome ) {
+            gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+            gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+            gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+            return( GLU.GLU_OUT_OF_MEMORY );
+          }
+        }
+        ScaleInternal.scale_internal( cmpts, newImage_width, newImage_height, 
+                              newImage, newwidth[0], newheight[0], otherImage );
+        // swap newImage and otherImage
+        tempImage = otherImage;
+        otherImage = newImage;
+        newImage = tempImage;
+        
+        newImage_width = newwidth[0];
+        newImage_height = newheight[0];
+        newImage.rewind();
+        gl.glTexImage2D( target, level, internalFormat, newImage_width, newImage_height,
+                                    0, format, GL2.GL_UNSIGNED_SHORT, newImage );
+      }
+      if( newheight[0] > 1 ) {
+        newwidth[0] /= 2;
+      }
+      if( newheight[0] > 1 ) {
+        newheight[0] /= 2;
+      }
+    }
+    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+    
+    return( 0 );
+  }
+  
+  public static int gluBuild2DMipmapLevelsCore( GL gl, int target, int internalFormat,
+                int width, int height, int widthPowerOf2, int heightPowerOf2,
+                int format, int type, int userLevel, int baseLevel, int maxLevel,
+                ByteBuffer data ) { // PointerWrapper data
+    int newwidth;
+    int newheight;
+    int level, levels;
+    int usersImage;
+    ByteBuffer srcImage = null;
+    ByteBuffer dstImage = null;
+    ByteBuffer tempImage = null;
+    int newImage_width;
+    int newImage_height;
+    short[] SWAP_IMAGE = null;
+    int memReq;
+    int maxsize;
+    int cmpts;
+    int mark=-1;
+    
+    boolean myswap_bytes;
+    int groups_per_line, element_size, group_size;
+    int rowsize, padding;
+    PixelStorageModes psm = new PixelStorageModes();
+    
+    assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
+    assert( width >= 1 && height >= 1 );
+    
+    if( type == GL2.GL_BITMAP ) {
+      return( bitmapBuild2DMipmaps( gl, target, internalFormat, width, height, format, type, data ) );
+    }
+    
+    newwidth = widthPowerOf2;
+    newheight = heightPowerOf2;
+    levels = Mipmap.computeLog( newwidth );
+    level = Mipmap.computeLog( newheight );
+    if( level > levels ) {
+      levels = level;
+    }
+    
+    levels += userLevel;
+    
+    Mipmap.retrieveStoreModes( gl, psm );
+    myswap_bytes = psm.getUnpackSwapBytes();
+    cmpts = Mipmap.elements_per_group( format, type );
+    if( psm.getUnpackRowLength() > 0 ) {
+      groups_per_line = psm.getUnpackRowLength();
+    } else {
+      groups_per_line = width;
+    }
+    
+    element_size = Mipmap.bytes_per_element( type );
+    group_size = element_size * cmpts;
+    if( element_size == 1 ) {
+      myswap_bytes = false;
+    }
+    
+    rowsize = groups_per_line * group_size;
+    padding = ( rowsize % psm.getUnpackAlignment() );
+    if( padding != 0 ) {
+      rowsize += psm.getUnpackAlignment() - padding;
+    }
+    
+    mark = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
+    data.position( mark );
+    
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+    
+    level = userLevel;
+    
+    // already power of two square
+    if( width == newwidth && height == newheight ) {
+      // use usersImage for level userLevel
+      if( baseLevel <= level && level <= maxLevel ) {
+        data.rewind();
+        gl.glTexImage2D( target, level, internalFormat, width, height, 0, format, type, data );
+      }
+      if( levels == 0 ) { /* we're done. clean up and return */
+        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+        return( 0 );
+      }
+      int nextWidth = newwidth / 2;
+      int nextHeight = newheight / 2;
+      
+      // clamp to 1
+      if( nextWidth < 1 ) {
+        nextWidth = 1;
+      }
+      if( nextHeight < 1 ) {
+        nextHeight = 1;
+      }
+      memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
+      
+      try {
+        switch( type ) {
+          case( GL2.GL_UNSIGNED_BYTE ):
+          case( GL2.GL_BYTE ):
+          case( GL2.GL_UNSIGNED_SHORT ):
+          case( GL2.GL_SHORT ):
+          case( GL2.GL_UNSIGNED_INT ):
+          case( GL2.GL_INT ):
+          case( GL2.GL_FLOAT ):
+          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            dstImage = Buffers.newDirectByteBuffer( memReq );
+            break;
+          default:
+            return( GLU.GLU_INVALID_ENUM );
+        }
+      } catch( OutOfMemoryError ome ) {
+        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+        return( GLU.GLU_OUT_OF_MEMORY );
+      }
+      if( dstImage != null ) {
+        switch( type ) {
+          case( GL2.GL_UNSIGNED_BYTE ):
+            HalveImage.halveImage_ubyte( cmpts, width, height, data, dstImage, element_size, rowsize, group_size );
+            break;
+          case( GL2.GL_BYTE ):
+            HalveImage.halveImage_byte( cmpts, width, height, data, dstImage, element_size, rowsize, group_size );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT ):
+            HalveImage.halveImage_ushort( cmpts, width, height, data, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+            break;
+          case( GL2.GL_SHORT ):
+            HalveImage.halveImage_short( cmpts, width, height, data, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_INT ):
+            HalveImage.halveImage_uint( cmpts, width, height, data, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+            break;
+          case( GL2.GL_INT ):
+            HalveImage.halveImage_int( cmpts, width, height, data, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+            break;
+          case( GL2.GL_FLOAT ):
+            HalveImage.halveImage_float( cmpts, width, height, data, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+            assert( format == GL2.GL_RGB );
+            HalveImage.halveImagePackedPixel( 3, new Extract332(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            assert( format == GL2.GL_RGB );
+            HalveImage.halveImagePackedPixel( 3, new Extract233rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+            HalveImage.halveImagePackedPixel( 3, new Extract565(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+            HalveImage.halveImagePackedPixel( 3, new Extract565rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+            HalveImage.halveImagePackedPixel( 4, new Extract4444(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+            HalveImage.halveImagePackedPixel( 4, new Extract4444rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+            HalveImage.halveImagePackedPixel( 4, new Extract5551(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+            HalveImage.halveImagePackedPixel( 4, new Extract1555rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+            HalveImage.halveImagePackedPixel( 4, new Extract8888(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+            HalveImage.halveImagePackedPixel( 4, new Extract8888rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+            HalveImage.halveImagePackedPixel( 4, new Extract1010102(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            HalveImage.halveImagePackedPixel( 4, new Extract2101010rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+          default:
+            assert( false );
+            break;
+        }
+      }
+      newwidth = width / 2;
+      newheight = height / 2;
+      // clamp to 1
+      if( newwidth < 1 ) {
+        newwidth = 1;
+      }
+      if( newheight < 1 ) {
+        newheight = 1;
+      }
+      
+      myswap_bytes = false;
+      rowsize = newwidth * group_size;
+      memReq = Mipmap.image_size( newwidth, newheight, format, type );
+      // swap srcImage and dstImage
+      tempImage = srcImage;
+      srcImage = dstImage;
+      dstImage = tempImage;
+      try {
+        switch( type ) {
+          case( GL2.GL_UNSIGNED_BYTE ):
+          case( GL2.GL_BYTE ):
+          case( GL2.GL_UNSIGNED_SHORT ):
+          case( GL2.GL_SHORT ):
+          case( GL2.GL_UNSIGNED_INT ):
+          case( GL2.GL_INT ):
+          case( GL2.GL_FLOAT ):
+          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            dstImage = Buffers.newDirectByteBuffer( memReq );
+            break;
+          default:
+            return( GLU.GLU_INVALID_ENUM );
+        }
+      } catch( OutOfMemoryError ome ) {
+        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+        return( GLU.GLU_OUT_OF_MEMORY );
+      }
+      // level userLevel+1 is in srcImage; level userLevel already saved
+      level = userLevel + 1;
+    } else { // user's image is not nice powerof2 size square
+      memReq = Mipmap.image_size( newwidth, newheight, format, type );
+      try { 
+        switch( type ) {
+          case( GL2.GL_UNSIGNED_BYTE ):
+          case( GL2.GL_BYTE ):
+          case( GL2.GL_UNSIGNED_SHORT ):
+          case( GL2.GL_SHORT ):
+          case( GL2.GL_UNSIGNED_INT ):
+          case( GL2.GL_INT ):
+          case( GL2.GL_FLOAT ):
+          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            dstImage = Buffers.newDirectByteBuffer( memReq );
+            break;
+          default:
+            return( GLU.GLU_INVALID_ENUM );
+        }
+      } catch( OutOfMemoryError ome ) {
+        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+        return( GLU.GLU_OUT_OF_MEMORY );
+      }
+      data.position( mark );
+      switch( type ) {
+        case( GL2.GL_UNSIGNED_BYTE ):
+          ScaleInternal.scale_internal_ubyte( cmpts, width, height, data, 
+                newwidth, newheight, dstImage, element_size, rowsize, group_size );
+          break;
+        case( GL2.GL_BYTE ):
+          ScaleInternal.scale_internal_byte( cmpts, width, height, data, newwidth, 
+                  newheight, dstImage, element_size, rowsize, group_size );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT ):
+          ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth, 
+                  newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+          break;
+        case( GL2.GL_SHORT ):
+          ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
+                  newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_INT ):
+          ScaleInternal.scale_internal_uint( cmpts, width, height, data, newwidth,
+                  newheight, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+          break;
+        case( GL2.GL_INT ):
+          ScaleInternal.scale_internal_int( cmpts, width, height, data, newwidth,
+                  newheight, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+          break;
+        case( GL2.GL_FLOAT ):
+          ScaleInternal.scale_internal_float( cmpts, width, height, data, newwidth,
+                  newheight, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+          ScaleInternal.scaleInternalPackedPixel( 3, new Extract332(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          ScaleInternal.scaleInternalPackedPixel( 3, new Extract233rev(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+          ScaleInternal.scaleInternalPackedPixel( 3, new Extract565(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          ScaleInternal.scaleInternalPackedPixel( 3, new Extract565rev(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          ScaleInternal.scaleInternalPackedPixel( 4, new Extract4444(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          ScaleInternal.scaleInternalPackedPixel( 4, new Extract4444rev(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          ScaleInternal.scaleInternalPackedPixel( 4, new Extract5551(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          ScaleInternal.scaleInternalPackedPixel( 4, new Extract1555rev(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+          ScaleInternal.scaleInternalPackedPixel( 4, new Extract8888(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          ScaleInternal.scaleInternalPackedPixel( 4, new Extract8888rev(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+          ScaleInternal.scaleInternalPackedPixel( 4, new Extract1010102(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+          ScaleInternal.scaleInternalPackedPixel( 4, new Extract2101010rev(), width, height, data, newwidth,
+              newheight, dstImage, element_size, rowsize, myswap_bytes );
+          break;
+        default:
+          assert( false );
+          break;
+      }
+      myswap_bytes = false;
+      rowsize = newwidth * group_size;
+      // swap dstImage and srcImage
+      tempImage = srcImage;
+      srcImage = dstImage;
+      dstImage = tempImage;
+      
+      if( levels != 0 ) { // use as little memory as possible
+        int nextWidth = newwidth / 2;
+        int nextHeight = newheight / 2;
+        if( nextWidth < 1 ) {
+          nextWidth = 1;
+        }
+        if( nextHeight < 1 ) {
+          nextHeight = 1;
+        }
+        
+        memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
+        try {
+          switch( type ) {
+            case( GL2.GL_UNSIGNED_BYTE ):
+            case( GL2.GL_BYTE ):
+            case( GL2.GL_UNSIGNED_SHORT ):
+            case( GL2.GL_SHORT ):
+            case( GL2.GL_UNSIGNED_INT ):
+            case( GL2.GL_INT ):
+            case( GL2.GL_FLOAT ):
+            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+              dstImage = Buffers.newDirectByteBuffer( memReq );
+              break;
+            default:
+              return( GLU.GLU_INVALID_ENUM );
+          }
+        } catch( OutOfMemoryError ome ) {
+          gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+          gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+          gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+          return( GLU.GLU_OUT_OF_MEMORY );
+        }
+      }
+      // level userLevel is in srcImage; nothing saved yet
+      level = userLevel;
+    }
+    
+    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+    if( baseLevel <= level && level <= maxLevel ) {
+      srcImage.rewind();
+      gl.glTexImage2D( target, level, internalFormat, newwidth, newheight, 0, format, type, srcImage );
+      if (DEBUG) {
+        System.err.println("GL Error(" + level + "): " + gl.glGetError() );
+        if (VERBOSE) {
+          srcImage.limit( Mipmap.image_size( newwidth, newheight, format, type ) );
+          writeTargaFile("glu2DMipmapJ" + level + ".tga",
+                         srcImage, newwidth, newheight);
+          srcImage.clear();
+        }
+      }
+    }
+    
+    level++;  // update current level for the loop
+    for( ; level <= levels; level++ ) {
+      srcImage.rewind();
+      dstImage.rewind();
+      switch( type ) {
+        case( GL2.GL_UNSIGNED_BYTE ):
+          HalveImage.halveImage_ubyte( cmpts, newwidth, newheight, srcImage, dstImage, element_size, rowsize, group_size );
+          break;
+        case( GL2.GL_BYTE ):
+          HalveImage.halveImage_byte( cmpts, newwidth, newheight, srcImage, dstImage, element_size, rowsize, group_size );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT ):
+          HalveImage.halveImage_ushort( cmpts, newwidth, newheight, srcImage, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+          break;
+        case( GL2.GL_SHORT ):
+          HalveImage.halveImage_short( cmpts, newwidth, newheight, srcImage, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_INT ):
+          HalveImage.halveImage_uint( cmpts, newwidth, newheight, srcImage, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+          break;
+        case( GL2.GL_INT ):
+          HalveImage.halveImage_int( cmpts, newwidth, newheight, srcImage, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+          break;
+        case( GL2.GL_FLOAT ):
+          HalveImage.halveImage_float( cmpts, newwidth, newheight, srcImage, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
+          break;
+        case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+          assert( format == GL2.GL_RGB );
+          HalveImage.halveImagePackedPixel( 3, new Extract332(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          assert( format == GL2.GL_RGB );
+          HalveImage.halveImagePackedPixel( 3, new Extract233rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+          HalveImage.halveImagePackedPixel( 3, new Extract565(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          HalveImage.halveImagePackedPixel( 3, new Extract565rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          HalveImage.halveImagePackedPixel( 4, new Extract4444(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          HalveImage.halveImagePackedPixel( 4, new Extract4444rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          HalveImage.halveImagePackedPixel( 4, new Extract5551(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          HalveImage.halveImagePackedPixel( 4, new Extract1555rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+          HalveImage.halveImagePackedPixel( 4, new Extract8888(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          HalveImage.halveImagePackedPixel( 4, new Extract8888rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+          HalveImage.halveImagePackedPixel( 4, new Extract1010102(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+          HalveImage.halveImagePackedPixel( 4, new Extract2101010rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+            break;
+        default:
+          assert( false );
+          break;
+      }
+      
+      // swap dstImage and srcImage
+      tempImage = srcImage;
+      srcImage = dstImage;
+      dstImage = tempImage;
+      
+      if( newwidth > 1 ) {
+        newwidth /= 2;
+        rowsize /= 2;
+      }
+      if( newheight > 1 ) {
+        newheight /= 2;
+      }
+      // compute amount to pad per row if any
+      int rowPad = rowsize % psm.getUnpackAlignment();
+      
+      // should row be padded
+      if( rowPad == 0 ) {
+        // call teximage with srcImage untouched since its not padded
+        if( baseLevel <= level && level <= maxLevel ) {
+          srcImage.rewind();
+          gl.glTexImage2D( target, level, internalFormat, newwidth, newheight, 0, format, type, srcImage );
+          if (DEBUG) {
+            System.err.println("GL Error(" + level + "): " + gl.glGetError() );
+            if (VERBOSE) {
+              srcImage.limit( Mipmap.image_size( newwidth, newheight, format, type ) );
+              writeTargaFile("glu2DMipmapJ" + level + ".tga",
+                             srcImage, newwidth, newheight);
+              srcImage.clear();
+            }
+          }
+        }
+      } else {
+        // compute length of new row in bytes, including padding
+        int newRowLength = rowsize + psm.getUnpackAlignment() - rowPad;
+        int ii, jj;
+        int dstTrav;
+        int srcTrav;
+        
+        // allocate new image for mipmap of size newRowLength x newheight
+        ByteBuffer newMipmapImage = null;
+        try {
+          newMipmapImage = ByteBuffer.allocateDirect( newRowLength * newheight );
+        } catch( OutOfMemoryError ome ) {
+          gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+          gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+          gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+          return( GLU.GLU_OUT_OF_MEMORY );
+        }
+        srcImage.rewind();
+        // copy image from srcImage into newMipmapImage by rows
+        for( ii = 0; ii < newheight; ii++ ) {
+          newMipmapImage.position(newRowLength * ii);
+          for( jj = 0; jj < rowsize; jj++ ) {
+            newMipmapImage.put( srcImage.get() );
+          }
+        }
+        
+        // and use this new image for mipmapping instead
+        if( baseLevel <= level && level <= maxLevel ) {
+          newMipmapImage.rewind();
+          gl.glTexImage2D( target, level, internalFormat, newwidth, newheight, 0, format, type, newMipmapImage );
+          if (DEBUG) {
+            System.err.println("GL Error(" + level + " padded): " + gl.glGetError() );
+            if (VERBOSE) {
+              writeTargaFile("glu2DMipmapJ" + level + ".tga",
+                             newMipmapImage, newwidth, newheight);
+            }
+          }
+        }
+      }
+    }
+    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+    
+    return( 0 );
+  }
+  
+  public static int fastBuild2DMipmaps( GL gl, PixelStorageModes psm, int target,
+          int components, int width, int height, int format, int type, ByteBuffer data ) {
+    int[] newwidth = new int[1];
+    int[] newheight = new int[1];
+    int level, levels;
+    ByteBuffer newImage;
+    int newImage_width;
+    int newImage_height;
+    ByteBuffer otherImage;
+    ByteBuffer imageTemp;
+    int memReq;
+    int maxsize;
+    int cmpts;
+    
+    Mipmap.closestFit( gl, target, width, height, components, format, type, newwidth, 
+            newheight );
+    
+    levels = Mipmap.computeLog( newwidth[0] );
+    level = Mipmap.computeLog( newheight[0] );
+    if( level > levels ) {
+      levels = level;
+    }
+    
+    cmpts = Mipmap.elements_per_group( format, type );
+    
+    otherImage = null;
+    //  No need to copy the user data if its packed correctly.
+    //  Make sure that later routines don't change that data.
+    
+    if( psm.getUnpackSkipRows() == 0 && psm.getUnpackSkipPixels() == 0 ) {
+      newImage = data;
+      newImage_width = width;
+      newImage_height = height;
+    } else {
+      int rowsize;
+      int group_per_line;
+      int elements_per_line;
+      int start;
+      int iter;
+      int iter2;
+      int i, j;
+      
+      try {
+        newImage = Buffers.newDirectByteBuffer( Mipmap.image_size(width, height, format, GL2.GL_UNSIGNED_BYTE ) );
+      } catch( OutOfMemoryError err ) {
+        return( GLU.GLU_OUT_OF_MEMORY );
+      }
+      newImage_width = width;
+      newImage_height = height;
+
+      // Abbreviated version of fill_image for the restricted case.
+      if( psm.getUnpackRowLength() > 0 ) {
+        group_per_line = psm.getUnpackRowLength();
+      } else {
+        group_per_line = width;
+      }
+      rowsize = group_per_line * cmpts;
+      elements_per_line = width * cmpts;
+      start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * cmpts;
+      
+      for( i = 0; i < height; i++ ) {
+        iter = start;
+        data.position( iter );
+        for( j = 0; j < elements_per_line; j++ ) {
+          newImage.put( data.get() );
+        }
+        start += rowsize;
+      }
+    }
+    
+    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 1 );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+    
+    for( level = 0; level <= levels; level++ ) {
+      if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
+        // use newImage for this level
+        newImage.rewind();
+        gl.glTexImage2D( target, level, components, newImage_width, newImage_height,
+                0, format, GL2.GL_UNSIGNED_BYTE, newImage );
+      } else {
+        if( otherImage == null ) {
+          memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_BYTE );
+          try {
+            otherImage = Buffers.newDirectByteBuffer( memReq );
+          } catch( OutOfMemoryError err ) {
+            gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+            gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+            gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
+            return( GLU.GLU_OUT_OF_MEMORY );
+          }
+        }
+        // swap newImage and otherImage
+        imageTemp = otherImage;
+        otherImage = newImage;
+        newImage = imageTemp;
+        
+        newImage_width = newwidth[0];
+        newImage_height = newheight[0];
+        newImage.rewind();
+        gl.glTexImage2D( target, level, components, newImage_width, newImage_height,
+                0, format, GL2.GL_UNSIGNED_BYTE, newImage );
+      }
+      if( newwidth[0] > 1 ) {
+        newwidth[0] /= 2;
+      }
+      if( newheight[0] > 1 ) {
+        newheight[0] /= 2;
+      }
+    }
+    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
+    
+    return( 0 );
+  }
+  
+  public static int gluBuild3DMipmapLevelsCore( GL gl, int target, int internalFormat,
+          int width, int height, int depth, int widthPowerOf2, int heightPowerOf2,
+          int depthPowerOf2, int format, int type, int userLevel, int baseLevel,
+          int maxLevel, ByteBuffer data ) {
+    int newWidth;
+    int newHeight;
+    int newDepth;
+    int level, levels;
+    ByteBuffer usersImage;
+    ByteBuffer srcImage, dstImage, tempImage;
+    int newImageWidth;
+    int newImageHeight;
+    int newImageDepth;
+    int memReq;
+    int maxSize;
+    int cmpts;
+    int mark=-1;
+    
+    boolean myswapBytes;
+    int groupsPerLine, elementSize, groupSize;
+    int rowsPerImage, imageSize;
+    int rowSize, padding;
+    PixelStorageModes psm = new PixelStorageModes();
+    
+    assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
+    assert( width >= 1 && height >= 1 && depth >= 1 );
+    assert( type != GL2.GL_BITMAP );
+    
+    srcImage = dstImage = null;
+    
+    newWidth = widthPowerOf2;
+    newHeight = heightPowerOf2;
+    newDepth = depthPowerOf2;
+    levels = Mipmap.computeLog( newWidth );
+    level = Mipmap.computeLog( newHeight );
+    if( level > levels ) {
+      levels = level;
+    }
+    level = Mipmap.computeLog( newDepth );
+    if( level > levels ) {
+      levels = level;
+    }
+    
+    levels += userLevel;
+    
+    Mipmap.retrieveStoreModes3D( gl, psm );
+    myswapBytes = psm.getUnpackSwapBytes();
+    cmpts = Mipmap.elements_per_group( format, type );
+    if( psm.getUnpackRowLength() > 0 ) {
+      groupsPerLine = psm.getUnpackRowLength();
+    } else {
+      groupsPerLine = width;
+    }
+    
+    elementSize = Mipmap.bytes_per_element( type );
+    groupSize = elementSize * cmpts;
+    if( elementSize == 1 ) {
+      myswapBytes = false;
+    }
+    
+    // 3dstuff
+    if( psm.getUnpackImageHeight() > 0 ) {
+      rowsPerImage = psm.getUnpackImageHeight();
+    } else {
+      rowsPerImage = height;
+    }
+    
+    rowSize = groupsPerLine * groupSize;
+    padding = ( rowSize % psm.getUnpackAlignment() );
+    if( padding != 0 ) {
+      rowSize += psm.getUnpackAlignment() - padding;
+    }
+    
+    imageSize = rowsPerImage * rowSize;
+    
+    usersImage = ByteBuffer.wrap(data.array());
+    mark = psm.getUnpackSkipRows() * rowSize +
+           psm.getUnpackSkipPixels() * groupSize +
+           psm.getUnpackSkipImages() * imageSize;
+    usersImage.position( mark );
+    
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, 0 );
+    
+    level = userLevel;
+    
+    if( width == newWidth && height == newHeight && depth == newDepth ) {
+      // use usersImage for level userlevel
+      if( baseLevel <= level && level <= maxLevel ) {
+        gl.getGL2().glTexImage3D( target, level, internalFormat, width, height, depth,
+                0, format, type, usersImage );
+      }
+      if( levels == 0 ) { /* we're done. clean up and return */
+        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+        return( 0 );
+      }
+      int nextWidth = newWidth / 2;
+      int nextHeight = newHeight / 2;
+      int nextDepth = newDepth / 2;
+      
+      // clamp to one
+      if( nextWidth < 1 ) {
+        nextWidth = 1;
+      }
+      if( nextHeight < 1 ) {
+        nextHeight = 1;
+      }
+      if( nextDepth < 1 ) {
+        nextDepth = 1;
+      }
+      memReq = Mipmap.imageSize3D( nextWidth, nextHeight, nextDepth, format, type );
+      try {
+        switch( type ) {
+          case( GL2.GL_UNSIGNED_BYTE ):
+          case( GL2.GL_BYTE ):
+          case( GL2.GL_UNSIGNED_SHORT ):
+          case( GL2.GL_SHORT ):
+          case( GL2.GL_UNSIGNED_INT ):
+          case( GL2.GL_INT ):
+          case( GL2.GL_FLOAT ):
+          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            dstImage = Buffers.newDirectByteBuffer( memReq );
+            break;
+          default:
+            return( GLU.GLU_INVALID_ENUM );
+        }
+      } catch( OutOfMemoryError err ) {
+        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+        return( GLU.GLU_OUT_OF_MEMORY );
+      }
+      
+      if( dstImage != null ) {
+        switch( type ) {
+          case( GL2.GL_UNSIGNED_BYTE ):
+            if( depth > 1 ) {
+              HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
+                      usersImage, dstImage, elementSize, 
+                      groupSize, rowSize, imageSize, myswapBytes );
+            } else {
+              HalveImage.halveImage_ubyte( cmpts, width, height, usersImage,
+                      dstImage, elementSize, rowSize, groupSize );
+            }
+            break;
+          case( GL2.GL_BYTE ):
+            if( depth > 1 ) {
+              HalveImage.halveImage3D( cmpts, new ExtractSByte(), width, height, depth,
+                      usersImage, dstImage, elementSize, groupSize, rowSize,
+                      imageSize, myswapBytes );
+            } else {
+              HalveImage.halveImage_byte( cmpts, width, height, usersImage,
+                      dstImage, elementSize, rowSize, groupSize );
+            }
+            break;
+          case( GL2.GL_UNSIGNED_SHORT ):
+            if( depth > 1 ) {
+              HalveImage.halveImage3D( cmpts, new ExtractUShort(), width, height, depth,
+                      usersImage, dstImage, elementSize, groupSize, rowSize,
+                      imageSize, myswapBytes );
+            } else {
+              HalveImage.halveImage_ushort( cmpts, width, height, usersImage, 
+                      dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+            }
+            break;
+          case( GL2.GL_SHORT ):
+            if( depth > 1 ) {
+              HalveImage.halveImage3D( cmpts, new ExtractSShort(), width, height, depth,
+                      usersImage, dstImage, elementSize, groupSize, rowSize,
+                      imageSize, myswapBytes );
+            } else {
+              HalveImage.halveImage_short( cmpts, width, height, usersImage,
+                      dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+            }
+            break;
+          case( GL2.GL_UNSIGNED_INT ):
+            if( depth > 1 ) {
+              HalveImage.halveImage3D( cmpts, new ExtractUInt(), width, height, depth,
+                      usersImage, dstImage, elementSize, groupSize, rowSize,
+                      imageSize, myswapBytes );
+            } else {
+              HalveImage.halveImage_uint( cmpts, width, height, usersImage,
+                      dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+            }
+            break;
+          case( GL2.GL_INT ):
+            if( depth > 1 ) {
+              HalveImage.halveImage3D( cmpts, new ExtractSInt(), width, height, depth,
+                      usersImage, dstImage, elementSize, groupSize, rowSize,
+                      imageSize, myswapBytes );
+            } else {
+              HalveImage.halveImage_int( cmpts, width, height, usersImage,
+                      dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+            }
+            break;
+          case( GL2.GL_FLOAT ):
+            if( depth > 1 ) {
+              HalveImage.halveImage3D( cmpts, new ExtractFloat(), width, height, depth,
+                      usersImage, dstImage, elementSize, groupSize, rowSize,
+                      imageSize, myswapBytes );
+            } else {
+              HalveImage.halveImage_float( cmpts, width, height, usersImage,
+                      dstImage.asFloatBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+            }
+            break;
+          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+            assert( format == GL2.GL_RGB );
+            HalveImage.halveImagePackedPixel3D( 3, new Extract332(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            assert( format == GL2.GL_RGB );
+            HalveImage.halveImagePackedPixel3D( 3, new Extract233rev(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+            HalveImage.halveImagePackedPixel3D( 3, new Extract565(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+            HalveImage.halveImagePackedPixel3D( 3, new Extract565rev(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+            HalveImage.halveImagePackedPixel3D( 4, new Extract4444(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+            HalveImage.halveImagePackedPixel3D( 4, new Extract4444rev(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+            HalveImage.halveImagePackedPixel3D( 4, new Extract5551(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+            HalveImage.halveImagePackedPixel3D( 4, new Extract1555rev(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+            HalveImage.halveImagePackedPixel3D( 4, new Extract8888(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+            HalveImage.halveImagePackedPixel3D( 4, new Extract8888rev(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+            HalveImage.halveImagePackedPixel3D( 4, new Extract1010102(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            HalveImage.halveImagePackedPixel3D( 4, new Extract2101010rev(), width, height, depth, usersImage,
+                    dstImage, elementSize, rowSize, imageSize, myswapBytes );
+            break;
+          default:
+            assert( false );
+            break;
+        }
+      }
+      newWidth = width / 2;
+      newHeight = height / 2;
+      newDepth = depth / 2;
+      // clamp to 1
+      if( newWidth < 1 ) {
+        newWidth = 1;
+      }
+      if( newHeight < 1 ) {
+        newHeight = 1;
+      }
+      if( newDepth < 1 ) {
+        newDepth = 1;
+      }
+      
+      myswapBytes = false;
+      rowSize = newWidth * groupSize;
+      imageSize = rowSize * newHeight;
+      memReq = Mipmap.imageSize3D( newWidth, newHeight, newDepth, format, type );
+      // swap srcImage and dstImage
+      tempImage = srcImage;
+      srcImage = dstImage;
+      dstImage = tempImage;
+      try {
+        switch( type ) {
+          case( GL2.GL_UNSIGNED_BYTE ):
+          case( GL2.GL_BYTE ):
+          case( GL2.GL_UNSIGNED_SHORT ):
+          case( GL2.GL_SHORT ):
+          case( GL2.GL_UNSIGNED_INT ):
+          case( GL2.GL_INT ):
+          case( GL2.GL_FLOAT ):
+          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            dstImage = Buffers.newDirectByteBuffer( memReq );
+            break;
+          default:
+            return( GLU.GLU_INVALID_ENUM );
+        }
+      } catch( OutOfMemoryError err ) {
+        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+        return( GLU.GLU_OUT_OF_MEMORY );
+      }
+      
+      // level userLevel + 1 is in srcImage; level userLevel already saved
+      level = userLevel + 1;
+    } else {
+      memReq = Mipmap.imageSize3D( newWidth, newHeight, newDepth, format, type );
+      try {
+        switch( type ) {
+          case( GL2.GL_UNSIGNED_BYTE ):
+          case( GL2.GL_BYTE ):
+          case( GL2.GL_UNSIGNED_SHORT ):
+          case( GL2.GL_SHORT ):
+          case( GL2.GL_UNSIGNED_INT ):
+          case( GL2.GL_INT ):
+          case( GL2.GL_FLOAT ):
+          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            dstImage = Buffers.newDirectByteBuffer( memReq );
+            break;
+          default:
+            return( GLU.GLU_INVALID_ENUM );
+        }
+      } catch( OutOfMemoryError err ) {
+        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+        return( GLU.GLU_OUT_OF_MEMORY );
+      }
+      
+      ScaleInternal.gluScaleImage3D( gl, format, width, height, depth, type,
+              usersImage, newWidth, newHeight, newDepth, type, dstImage );
+      
+      myswapBytes = false;
+      rowSize = newWidth * groupSize;
+      imageSize = rowSize * newHeight;
+      // swap dstImage and srcImage
+      tempImage = srcImage;
+      srcImage = dstImage;
+      dstImage = tempImage;
+      
+      if( levels != 0 ) {
+        int nextWidth = newWidth / 2;
+        int nextHeight = newHeight / 2;
+        int nextDepth = newDepth / 2;
+        if( nextWidth < 1 ) {
+          nextWidth = 1;
+        }
+        if( nextHeight < 1 ) {
+          nextHeight = 1;
+        }
+        if( nextDepth < 1 ) {
+          nextDepth = 1;
+        }
+        memReq = Mipmap.imageSize3D( nextWidth, nextHeight, nextDepth, format, type );
+        try {
+          switch( type ) {
+            case( GL2.GL_UNSIGNED_BYTE ):
+            case( GL2.GL_BYTE ):
+            case( GL2.GL_UNSIGNED_SHORT ):
+            case( GL2.GL_SHORT ):
+            case( GL2.GL_UNSIGNED_INT ):
+            case( GL2.GL_INT ):
+            case( GL2.GL_FLOAT ):
+            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+              dstImage = Buffers.newDirectByteBuffer( memReq );
+              break;
+            default:
+              return( GLU.GLU_INVALID_ENUM );
+          }
+        } catch( OutOfMemoryError err ) {
+          gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+          gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+          gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+          gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+          return( GLU.GLU_OUT_OF_MEMORY );
+        }
+      }
+      // level userLevel is in srcImage; nothing saved yet
+      level = userLevel;
+    }
+    
+    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+    if( baseLevel <= level && level <= maxLevel ) {
+      usersImage.position( mark );
+      gl.getGL2().glTexImage3D( target, level, internalFormat, width, height, depth,
+              0, format, type, usersImage );
+    }
+    level++;
+    for( ; level <= levels; level++ ) {
+      switch( type ) {
+        case( GL2.GL_UNSIGNED_BYTE ):
+          if( depth > 1 ) {
+            HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
+                    usersImage, dstImage, elementSize, groupSize, rowSize,
+                    imageSize, myswapBytes );
+          } else {
+            HalveImage.halveImage_ubyte( cmpts, width, height, usersImage,
+                    dstImage, elementSize, rowSize, groupSize );
+          }
+          break;
+        case( GL2.GL_BYTE ):
+          if( depth > 1 ) {
+            HalveImage.halveImage3D( cmpts, new ExtractSByte(), width, height, depth,
+                    usersImage, dstImage, elementSize, groupSize, rowSize,
+                    imageSize, myswapBytes );
+          } else {
+            HalveImage.halveImage_byte( cmpts, width, height, usersImage,
+                    dstImage, elementSize, rowSize, groupSize );
+          }
+          break;
+        case( GL2.GL_UNSIGNED_SHORT ):
+          if( depth > 1 ) {
+            HalveImage.halveImage3D( cmpts, new ExtractUShort(), width, height, depth,
+                    usersImage, dstImage, elementSize, groupSize, rowSize,
+                    imageSize, myswapBytes );
+          } else {
+            HalveImage.halveImage_ushort( cmpts, width, height, usersImage,
+                    dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+          }
+          break;
+        case( GL2.GL_SHORT ):
+          if( depth > 1 ) {
+            HalveImage.halveImage3D( cmpts, new ExtractSShort(), width, height, depth,
+                    usersImage, dstImage, elementSize, groupSize, rowSize,
+                    imageSize, myswapBytes );
+          } else {
+            HalveImage.halveImage_short( cmpts, width, height, usersImage,
+                    dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+          }
+          break;
+        case( GL2.GL_UNSIGNED_INT ):
+          if( depth > 1 ) {
+            HalveImage.halveImage3D( cmpts, new ExtractUInt(), width, height, depth,
+                    usersImage, dstImage, elementSize, groupSize, rowSize,
+                    imageSize, myswapBytes );
+          } else {
+            HalveImage.halveImage_uint( cmpts, width, height, usersImage,
+                    dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+          }
+          break;
+        case( GL2.GL_INT ):
+          if( depth > 1 ) {
+            HalveImage.halveImage3D( cmpts, new ExtractSInt(), width, height, depth,
+                    usersImage, dstImage, elementSize, groupSize, rowSize,
+                    imageSize, myswapBytes );
+          } else {
+            HalveImage.halveImage_int( cmpts, width, height, usersImage,
+                    dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+          }
+          break;
+        case( GL2.GL_FLOAT ):
+          if( depth > 1 ) {
+            HalveImage.halveImage3D( cmpts, new ExtractFloat(), width, height, depth,
+                    usersImage, dstImage, elementSize, groupSize, rowSize,
+                    imageSize, myswapBytes );
+          } else {
+            HalveImage.halveImage_float( cmpts, width, height, usersImage,
+                    dstImage.asFloatBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+          }
+          break;
+        case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+          HalveImage.halveImagePackedPixel3D( 3, new Extract332(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          HalveImage.halveImagePackedPixel3D( 3, new Extract233rev(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+          HalveImage.halveImagePackedPixel3D( 3, new Extract565(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          HalveImage.halveImagePackedPixel3D( 3, new Extract565rev(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          HalveImage.halveImagePackedPixel3D( 4, new Extract4444(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          HalveImage.halveImagePackedPixel3D( 4, new Extract4444rev(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          HalveImage.halveImagePackedPixel3D( 4, new Extract5551(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          HalveImage.halveImagePackedPixel3D( 4, new Extract1555rev(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+          HalveImage.halveImagePackedPixel3D( 4, new Extract8888(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          HalveImage.halveImagePackedPixel3D( 4, new Extract8888rev(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+          HalveImage.halveImagePackedPixel3D( 4, new Extract1010102(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+          HalveImage.halveImagePackedPixel3D( 4, new Extract2101010rev(), width, height, depth, usersImage,
+                  dstImage, elementSize, rowSize, imageSize, myswapBytes );
+          break;
+        default:
+          assert( false );
+          break;
+      }
+      
+      tempImage = srcImage;
+      srcImage = dstImage;
+      dstImage = tempImage;
+      
+      if( newWidth > 1 ) {
+        newWidth /= 2;
+        rowSize /= 2;
+      }
+      if( newHeight > 1 ) {
+        newHeight /= 2;
+        imageSize = rowSize * newHeight;
+      }
+      if( newDepth > 1 ) {
+        newDepth /= 2;
+      }
+      if( baseLevel <= level && level <= maxLevel ) {
+        usersImage.position( mark );
+        gl.getGL2().glTexImage3D( target, level, internalFormat, width, height, depth,
+                0, format, type, usersImage );
+      }
+    }
+    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+    gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+    return( 0 );
+  }
+
+  private static final int TARGA_HEADER_SIZE = 18;
+  private static void writeTargaFile(String filename, ByteBuffer data,
+                                     int width, int height) {
+    try {
+      FileOutputStream fos = new FileOutputStream(new File(filename));
+      ByteBuffer header = ByteBuffer.allocateDirect(TARGA_HEADER_SIZE);
+      header.put(0, (byte) 0).put(1, (byte) 0);
+      header.put(2, (byte) 2); // uncompressed type
+      header.put(12, (byte) (width & 0xFF)); // width
+      header.put(13, (byte) (width >> 8)); // width
+      header.put(14, (byte) (height & 0xFF)); // height
+      header.put(15, (byte) (height >> 8)); // height
+      header.put(16, (byte) 24); // pixel size
+      fos.write(header.array());
+      fos.write(data.array());
+      data.clear();
+      fos.close();
+    } catch (IOException e) {
+      e.printStackTrace();
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java
new file mode 100644
index 0000000..a564269
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java
@@ -0,0 +1,56 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public interface Extract {
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents );
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel );
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
new file mode 100644
index 0000000..10ea1d7
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract1010102 implements Extract {
+  
+  /** Creates a new instance of Extract1010102 */
+  public Extract1010102() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    long uint = 0;
+    
+    if( isSwap ) {
+      uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
+    } else {
+      uint = 0x00000000FFFFFFFF & packedPixel.getInt();
+    }
+    
+    // 11111111,11000000,00000000,00000000 == 0xFFC00000
+    // 00000000,00111111,11110000,00000000 == 0x003F0000
+    // 00000000,00000000,00001111,11111100 == 0x00000FFC
+    // 00000000,00000000,00000000,00000011 == 0x00000003
+    
+    extractComponents[0] = (float)( ( uint & 0xFFC00000 ) >> 22 ) / 1023.0f;
+    extractComponents[1] = (float)( ( uint & 0x003FF000 ) >> 12 ) / 1023.0f;
+    extractComponents[2] = (float)( ( uint & 0x00000FFC ) >>  2 ) / 1023.0f;
+    extractComponents[3] = (float)( ( uint & 0x00000003 )       ) / 3.0f;
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 11110000,00000000 == 0xF000
+    // 00001111,00000000 == 0x0F00
+    // 00000000,11110000 == 0x00F0
+    // 00000000,00001111 == 0x000F
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    long uint = (((int)((shoveComponents[0] * 1023) + 0.5f) << 22) & 0xFFC00000 );
+    uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) <<   12) & 0x003FF000 );
+    uint |= (((int)((shoveComponents[2] * 1023) + 0.5f) <<    2) & 0x00000FFC );
+    uint |= (((int)((shoveComponents[3] *    3) + 0.5f)        ) & 0x00000003 );
+    packedPixel.asIntBuffer().put( index, (int)uint );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
new file mode 100644
index 0000000..1234da5
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract1555rev implements Extract {
+  
+  /** Creates a new instance of Extract1555rev */
+  public Extract1555rev() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    int ushort = 0;
+    
+    if( isSwap ) {
+      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+    } else {
+      ushort = 0x0000FFFF & packedPixel.getShort();
+    }
+    
+    // 00000000,00011111 == 0x001F
+    // 00000011,11100000 == 0x03E0
+    // 01111100,00000000 == 0x7C00
+    // 10000000,00000000 == 0x8000
+    
+    extractComponents[0] = (float)( ( ushort & 0x001F )       ) / 31.0f;
+    extractComponents[1] = (float)( ( ushort & 0x003E ) >>  5 ) / 31.0f;
+    extractComponents[2] = (float)( ( ushort & 0x7C00 ) >>  10) / 31.0f;
+    extractComponents[3] = (float)( ( ushort & 0x8000 ) >>  15);
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 00000000,00011111 == 0x001F
+    // 00000011,11100000 == 0x03E0
+    // 01111100,00000000 == 0x7C00
+    // 10000000,00000000 == 0x8000
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    int ushort = (((int)((shoveComponents[0] * 31) + 0.5f)   ) & 0x0000001F );
+    ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) <<  5) & 0x000003E0 );
+    ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) << 10) & 0x00007C00 );
+    ushort |= (((int)((shoveComponents[3]) + 0.5f)      << 15) & 0x00008000 );
+    packedPixel.asShortBuffer().put( index, (short)ushort );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
new file mode 100644
index 0000000..226254f
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract2101010rev implements Extract {
+  
+  /** Creates a new instance of Extract2101010 */
+  public Extract2101010rev() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    long uint = 0;
+    
+    if( isSwap ) {
+      uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
+    } else {
+      uint = 0x00000000FFFFFFFF & packedPixel.getInt();
+    }
+    
+    // 11111111,11000000,00000000,00000000 == 0xFFC00000
+    // 00000000,00111111,11110000,00000000 == 0x003F0000
+    // 00000000,00000000,00001111,11111100 == 0x00000FFC
+    // 00000000,00000000,00000000,00000011 == 0x00000003
+    
+    extractComponents[0] = (float)( ( uint & 0x000003FF )       ) / 1023.0f;
+    extractComponents[1] = (float)( ( uint & 0x000FFC00 ) >> 10 ) / 1023.0f;
+    extractComponents[2] = (float)( ( uint & 0x3FF00000 ) >> 20 ) / 1023.0f;
+    extractComponents[3] = (float)( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 11110000,00000000 == 0xF000
+    // 00001111,00000000 == 0x0F00
+    // 00000000,11110000 == 0x00F0
+    // 00000000,00001111 == 0x000F
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    long uint = (((int)((shoveComponents[0] * 1023) + 0.5f)    ) & 0x000003FF );
+    uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) <<   10) & 0x000FFC00 );
+    uint |= (((int)((shoveComponents[2] * 1023) + 0.5f) <<   20) & 0x3FF00000 );
+    uint |= (((int)((shoveComponents[3] *    3) + 0.5f) <<   30) & 0xC0000000 );
+    packedPixel.asIntBuffer().put( index, (int)uint );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
new file mode 100644
index 0000000..9fa2a3a
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
@@ -0,0 +1,85 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract233rev implements Extract {
+  
+  /** Creates a new instance of Extract223rev */
+  public Extract233rev() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    // 11100000 == 0xe0
+    // 00011100 == 0x1c
+    // 00000011 == 0x03
+    byte ubyte = packedPixel.get();
+    extractComponents[0] = (float)((ubyte & 0x07) ) / 7.0f;
+    extractComponents[1] = (float)((ubyte & 0x38) >> 3) / 7.0f;
+    extractComponents[2] = (float)((ubyte & 0xC0) >> 6) / 3.0f;
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 11100000 == 0xE0
+    // 00011100 == 0x1C
+    // 00000011 == 0x03
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) ) & 0x07 );
+    b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 3 ) & 0x38 );
+    b |= (byte)( ( (int)( ( shoveComponents[2] * 3 ) + 0.5f ) << 6 ) & 0xC0 );
+    packedPixel.position( index );
+    packedPixel.put( b );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
new file mode 100644
index 0000000..92d141b
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
@@ -0,0 +1,84 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract332 implements Extract {
+  
+  /** Creates a new instance of Extract332 */
+  public Extract332() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    // 11100000 == 0xe0
+    // 00011100 == 0x1c
+    // 00000011 == 0x03
+    byte ubyte = packedPixel.get();
+    extractComponents[0] = (float)((ubyte & 0xe0) >> 5) / 7.0f;
+    extractComponents[1] = (float)((ubyte & 0x1c) >> 2) / 7.0f;
+    extractComponents[2] = (float)((ubyte & 0x03)) / 3.0f;
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 11100000 == 0xE0
+    // 00011100 == 0x1C
+    // 00000011 == 0x03
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) << 5 ) & 0xE0 );
+    b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 2 ) & 0x1C );
+    b |= (byte)( ( (int)( ( shoveComponents[2] * 3 ) + 0.5f ) ) & 0x03 );
+    packedPixel.put( index, b );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
new file mode 100644
index 0000000..af99d15
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
@@ -0,0 +1,96 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract4444 implements Extract {
+  
+  /** Creates a new instance of Extract4444 */
+  public Extract4444() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    int ushort = 0;
+    
+    if( isSwap ) {
+      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+    } else {
+      ushort = 0x0000FFFF & packedPixel.getShort();
+    }
+    
+    // 11110000,00000000 == 0xF000
+    // 00001111,00000000 == 0x0F00
+    // 00000000,11110000 == 0x00F0
+    // 00000000,00001111 == 0x000F
+    
+    extractComponents[0] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
+    extractComponents[1] = (float)( ( ushort & 0x0F00 ) >> 8  ) / 15.0f;
+    extractComponents[2] = (float)( ( ushort & 0x00F0 ) >> 4  ) / 15.0f;
+    extractComponents[3] = (float)( ( ushort & 0x000F )       ) / 15.0f;
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 11110000,00000000 == 0xF000
+    // 00001111,00000000 == 0x0F00
+    // 00000000,11110000 == 0x00F0
+    // 00000000,00001111 == 0x000F
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    int ushort = (((int)((shoveComponents[0] * 15) + 0.5f) << 12) & 0x0000F000 );
+    ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) << 8) & 0x00000F00 );
+    ushort |= (((int)((shoveComponents[2] * 15) + 0.5f) << 4) & 0x000000F0 );
+    ushort |= (((int)((shoveComponents[3] * 15) + 0.5f)     ) & 0x0000000F );
+    packedPixel.asShortBuffer().put( index, (short)ushort );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
new file mode 100644
index 0000000..e5bce60
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract4444rev implements Extract {
+  
+  /** Creates a new instance of Extract4444rev */
+  public Extract4444rev() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    int ushort = 0;
+    
+    if( isSwap ) {
+      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+    } else {
+      ushort = 0x0000FFFF & packedPixel.getShort();
+    }
+    
+    // 00000000,00001111 == 0x000F
+    // 00000000,11110000 == 0x00F0
+    // 00001111,00000000 == 0x0F00
+    // 11110000,00000000 == 0xF000
+    
+    extractComponents[0] = (float)( ( ushort & 0x000F )       ) / 15.0f;
+    extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 4  ) / 15.0f;
+    extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 8  ) / 15.0f;
+    extractComponents[3] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 11110000,00000000 == 0xF000
+    // 00001111,00000000 == 0x0F00
+    // 00000000,11110000 == 0x00F0
+    // 00000000,00001111 == 0x000F
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    int ushort = (((int)((shoveComponents[0] * 15) + 0.5f)   ) & 0x0000000F );
+    ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) <<  4) & 0x000000F0 );
+    ushort |= (((int)((shoveComponents[2] * 15) + 0.5f) <<  8) & 0x00000F00 );
+    ushort |= (((int)((shoveComponents[3] * 15) + 0.5f) << 12) & 0x0000F000 );
+    packedPixel.asShortBuffer().put( index, (short)ushort );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
new file mode 100644
index 0000000..5c38310
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract5551 implements Extract {
+  
+  /** Creates a new instance of Extract5551 */
+  public Extract5551() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    int ushort = 0;
+    
+    if( isSwap ) {
+      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+    } else {
+      ushort = 0x0000FFFF & packedPixel.getShort();
+    }
+    
+    // 11111000,00000000 == 0xF800
+    // 00000111,11000000 == 0x07C0
+    // 00000000,00111110 == 0x003E
+    // 00000000,00000001 == 0x0001
+    
+    extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+    extractComponents[1] = (float)( ( ushort & 0x00F0 ) >>  6 ) / 31.0f;
+    extractComponents[2] = (float)( ( ushort & 0x0F00 ) >>  1 ) / 31.0f;
+    extractComponents[3] = (float)( ( ushort & 0xF000 )       );
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 11110000,00000000 == 0xF000
+    // 00001111,00000000 == 0x0F00
+    // 00000000,11110000 == 0x00F0
+    // 00000000,00001111 == 0x000F
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
+    ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) <<  6) & 0x000007C0 );
+    ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) <<  1) & 0x0000003E );
+    ushort |= (((int)((shoveComponents[3]) + 0.5f)) & 0x00000001 );
+    packedPixel.asShortBuffer().put( index, (short)ushort );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
new file mode 100644
index 0000000..f6193dd
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
@@ -0,0 +1,92 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract565 implements Extract {
+  
+  /** Creates a new instance of Extract565 */
+  public Extract565() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    int ushort = 0;
+    
+    if( isSwap ) {
+      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+    } else {
+      ushort = 0x0000FFFF & packedPixel.getShort();
+    }
+    
+    // 11111000,00000000 == 0xF800
+    // 00000111,11100000 == 0x07E0
+    // 00000000,00111111 == 0x001F
+    
+    extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+    extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
+    extractComponents[2] = (float)( ( ushort & 0x001F ) ) / 31.0f;
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 11111000,00000000 == 0xF800
+    // 00000111,11100000 == 0x07E0
+    // 00000000,00111111 == 0x001F
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
+    ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
+    ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) ) & 0x0000001F );
+    packedPixel.asShortBuffer().put( index, (short)ushort );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
new file mode 100644
index 0000000..2e455ad
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
@@ -0,0 +1,92 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract565rev implements Extract {
+  
+  /** Creates a new instance of Extract565rev */
+  public Extract565rev() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    int ushort = 0;
+    
+    if( isSwap ) {
+      ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+    } else {
+      ushort = 0x0000FFFF & packedPixel.getShort();
+    }
+    
+    // 00000000,00011111 == 0x001F
+    // 00000111,11100000 == 0x07E0
+    // 11111000,00000000 == 0xF800
+    
+    extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
+    extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
+    extractComponents[2] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 00000000,00111111 == 0x001F
+    // 00000111,11100000 == 0x07E0
+    // 11111000,00000000 == 0xF800
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) ) & 0x0000001F );
+    ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
+    ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) << 11) & 0x0000F800 );
+    packedPixel.asShortBuffer().put( index, (short)ushort );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
new file mode 100644
index 0000000..137fa3c
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract8888 implements Extract {
+  
+  /** Creates a new instance of Extract8888 */
+  public Extract8888() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    long uint = 0;
+    
+    if( isSwap ) {
+      uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
+    } else {
+      uint = 0x00000000FFFFFFFF & packedPixel.getInt();
+    }
+    
+    // 11111000,00000000 == 0xF800
+    // 00000111,11000000 == 0x07C0
+    // 00000000,00111110 == 0x003E
+    // 00000000,00000001 == 0x0001
+    
+    extractComponents[0] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
+    extractComponents[1] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
+    extractComponents[2] = (float)( ( uint & 0x0000FF00 ) >>  8 ) / 255.0f;
+    extractComponents[3] = (float)( ( uint & 0x000000FF )       ) / 255.0f;
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 11110000,00000000 == 0xF000
+    // 00001111,00000000 == 0x0F00
+    // 00000000,11110000 == 0x00F0
+    // 00000000,00001111 == 0x000F
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    long uint = (((int)((shoveComponents[0] * 255) + 0.5f) << 24) & 0xFF000000 );
+    uint |= (((int)((shoveComponents[1] * 255) + 0.5f) <<   16) & 0x00FF0000 );
+    uint |= (((int)((shoveComponents[2] * 255) + 0.5f) <<    8) & 0x0000FF00 );
+    uint |= (((int)((shoveComponents[3] * 255) + 0.5f)        ) & 0x000000FF );
+    packedPixel.asIntBuffer().put( index, (int)uint );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
new file mode 100644
index 0000000..2ac942c
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract8888rev implements Extract {
+  
+  /** Creates a new instance of Extract8888rev */
+  public Extract8888rev() {
+  }
+  
+  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+    long uint = 0;
+    
+    if( isSwap ) {
+      uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
+    } else {
+      uint = 0x00000000FFFFFFFF & packedPixel.getInt();
+    }
+    
+    // 11111000,00000000 == 0xF800
+    // 00000111,11000000 == 0x07C0
+    // 00000000,00111110 == 0x003E
+    // 00000000,00000001 == 0x0001
+    
+    extractComponents[0] = (float)( ( uint & 0x000000FF )       ) / 255.0f;
+    extractComponents[1] = (float)( ( uint & 0x0000FF00 ) >>  8 ) / 255.0f;
+    extractComponents[2] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
+    extractComponents[3] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
+  }
+  
+  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+    // 11110000,00000000 == 0xF000
+    // 00001111,00000000 == 0x0F00
+    // 00000000,11110000 == 0x00F0
+    // 00000000,00001111 == 0x000F
+    
+    assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+    assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+    assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+    assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+    
+    // due to limited precision, need to round before shoving
+    long uint = (((int)((shoveComponents[0] * 255) + 0.5f)    ) & 0x000000FF );
+    uint |= (((int)((shoveComponents[1] * 255) + 0.5f) <<    8) & 0x0000FF00 );
+    uint |= (((int)((shoveComponents[2] * 255) + 0.5f) <<   16) & 0x00FF0000 );
+    uint |= (((int)((shoveComponents[3] * 255) + 0.5f) <<   24) & 0xFF000000 );
+    packedPixel.asIntBuffer().put( index, (int)uint );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
new file mode 100644
index 0000000..52c2191
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
@@ -0,0 +1,74 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractFloat implements ExtractPrimitive {
+  
+  /** Creates a new instance of ExtractFloat */
+  public ExtractFloat() {
+  }
+  
+  public double extract( boolean isSwap, ByteBuffer data ) {
+    float f = 0;
+    if( isSwap ) {
+      f = Mipmap.GLU_SWAP_4_BYTES( data.getInt() );
+    } else {
+      f = data.getInt();
+    }
+    assert( f <= 1.0f );
+    return( f );
+  }
+  
+  public void shove( double value, int index, ByteBuffer data ) {
+    assert(0.0 <= value && value < 1.0);
+    data.asFloatBuffer().put( index, (float)value );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java
new file mode 100644
index 0000000..9260966
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java
@@ -0,0 +1,56 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public interface ExtractPrimitive {
+  public double extract( boolean isSwap, ByteBuffer pointer );
+  public void shove( double value, int index, ByteBuffer pointer );
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
new file mode 100644
index 0000000..2e1a9a0
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
@@ -0,0 +1,69 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractSByte implements ExtractPrimitive {
+  
+  /** Creates a new instance of ExtractUByte */
+  public ExtractSByte() {
+  }
+  
+  public double extract( boolean isSwap, ByteBuffer sbyte ) {
+    byte b = sbyte.get();
+    assert( b <= 127 );
+    return( b );
+  }
+  
+  public void shove( double value, int index, ByteBuffer data ) {
+    data.position( index );
+    data.put( (byte)value );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
new file mode 100644
index 0000000..ca80747
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
@@ -0,0 +1,76 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractSInt implements ExtractPrimitive {
+  
+  /** Creates a new instance of ExtractSInt */
+  public ExtractSInt() {
+  }
+  
+  public double extract( boolean isSwap, ByteBuffer uint ) {
+    int i = 0;
+    if( isSwap ) {
+      i = Mipmap.GLU_SWAP_4_BYTES( uint.getInt() );
+    } else {
+      i = uint.getInt();
+    }
+    assert( i <= 0x7FFFFFFF );
+    return( i );
+  }
+  
+  public void shove( double value, int index, ByteBuffer data ) {
+    assert(0.0 <= value && value < Integer.MAX_VALUE);
+    IntBuffer ib = data.asIntBuffer();
+    ib.position( index );
+    ib.put( (int)value );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
new file mode 100644
index 0000000..979c3b4
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
@@ -0,0 +1,76 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractSShort implements ExtractPrimitive {
+  
+  /** Creates a new instance of ExtractSShort */
+  public ExtractSShort() {
+  }
+  
+  public double extract( boolean isSwap, ByteBuffer ushort ) {
+    short s = 0;
+    if( isSwap ) {
+      s = Mipmap.GLU_SWAP_2_BYTES( ushort.getShort() );
+    } else {
+      s = ushort.getShort();
+    }
+    assert( s <= 32767 );
+    return( s );
+  }
+  
+  public void shove( double value, int index, ByteBuffer data ) {
+    assert(0.0 <= value && value < 32768.0);
+    ShortBuffer sb = data.asShortBuffer();
+    sb.position( index );
+    sb.put( (short)value );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
new file mode 100644
index 0000000..4d14212
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
@@ -0,0 +1,70 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractUByte implements ExtractPrimitive {
+  
+  /** Creates a new instance of ExtractUByte */
+  public ExtractUByte() {
+  }
+  
+  public double extract( boolean isSwap, ByteBuffer ubyte ) {
+    int i = 0x000000FF & ubyte.get();
+    assert( i <= 255 );
+    return( i );
+  }
+  
+  public void shove( double value, int index, ByteBuffer data ) {
+    assert(0.0 <= value && value < 256.0);
+    data.position( index );
+    data.put( (byte)value );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
new file mode 100644
index 0000000..c088ca3
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
@@ -0,0 +1,76 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractUInt implements ExtractPrimitive {
+  
+  /** Creates a new instance of ExtractUInt */
+  public ExtractUInt() {
+  }
+  
+  public double extract( boolean isSwap, ByteBuffer uint ) {
+    long i = 0;
+    if( isSwap ) {
+      i = 0xFFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( uint.getInt() );
+    } else {
+      i = 0xFFFFFFFF & uint.getInt();
+    }
+    assert( i <= 0xFFFFFFFF );
+    return( i );
+  }
+  
+  public void shove( double value, int index, ByteBuffer data ) {
+    assert(0.0 <= value && value < 0xFFFFFFFF);
+    IntBuffer ib = data.asIntBuffer();
+    ib.position( index );
+    ib.put( (int)value );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
new file mode 100644
index 0000000..81db60f
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
@@ -0,0 +1,76 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractUShort implements ExtractPrimitive {
+  
+  /** Creates a new instance of ExtracUShort */
+  public ExtractUShort() {
+  }
+  
+  public double extract( boolean isSwap, ByteBuffer ushort ) {
+    int i = 0;
+    if( isSwap ) {
+      i = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( ushort.getShort() );
+    } else {
+      i = 0x0000FFFF & ushort.getShort();
+    }
+    assert( i <= 65535 );
+    return( i );
+  }
+  
+  public void shove( double value, int index, ByteBuffer data ) {
+    assert(0.0 <= value && value < 65536.0);
+    ShortBuffer sb = data.asShortBuffer();
+    sb.position( index );
+    sb.put( (short)value );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
new file mode 100644
index 0000000..7549044
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
@@ -0,0 +1,1533 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import javax.media.opengl.GL;
+import java.nio.*;
+
+/**
+ *
+ * @author  Administrator
+ */
+public class HalveImage {
+  
+  private static final int BOX2 = 2;
+  private static final int BOX4 = 4;
+  private static final int BOX8 = 8;
+  
+  public static void halveImage( int components, int width, int height,
+          ShortBuffer datain, ShortBuffer dataout ) {
+    int i, j, k;
+    int newwidth, newheight;
+    int delta;
+    int t = 0;
+    short temp = 0;
+    
+    newwidth = width / 2;
+    newheight = height /2;
+    delta = width * components;
+    
+    // Piece of cake
+    for( i = 0; i < newheight; i++ ) {
+      for( j = 0; j < newwidth; j++ ) {
+        for( k = 0; k < components; k++ ) {
+          datain.position( t );
+          temp = datain.get();
+          datain.position( t + components );
+          temp += datain.get();
+          datain.position( t + delta );
+          temp += datain.get();
+          datain.position( t + delta + components );
+          temp +=datain.get();
+          temp += 2;
+          temp /= 4;
+          dataout.put( temp );
+          t++;
+        }
+        t += components;
+      }
+      t += delta;
+    }
+  }
+  
+  public static void halveImage_ubyte( int components, int width, int height,
+                                      ByteBuffer datain, ByteBuffer dataout,
+                                      int element_size, int ysize, int group_size ) {
+    int i, j, k;
+    int newwidth, newheight;
+    int s;
+    int t;
+    
+    // Handle case where there is only 1 column/row
+    if( width == 1 || height == 1 ) {
+      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+      halve1Dimage_ubyte( components, width, height, datain, dataout, element_size, ysize, group_size );
+      return;
+    }
+    
+    newwidth = width / 2;
+    newheight = height / 2;
+    s = 0;
+    t = 0;
+    
+    int temp = 0;
+    // piece of cake
+    for( i = 0; i < newheight; i++ ) {
+      for( j = 0; j < newwidth; j++ ) {
+        for( k = 0; k < components; k++ ) {
+          datain.position( t );
+          temp = ( 0x000000FF & datain.get() );
+          datain.position( t + group_size );
+          temp += ( 0x000000FF & datain.get() );
+          datain.position( t + ysize );
+          temp += ( 0x000000FF & datain.get() );
+          datain.position( t + ysize + group_size );
+          temp += ( 0x000000FF & datain.get() ) + 2;
+          dataout.put( (byte)(temp / 4) );
+          t += element_size;
+        }
+        t += group_size;
+      }
+      t += ysize;
+    }
+  }
+  
+  public static void halve1Dimage_ubyte( int components, int width, int height,
+                      ByteBuffer datain, ByteBuffer dataout, 
+                      int element_size, int ysize, int group_size ) {
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int src = 0;
+    int dest = 0;
+    int jj;
+    int temp = 0;
+    
+    assert( width == 1 || height == 1 ); // Must be 1D
+    assert( width != height ); // can't be square
+    
+    if( height == 1 ) { // 1 row
+      assert( width != 1 ); // widthxheight can't be 1x1
+      halfHeight = 1;
+      
+      for( jj = 0; jj < halfWidth; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          datain.position( src );
+          temp = ( 0x000000FF & datain.get() );
+          datain.position( src + group_size );
+          temp += ( 0x000000FF & datain.get() );
+          temp /= 2;
+          dataout.put( (byte)temp );
+          /*
+          dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) + 
+                    (0x000000FF & datain.setIndexInBytes( src + group_size ).getByte())) / 2 ) );
+           */
+          src += element_size;
+          //dataout.plusPlus();
+          dest++;
+        }
+        src += group_size; // skip to next 2
+      }
+      int padBytes = ysize - ( width * group_size );
+      src += padBytes; // for assertion only
+    } else if( width == 1 ) { // 1 column
+      int padBytes = ysize - ( width * group_size );
+      assert( height != 1 );
+      halfWidth = 1;
+      // one vertical column with possible pad bytes per row
+      // average two at a time
+      for( jj = 0; jj < halfHeight; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          datain.position( src );
+          temp = ( 0x000000FF & datain.get() );
+          datain.position( src + ysize );
+          temp += ( 0x000000FF & datain.get() );
+          temp /= 2;
+          dataout.put( (byte)temp );
+          /*
+          dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) + 
+                    (0x000000FF & datain.setIndexInBytes(src + ysize).getByte()) ) / 2 ) );
+           */
+          src += element_size;
+          //dataout.plusPlus();
+          dest++;
+        }
+        src += padBytes; // add pad bytes, if any, to get to end of row
+        src += ysize;
+      }
+    }
+    assert( src == ysize * height );
+    assert( dest == components * element_size * halfWidth * halfHeight );
+  }
+  
+  public static void halveImage_byte( int components, int width, int height,
+                    ByteBuffer datain, ByteBuffer dataout, int element_size,
+                    int ysize, int group_size ) {
+    int i, j, k;
+    int newwidth, newheight;
+    int s = 0;
+    int t = 0;
+    byte temp = (byte)0;
+    
+    // handle case where there is only 1 column
+    if( width == 1 || height == 1 ) {
+      assert( !( width == 1 && height == 1 ) );
+      halve1Dimage_byte( components, width, height, datain, dataout, element_size,
+                                                            ysize, group_size );
+      return;
+    }
+    
+    newwidth = width / 2;
+    newheight = height / 2;
+    
+    for( i = 0; i < newheight; i++ ) {
+      for( j = 0; j < newwidth; j++ ) {
+        for( k = 0; k < components; k++ ) {
+          datain.position( t );
+          temp = datain.get();
+          datain.position( t + group_size );
+          temp += datain.get();
+          datain.position( t + ysize );
+          temp += datain.get();
+          datain.position( t + ysize + group_size );
+          temp += datain.get();
+          temp += 2;
+          temp /= 4;
+          dataout.put( temp );
+          t += element_size;
+        }
+        t += group_size;
+      }
+      t += ysize;
+    }
+  }
+  
+  public static void halve1Dimage_byte( int components, int width, int height,
+                      ByteBuffer datain, ByteBuffer dataout,
+                      int element_size, int ysize, int group_size ) {
+    int halfWidth = width / 2;
+    int halfHeight = width / 2;
+    int src = 0;
+    int dest = 0;
+    int jj;
+    byte temp = (byte)0;
+    
+    assert( width == 1 || height == 1 ); // must be 1D
+    assert( width != height ); // can't be square
+    
+    if( height == 1 ) { // 1 row
+      assert( width != 1 ); // widthxheight can't be 1
+      halfHeight = 1;
+      
+      for( jj = 0; jj < halfWidth; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          datain.position( src );
+          temp = datain.get();
+          datain.position( src + group_size );
+          temp += datain.get();
+          temp /= 2;
+          dataout.put( temp );
+          src += element_size;
+          dest++;
+        }
+        src += group_size; // skip to next 2
+      }
+      int padBytes = ysize - ( width * group_size );
+      src += padBytes; // for assert only
+    } else if( width == 1 ) { // 1 column
+      int padBytes = ysize - ( width * group_size );
+      assert( height != 1 ); // widthxheight can't be 1
+      halfWidth = 1;
+      // one vertical column with possible pad bytes per row
+      // average two at a time
+      
+      for( jj = 0; jj < halfHeight; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          datain.position( src );
+          temp = datain.get();
+          datain.position( src + ysize );
+          temp += datain.get();
+          temp /= 2;
+          src += element_size;
+          dest++;
+        }
+        src += padBytes; // add pad bytes, if any, to get to end of row
+        src += ysize;
+      }
+      assert( src == ysize * height );
+    }
+    assert( dest == components * element_size * halfWidth * halfHeight );
+  }
+  
+  public static void halveImage_ushort( int components, int width, int height,
+                          ByteBuffer datain, ShortBuffer dataout, int element_size,
+                          int ysize, int group_size, boolean myswap_bytes ) {
+    int i, j, k, l;
+    int newwidth, newheight;
+    int s = 0;
+    int t = 0;
+    int temp = 0;
+    // handle case where there is only 1 column/row
+    if( width == 1 || height == 1 ) {
+      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+      halve1Dimage_ushort( components, width, height, datain, dataout, element_size,
+                                ysize, group_size, myswap_bytes );
+      return;
+    }
+    
+    newwidth = width / 2;
+    newheight = height / 2;
+    
+    // Piece of cake
+    if( !myswap_bytes ) {
+      for( i = 0; i < newheight; i++ ) {
+        for( j = 0; j < newwidth; j++ ) {
+          for( k = 0; k < components; k++ ) {
+            datain.position( t );
+            temp = ( 0x0000FFFF & datain.getShort() );
+            datain.position( t + group_size );
+            temp += ( 0x0000FFFF & datain.getShort() );
+            datain.position( t + ysize );
+            temp += ( 0x0000FFFF & datain.getShort() );
+            datain.position( t + ysize + group_size );
+            temp += ( 0x0000FFFF & datain.getShort() );
+            dataout.put( (short)( ( temp + 2 ) / 4 ) );
+            t += element_size;
+          }
+          t += group_size;
+        }
+        t += ysize;
+      }
+    } else {
+      for( i = 0; i < newheight; i++ ) {
+        for( j = 0; j < newwidth; j++ ) {
+          for( k = 0; k < components; k++ ) {
+            datain.position( t );
+            temp = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+            datain.position( t + group_size );
+            temp += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+            datain.position( t + ysize );
+            temp += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+            datain.position( t + ysize + group_size );
+            temp += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+            dataout.put( (short)( ( temp + 2 ) / 4 ) );
+            t += element_size;
+          }
+          t += group_size;
+        }
+        t += ysize;
+      }
+    }
+  }
+  
+  public static void halve1Dimage_ushort( int components, int width, int height,
+                      ByteBuffer datain, ShortBuffer dataout, int element_size,
+                      int ysize, int group_size, boolean myswap_bytes ) {
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int src = 0;
+    int dest = 0;
+    int jj;
+    
+    assert( width == 1 || height == 1 ); // must be 1D
+    assert( width != height ); // can't be square
+    
+    if( height == 1 ) { // 1 row
+      assert( width != 1 ); // widthxheight can't be 1
+      halfHeight = 1;
+      
+      for( jj = 0; jj < halfWidth; jj++ ) {
+        int kk;
+        for( kk = 0; kk < halfHeight; kk++ ) {
+          int[] ushort = new int[BOX2];
+          if( myswap_bytes ) {
+            datain.position( src );
+            ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+            datain.position( src + group_size );
+            ushort[1] = (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+          } else {
+            datain.position( src );
+            ushort[0] = (0x0000FFFF & datain.getShort() );
+            datain.position( src + group_size );
+            ushort[1] = (0x0000FFFF & datain.getShort() );
+          }
+          dataout.put( (short)( (ushort[0] + ushort[1]) / 2 ) );
+          src += element_size;
+          dest += 2;
+        }
+        src += group_size; // skip to next 2
+      }
+      int padBytes = ysize - ( width * group_size );
+      src += padBytes; // for assertion only
+    } else if( width == 1 ) { // 1 column
+      int padBytes = ysize - ( width * group_size );
+      assert( height != 1 ); // widthxheight can't be 1
+      halfWidth = 1;
+      // one vertical column with possible pad bytes per row
+      // average two at a time
+      
+      for( jj = 0; jj < halfHeight; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          int[] ushort = new int[BOX2];
+          if( myswap_bytes ) {
+            datain.position( src );
+            ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+            datain.position( src + ysize );
+            ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+          } else {
+            datain.position( src );
+            ushort[0] = ( 0x0000FFFF & datain.getShort() );
+            datain.position( src + ysize );
+            ushort[1] = ( 0x0000FFFF & datain.getShort() );
+          }
+          dataout.put( (short)((ushort[0] + ushort[1]) / 2) );
+          src += element_size;
+          dest += 2;
+        }
+        src += padBytes; // add pad bytes, if any, to get to end of row
+        src += ysize;
+      }
+      assert( src == ysize * height );
+    }
+    assert( dest == components * element_size * halfWidth * halfHeight );
+  }
+  
+  public static void halveImage_short( int components, int width, int height,
+                        ByteBuffer datain, ShortBuffer dataout, int element_size,
+                        int ysize, int group_size, boolean myswap_bytes ) {
+    int i, j, k, l;
+    int newwidth, newheight;
+    int s = 0;
+    int t = 0;
+    short temp = (short)0;
+    // handle case where there is only 1 column/row
+    if( width == 1 || height == 1 ) {
+      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+      halve1Dimage_short( components, width, height, datain, dataout, element_size,
+                            ysize, group_size, myswap_bytes );
+      return;
+    }
+    
+    newwidth = width / 2;
+    newheight = height / 2;
+    
+    // Piece of cake
+    if( !myswap_bytes ) {
+      for( i = 0; i < newheight; i++ ) {
+        for( j = 0; j < newwidth; j++ ) {
+          for( k = 0; k < components; k++ ) {
+            datain.position( t );
+            temp = datain.getShort();
+            datain.position( t + group_size );
+            temp += datain.getShort();
+            datain.position( t + ysize );
+            temp += datain.getShort();
+            datain.position( t + ysize + group_size );
+            temp += datain.getShort();
+            temp += 2;
+            temp /= 4;
+            dataout.put( (short)temp );
+            t += element_size;
+          }
+          t += group_size;
+        }
+        t += ysize;
+      }
+    } else {
+      for( i = 0; i < newheight; i++ ) {
+        for( j = 0; j < newwidth; j++ ) {
+          for( k = 0; k < components; k++ ) {
+            short b;
+            int buf;
+            datain.position( t );
+            temp = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+            datain.position( t + group_size );
+            temp += Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+            datain.position( t + ysize );
+            temp += Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+            datain.position( t + ysize + group_size );
+            temp += Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+            temp += 2;
+            temp /= 4;
+            dataout.put( temp );
+            t += element_size;
+          }
+          t += group_size;
+        }
+        t += ysize;
+      }
+    }
+  }
+  
+  public static void halve1Dimage_short( int components, int width, int height,
+              ByteBuffer datain, ShortBuffer dataout, int element_size, int ysize,
+              int group_size, boolean myswap_bytes ) {
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int src = 0;
+    int dest = 0;
+    int jj;
+    
+    assert( width == 1 || height == 1 ); // must be 1D
+    assert( width != height ); // can't be square
+    
+    if( height == 1 ) { // 1 row
+      assert( width != 1 ); // can't be 1x1
+      halfHeight = 1;
+      
+      for( jj = 0; jj < halfWidth; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          short[] sshort = new short[BOX2];
+          if( myswap_bytes ) {
+            datain.position( src );
+            sshort[0] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+            datain.position( src + group_size );
+            sshort[1] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+          } else {
+            datain.position( src );
+            sshort[0] = datain.getShort();
+            datain.position( src + group_size );
+            sshort[1] = datain.getShort();
+          }
+          dataout.put( (short)(( sshort[0] + sshort[1] ) / 2) );
+          src += element_size;
+          dest += 2;
+        }
+        src += group_size; // skip to next 2
+      }
+      int padBytes = ysize - ( width * group_size );
+      src += padBytes; // for assertion only
+    } else if( width == 1 ) {
+      int padBytes = ysize - ( width * group_size );
+      assert( height != 1 );
+      halfWidth = 1;
+      // one vertical column with possible pad bytes per row
+      // average two at a time
+      
+      for( jj = 0; jj < halfHeight; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          short[] sshort = new short[BOX2];
+          if( myswap_bytes ) {
+            datain.position( src );
+            sshort[0] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+            datain.position( src + ysize );
+            sshort[1] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+          } else {
+            datain.position( src );
+            sshort[0] = datain.getShort();
+            datain.position( src + ysize );
+            sshort[1] = datain.getShort();
+          }
+          dataout.put( (short)(( sshort[0] + sshort[1] ) / 2) );
+          src += element_size;
+          dest += 2;
+        }
+        src += padBytes; // add pad bytes, if any, to get to end of row
+        src += ysize;
+      }
+      assert( src == ysize * height );
+    }
+    assert( dest == ( components * element_size * halfWidth * halfHeight ) );
+  }
+  
+  public static void halveImage_uint( int components, int width, int height,
+                          ByteBuffer datain, IntBuffer dataout, int element_size,
+                          int ysize, int group_size, boolean myswap_bytes ) {
+    int i, j, k, l;
+    int newwidth, newheight;
+    int s = 0;
+    int t = 0;
+    double temp = 0;
+    
+    // handle case where there is only 1 column/row
+    if( width == 1 || height == 1 ) {
+      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+      halve1Dimage_uint( components, width, height, datain, dataout, element_size,
+                                ysize, group_size, myswap_bytes );
+      return;
+    }
+    
+    newwidth = width / 2;
+    newheight = height / 2;
+    
+    // Piece of cake
+    if( !myswap_bytes ) {
+      for( i = 0; i < newheight; i++ ) {
+        for( j = 0; j < newwidth; j++ ) {
+          for( k = 0; k < components; k++ ) {
+            datain.position( t );
+            temp = (0x000000007FFFFFFFL & datain.getInt() );
+            datain.position( t + group_size );
+            temp += (0x000000007FFFFFFFL & datain.getInt() );
+            datain.position( t + ysize );
+            temp += (0x000000007FFFFFFFL & datain.getInt() );
+            datain.position( t + ysize + group_size );
+            temp += (0x000000007FFFFFFFL & datain.getInt() );
+            dataout.put( (int)( ( temp / 4 ) + 0.5 ) );
+            t += element_size;
+          }
+          t += group_size;
+        }
+        t += ysize;
+      }
+    } else {
+      for( i = 0; i < newheight; i++ ) {
+        for( j = 0; j < newwidth; j++ ) {
+          for( k = 0; k < components; k++ ) {
+            // need to cast to double to hold large unsigned ints
+            double buf;
+            datain.position( t );
+            buf = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            datain.position( t + group_size );
+            buf += ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            datain.position( t + ysize );
+            buf += ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            datain.position( t + ysize + group_size );
+            buf += ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            temp /= 4;
+            temp += 0.5;
+            dataout.put( (int)temp );
+            t += element_size;
+          }
+          t += group_size;
+        }
+        t += ysize;
+      }
+    }
+  }
+  
+  public static void halve1Dimage_uint( int components, int width, int height,
+                      ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
+                      int group_size, boolean myswap_bytes ) {
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int src = 0;
+    int dest = 0;
+    int jj;
+    
+    assert( width == 1 || height == 1 ); // must be 1D
+    assert( width != height ); // can't be square
+    
+    if( height == 1 ) { // 1 row
+      assert( width != 1 ); // widthxheight can't be 1
+      halfHeight = 1;
+      
+      for( jj = 0; jj < halfWidth; jj++ ) {
+        int kk;
+        for( kk = 0; kk < halfHeight; kk++ ) {
+          long[] uint = new long[BOX2];
+          if( myswap_bytes ) {
+            datain.position( src );
+            uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            datain.position( src + group_size );
+            uint[1] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+          } else {
+            datain.position( src );
+            uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
+            datain.position( src + group_size );
+            uint[1] = (0x00000000FFFFFFFF & datain.getInt() );
+          }
+          dataout.put( (int)( ( uint[0] + uint[1] ) / 2.0 ) );
+          src += element_size;
+          dest += 4;
+        }
+        src += group_size; // skip to next 2
+      }
+      int padBytes = ysize - ( width * group_size );
+      src += padBytes; // for assertion only
+    } else if( width == 1 ) { // 1 column
+      int padBytes = ysize - ( width * group_size );
+      assert( height != 1 ); // widthxheight can't be 1
+      halfWidth = 1;
+      // one vertical column with possible pad bytes per row
+      // average two at a time
+      
+      for( jj = 0; jj < halfHeight; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          long[] uint = new long[BOX2];
+          if( myswap_bytes ) {
+            datain.position( src );
+            uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            datain.position( src + group_size );
+            uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+          } else {
+            datain.position( src );
+            uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
+            datain.position( src + ysize );
+            uint[1] = ( 0x00000000FFFFFFFF & datain.getInt() );
+          }
+          dataout.put( (int)( ( uint[0] + uint[1] ) / 2.0 ) );
+          src += element_size;
+          dest += 4;
+        }
+        src += padBytes; // add pad bytes, if any, to get to end of row
+        src += ysize;
+      }
+      assert( src == ysize * height );
+    }
+    assert( dest == components * element_size * halfWidth * halfHeight );
+  }
+  
+  public static void halveImage_int( int components, int width, int height,
+                        ByteBuffer datain, IntBuffer dataout, int element_size,
+                        int ysize, int group_size, boolean myswap_bytes ) {
+    int i, j, k, l;
+    int newwidth, newheight;
+    int s = 0;
+    int t = 0;
+    int temp = 0;
+    
+    // handle case where there is only 1 column/row
+    if( width == 1 || height == 1 ) {
+      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+      halve1Dimage_int( components, width, height, datain, dataout, element_size,
+                            ysize, group_size, myswap_bytes );
+      return;
+    }
+    
+    newwidth = width / 2;
+    newheight = height / 2;
+    
+    // Piece of cake
+    if( !myswap_bytes ) {
+      for( i = 0; i < newheight; i++ ) {
+        for( j = 0; j < newwidth; j++ ) {
+          for( k = 0; k < components; k++ ) {
+            datain.position( t );
+            temp = datain.getInt();
+            datain.position( t + group_size );
+            temp += datain.getInt();
+            datain.position( t + ysize );
+            temp += datain.getInt();
+            datain.position( t + ysize + group_size );
+            temp += datain.getInt();
+            temp = (int)( ( temp / 4.0f ) + 0.5f );
+            dataout.put( temp );
+            t += element_size;
+          }
+          t += group_size;
+        }
+        t += ysize;
+      }
+    } else {
+      for( i = 0; i < newheight; i++ ) {
+        for( j = 0; j < newwidth; j++ ) {
+          for( k = 0; k < components; k++ ) {
+            long b;
+            float buf;
+            datain.position( t );
+            b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            buf = b;
+            datain.position( t + group_size );
+            b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            buf += b;
+            datain.position( t + ysize );
+            b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            buf += b;
+            datain.position( t + ysize + group_size );
+            b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            buf += b;
+            dataout.put( (int)( ( buf / 4.0f ) + 0.5f ) );
+            t += element_size;
+          }
+          t += group_size;
+        }
+        t += ysize;
+      }
+    }
+  }
+  
+  public static void halve1Dimage_int( int components, int width, int height,
+              ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
+              int group_size, boolean myswap_bytes ) {
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int src = 0;
+    int dest = 0;
+    int jj;
+    
+    assert( width == 1 || height == 1 ); // must be 1D
+    assert( width != height ); // can't be square
+    
+    if( height == 1 ) { // 1 row
+      assert( width != 1 ); // can't be 1x1
+      halfHeight = 1;
+      
+      for( jj = 0; jj < halfWidth; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          long[] uint = new long[BOX2];
+          if( myswap_bytes ) {
+            datain.position( src );
+            uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            datain.position( src + group_size );
+            uint[1] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+          } else {
+            datain.position( src );
+            uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
+            datain.position( src + group_size );
+            uint[1] = ( 0x00000000FFFFFFFF & datain.getInt() );
+          }
+          dataout.put( (int)( ( (float)uint[0] + (float)uint[1] ) / 2.0f) );
+          src += element_size;
+          dest += 4;
+        }
+        src += group_size; // skip to next 2
+      }
+      int padBytes = ysize - ( width * group_size );
+      src += padBytes; // for assertion only
+    } else if( width == 1 ) {
+      int padBytes = ysize - ( width * group_size );
+      assert( height != 1 );
+      halfWidth = 1;
+      // one vertical column with possible pad bytes per row
+      // average two at a time
+      
+      for( jj = 0; jj < halfHeight; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          long[] uint = new long[BOX2];
+          if( myswap_bytes ) {
+            datain.position( src );
+            uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+            datain.position( src + ysize );
+            uint[1] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+          } else {
+            datain.position( src );
+            uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
+            datain.position( src + ysize );
+            uint[1] = ( 0x00000000FFFFFFFF & datain.getInt() );
+          }
+          dataout.put( (int)(( (float)uint[0] + (float)uint[1] ) / 2.0f) );
+          src += element_size;
+          dest += 4;
+        }
+        src += padBytes; // add pad bytes, if any, to get to end of row
+        src += ysize;
+      }
+      assert( src == ysize * height );
+    }
+    assert( dest == ( components * element_size * halfWidth * halfHeight ) );
+  }
+  
+  public static void halveImage_float( int components, int width, int height,
+                    ByteBuffer datain, FloatBuffer dataout, int element_size,
+                    int ysize, int group_size, boolean myswap_bytes ) {
+    int i, j, k, l;
+    int newwidth, newheight;
+    int s = 0;
+    int t = 0;
+    float temp = 0.0f;
+    // handle case where there is only 1 column/row
+    if( width == 1 || height == 1 ) {
+      assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+      halve1Dimage_float( components, width, height, datain, dataout, element_size,
+                                              ysize, group_size, myswap_bytes );
+      return;
+    }
+    
+    newwidth = width / 2;
+    newheight = height / 2;
+    
+    // Piece of cake
+    if( !myswap_bytes ) {
+      for( i = 0; i < newheight; i++ ) {
+        for( j = 0; j < newwidth; j++ ) {
+          for( k = 0; k < components; k++ ) {
+            datain.position( t );
+            temp = datain.getFloat();
+            datain.position( t + group_size );
+            temp += datain.getFloat();
+            datain.position( t + ysize );
+            temp += datain.getFloat();
+            datain.position( t + ysize + group_size );
+            temp /= 4.0f;
+            dataout.put( temp );
+            t += element_size;
+          }
+          t += group_size;
+        }
+        t += ysize;
+      }
+    } else {
+      for( i = 0; i < newheight; i++ ) {
+        for( j = 0; j < newwidth; j++ ) {
+          for( k = 0; k < components; k++ ) {
+            float buf;
+            datain.position( t );
+            buf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+            datain.position( t + group_size );
+            buf += Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+            datain.position( t + ysize );
+            buf += Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+            datain.position( t + ysize + group_size );
+            buf += Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+            dataout.put( buf / 4.0f );
+            t += element_size;
+          }
+          t += group_size;
+        }
+        t += ysize;
+      }
+    }
+  }
+  
+  public static void halve1Dimage_float( int components, int width, int height,
+              ByteBuffer datain, FloatBuffer dataout, int element_size, int ysize,
+              int group_size, boolean myswap_bytes ) {
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int src = 0;
+    int dest = 0;
+    int jj;
+    
+    assert( width == 1 || height == 1 ); // must be 1D
+    assert( width != height ); // can't be square
+    
+    if( height == 1 ) { // 1 row
+      assert( width != 1 ); // can't be 1x1
+      halfHeight = 1;
+      
+      for( jj = 0; jj < halfWidth; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          float[] sfloat = new float[BOX2];
+          if( myswap_bytes ) {
+            datain.position( src );
+            sfloat[0] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+            datain.position( src + group_size );
+            sfloat[1] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+          } else {
+            datain.position( src );
+            sfloat[0] = datain.getFloat();
+            datain.position( src + group_size );
+            sfloat[1] = datain.getFloat();
+          }
+          dataout.put( (sfloat[0] + sfloat[1]) / 2.0f );
+          src += element_size;
+          dest += 4;
+        }
+        src += group_size; // skip to next 2
+      }
+      int padBytes = ysize - ( width * group_size );
+      src += padBytes; // for assertion only
+    } else if( width == 1 ) {
+      int padBytes = ysize - ( width * group_size );
+      assert( height != 1 );
+      halfWidth = 1;
+      // one vertical column with possible pad bytes per row
+      // average two at a time
+      
+      for( jj = 0; jj < halfHeight; jj++ ) {
+        int kk;
+        for( kk = 0; kk < components; kk++ ) {
+          float[] sfloat = new float[BOX2];
+          if( myswap_bytes ) {
+            datain.position( src );
+            sfloat[0] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+            datain.position( src + ysize );
+            sfloat[1] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+          } else {
+            datain.position( src );
+            sfloat[0] = datain.getFloat();
+            datain.position( src + ysize );
+            sfloat[1] = datain.getFloat();
+          }
+          dataout.put( ( sfloat[0] + sfloat[1] ) / 2.0f );
+          src += element_size;
+          dest += 4;
+        }
+        src += padBytes; // add pad bytes, if any, to get to end of row
+        src += ysize;
+      }
+      assert( src == ysize * height );
+    }
+    assert( dest == ( components * element_size * halfWidth * halfHeight ) );
+  }
+  
+  public static void halveImagePackedPixel( int components, Extract extract, int width, 
+          int height, ByteBuffer datain, ByteBuffer dataout, 
+          int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
+    if( width == 1 || height == 1 ) {
+      assert( !( width == 1 && height == 1 ) );
+      halve1DimagePackedPixel( components, extract, width, height, datain, dataout,
+                          pixelSizeInBytes, rowSizeInBytes, isSwap );
+      return;
+    }
+    int ii, jj;
+    
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int src = 0;
+    int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+    int outIndex = 0;
+    
+    for( ii = 0; ii < halfHeight; ii++ ) {
+      for( jj = 0; jj < halfWidth; jj++ ) {
+        float totals[] = new float[4];
+        float extractTotals[][] = new float[BOX4][4];
+        int cc;
+        
+        datain.position( src );
+        extract.extract( isSwap, datain, extractTotals[0] );
+        datain.position( src + pixelSizeInBytes );
+        extract.extract( isSwap, datain, extractTotals[1] );
+        datain.position( src + rowSizeInBytes );
+        extract.extract( isSwap, datain, extractTotals[2] );
+        datain.position( src + rowSizeInBytes + pixelSizeInBytes );
+        extract.extract( isSwap, datain, extractTotals[3] );
+        for( cc = 0; cc < components; cc++ ) {
+          int kk = 0;
+          // grab 4 pixels to average
+          totals[cc] = 0.0f;
+          for( kk = 0; kk < BOX4; kk++ ) {
+            totals[cc] += extractTotals[kk][cc];
+          }
+          totals[cc] /= BOX4;
+        }
+        extract.shove( totals, outIndex, dataout );
+        outIndex++;
+        src += pixelSizeInBytes + pixelSizeInBytes;
+      }
+      // skip past pad bytes, if any, to get to next row
+      src += padBytes;
+      src += rowSizeInBytes;
+    }
+    assert( src == rowSizeInBytes * height );
+    assert( outIndex == halfWidth * halfHeight );
+  }
+  
+  public static void halve1DimagePackedPixel( int components, Extract extract, int width,
+              int height, ByteBuffer datain, ByteBuffer dataout,
+              int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int src = 0;
+    int jj;
+    
+    assert( width == 1 || height == 1 );
+    assert( width != height );
+    
+    if( height == 1 ) {
+      int outIndex = 0;
+      
+      assert( width != 1 );
+      halfHeight = 1;
+      
+      // one horizontal row with possible pad bytes
+      
+      for( jj = 0; jj < halfWidth; jj++ ) {
+        float[] totals = new float[4];
+        float[][] extractTotals = new float[BOX2][4];
+        int cc;
+        
+        datain.position( src );
+        extract.extract( isSwap, datain, extractTotals[0] );
+        datain.position( src + pixelSizeInBytes );
+        extract.extract( isSwap, datain, extractTotals[1] );
+        for( cc = 0; cc < components; cc++ ) {
+          int kk = 0;
+          // grab 4 pixels to average
+          totals[cc] = 0.0f;
+          for( kk = 0; kk < BOX2; kk++ ) {
+            totals[cc] += extractTotals[kk][cc];
+          }
+          totals[cc] /= BOX2;
+        }
+        extract.shove( totals, outIndex, dataout );
+        outIndex++;
+        // skip over to next group of 2
+        src += pixelSizeInBytes + pixelSizeInBytes;
+      }
+      int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+      src += padBytes;
+      
+      assert( src == rowSizeInBytes );
+      assert( outIndex == halfWidth * halfHeight );
+    } else if( width == 1 ) {
+      int outIndex = 0;
+      
+      assert( height != 1 );
+      halfWidth = 1;
+      // one vertical volumn with possible pad bytes per row
+      // average two at a time
+      
+      for( jj = 0; jj < halfHeight; jj++ ) {
+        float[] totals = new float[4];
+        float[][] extractTotals = new float[BOX2][4];
+        int cc;
+        // average two at a time, instead of four
+        datain.position( src );
+        extract.extract( isSwap, datain, extractTotals[0] );
+        datain.position( src + rowSizeInBytes );
+        extract.extract( isSwap, datain, extractTotals[1] );
+        for( cc = 0; cc < components; cc++ ) {
+          int kk = 0;
+          // grab 4 pixels to average
+          totals[cc] = 0.0f;
+          for( kk = 0; kk < BOX2; kk++ ) {
+            totals[cc] += extractTotals[kk][cc];
+          }
+          totals[cc] /= BOX2;
+        }
+        extract.shove( totals, outIndex, dataout );
+        outIndex++;
+        // skip over to next group of 2
+        src += rowSizeInBytes + rowSizeInBytes;
+      }
+      assert( src == rowSizeInBytes );
+      assert( outIndex == halfWidth * halfHeight );
+    }
+  }
+  
+  public static void halveImagePackedPixelSlice( int components, Extract extract,
+          int width, int height, int depth, ByteBuffer dataIn,
+          ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
+          int imageSizeInBytes, boolean isSwap ) {
+    int ii, jj;
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int halfDepth = depth / 2;
+    int src = 0;
+    int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+    int outIndex = 0;
+    
+    assert( (width == 1 || height == 1) && depth >= 2 );
+    
+    if( width == height ) {
+      assert( width == 1 && height == 1 );
+      assert( depth >= 2 );
+      
+      for( ii = 0; ii < halfDepth; ii++ ) {
+        float totals[] = new float[4];
+        float extractTotals[][] = new float[BOX2][4];
+        int cc;
+        
+        dataIn.position( src );
+        extract.extract( isSwap, dataIn, extractTotals[0] );
+        dataIn.position( src + imageSizeInBytes );
+        extract.extract( isSwap, dataIn, extractTotals[1] );
+        
+        for( cc = 0; cc < components; cc++ ) {
+          int kk;
+          
+          // average only 2 pixels since a column
+          totals[cc]= 0.0f;
+          for( kk = 0; kk < BOX2; kk++ ) {
+            totals[cc] += extractTotals[kk][cc];
+          }
+          totals[cc] /= BOX2;
+        } // for cc
+        
+        extract.shove( totals, outIndex, dataOut );
+        outIndex++;
+        // skip over to next group of 2
+        src += imageSizeInBytes + imageSizeInBytes;
+      } // for ii
+    } else if( height == 1 ) {
+      assert( width != 1 );
+      
+      for( ii = 0; ii < halfDepth; ii++ ) {
+        for( jj = 0; jj < halfWidth; jj++ ) {
+          float totals[] = new float[4];
+          float extractTotals[][] = new float[BOX4][4];
+          int cc;
+          
+          dataIn.position( src );
+          extract.extract( isSwap, dataIn, extractTotals[0] );
+          dataIn.position( src + pixelSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[1] );
+          dataIn.position( src + imageSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[2] );
+          dataIn.position( src + pixelSizeInBytes + imageSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[3] );
+          
+          for( cc = 0; cc < components; cc++ ) {
+            int kk;
+            
+            // grab 4 pixels to average
+            totals[cc] = 0.0f;
+            for( kk = 0; kk < BOX4; kk++ ) {
+              totals[cc]+= extractTotals[kk][cc];
+            }
+            totals[cc]/= (float)BOX4;
+          }
+          extract.shove( totals, outIndex, dataOut );
+          outIndex++;
+          // skip over to next horizontal square of 4
+          src += imageSizeInBytes + imageSizeInBytes;
+        }
+      }
+    } else if( width == 1 ) {
+      assert( height != 1 );
+      
+      for( ii = 0; ii < halfDepth; ii++ ) {
+        for( jj = 0; jj < halfWidth; jj++ ) {
+          float totals[] = new float[4];
+          float extractTotals[][] = new float[BOX4][4];
+          int cc;
+          
+          dataIn.position( src );
+          extract.extract( isSwap, dataIn, extractTotals[0] );
+          dataIn.position( src + rowSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[1] );
+          dataIn.position( src + imageSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[2] );
+          dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[3] );
+          
+          for( cc = 0; cc < components; cc++ ) {
+            int kk;
+            
+            // grab 4 pixels to average
+            totals[cc] = 0.0f;
+            for( kk = 0; kk < BOX4; kk++ ) {
+              totals[cc]+= extractTotals[kk][cc];
+            }
+            totals[cc]/= (float)BOX4;
+          }
+          extract.shove( totals, outIndex, dataOut );
+          outIndex++;
+          // skip over to next horizontal square of 4
+          src += imageSizeInBytes + imageSizeInBytes;
+        }
+      }
+    }
+  }
+  
+  public static void halveImageSlice( int components, ExtractPrimitive extract, int width,
+          int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
+          int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
+          int imageSizeInBytes, boolean isSwap ) {
+    int ii, jj;
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int halfDepth = depth / 2;
+    int src = 0;
+    int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
+    int outIndex = 0;
+    
+    assert( (width == 1 || height == 1) && depth >= 2 );
+    
+    if( width == height ) {
+      assert( width == 1 && height == 1 );
+      assert( depth >= 2 );
+      
+      for( ii = 0; ii < halfDepth; ii++ ) {
+        int cc;
+        for( cc = 0; cc < components; cc++ ) {
+          double[] totals = new double[4];
+          double[][] extractTotals = new double[BOX2][4];
+          int kk;
+          
+          dataIn.position( src );
+          extractTotals[0][cc] = extract.extract( isSwap, dataIn );
+          dataIn.position( src + imageSizeInBytes );
+          extractTotals[1][cc] = extract.extract( isSwap, dataIn );
+          
+          // average 2 pixels since only a column
+          totals[cc] = 0.0f;
+          // totals[red] = extractTotals[0][red] + extractTotals[1][red];
+          // totals[red] = red / 2;
+          for( kk = 0; kk < BOX2; kk++ ) {
+            totals[cc] += extractTotals[kk][cc];
+          }
+          totals[cc] /= (double)BOX2;
+          
+          extract.shove( totals[cc], outIndex, dataOut );
+          outIndex++;
+          src += elementSizeInBytes;
+        } // for cc
+        // skip over next group of 2
+        src += rowSizeInBytes;
+      } // for ii
+      
+      assert( src == rowSizeInBytes * height * depth );
+      assert( outIndex == halfDepth * components );
+    } else if( height == 1 ) {
+      assert( width != 1 );
+      
+      for( ii = 0; ii < halfDepth; ii++ ) {
+        for( jj = 0; jj < halfWidth; jj++ ) {
+          int cc;
+          for( cc = 0; cc < components; cc++ ) {
+            int kk;
+            double totals[] = new double[4];
+            double extractTotals[][] = new double[BOX4][4];
+            
+            dataIn.position( src );
+            extractTotals[0][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + groupSizeInBytes );
+            extractTotals[1][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + imageSizeInBytes );
+            extractTotals[2][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
+            extractTotals[3][cc] = extract.extract( isSwap, dataIn );
+            
+            // grab 4 pixels to average
+            totals[cc] = 0.0f;
+            // totals[red] = extractTotals[0][red] + extractTotals[1][red] +
+            //               extractTotals[2][red] + extractTotals[3][red];
+            // totals[red] /= (double)BOX4;
+            for( kk = 0; kk < BOX4; kk++ ) {
+              totals[cc] += extractTotals[kk][cc];
+            }
+            totals[cc] /= (double)BOX4;
+            
+            extract.shove( totals[cc], outIndex, dataOut );
+            outIndex++;
+            src += elementSizeInBytes;
+          } // for cc
+          // skip over to next horizontal square of 4
+          src += elementSizeInBytes;
+        } // for jj
+        src += padBytes;
+        src += rowSizeInBytes;
+      } // for ii
+      assert( src == rowSizeInBytes * height * depth );
+      assert( outIndex == halfWidth * halfDepth * components );
+    } else if( width == 1 ) {
+      assert( height != 1 );
+      
+      for( ii = 0; ii < halfDepth; ii++ ) {
+        for( jj = 0; jj < halfHeight; jj++ ) {
+          int cc;
+          for( cc = 0; cc < components; cc++ ) {
+            int kk;
+            double totals[] = new double[4];
+            double extractTotals[][] = new double[BOX4][4];
+            
+            dataIn.position( src );
+            extractTotals[0][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + rowSizeInBytes );
+            extractTotals[1][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + imageSizeInBytes );
+            extractTotals[2][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
+            extractTotals[3][cc] = extract.extract( isSwap, dataIn );
+            
+            
+            // grab 4 pixels to average
+            totals[cc] = 0.0f;
+            // totals[red] = extractTotals[0][red] + extractTotals[1][red] +
+            //               extractTotals[2][red] + extractTotals[3][red];
+            // totals[red] /= (double)BOX4;
+            for( kk = 0; kk < BOX4; kk++ ) {
+              totals[cc] += extractTotals[kk][cc];
+            }
+            totals[cc] /= (double)BOX4;
+            
+            extract.shove( totals[cc], outIndex, dataOut );
+            outIndex++;
+            src += elementSizeInBytes;
+          } // for cc
+          // skip over to next horizontal square of 4
+          src += padBytes;
+          src += rowSizeInBytes;
+        } // for jj
+        src += imageSizeInBytes;
+      } // for ii
+      assert( src == rowSizeInBytes * height * depth );
+      assert( outIndex == halfWidth * halfDepth * components );
+    }
+  }
+  
+  public static void halveImage3D( int components, ExtractPrimitive extract,
+          int width, int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
+          int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
+          int imageSizeInBytes, boolean isSwap ) {
+    assert( depth > 1 );
+    
+    // horizontal/vertical/onecolumn slice viewed from top
+    if( width == 1 || height == 1 ) {
+      assert( 1 <= depth );
+      
+      halveImageSlice( components, extract, width, height, depth, dataIn, dataOut,
+              elementSizeInBytes, groupSizeInBytes, rowSizeInBytes, imageSizeInBytes,
+              isSwap );
+      return;
+    }
+    
+    int ii, jj, dd;
+    
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int halfDepth = depth / 2;
+    int src = 0;
+    int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
+    int outIndex = 0;
+    
+    for( dd = 0; dd < halfDepth; dd++ ) {
+      for( ii = 0; ii < halfHeight; ii++ ) {
+        for( jj = 0; jj < halfWidth; jj++ ) {
+          int cc;
+          for( cc = 0; cc < components; cc++ ) {
+            int kk;
+            double totals[] = new double[4];
+            double extractTotals[][] = new double[BOX8][4];
+            
+            dataIn.position( src );
+            extractTotals[0][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + groupSizeInBytes );
+            extractTotals[1][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + rowSizeInBytes );
+            extractTotals[2][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + rowSizeInBytes + groupSizeInBytes );
+            extractTotals[3][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + imageSizeInBytes );
+            extractTotals[4][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + groupSizeInBytes + imageSizeInBytes );
+            extractTotals[5][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
+            extractTotals[6][cc] = extract.extract( isSwap, dataIn );
+            dataIn.position( src + rowSizeInBytes + imageSizeInBytes + groupSizeInBytes );
+            extractTotals[7][cc] = extract.extract( isSwap, dataIn );
+            
+            totals[cc] = 0.0f;
+            
+            for( kk = 0; kk < BOX8; kk++ ) {
+              totals[cc] += extractTotals[kk][cc];
+            }
+            totals[cc] /= (double)BOX8;
+            
+            extract.shove( totals[cc], outIndex, dataOut );
+            outIndex++;
+            
+            src += elementSizeInBytes;
+          } // for cc
+          // skip over to next square of 4
+          src += groupSizeInBytes;
+        } // for jj
+        // skip past pad bytes, if any, to get to next row
+        src += padBytes;
+        src += rowSizeInBytes;
+      } // for ii
+      src += imageSizeInBytes;
+    } // for dd
+    assert( src == rowSizeInBytes * height * depth );
+    assert( outIndex == halfWidth * halfHeight * halfDepth * components );
+  }
+  
+  public static void halveImagePackedPixel3D( int components, Extract extract,
+          int width, int height, int depth, ByteBuffer dataIn, 
+          ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
+          int imageSizeInBytes, boolean isSwap ) {
+    if( depth == 1 ) {
+      assert( 1 <= width && 1 <= height );
+      
+      halveImagePackedPixel( components, extract, width, height, dataIn, dataOut,
+              pixelSizeInBytes, rowSizeInBytes, isSwap );
+      return;
+    } else if( width == 1 || height == 1 ) { // a horizontal or vertical slice viewed from top
+      assert( 1 <= depth );
+      
+      halveImagePackedPixelSlice( components, extract, width, height, depth, dataIn,
+              dataOut, pixelSizeInBytes, rowSizeInBytes, imageSizeInBytes, isSwap );
+      return;
+    }
+    int ii, jj, dd;
+    
+    int halfWidth = width / 2;
+    int halfHeight = height / 2;
+    int halfDepth = depth / 2;
+    int src = 0;
+    int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+    int outIndex = 0;
+    
+    for( dd = 0; dd < halfDepth; dd++ ) {
+      for( ii = 0; ii < halfHeight; ii++ ) {
+        for( jj = 0; jj < halfWidth; jj++ ) {
+          float totals[] = new float[4]; // 4 is max components
+          float extractTotals[][] = new float[BOX8][4];
+          int cc;
+          
+          dataIn.position( src );
+          extract.extract( isSwap, dataIn, extractTotals[0] );
+          dataIn.position( src + pixelSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[1] );
+          dataIn.position( src + rowSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[2] );
+          dataIn.position( src + rowSizeInBytes + pixelSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[3] );
+          dataIn.position( src + imageSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[4] );
+          dataIn.position( src + pixelSizeInBytes + imageSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[5] );
+          dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[6] );
+          dataIn.position( src + rowSizeInBytes + pixelSizeInBytes + imageSizeInBytes );
+          extract.extract( isSwap, dataIn, extractTotals[7] );
+          
+          for( cc = 0; cc < components; cc++ ) {
+            int kk;
+            // grab 8 pixels to average
+            totals[cc] = 0.0f;
+            for( kk = 0; kk < BOX8; kk++ ) {
+              totals[cc] += extractTotals[kk][cc];
+            }
+            totals[cc] /= (float)BOX8;
+          }
+          extract.shove( totals, outIndex, dataOut );
+          outIndex++;
+          // skip over to next square of 4
+          src += pixelSizeInBytes + pixelSizeInBytes;
+        }
+        // skip past pad bytes, if any, to get to next row
+        src += padBytes;
+        src += rowSizeInBytes;
+      }
+      src += imageSizeInBytes;
+    }
+    assert( src == rowSizeInBytes * height * depth );
+    assert( outIndex == halfWidth * halfHeight * halfDepth );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
new file mode 100644
index 0000000..b610ce8
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
@@ -0,0 +1,1413 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import java.nio.*;
+
+/**
+ *
+ * @author  Administrator
+ */
+public class Image {
+  
+  /** Creates a new instance of Image */
+  public Image() {
+  }
+  
+  public static short getShortFromByteArray( byte[] array, int index ) {
+    short s;
+    s = (short)(array[index] << 8 );
+    s |= (short)(0x00FF & array[index+1]);
+    return( s );
+  }
+  
+  public static int getIntFromByteArray( byte[] array, int index ) {
+    int i;
+    i = ( array[index] << 24 ) & 0xFF000000;
+    i |= ( array[index+1] << 16 ) & 0x00FF0000;
+    i |= ( array[index+2] << 8 ) & 0x0000FF00;
+    i |= ( array[index+3] ) & 0x000000FF;
+    return( i );
+  }
+  
+  public static float getFloatFromByteArray( byte[] array, int index ) {
+    int i = getIntFromByteArray( array, index );
+    return( Float.intBitsToFloat(i) );
+  }
+  
+  /*
+   *  Extract array from user's data applying all pixel store modes.
+   *  The internal format used is an array of unsigned shorts.
+   */
+  public static void fill_image( PixelStorageModes psm, int width, int height,
+                  int format, int type, boolean index_format, ByteBuffer userdata,
+                  ShortBuffer newimage ) {
+    int components;
+    int element_size;
+    int rowsize;
+    int padding;
+    int groups_per_line;
+    int group_size;
+    int elements_per_line;
+    int start;
+    int iter = 0;
+    int iter2;
+    int i, j, k;
+    boolean myswap_bytes;
+    
+    // Create a Extract interface object
+    Extract extract = null;
+    switch( type ) {
+      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+        extract = new Extract332();
+        break;
+      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+        extract = new Extract233rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+        extract = new Extract565();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+        extract = new Extract565rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+        extract = new Extract4444();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+        extract = new Extract4444rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+        extract = new Extract5551();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+        extract = new Extract1555rev();
+        break;
+      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+        extract = new Extract8888();
+        break;
+      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+        extract = new Extract8888rev();
+        break;
+      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+        extract = new Extract1010102();
+        break;
+      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+        extract = new Extract2101010rev();
+        break;
+    }
+    
+    myswap_bytes = psm.getUnpackSwapBytes();
+    components = Mipmap.elements_per_group( format, type );
+    if( psm.getUnpackRowLength() > 0 ) {
+      groups_per_line = psm.getUnpackRowLength();
+    } else {
+      groups_per_line = width;
+    }
+    
+    // All formats except GL_BITMAP fall out trivially
+    if( type == GL2.GL_BITMAP ) {
+      int bit_offset;
+      int current_bit;
+      
+      rowsize = ( groups_per_line * components + 7 ) / 8;
+      padding = ( rowsize % psm.getUnpackAlignment() );
+      if( padding != 0 ) {
+        rowsize += psm.getUnpackAlignment() - padding;
+      }
+      start = psm.getUnpackSkipRows() * rowsize + ( psm.getUnpackSkipPixels() * components / 8 );
+      elements_per_line = width * components;
+      iter2 = 0;
+      for( i = 0; i < height; i++ ) {
+        iter = start;
+        userdata.position( iter ); // ****************************************
+        bit_offset = (psm.getUnpackSkipPixels() * components) % 8;
+        for( j = 0; j < elements_per_line; j++ ) {
+          // retrieve bit
+          if( psm.getUnpackLsbFirst() ) {
+            userdata.position( iter );
+            current_bit = ( userdata.get() & 0x000000FF ) & ( 1 << bit_offset );//userdata[iter] & ( 1 << bit_offset );
+          } else {
+            current_bit = ( userdata.get() & 0x000000FF ) & ( 1 << ( 7 - bit_offset ) );
+          }
+          if( current_bit != 0 ) {
+            if( index_format ) {
+              newimage.position( iter2 );
+              newimage.put( (short)1 );
+            } else {
+              newimage.position( iter2 );
+              newimage.put( (short)65535 );
+            }
+          } else {
+            newimage.position( iter2 );
+            newimage.put( (short)0 );
+          }
+          bit_offset++;
+          if( bit_offset == 8 ) {
+            bit_offset = 0;
+            iter++;
+          }
+          iter2++;
+        }
+        start += rowsize;
+      }
+    } else {
+      element_size = Mipmap.bytes_per_element( type );
+      group_size = element_size * components;
+      if( element_size == 1 ) {
+        myswap_bytes = false;
+      }
+      
+      rowsize = groups_per_line * group_size;
+      padding = ( rowsize % psm.getUnpackAlignment() );
+      if( padding != 0 ) {
+        rowsize += psm.getUnpackAlignment() - padding;
+      }
+      start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
+      elements_per_line = width * components;
+      
+      iter2 = 0;
+      for( i = 0; i < height; i++ ) {
+        iter = start;
+        userdata.position( iter ); //***************************************
+        for( j = 0; j < elements_per_line; j++ ) {
+          Type_Widget widget = new Type_Widget();
+          float[] extractComponents = new float[4];
+          userdata.position( iter );
+          switch( type ) {
+            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+              extract.extract( false, userdata /*userdata[iter]*/, extractComponents );
+              for( k = 0; k < 3; k++ ) {
+                newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+              extract.extract( false, userdata /*userdata[iter]*/, extractComponents );
+              for( k = 0; k < 3; k++ ) {
+                newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_BYTE ):
+              if( index_format ) {
+                newimage.put( iter2++, (short)( 0x000000FF & userdata.get() ) );//userdata[iter];
+              } else {
+                newimage.put( iter2++, (short)( 0x000000FF & userdata.get()/*userdata[iter]*/ * 257 ) );
+              }
+              break;
+            case( GL2.GL_BYTE ):
+              if( index_format ) {
+                newimage.put( iter2++, userdata.get() ); //userdata[iter];
+              } else {
+                newimage.put( iter2++, (short)(userdata.get()/*userdata[iter]*/ * 516 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+              extract.extract( myswap_bytes, userdata/*userdata[iter]*/, extractComponents );
+              for( k = 0; k < 3; k++ ) {
+                newimage.put( iter2++, (short)(extractComponents[k] * 65535) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+              extract.extract( myswap_bytes, userdata, extractComponents );
+              for( k = 0; k < 3; k++ ) {
+                newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+              extract.extract( myswap_bytes, userdata, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+              extract.extract( myswap_bytes, userdata, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+              extract.extract( myswap_bytes, userdata, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+              extract.extract( myswap_bytes, userdata, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT ):
+            case( GL2.GL_SHORT ):
+              if( myswap_bytes ) {
+                widget.setUB1( userdata.get() );
+                widget.setUB0( userdata.get() );
+              } else {
+                widget.setUB0( userdata.get() );
+                widget.setUB1( userdata.get() );
+              }
+              if( type == GL2.GL_SHORT ) {
+                if( index_format ) {
+                  newimage.put( iter2++, widget.getS0() );
+                } else {
+                  newimage.put( iter2++, (short)(widget.getS0() * 2) );
+                }
+              } else {
+                newimage.put( iter2++, widget.getUS0() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+              extract.extract( myswap_bytes, userdata, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+              extract.extract( myswap_bytes, userdata, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+              extract.extract( myswap_bytes, userdata, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+              extract.extract( myswap_bytes, userdata, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_INT ):
+            case( GL2.GL_UNSIGNED_INT ):
+            case( GL2.GL_FLOAT ):
+              if( myswap_bytes ) {
+                widget.setUB3( userdata.get() );
+                widget.setUB2( userdata.get() );
+                widget.setUB1( userdata.get() );
+                widget.setUB0( userdata.get() );
+              } else {
+                widget.setUB0( userdata.get() );
+                widget.setUB1( userdata.get() );
+                widget.setUB2( userdata.get() );
+                widget.setUB3( userdata.get() );
+              }
+              if( type == GL2.GL_FLOAT ) {
+                if( index_format ) {
+                  newimage.put( iter2++, (short)widget.getF() );
+                } else {
+                  newimage.put( iter2++, (short)(widget.getF() * 65535 ) );
+                }
+              } else if( type == GL2.GL_UNSIGNED_INT ) {
+                if( index_format ) {
+                  newimage.put( iter2++, (short)( widget.getUI() ) );
+                } else {
+                  newimage.put( iter2++, (short)( widget.getUI() >> 16 ) );
+                }
+              } else {
+                if( index_format ) {
+                  newimage.put( iter2++, (short)( widget.getI() ) );
+                } else {
+                  newimage.put( iter2++, (short)( widget.getI() >> 15 ) );
+                }
+              }
+              break;
+          }
+          iter += element_size;
+        }  // for j
+        start += rowsize;
+        // want iter pointing at start, not within, row for assertion purposes
+        iter = start;
+      } // for i
+      
+      // iterators should be one byte past end
+      if( !Mipmap.isTypePackedPixel( type ) ) {
+        assert( iter2 == ( width * height * components ) );
+      } else {
+        assert( iter2 == ( width * height * Mipmap.elements_per_group( format, 0 ) ) );
+      }
+      assert( iter == ( rowsize * height + psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size ) );
+    }
+  }
+  
+  /*
+   *  Insert array into user's data applying all pixel store modes.
+   *  Theinternal format is an array of unsigned shorts.
+   *  empty_image() because it is the opposet of fill_image().
+   */
+  public static void empty_image( PixelStorageModes psm, int width, int height, 
+                                  int format, int type, boolean index_format, 
+                                  ShortBuffer oldimage, ByteBuffer userdata ) {
+    
+    int components;
+    int element_size;
+    int rowsize;
+    int padding;
+    int groups_per_line;
+    int group_size;
+    int elements_per_line;
+    int start;
+    int iter = 0;
+    int iter2;
+    int i, j, k;
+    boolean myswap_bytes;
+    
+    // Create a Extract interface object
+    Extract extract = null;
+    switch( type ) {
+      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+        extract = new Extract332();
+        break;
+      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+        extract = new Extract233rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+        extract = new Extract565();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+        extract = new Extract565rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+        extract = new Extract4444();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+        extract = new Extract4444rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+        extract = new Extract5551();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+        extract = new Extract1555rev();
+        break;
+      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+        extract = new Extract8888();
+        break;
+      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+        extract = new Extract8888rev();
+        break;
+      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+        extract = new Extract1010102();
+        break;
+      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+        extract = new Extract2101010rev();
+        break;
+    }
+    
+    myswap_bytes = psm.getPackSwapBytes();
+    components = Mipmap.elements_per_group( format, type );
+    if( psm.getPackRowLength() > 0 ) {
+      groups_per_line = psm.getPackRowLength();
+    } else {
+      groups_per_line = width;
+    }
+    
+    // all formats except GL_BITMAP fall out trivially
+    if( type == GL2.GL_BITMAP ) {
+      int bit_offset;
+      int current_bit;
+      
+      rowsize = ( groups_per_line * components + 7 ) / 8;
+      padding = ( rowsize % psm.getPackAlignment() );
+      if( padding != 0 ) {
+        rowsize += psm.getPackAlignment() - padding;
+      }
+      start = psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * components / 8;
+      elements_per_line = width * components;
+      iter2 = 0;
+      for( i = 0; i < height; i++ ) {
+        iter = start;
+        bit_offset = ( psm.getPackSkipPixels() * components ) % 8;
+        for( j = 0; j < elements_per_line; j++ ) {
+          if( index_format ) {
+            current_bit = oldimage.get( iter2 ) & 1;
+          } else {
+            if( oldimage.get( iter2 ) < 0 ) { // must check for negative rather than 32767
+              current_bit = 1;
+            } else {
+              current_bit = 0;
+            }
+          }
+          
+          if( current_bit != 0 ) {
+            if( psm.getPackLsbFirst() ) {
+              userdata.put( iter, (byte)( ( userdata.get( iter ) | ( 1 << bit_offset ) ) ) );
+            } else {
+              userdata.put( iter, (byte)( ( userdata.get( iter ) | ( 7 - bit_offset ) ) ) );
+            }
+          } else {
+            if( psm.getPackLsbFirst() ) {
+              //userdata[iter] &= ~( 1 << bit_offset );
+              userdata.put( iter, (byte)( ( userdata.get( iter ) & ~( 1 << bit_offset ) ) ) );
+            } else {
+              //userdata[iter] &= ~( 1 << ( 7 - bit_offset ) );
+              userdata.put( iter, (byte)( ( userdata.get( iter ) & ~( 7 - bit_offset ) ) ) );
+            }
+          }
+          
+          bit_offset++;
+          if( bit_offset == 8 ) {
+            bit_offset = 0;
+            iter++;
+          }
+          iter2++;
+        }
+        start += rowsize;
+      }
+    } else {
+      float shoveComponents[] = new float[4];
+      
+      element_size = Mipmap.bytes_per_element( type );
+      group_size = element_size * components;
+      if( element_size == 1 ) {
+        myswap_bytes = false;
+      }
+      
+      rowsize = groups_per_line * group_size;
+      padding = ( rowsize % psm.getPackAlignment() );
+      if( padding != 0 ) {
+        rowsize += psm.getPackAlignment() - padding;
+      }
+      start = psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size;
+      elements_per_line = width * components;
+      
+      iter2 = 0;
+      for( i = 0; i < height; i++ ) {
+        iter = start;
+        for( j = 0; j < elements_per_line; j++ ) {
+          Type_Widget widget = new Type_Widget();
+          
+          switch( type ) {
+            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+              for( k = 0; k < 3; k++ ) {
+                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, userdata );
+              break;
+            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+              for( k = 0; k < 3; k++ ) {
+                shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, userdata );
+              break;
+            case( GL2.GL_UNSIGNED_BYTE ):
+              if( index_format ) {
+                //userdata[iter] = (byte)oldimage[iter2++];
+                userdata.put( iter, (byte)oldimage.get(iter2++) );
+              } else {
+                //userdata[iter] = (byte)( oldimage[iter2++] >> 8 );
+                userdata.put( iter, (byte)( oldimage.get(iter2++) ) );
+              }
+              break;
+            case( GL2.GL_BYTE ):
+              if( index_format ) {
+                //userdata[iter] = (byte)oldimage[iter2++];
+                userdata.put( iter, (byte)oldimage.get(iter2++) );
+              } else {
+                //userdata[iter] = (byte)( oldimage[iter2++] >> 9 );
+                userdata.put( iter, (byte)( oldimage.get(iter2++) ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+              for( k = 0; k < 3; k++ ) {
+                shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswap_bytes ) {
+                //userdata[iter] = widget.getUB1();
+                //userdata[iter+1] = widget.getUB0();
+                userdata.put( iter, widget.getUB1() );
+                userdata.put( iter + 1,widget.getUB0() );
+              } else {
+                //userdata[iter] = widget.getUB0();
+                //userdata[iter+1] = widget.getUB1();
+                userdata.put( iter, widget.getUB0() );
+                userdata.put( iter + 1, widget.getUB1() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+              for( k = 0; k < 3; k++ ) {
+                shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswap_bytes ) {
+                //userdata[iter] = widget.getUB1();
+                //userdata[iter+1] = widget.getUB0();
+                userdata.put( iter, widget.getUB1() );
+                userdata.put( iter + 1, widget.getUB0() );
+              } else {
+                //userdata[iter] = widget.getUB0();
+                //userdata[iter+1] = widget.getUB1();
+                userdata.put( iter, widget.getUB0() );
+                userdata.put( iter, widget.getUB1() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswap_bytes ) {
+                //userdata[iter] = widget.getUB1();
+                //userdata[iter+1] = widget.getUB0();
+                userdata.put( iter, widget.getUB1() );
+                userdata.put( iter + 1, widget.getUB0() );
+              } else {
+                //userdata[iter] = widget.getUB0();
+                //userdata[iter+1] = widget.getUB1();
+                userdata.put( iter, widget.getUB0() );
+                userdata.put( iter + 1, widget.getUB1() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswap_bytes ) {
+                //userdata[iter] = widget.getUB1();
+                //userdata[iter+1] = widget.getUB0();
+                userdata.put( iter, widget.getUB1() );
+                userdata.put( iter + 1, widget.getUB0() );
+              } else {
+                //userdata[iter] = widget.getUB0();
+                //userdata[iter+1] = widget.getUB1();
+                userdata.put( iter, widget.getUB0() );
+                userdata.put( iter + 1, widget.getUB1() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswap_bytes ) {
+                //userdata[iter] = widget.getUB1();
+                //userdata[iter+1] = widget.getUB0();
+                userdata.put( iter, widget.getUB1() );
+                userdata.put( iter + 1, widget.getUB0() );
+              } else {
+                //userdata[iter] = widget.getUB0();
+                //userdata[iter+1] = widget.getUB1();
+                userdata.put( iter, widget.getUB0() );
+                userdata.put( iter + 1, widget.getUB1() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswap_bytes ) {
+                //userdata[iter] = widget.getUB1();
+                //userdata[iter+1] = widget.getUB0();
+                userdata.put( iter, widget.getUB1() );
+                userdata.put( iter + 1, widget.getUB0() );
+              } else {
+                //userdata[iter] = widget.getUB0();
+                //userdata[iter+1] = widget.getUB1();
+                userdata.put( iter, widget.getUB0() );
+                userdata.put( iter + 1, widget.getUB1() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT ):
+            case( GL2.GL_SHORT ):
+              if( type == GL2.GL_SHORT ) {
+                if( index_format ) {
+                  widget.setS0( oldimage.get( iter2++ ) );
+                } else {
+                  widget.setS0( (short)(oldimage.get( iter2++ ) >> 1) );
+                }
+              } else {
+                widget.setUS0( oldimage.get( iter2++ ) );
+              }
+              if( myswap_bytes ) {
+                //userdata[iter] = widget.getUB1();
+                //userdata[iter+1] = widget.getUB0();
+                userdata.put( iter, widget.getUB1() );
+                userdata.put( iter + 1, widget.getUB0() );
+              } else {
+                //userdata[iter] = widget.getUB0();
+                //userdata[iter] = widget.getUB1();
+                userdata.put( iter, widget.getUB0() );
+                userdata.put( iter + 1, widget.getUB1() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswap_bytes ) {
+                //userdata[iter+3] = widget.getUB0();
+                //userdata[iter+2] = widget.getUB1();
+                //userdata[iter+1] = widget.getUB2();
+                //userdata[iter  ] = widget.getUB3();
+                userdata.put( iter + 3, widget.getUB0() );
+                userdata.put( iter + 2, widget.getUB1() );
+                userdata.put( iter + 1, widget.getUB2() );
+                userdata.put( iter    , widget.getUB3() );
+              } else {
+                userdata.putInt( iter, widget.getUI() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswap_bytes ) {
+                //userdata[iter+3] = widget.getUB0();
+                //userdata[iter+2] = widget.getUB1();
+                //userdata[iter+1] = widget.getUB2();
+                //userdata[iter  ] = widget.getUB3();
+                userdata.put( iter + 3, widget.getUB0() );
+                userdata.put( iter + 2, widget.getUB1() );
+                userdata.put( iter + 2, widget.getUB2() );
+                userdata.put( iter    , widget.getUB3() );
+              } else {
+                userdata.putInt( iter, widget.getUI() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswap_bytes ) {
+                //userdata[iter+3] = widget.getUB0();
+                //userdata[iter+2] = widget.getUB1();
+                //userdata[iter+1] = widget.getUB2();
+                //userdata[iter  ] = widget.getUB3();
+                userdata.put( iter + 3, widget.getUB0() );
+                userdata.put( iter + 2, widget.getUB1() );
+                userdata.put( iter + 1, widget.getUB2() );
+                userdata.put( iter    , widget.getUB3() );
+              } else {
+                userdata.putInt( iter, widget.getUI() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswap_bytes ) {
+                //userdata[iter+3] = widget.getUB0();
+                //userdata[iter+2] = widget.getUB1();
+                //userdata[iter+1] = widget.getUB2();
+                //userdata[iter  ] = widget.getUB3();
+                userdata.put( iter + 3, widget.getUB0() );
+                userdata.put( iter + 2, widget.getUB1() );
+                userdata.put( iter + 1, widget.getUB2() );
+                userdata.put( iter    , widget.getUB3() );
+              } else {
+                userdata.putInt( iter, widget.getUI() );
+              }
+              break;
+            case( GL2.GL_INT ):
+            case( GL2.GL_UNSIGNED_INT ):
+            case( GL2.GL_FLOAT ):
+              if( type == GL2.GL_FLOAT ) {
+                if( index_format ) {
+                  widget.setF( oldimage.get( iter2++ ) );
+                } else {
+                  widget.setF( oldimage.get( iter2++ ) / 65535.0f );
+                }
+              } else if( type == GL2.GL_UNSIGNED_INT ) {
+                if( index_format ) {
+                  widget.setUI( oldimage.get( iter2++ ) );
+                } else {
+                  widget.setUI( oldimage.get( iter2++ ) * 65537 );
+                }
+              } else {
+                if( index_format ) {
+                  widget.setI( oldimage.get( iter2++ ) );
+                } else {
+                  widget.setI( (oldimage.get( iter2++ ) * 65537) / 2 );
+                }
+              }
+              if( myswap_bytes ) {
+                userdata.put( iter + 3, widget.getUB0() );
+                userdata.put( iter + 2, widget.getUB1() );
+                userdata.put( iter + 1, widget.getUB2() );
+                userdata.put( iter    , widget.getUB3() );
+              } else {
+                userdata.put( iter    , widget.getUB0() );
+                userdata.put( iter + 1, widget.getUB1() );
+                userdata.put( iter + 2, widget.getUB2() );
+                userdata.put( iter + 3, widget.getUB3() );
+              }
+              break;
+          }
+          iter += element_size;
+        } // for j
+        start += rowsize;
+        // want iter pointing at start, not within, row for assertion purposes
+        iter = start;
+      } // for i
+      // iterators should be one byte past end
+      if( !Mipmap.isTypePackedPixel( type ) ) {
+        assert( iter2 == width * height * components );
+      } else {
+        assert( iter2 == width * height * Mipmap.elements_per_group( format, 0 ) );
+      }
+      assert( iter == rowsize * height + psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size );
+    }
+  }
+  
+  public static void fillImage3D( PixelStorageModes psm, int width, int height,
+          int depth, int format, int type, boolean indexFormat, ByteBuffer userImage,
+          ShortBuffer newImage ) {
+    boolean myswapBytes;
+    int components;
+    int groupsPerLine;
+    int elementSize;
+    int groupSize;
+    int rowSize;
+    int padding;
+    int elementsPerLine;
+    int rowsPerImage;
+    int imageSize;
+    int start, rowStart;
+    int iter = 0;
+    int iter2 = 0;
+    int ww, hh, dd, k;
+    Type_Widget widget = new Type_Widget();
+    float extractComponents[] = new float[4];
+    
+    // Create a Extract interface object
+    Extract extract = null;
+    switch( type ) {
+      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+        extract = new Extract332();
+        break;
+      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+        extract = new Extract233rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+        extract = new Extract565();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+        extract = new Extract565rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+        extract = new Extract4444();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+        extract = new Extract4444rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+        extract = new Extract5551();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+        extract = new Extract1555rev();
+        break;
+      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+        extract = new Extract8888();
+        break;
+      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+        extract = new Extract8888rev();
+        break;
+      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+        extract = new Extract1010102();
+        break;
+      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+        extract = new Extract2101010rev();
+        break;
+    }
+    
+    myswapBytes = psm.getUnpackSwapBytes();
+    components = Mipmap.elements_per_group( format, type );
+    if( psm.getUnpackRowLength() > 0 ) {
+      groupsPerLine = psm.getUnpackRowLength();
+    } else {
+      groupsPerLine = width;
+    }
+    elementSize = Mipmap.bytes_per_element( type );
+    groupSize = elementSize * components;
+    if( elementSize == 1 ) {
+      myswapBytes = false;
+    }
+    
+    // 3dstuff begin
+    if( psm.getUnpackImageHeight() > 0 ) {
+      rowsPerImage = psm.getUnpackImageHeight();
+    } else {
+      rowsPerImage = height;
+    }
+    // 3dstuff end
+    
+    rowSize = groupsPerLine * groupSize;
+    padding = rowSize % psm.getUnpackAlignment();
+    if( padding != 0 ) {
+      rowSize += psm.getUnpackAlignment() - padding;
+    }
+    
+    imageSize = rowsPerImage * rowSize; // 3dstuff
+    
+    start = psm.getUnpackSkipRows() * rowSize + 
+            psm.getUnpackSkipPixels() * groupSize + 
+            psm.getUnpackSkipImages() * imageSize;
+    elementsPerLine = width * components;
+    
+    iter2 = 0;
+    for( dd = 0; dd < depth; dd++ ) {
+      rowStart = start;
+      for( hh = 0; hh < height; hh++ ) {
+        iter = rowStart;
+        for( ww = 0; ww < elementsPerLine; ww++ ) {
+          
+          switch( type ) {
+            case( GL2.GL_UNSIGNED_BYTE ):
+              if( indexFormat ) {
+                newImage.put( iter2++, (short)(0x000000FF & userImage.get( iter ) ) );
+              } else {
+                newImage.put( iter2++, (short)((0x000000FF & userImage.get( iter ) ) * 257 ) );
+              }
+              break;
+            case( GL2.GL_BYTE ):
+              if( indexFormat ) {
+                newImage.put( iter2++, userImage.get( iter ) );
+              } else {
+                newImage.put( iter2++, (short)(userImage.get( iter ) * 516 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+              userImage.position( iter );
+              extract.extract( false, userImage, extractComponents );
+              for( k = 0; k < 3; k++ ) {
+                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+              userImage.position( iter );
+              extract.extract( false, userImage, extractComponents );
+              for( k = 0; k < 3; k++ ) {
+                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+              userImage.position( iter );
+              extract.extract( myswapBytes, userImage, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+              userImage.position( iter );
+              extract.extract( myswapBytes, userImage, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+              userImage.position( iter );
+              extract.extract( myswapBytes, userImage, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+              userImage.position( iter );
+              extract.extract( myswapBytes, userImage, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+              userImage.position( iter );
+              extract.extract( myswapBytes, userImage, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+              userImage.position( iter );
+              extract.extract( myswapBytes, userImage, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT ):
+            case( GL2.GL_SHORT ):
+              if( myswapBytes ) {
+                widget.setUB0( userImage.get( iter + 1 ) );
+                widget.setUB1( userImage.get( iter ) );
+              } else {
+                widget.setUB0( userImage.get( iter ) );
+                widget.setUB1( userImage.get( iter + 1 ) );
+              }
+              if( type == GL2.GL_SHORT ) {
+                if( indexFormat ) {
+                  newImage.put( iter2++, widget.getUS0() );
+                } else {
+                  newImage.put( iter2++, (short)(widget.getUS0() * 2) );
+                }
+              } else {
+                newImage.put( iter2++, widget.getUS0() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+              userImage.position( iter );
+              extract.extract( myswapBytes, userImage, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+              userImage.position( iter );
+              extract.extract( myswapBytes, userImage, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+              userImage.position( iter );
+              extract.extract( myswapBytes, userImage, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+              extract.extract( myswapBytes, userImage, extractComponents );
+              for( k = 0; k < 4; k++ ) {
+                newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+              }
+              break;
+            case( GL2.GL_INT ):
+            case( GL2.GL_UNSIGNED_INT ):
+            case( GL2.GL_FLOAT ):
+              if( myswapBytes ) {
+                widget.setUB0( userImage.get( iter + 3 ) );
+                widget.setUB1( userImage.get( iter + 2 ) );
+                widget.setUB2( userImage.get( iter + 1 ) );
+                widget.setUB3( userImage.get( iter     ) );
+              } else {
+                widget.setUB0( userImage.get( iter     ) );
+                widget.setUB1( userImage.get( iter + 1 ) );
+                widget.setUB2( userImage.get( iter + 2 ) );
+                widget.setUB3( userImage.get( iter + 3 ) );
+              }
+              if( type == GL2.GL_FLOAT ) {
+                if( indexFormat ) {
+                  newImage.put( iter2++, (short)widget.getF() );
+                } else {
+                  newImage.put( iter2++, (short)( widget.getF() * 65535.0f ) );
+                }
+              } else if( type == GL2.GL_UNSIGNED_INT ) {
+                if( indexFormat ) {
+                  newImage.put( iter2++, (short)widget.getUI() );
+                } else {
+                  newImage.put( iter2++, (short)(widget.getUI() >> 16) );
+                }
+              } else {
+                if( indexFormat ) {
+                  newImage.put( iter2++, (short)widget.getI() );
+                } else {
+                  newImage.put( iter2++, (short)(widget.getI() >> 15) );
+                }
+              }
+              break;
+            default:
+              assert( false );
+          }
+          iter += elementSize;
+        } // for ww
+        rowStart += rowSize;
+        iter = rowStart; // for assert
+      } // for hh
+      start += imageSize;
+    }// for dd
+    
+    // iterators should be one byte past end
+    if( !Mipmap.isTypePackedPixel( type ) ) {
+      assert( iter2 == width * height * depth * components );
+    } else {
+      assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
+    }
+    assert( iter == rowSize * height * depth + psm.getUnpackSkipRows() * rowSize + 
+            psm.getUnpackSkipPixels() * groupSize +
+            psm.getUnpackSkipImages() * imageSize );
+  }
+  
+  public static void emptyImage3D( PixelStorageModes psm, int width, int height, int depth,
+          int format, int type, boolean indexFormat, ShortBuffer oldImage, ByteBuffer userImage ) {
+    boolean myswapBytes;
+    int components;
+    int groupsPerLine;
+    int elementSize;
+    int groupSize;
+    int rowSize;
+    int padding;
+    int start, rowStart, iter;
+    int elementsPerLine;
+    int iter2;
+    int ii, jj, dd, k;
+    int rowsPerImage;
+    int imageSize;
+    Type_Widget widget = new Type_Widget();
+    float[] shoveComponents = new float[4];
+    
+    // Create a Extract interface object
+    Extract extract = null;
+    switch( type ) {
+      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+        extract = new Extract332();
+        break;
+      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+        extract = new Extract233rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+        extract = new Extract565();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+        extract = new Extract565rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+        extract = new Extract4444();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+        extract = new Extract4444rev();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+        extract = new Extract5551();
+        break;
+      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+        extract = new Extract1555rev();
+        break;
+      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+        extract = new Extract8888();
+        break;
+      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+        extract = new Extract8888rev();
+        break;
+      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+        extract = new Extract1010102();
+        break;
+      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+        extract = new Extract2101010rev();
+        break;
+    }
+    
+    iter = 0;
+    
+    myswapBytes = psm.getPackSwapBytes();
+    components = Mipmap.elements_per_group( format, type );
+    if( psm.getPackRowLength() > 0 ) {
+      groupsPerLine = psm.getPackRowLength();
+    } else {
+      groupsPerLine = width;
+    }
+    
+    elementSize = Mipmap.bytes_per_element( type );
+    groupSize = elementSize * components;
+    if( elementSize == 1 ) {
+      myswapBytes = false;
+    }
+    
+    // 3dstuff begin
+    if( psm.getPackImageHeight() > 0 ) {
+      rowsPerImage = psm.getPackImageHeight();
+    } else {
+      rowsPerImage = height;
+    }
+    
+    // 3dstuff end
+    
+    rowSize = groupsPerLine * groupSize;
+    padding = rowSize % psm.getPackAlignment();
+    if( padding != 0 ) {
+      rowSize += psm.getPackAlignment() - padding;
+    }
+    
+    imageSize = rowsPerImage * rowSize;
+    
+    start = psm.getPackSkipRows() * rowSize +
+            psm.getPackSkipPixels() * groupSize +
+            psm.getPackSkipImages() * imageSize;
+    elementsPerLine = width * components;
+    
+    iter2 = 0;
+    for( dd = 0; dd < depth; dd++ ) {
+      rowStart = start;
+      
+      for( ii = 0; ii < height; ii++ ) {
+        iter = rowStart;
+        
+        for( jj = 0; jj < elementsPerLine; jj++ ) {
+          
+          switch( type ) {
+            case( GL2.GL_UNSIGNED_BYTE ):
+              if( indexFormat ) {
+                userImage.put( iter, (byte)(oldImage.get( iter2++ ) ) );
+              } else {
+                userImage.put( iter, (byte)(oldImage.get( iter2++ ) >> 8 ) );
+              }
+              break;
+            case( GL2.GL_BYTE ):
+              if( indexFormat ) {
+                userImage.put( iter, (byte)(oldImage.get(iter2++) ) );
+              } else {
+                userImage.put( iter, (byte)(oldImage.get(iter2++) >> 9) );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+              for( k = 0; k < 3; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, userImage );
+              break;
+            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+              for( k = 0; k < 3; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, userImage );
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswapBytes ) {
+                userImage.putShort( iter, widget.getUB1() );
+                userImage.putShort( iter + 1, widget.getUB0() );
+              } else {
+                userImage.putShort( iter, widget.getUS0() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswapBytes ) {
+                userImage.put( iter, widget.getUB1() );
+                userImage.put( iter + 1, widget.getUB0() );
+              } else {
+                userImage.putShort( iter, widget.getUS0() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswapBytes ) {
+                userImage.put( iter, widget.getUB1() );
+                userImage.put( iter + 1, widget.getUB0() );
+              } else {
+                userImage.putShort( iter, widget.getUS0() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswapBytes ) {
+                userImage.put( iter, widget.getUB1() );
+                userImage.put( iter + 1, widget.getUB0() );
+              } else {
+                userImage.putShort( iter, widget.getUS0() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswapBytes ) {
+                userImage.put( iter, widget.getUB1() );
+                userImage.put( iter + 1, widget.getUB0() );
+              } else {
+                userImage.putShort( iter, widget.getUS0() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswapBytes ) {
+                userImage.put( iter, widget.getUB1() );
+                userImage.put( iter + 1, widget.getUB0() );
+              } else {
+                userImage.putShort( iter, widget.getUS0() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_SHORT ):
+            case( GL2.GL_SHORT ):
+              if( type == GL2.GL_SHORT ) {
+                if( indexFormat ) {
+                  widget.setS0( (short)oldImage.get( iter2++ ) );
+                } else {
+                  widget.setS0( (short)(oldImage.get( iter2++ ) >> 1) );
+                }
+              } else {
+                widget.setUS0( (short)oldImage.get( iter2++ ) );
+              }
+              if( myswapBytes ) {
+                userImage.put( iter, widget.getUB1() );
+                userImage.put( iter + 1, widget.getUB0() );
+              } else {
+                userImage.put( iter, widget.getUB0() );
+                userImage.put( iter + 1, widget.getUB1() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswapBytes ) {
+                userImage.put( iter + 3, widget.getUB0() );
+                userImage.put( iter + 2, widget.getUB1() );
+                userImage.put( iter + 1, widget.getUB2() );
+                userImage.put( iter    , widget.getUB3() );
+              } else {
+                userImage.putInt( iter, widget.getUI() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswapBytes ) {
+                userImage.put( iter + 3, widget.getUB0() );
+                userImage.put( iter + 2, widget.getUB1() );
+                userImage.put( iter + 1, widget.getUB2() );
+                userImage.put( iter    , widget.getUB3() );
+              } else {
+                userImage.putInt( iter, widget.getUI() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswapBytes ) {
+                userImage.put( iter + 3, widget.getUB0() );
+                userImage.put( iter + 2, widget.getUB1() );
+                userImage.put( iter + 1, widget.getUB2() );
+                userImage.put( iter    ,widget.getUB3() );
+              } else {
+                userImage.putInt( iter, widget.getUI() );
+              }
+              break;
+            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+              for( k = 0; k < 4; k++ ) {
+                shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+              }
+              extract.shove( shoveComponents, 0, widget.getBuffer() );
+              if( myswapBytes ) {
+                userImage.put( iter + 3, widget.getUB0() );
+                userImage.put( iter + 2, widget.getUB2() );
+                userImage.put( iter + 1, widget.getUB1() );
+                userImage.put( iter    , widget.getUB0() );
+              } else {
+                userImage.putInt( iter, widget.getUI() );
+              }
+              break;
+            case( GL2.GL_INT ):
+            case( GL2.GL_UNSIGNED_INT ):
+            case( GL2.GL_FLOAT ):
+              if( type == GL2.GL_FLOAT ) {
+                if( indexFormat ) {
+                  widget.setF( oldImage.get( iter2++ ) );
+                } else {
+                  widget.setF( oldImage.get( iter2++ ) / 65535.0f );
+                }
+              } else if( type == GL2.GL_UNSIGNED_INT ) {
+                if( indexFormat ) {
+                  widget.setUI( oldImage.get( iter2++ ) );
+                } else {
+                  widget.setUI( oldImage.get( iter2++ ) * 65537 );
+                }
+              } else {
+                if( indexFormat ) {
+                  widget.setI( oldImage.get( iter2++ ) );
+                } else {
+                  widget.setI( ( oldImage.get( iter2++ ) * 65535 ) / 2 );
+                }
+              }
+              if( myswapBytes ) {
+                userImage.put( iter + 3, widget.getUB0() );
+                userImage.put( iter + 2, widget.getUB1() );
+                userImage.put( iter + 1, widget.getUB2() );
+                userImage.put( iter    , widget.getUB3() );
+              } else {
+                userImage.put( iter    , widget.getUB0() );
+                userImage.put( iter + 1, widget.getUB1() );
+                userImage.put( iter + 2, widget.getUB2() );
+                userImage.put( iter + 3, widget.getUB3() );
+              }
+              break;
+            default:
+              assert( false );
+          }
+          
+          iter += elementSize;
+        } // for jj
+        rowStart += rowSize;
+      } // for ii
+      start += imageSize;
+    } // for dd
+    
+    if( !Mipmap.isTypePackedPixel( type ) ) {
+      assert( iter2 == width * height * depth * components );
+    } else {
+      assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
+    }
+    assert( iter == rowSize * height * depth + 
+                    psm.getUnpackSkipRows() * rowSize +
+                    psm.getUnpackSkipPixels() * groupSize +
+                    psm.getUnpackSkipImages() * imageSize );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
new file mode 100644
index 0000000..f38b62e
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
@@ -0,0 +1,868 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
+import javax.media.opengl.glu.GLU;
+import javax.media.opengl.GLException;
+import java.nio.*;
+import com.jogamp.common.nio.Buffers;
+
+/**
+ *
+ * @author  Administrator
+ */
+public class Mipmap {
+  
+  /** Creates a new instance of Mipmap */
+  public Mipmap() {
+  }
+  
+  public static int computeLog( int value ) {
+    int i = 0;
+    // Error
+    if( value == 0 ) {
+      return( -1 );
+    }
+    for( ;; ) {
+      if( (value & 1) >= 1 ) {
+        if( value != 1 ) {
+          return( -1 );
+        }
+        return( i );
+      }
+      value = value >> 1;
+      i++;
+    }
+  }
+  
+  /* Compute the nearest power of 2 number.  This algorithm is a little strange
+   * but it works quite well.
+   */
+  public static int nearestPower( int value ) {
+    int i = 1;
+    // Error!
+    if( value == 0 ) {
+      return( -1 );
+    }
+    for( ;; ) {
+      if( value == 1 ) {
+        return( i );
+      } else if( value == 3 ) {
+        return( i * 4 );
+      }
+      value = value >> 1;
+      i *= 2;
+    }
+  }
+  
+  public static short GLU_SWAP_2_BYTES( short s ) {
+    byte b = 0;
+    b = (byte)( s >>> 8 );
+    s = (short)( s << 8 );
+    s = (short)( s | (0x00FF & b) );
+    return( s );
+  }
+  
+  public static int GLU_SWAP_4_BYTES( int i ) {
+    int t = i << 24;
+    t |= 0x00FF0000 & ( i << 8 );
+    t |= 0x0000FF00 & ( i >>> 8 );
+    t |= 0x000000FF & ( i >>> 24 );
+    return( t );
+  }
+  
+  public static float GLU_SWAP_4_BYTES( float f ) {
+    int i = Float.floatToRawIntBits( f );
+    float temp = Float.intBitsToFloat( i );
+    return( temp );
+  }
+  
+  public static int checkMipmapArgs( int internalFormat, int format, int type ) {
+    if( !legalFormat( format ) || !legalType( type ) ) {
+      return( GLU.GLU_INVALID_ENUM );
+    }
+    if( format == GL2GL3.GL_STENCIL_INDEX ) {
+      return( GLU.GLU_INVALID_ENUM );
+    }
+    if( !isLegalFormatForPackedPixelType( format, type ) ) {
+      return( GLU.GLU_INVALID_OPERATION );
+    }
+    return( 0 );
+  }
+  
+  public static boolean legalFormat( int format ) {
+    switch( format ) {
+      case( GL2.GL_COLOR_INDEX ):
+      case( GL2GL3.GL_STENCIL_INDEX ):
+      case( GL2GL3.GL_DEPTH_COMPONENT ):
+      case( GL2GL3.GL_RED ):
+      case( GL2GL3.GL_GREEN ):
+      case( GL2GL3.GL_BLUE ):
+      case( GL2GL3.GL_ALPHA ):
+      case( GL2GL3.GL_RGB ):
+      case( GL2GL3.GL_RGBA ):
+      case( GL2GL3.GL_LUMINANCE ):
+      case( GL2GL3.GL_LUMINANCE_ALPHA ):
+      case( GL2GL3.GL_BGR ):
+      case( GL2GL3.GL_BGRA ):
+        return( true );
+      default:
+        return( false );
+    }
+  }
+  
+  public static boolean legalType( int type ) {
+    switch( type ) {
+      case( GL2.GL_BITMAP ):
+      case( GL2GL3.GL_BYTE ):
+      case( GL2GL3.GL_UNSIGNED_BYTE ):
+      case( GL2GL3.GL_SHORT ):
+      case( GL2GL3.GL_UNSIGNED_SHORT ):
+      case( GL2GL3.GL_INT ):
+      case( GL2GL3.GL_UNSIGNED_INT ):
+      case( GL2GL3.GL_FLOAT ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+      case( GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ):
+      case( GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ):
+        return( true );
+      default:
+        return( false );
+    }
+  }
+  
+  public static boolean isTypePackedPixel( int type ) {
+    assert( legalType( type ) );
+    
+    if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
+        type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+        type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
+        type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
+        type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
+        type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) {
+          return( true );
+    }
+    return( false );
+  }
+  
+  public static boolean isLegalFormatForPackedPixelType( int format, int type ) {
+    // if not a packed pixel type then return true
+    if( isTypePackedPixel( type ) ) {
+      return( true );
+    }
+    
+    // 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB
+    if( (type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 || type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 || type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV )
+        & format != GL2GL3.GL_RGB ) {
+          return( false );
+    }
+    
+    // 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV &
+    // 10_10_10_2/2_10_10_10_REV are only campatible with RGBA, BGRA & ARGB_EXT
+    if( ( type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
+          type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
+          type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
+          type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+          type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
+          type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
+          type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
+          type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) &&
+          (format != GL2GL3.GL_RGBA && format != GL2GL3.GL_BGRA) ) {
+            return( false );
+    }
+    return( true );
+  }
+  
+  public static boolean isLegalLevels( int userLevel, int baseLevel, int maxLevel,
+                                            int totalLevels ) {
+    if( (baseLevel < 0) || (baseLevel < userLevel) || (maxLevel < baseLevel) ||
+                                                  (totalLevels < maxLevel) ) {
+      return( false );
+    }
+    return( true );
+  }
+  
+  /* Given user requested textures size, determine if it fits. If it doesn't then
+   * halve both sides and make the determination again until it does fit ( for
+   * IR only ).
+   * Note that proxy textures are not implemented in RE* even though they
+   * advertise the texture extension.
+   * Note that proxy textures are implemented but not according to spec in IMPACT*
+   */
+  public static void closestFit( GL gl, int target, int width, int height, int internalFormat,
+                                int format, int type, int[] newWidth, int[] newHeight ) {
+    // Use proxy textures if OpenGL version >= 1.1
+    if( Double.parseDouble( gl.glGetString( GL.GL_VERSION ).trim().substring( 0, 3 ) ) >= 1.1 ) {
+      int widthPowerOf2 = nearestPower( width );
+      int heightPowerOf2 = nearestPower( height );
+      int[] proxyWidth = new int[1];
+      boolean noProxyTextures = false;
+      
+      // Some drivers (in particular, ATI's) seem to set a GL error
+      // when proxy textures are used even though this is in violation
+      // of the spec. Guard against this and interactions with the
+      // DebugGL by watching for GLException.
+      try {
+        do {
+          // compute level 1 width & height, clamping each at 1
+          int widthAtLevelOne = ( ( width > 1 ) ? (widthPowerOf2 >> 1) : widthPowerOf2 );
+          int heightAtLevelOne = ( ( height > 1 ) ? (heightPowerOf2 >> 1) : heightPowerOf2 );
+          int proxyTarget;
+        
+          assert( widthAtLevelOne > 0 );
+          assert( heightAtLevelOne > 0 );
+        
+          // does width x height at level 1 & all their mipmaps fit?
+          if( target == GL2GL3.GL_TEXTURE_2D || target == GL2GL3.GL_PROXY_TEXTURE_2D ) {
+            proxyTarget = GL2GL3.GL_PROXY_TEXTURE_2D;
+            gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
+                             heightAtLevelOne, 0, format, type, null );
+          } else if( (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_X) || 
+                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) || 
+                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) || 
+                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) || 
+                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) || 
+                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) ) {
+            proxyTarget = GL2GL3.GL_PROXY_TEXTURE_CUBE_MAP;
+            gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
+                             heightAtLevelOne, 0, format, type, null );
+          } else {
+            assert( target == GL2GL3.GL_TEXTURE_1D || target == GL2GL3.GL_PROXY_TEXTURE_1D );
+            proxyTarget = GL2GL3.GL_PROXY_TEXTURE_1D;
+            gl.getGL2GL3().glTexImage1D( proxyTarget, 1, internalFormat, widthAtLevelOne, 
+                             0, format, type, null );
+          }
+          if(gl.isGL2GL3()) {
+            gl.getGL2GL3().glGetTexLevelParameteriv( proxyTarget, 1, GL2GL3.GL_TEXTURE_WIDTH, proxyWidth, 0 );
+          } else {
+            proxyWidth[0] = 0;
+          }
+          // does it fit?
+          if( proxyWidth[0] == 0 ) { // nope, so try again with theses sizes
+            if( widthPowerOf2 == 1 && heightPowerOf2 == 1 ) {
+              /* A 1x1 texture couldn't fit for some reason so break out.  This
+               * should never happen.  But things happen.  The disadvantage with
+               * this if-statement is that we will never be aware of when this
+               * happens since it will silently branch out.
+               */
+              noProxyTextures = true;
+              break;
+            }
+            widthPowerOf2 = widthAtLevelOne;
+            heightPowerOf2 = heightAtLevelOne;
+          }
+          // else it does fit
+        } while( proxyWidth[0] == 0 );
+      } catch (GLException e) {
+        noProxyTextures = true;
+      }
+      // loop must terminate
+      // return the width & height at level 0 that fits
+      if( !noProxyTextures ) {
+        newWidth[0] = widthPowerOf2;
+        newHeight[0] = heightPowerOf2;
+        return;
+      }
+    }
+    int[] maxsize = new int[1];
+    gl.glGetIntegerv( GL2GL3.GL_MAX_TEXTURE_SIZE, maxsize , 0);
+    // clamp user's texture sizes to maximum sizes, if necessary
+    newWidth[0] = nearestPower( width );
+    if( newWidth[0] > maxsize[0] ) {
+      newWidth[0] = maxsize[0];
+    }
+    newHeight[0] = nearestPower( height );
+    if( newHeight[0] > maxsize[0] ) {
+      newHeight[0] = maxsize[0];
+    }
+  }
+  
+  public static void closestFit3D( GL gl, int target, int width, int height, int depth, 
+          int internalFormat, int format, int type, int[] newWidth, int[] newHeight,
+          int[] newDepth ) {
+    int widthPowerOf2 = nearestPower( width );
+    int heightPowerOf2 = nearestPower( height );
+    int depthPowerOf2 = nearestPower( depth );
+    int[] proxyWidth = new int[1];
+    
+    do {
+      // compute level 1 width & height & depth, clamping each at 1
+      int widthAtLevelOne = (widthPowerOf2 > 1) ? widthPowerOf2 >> 1 : widthPowerOf2;
+      int heightAtLevelOne = (heightPowerOf2 > 1) ? heightPowerOf2 >> 1 : heightPowerOf2;
+      int depthAtLevelOne = (depthPowerOf2 > 1) ? depthPowerOf2 >> 1 : depthPowerOf2;
+      int proxyTarget = 0;
+      assert( widthAtLevelOne > 0 );
+      assert( heightAtLevelOne > 0 );
+      assert( depthAtLevelOne > 0 );
+      
+      // does width x height x depth at level 1 & all their mipmaps fit?
+      if( target == GL2GL3.GL_TEXTURE_3D || target == GL2GL3.GL_PROXY_TEXTURE_3D ) {
+        proxyTarget = GL2GL3.GL_PROXY_TEXTURE_3D;
+        gl.getGL2GL3().glTexImage3D( proxyTarget, 1, internalFormat, widthAtLevelOne,
+                heightAtLevelOne, depthAtLevelOne, 0, format, type, null );
+      }
+      if(gl.isGL2GL3()) {
+        gl.getGL2GL3().glGetTexLevelParameteriv( proxyTarget, 1, GL2GL3.GL_TEXTURE_WIDTH, proxyWidth, 0 );
+      } else {
+        proxyWidth[0] = 0;
+      }
+      // does it fit
+      if( proxyWidth[0] == 0 ) {
+        if( widthPowerOf2 == 1 && heightPowerOf2 == 1 && depthPowerOf2 == 1 ) {
+          newWidth[0] = newHeight[0] = newDepth[0] = 1;
+          return;
+        }
+        widthPowerOf2 = widthAtLevelOne;
+        heightPowerOf2 = heightAtLevelOne;
+        depthPowerOf2 = depthAtLevelOne;
+      }
+    } while( proxyWidth[0] == 0 );
+    // loop must terminate
+    
+    // return the width & height at level 0 that fits
+    newWidth[0] = widthPowerOf2;
+    newHeight[0] = heightPowerOf2;
+    newDepth[0] = depthPowerOf2;
+  }
+  
+  public static int elements_per_group( int format, int type ) {
+    // Return the number of elements per grtoup of a specified gromat
+    
+    // If the type is packedpixels then answer is 1
+    if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
+        type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
+        type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
+        type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
+        type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
+        type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
+        type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) {
+          return( 1 );
+    }
+    
+    // Types are not packed pixels so get elements per group
+    switch( format ) {
+      case( GL2GL3.GL_RGB ):
+      case( GL2GL3.GL_BGR ):
+        return( 3 );
+      case( GL2GL3.GL_LUMINANCE_ALPHA ):
+        return( 2 );
+      case( GL2GL3.GL_RGBA ):
+      case( GL2GL3.GL_BGRA ):
+        return( 4 );
+      default:
+        return( 1 );
+    }
+  }
+  
+  public static int bytes_per_element( int type ) {
+    // return the number of bytes per element, based on the element type
+    
+    switch( type ) {
+      case( GL2.GL_BITMAP ):
+      case( GL2GL3.GL_BYTE ):
+      case( GL2GL3.GL_UNSIGNED_BYTE ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+        return( 1 );
+      case( GL2GL3.GL_SHORT ):
+      case( GL2GL3.GL_UNSIGNED_SHORT ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+        return( 2 );
+      case( GL2GL3.GL_INT ):
+      case( GL2GL3.GL_UNSIGNED_INT ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+      case( GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ):
+      case( GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ):
+      case( GL2GL3.GL_FLOAT ):
+        return( 4 );
+      default:
+        return( 4 );
+    }
+  }
+  
+  public static boolean is_index( int format ) {
+    return( format == GL2.GL_COLOR_INDEX || format == GL2GL3.GL_STENCIL_INDEX );
+  }
+  
+  /* Compute memory required for internal packed array of data of given type and format. */
+  
+  public static int image_size( int width, int height, int format, int type ) {
+    int bytes_per_row;
+    int components;
+    
+    assert( width > 0 );
+    assert( height > 0 );
+    components = elements_per_group( format, type );
+    if( type == GL2.GL_BITMAP ) {
+      bytes_per_row = (width + 7) / 8;
+    } else {
+      bytes_per_row = bytes_per_element( type ) * width;
+    }
+    return( bytes_per_row * height * components );
+  }
+  
+  public static int imageSize3D( int width, int height, int depth, int format, int type ) {
+    int components = elements_per_group( format, type );
+    int bytes_per_row = bytes_per_element( type ) * width;
+    
+    assert( width > 0 && height > 0 && depth > 0 );
+    assert( type != GL2.GL_BITMAP );
+    
+    return( bytes_per_row * height * depth * components );
+  }
+  
+  public static void retrieveStoreModes( GL gl, PixelStorageModes psm ) {
+    int[] a = new int[1];
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
+    psm.setUnpackAlignment( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ROW_LENGTH, a, 0);
+    psm.setUnpackRowLength( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_ROWS, a, 0);
+    psm.setUnpackSkipRows( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_PIXELS, a, 0);
+    psm.setUnpackSkipPixels( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_LSB_FIRST, a, 0);
+    psm.setUnpackLsbFirst( ( a[0] == 1 ) );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0);
+    psm.setUnpackSwapBytes( ( a[0] == 1 ) );
+    
+    gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
+    psm.setPackAlignment( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
+    psm.setPackRowLength( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_ROWS, a, 0);
+    psm.setPackSkipRows( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_PIXELS, a, 0);
+    psm.setPackSkipPixels( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_LSB_FIRST, a, 0);
+    psm.setPackLsbFirst( ( a[0] == 1 ) );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_SWAP_BYTES, a, 0);
+    psm.setPackSwapBytes( ( a[0] == 1 ) );
+  }
+  
+  public static void retrieveStoreModes3D( GL gl, PixelStorageModes psm ) {
+    int[] a = new int[1];
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
+    psm.setUnpackAlignment( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ROW_LENGTH, a, 0);
+    psm.setUnpackRowLength( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_ROWS, a, 0);
+    psm.setUnpackSkipRows( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_PIXELS, a, 0);
+    psm.setUnpackSkipPixels( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_LSB_FIRST, a, 0);
+    psm.setUnpackLsbFirst( ( a[0] == 1 ) );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0);
+    psm.setUnpackSwapBytes( ( a[0] == 1 ) );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_IMAGES, a, 0);
+    psm.setUnpackSkipImages( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_UNPACK_IMAGE_HEIGHT, a, 0);
+    psm.setUnpackImageHeight( a[0] );
+    
+    gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
+    psm.setPackAlignment( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
+    psm.setPackRowLength( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_ROWS, a, 0);
+    psm.setPackSkipRows( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_PIXELS, a, 0 );
+    psm.setPackSkipPixels( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_LSB_FIRST, a, 0 );
+    psm.setPackLsbFirst( ( a[0] == 1 ) );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_SWAP_BYTES, a, 0 );
+    psm.setPackSwapBytes( ( a[0] == 1 ) );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_IMAGES, a, 0 );
+    psm.setPackSkipImages( a[0] );
+    gl.glGetIntegerv( GL2GL3.GL_PACK_IMAGE_HEIGHT, a, 0 );
+    psm.setPackImageHeight( a[0] );
+  }
+  
+  public static int gluScaleImage( GL gl, int format, int widthin, int heightin, 
+          int typein, ByteBuffer datain, int widthout, int heightout, 
+          int typeout, ByteBuffer dataout ) {
+    int datainPos = datain.position();
+    int dataoutPos = dataout.position();
+    try {
+
+      int components;
+      ByteBuffer beforeimage;
+      ByteBuffer afterimage;
+      PixelStorageModes psm = new PixelStorageModes();
+    
+      if( (widthin == 0)  || (heightin == 0) || (widthout == 0) || (heightout == 0) ) {
+        return( 0 );
+      }
+      if( (widthin < 0) || (heightin < 0) || (widthout < 0) || (heightout < 0) ) {
+        return( GLU.GLU_INVALID_VALUE );
+      }
+      if( !legalFormat( format ) || !legalType( typein ) || !legalType( typeout ) ) {
+        return( GLU.GLU_INVALID_ENUM );
+      }
+      if( !isLegalFormatForPackedPixelType( format, typein ) ) {
+        return( GLU.GLU_INVALID_OPERATION );
+      }
+      if( !isLegalFormatForPackedPixelType( format, typeout ) ) {
+        return( GLU.GLU_INVALID_OPERATION );
+      }
+      beforeimage = Buffers.newDirectByteBuffer( image_size( widthin, heightin, format, GL2GL3.GL_UNSIGNED_SHORT ) );
+      afterimage = Buffers.newDirectByteBuffer( image_size( widthout, heightout, format, GL2GL3.GL_UNSIGNED_SHORT ) );
+      if( beforeimage == null || afterimage == null ) {
+        return( GLU.GLU_OUT_OF_MEMORY );
+      }
+    
+      retrieveStoreModes( gl, psm );
+      Image.fill_image( psm, widthin, heightin, format, typein, is_index( format ), datain, beforeimage.asShortBuffer() );
+      components = elements_per_group( format, 0 );
+      ScaleInternal.scale_internal( components, widthin, heightin, beforeimage.asShortBuffer(), widthout, heightout, afterimage.asShortBuffer() );
+      Image.empty_image( psm, widthout, heightout, format, typeout, is_index( format ), afterimage.asShortBuffer(), dataout );
+    
+      return( 0 );
+    } finally {
+      datain.position(datainPos);
+      dataout.position(dataoutPos);
+    }
+  }
+  
+  public static int gluBuild1DMipmapLevels( GL gl, int target, int internalFormat,
+                          int width, int format, int type, int userLevel, int baseLevel,
+                          int maxLevel, ByteBuffer data ) {
+    int dataPos = data.position();
+    try {
+
+      int levels;
+    
+      int rc = checkMipmapArgs( internalFormat, format, type );
+      if( rc != 0 ) {
+        return( rc );
+      }
+    
+      if( width < 1 ) {
+        return( GLU.GLU_INVALID_VALUE );
+      }
+    
+      levels = computeLog( width );
+    
+      levels += userLevel;
+      if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
+        return( GLU.GLU_INVALID_VALUE );
+      }
+    
+      return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat, width,
+              width, format, type, userLevel, baseLevel, maxLevel, data ) );
+    } finally {
+      data.position(dataPos);
+    }
+  }
+  
+  public static int gluBuild1DMipmaps( GL gl, int target, int internalFormat, int width,
+              int format, int type, ByteBuffer data ) {
+    int dataPos = data.position();
+
+    try {
+      int[] widthPowerOf2 = new int[1];
+      int levels;
+      int[] dummy = new int[1];
+    
+      int rc = checkMipmapArgs( internalFormat, format, type );
+      if( rc != 0 ) {
+        return( rc );
+      }
+    
+      if( width < 1 ) {
+        return( GLU.GLU_INVALID_VALUE );
+      }
+    
+      closestFit( gl, target, width, 1, internalFormat, format, type, widthPowerOf2, dummy );
+      levels = computeLog( widthPowerOf2[0] );
+    
+      return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat, 
+                    width, widthPowerOf2[0], format, type, 0, 0, levels, data ) );
+    } finally {
+      data.position(dataPos);
+    }
+  }
+
+ 
+  public static int gluBuild2DMipmapLevels( GL gl, int target, int internalFormat,
+          int width, int height, int format, int type, int userLevel,
+          int baseLevel, int maxLevel, Object data ) {
+    int dataPos = 0;
+
+    int level, levels;
+    
+    int rc = checkMipmapArgs( internalFormat, format, type );
+    if( rc != 0 ) {
+      return( rc );
+    }
+    
+    if( width < 1 || height < 1 ) {
+      return( GLU.GLU_INVALID_VALUE );
+    }
+    
+    levels = computeLog( width );
+    level = computeLog( height );
+    if( level > levels ) {
+      levels = level;
+    }
+    
+    levels += userLevel;
+    if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
+      return( GLU.GLU_INVALID_VALUE );
+    }
+    
+    //PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
+    ByteBuffer buffer = null;
+    if( data instanceof ByteBuffer ) {
+        buffer = (ByteBuffer)data;
+        dataPos = buffer.position();
+    } else if( data instanceof byte[] ) {
+      byte[] array = (byte[])data;
+      buffer = ByteBuffer.allocateDirect(array.length);
+      buffer.put(array);
+    } else if( data instanceof short[] ) {
+        short[] array = (short[])data;
+        buffer = ByteBuffer.allocateDirect( array.length * 2 );
+        ShortBuffer sb = buffer.asShortBuffer();
+        sb.put( array );
+    } else if( data instanceof int[] ) {
+        int[] array = (int[])data;
+        buffer = ByteBuffer.allocateDirect( array.length * 4 );
+        IntBuffer ib = buffer.asIntBuffer();
+        ib.put( array );
+    } else if( data instanceof float[] ) {
+        float[] array = (float[])data;
+        buffer = ByteBuffer.allocateDirect( array.length * 4 );
+        FloatBuffer fb = buffer.asFloatBuffer();
+        fb.put( array );
+    }
+    
+    try {
+      return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
+              width, height, width, height, format, type, userLevel, baseLevel,
+              maxLevel, buffer ) );
+    } finally {
+      buffer.position(dataPos);
+    }
+  }
+
+ 
+  public static int gluBuild2DMipmaps( GL gl, int target, int internalFormat,
+          int width, int height, int format, int type, Object data ) {
+    int dataPos = 0;
+
+    int[] widthPowerOf2 = new int[1];
+    int[] heightPowerOf2 = new int[1];
+    int level, levels;
+    
+    int rc = checkMipmapArgs( internalFormat, format, type );
+    if( rc != 0 ) {
+      return( rc );
+    }
+    
+    if( width < 1 || height < 1 ) {
+      return( GLU.GLU_INVALID_VALUE );
+    }
+    
+    closestFit( gl, target, width, height, internalFormat, format, type, 
+            widthPowerOf2, heightPowerOf2 );
+    
+    levels = computeLog( widthPowerOf2[0] );
+    level = computeLog( heightPowerOf2[0] );
+    if( level > levels ) {
+      levels = level;
+    }
+    
+    //PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
+    ByteBuffer buffer = null;
+    if( data instanceof ByteBuffer ) {
+        buffer = (ByteBuffer)data;
+        dataPos = buffer.position();
+    } else if( data instanceof byte[] ) {
+      byte[] array = (byte[])data;
+      buffer = ByteBuffer.allocateDirect(array.length);
+      buffer.put(array);
+    } else if( data instanceof short[] ) {
+        short[] array = (short[])data;
+        buffer = ByteBuffer.allocateDirect( array.length * 2 );
+        ShortBuffer sb = buffer.asShortBuffer();
+        sb.put( array );
+    } else if( data instanceof int[] ) {
+        int[] array = (int[])data;
+        buffer = ByteBuffer.allocateDirect( array.length * 4 );
+        IntBuffer ib = buffer.asIntBuffer();
+        ib.put( array );
+    } else if( data instanceof float[] ) {
+        float[] array = (float[])data;
+        buffer = ByteBuffer.allocateDirect( array.length * 4 );
+        FloatBuffer fb = buffer.asFloatBuffer();
+        fb.put( array );
+    }
+    
+    try {
+      return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat, 
+              width, height, widthPowerOf2[0], heightPowerOf2[0], format, type, 0, 
+              0, levels, buffer ) );
+    } finally {
+      buffer.position(dataPos);
+    }
+  }
+ 
+ 
+  public static int gluBuild3DMipmaps( GL gl, int target, int internalFormat,
+          int width, int height, int depth, int format, int type, ByteBuffer data ) {
+    int dataPos = data.position();
+    try {
+
+      int[] widthPowerOf2 = new int[1];
+      int[] heightPowerOf2 = new int[1];
+      int[] depthPowerOf2 = new int[1];
+      int level, levels;
+    
+      int rc = checkMipmapArgs( internalFormat, format, type );
+      if( rc != 0 ) {
+        return( rc );
+      }
+    
+      if( width < 1 || height < 1 || depth < 1 ) {
+        return( GLU.GLU_INVALID_VALUE );
+      }
+    
+      if( type == GL2.GL_BITMAP ) {
+        return( GLU.GLU_INVALID_ENUM );
+      }
+    
+      closestFit3D( gl, target, width, height, depth, internalFormat, format,
+                    type, widthPowerOf2, heightPowerOf2, depthPowerOf2 );
+    
+      levels = computeLog( widthPowerOf2[0] );
+      level = computeLog( heightPowerOf2[0] );
+      if( level > levels ) {
+        levels = level;
+      }
+      level = computeLog( depthPowerOf2[0] );
+      if( level > levels ) {
+        levels = level;
+      }
+    
+      return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
+              height, depth, widthPowerOf2[0], heightPowerOf2[0], depthPowerOf2[0],
+              format, type, 0, 0, levels, data ) );
+    } finally {
+      data.position(dataPos);
+    }
+  }
+  
+  public static int gluBuild3DMipmapLevels( GL gl, int target, int internalFormat,
+          int width, int height, int depth, int format, int type, int userLevel,
+          int baseLevel, int maxLevel, ByteBuffer data ) {
+    int dataPos = data.position();
+    try {
+      int level, levels;
+    
+      int rc = checkMipmapArgs( internalFormat, format, type );
+      if( rc != 0 ) {
+        return( rc );
+      }
+    
+      if( width < 1 || height < 1 || depth < 1 ) {
+        return( GLU.GLU_INVALID_VALUE );
+      }
+    
+      if( type == GL2.GL_BITMAP ) {
+        return( GLU.GLU_INVALID_ENUM );
+      }
+    
+      levels = computeLog( width );
+      level = computeLog( height );
+      if( level > levels ) {
+        levels = level;
+      }
+      level = computeLog( depth );
+      if( level > levels ) {
+        levels = level;
+      }
+    
+      levels += userLevel;
+      if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
+        return( GLU.GLU_INVALID_VALUE );
+      }
+    
+      return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
+              height, depth, width, height, depth, format, type, userLevel,
+              baseLevel, maxLevel, data ) );
+    } finally {
+      data.position(dataPos);
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
new file mode 100644
index 0000000..0b1af83
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
@@ -0,0 +1,426 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+/**
+ *
+ * @author  Administrator
+ */
+public class PixelStorageModes {
+
+  /**
+   * Holds value of property packAlignment.
+   */
+  private int packAlignment;
+
+  /**
+   * Holds value of property packRowLength.
+   */
+  private int packRowLength;
+
+  /**
+   * Holds value of property packSkipRows.
+   */
+  private int packSkipRows;
+
+  /**
+   * Holds value of property packSkipPixels.
+   */
+  private int packSkipPixels;
+
+  /**
+   * Holds value of property packLsbFirst.
+   */
+  private boolean packLsbFirst;
+
+  /**
+   * Holds value of property packSwapBytes.
+   */
+  private boolean packSwapBytes;
+
+  /**
+   * Holds value of property packSkipImages.
+   */
+  private int packSkipImages;
+
+  /**
+   * Holds value of property packImageHeight.
+   */
+  private int packImageHeight;
+
+  /**
+   * Holds value of property unpackAlignment.
+   */
+  private int unpackAlignment;
+
+  /**
+   * Holds value of property unpackRowLength.
+   */
+  private int unpackRowLength;
+
+  /**
+   * Holds value of property unpackSkipRows.
+   */
+  private int unpackSkipRows;
+
+  /**
+   * Holds value of property unpackSkipPixels.
+   */
+  private int unpackSkipPixels;
+
+  /**
+   * Holds value of property unpackLsbFirst.
+   */
+  private boolean unpackLsbFirst;
+
+  /**
+   * Holds value of property unpackSwapBytes.
+   */
+  private boolean unpackSwapBytes;
+
+  /**
+   * Holds value of property unpackSkipImages.
+   */
+  private int unpackSkipImages;
+
+  /**
+   * Holds value of property unpackImageHeight.
+   */
+  private int unpackImageHeight;
+  
+  /** Creates a new instance of PixelStorageModes */
+  public PixelStorageModes() {
+  }
+
+  /**
+   * Getter for property packAlignment.
+   * @return Value of property packAlignment.
+   */
+  public int getPackAlignment() {
+
+    return this.packAlignment;
+  }
+
+  /**
+   * Setter for property packAlignment.
+   * @param packAlignment New value of property packAlignment.
+   */
+  public void setPackAlignment(int packAlignment) {
+
+    this.packAlignment = packAlignment;
+  }
+
+  /**
+   * Getter for property packRowLength.
+   * @return Value of property packRowLength.
+   */
+  public int getPackRowLength() {
+
+    return this.packRowLength;
+  }
+
+  /**
+   * Setter for property packRowLength.
+   * @param packRowLength New value of property packRowLength.
+   */
+  public void setPackRowLength(int packRowLength) {
+
+    this.packRowLength = packRowLength;
+  }
+
+  /**
+   * Getter for property packSkipRows.
+   * @return Value of property packSkipRows.
+   */
+  public int getPackSkipRows() {
+
+    return this.packSkipRows;
+  }
+
+  /**
+   * Setter for property packSkipRows.
+   * @param packSkipRows New value of property packSkipRows.
+   */
+  public void setPackSkipRows(int packSkipRows) {
+
+    this.packSkipRows = packSkipRows;
+  }
+
+  /**
+   * Getter for property packSkipPixels.
+   * @return Value of property packSkipPixels.
+   */
+  public int getPackSkipPixels() {
+
+    return this.packSkipPixels;
+  }
+
+  /**
+   * Setter for property packSkipPixels.
+   * @param packSkipPixels New value of property packSkipPixels.
+   */
+  public void setPackSkipPixels(int packSkipPixels) {
+
+    this.packSkipPixels = packSkipPixels;
+  }
+
+  /**
+   * Getter for property packLsbFirst.
+   * @return Value of property packLsbFirst.
+   */
+  public boolean getPackLsbFirst() {
+
+    return this.packLsbFirst;
+  }
+
+  /**
+   * Setter for property packLsbFirst.
+   * @param packLsbFirst New value of property packLsbFirst.
+   */
+  public void setPackLsbFirst(boolean packLsbFirst) {
+
+    this.packLsbFirst = packLsbFirst;
+  }
+
+  /**
+   * Getter for property packSwapBytes.
+   * @return Value of property packSwapBytes.
+   */
+  public boolean getPackSwapBytes() {
+
+    return this.packSwapBytes;
+  }
+
+  /**
+   * Setter for property packSwapBytes.
+   * @param packSwapBytes New value of property packSwapBytes.
+   */
+  public void setPackSwapBytes(boolean packSwapBytes) {
+
+    this.packSwapBytes = packSwapBytes;
+  }
+
+  /**
+   * Getter for property packSkipImages.
+   * @return Value of property packSkipImages.
+   */
+  public int getPackSkipImages() {
+
+    return this.packSkipImages;
+  }
+
+  /**
+   * Setter for property packSkipImages.
+   * @param packSkipImages New value of property packSkipImages.
+   */
+  public void setPackSkipImages(int packSkipImages) {
+
+    this.packSkipImages = packSkipImages;
+  }
+
+  /**
+   * Getter for property packImageHeight.
+   * @return Value of property packImageHeight.
+   */
+  public int getPackImageHeight() {
+
+    return this.packImageHeight;
+  }
+
+  /**
+   * Setter for property packImageHeight.
+   * @param packImageHeight New value of property packImageHeight.
+   */
+  public void setPackImageHeight(int packImageHeight) {
+
+    this.packImageHeight = packImageHeight;
+  }
+
+  /**
+   * Getter for property unpackAlignment.
+   * @return Value of property unpackAlignment.
+   */
+  public int getUnpackAlignment() {
+
+    return this.unpackAlignment;
+  }
+
+  /**
+   * Setter for property unpackAlignment.
+   * @param unpackAlignment New value of property unpackAlignment.
+   */
+  public void setUnpackAlignment(int unpackAlignment) {
+
+    this.unpackAlignment = unpackAlignment;
+  }
+
+  /**
+   * Getter for property unpackRowLength.
+   * @return Value of property unpackRowLength.
+   */
+  public int getUnpackRowLength() {
+
+    return this.unpackRowLength;
+  }
+
+  /**
+   * Setter for property unpackRowLength.
+   * @param unpackRowLength New value of property unpackRowLength.
+   */
+  public void setUnpackRowLength(int unpackRowLength) {
+
+    this.unpackRowLength = unpackRowLength;
+  }
+
+  /**
+   * Getter for property unpackSkipRows.
+   * @return Value of property unpackSkipRows.
+   */
+  public int getUnpackSkipRows() {
+
+    return this.unpackSkipRows;
+  }
+
+  /**
+   * Setter for property unpackSkipRows.
+   * @param unpackSkipRows New value of property unpackSkipRows.
+   */
+  public void setUnpackSkipRows(int unpackSkipRows) {
+
+    this.unpackSkipRows = unpackSkipRows;
+  }
+
+  /**
+   * Getter for property unpackSkipPixels.
+   * @return Value of property unpackSkipPixels.
+   */
+  public int getUnpackSkipPixels() {
+
+    return this.unpackSkipPixels;
+  }
+
+  /**
+   * Setter for property unpackSkipPixels.
+   * @param unpackSkipPixels New value of property unpackSkipPixels.
+   */
+  public void setUnpackSkipPixels(int unpackSkipPixels) {
+
+    this.unpackSkipPixels = unpackSkipPixels;
+  }
+
+  /**
+   * Getter for property unpackLsbFirst.
+   * @return Value of property unpackLsbFirst.
+   */
+  public boolean getUnpackLsbFirst() {
+
+    return this.unpackLsbFirst;
+  }
+
+  /**
+   * Setter for property unpackLsbFirst.
+   * @param unpackLsbFirst New value of property unpackLsbFirst.
+   */
+  public void setUnpackLsbFirst(boolean unpackLsbFirst) {
+
+    this.unpackLsbFirst = unpackLsbFirst;
+  }
+
+  /**
+   * Getter for property unpackSwapBytes.
+   * @return Value of property unpackSwapBytes.
+   */
+  public boolean getUnpackSwapBytes() {
+
+    return this.unpackSwapBytes;
+  }
+
+  /**
+   * Setter for property unpackSwapBytes.
+   * @param unpackSwapBytes New value of property unpackSwapBytes.
+   */
+  public void setUnpackSwapBytes(boolean unpackSwapBytes) {
+
+    this.unpackSwapBytes = unpackSwapBytes;
+  }
+
+  /**
+   * Getter for property unpackSkipImages.
+   * @return Value of property unpackSkipImages.
+   */
+  public int getUnpackSkipImages() {
+
+    return this.unpackSkipImages;
+  }
+
+  /**
+   * Setter for property unpackSkipImages.
+   * @param unpackSkipImages New value of property unpackSkipImages.
+   */
+  public void setUnpackSkipImages(int unpackSkipImages) {
+
+    this.unpackSkipImages = unpackSkipImages;
+  }
+
+  /**
+   * Getter for property unpackImageHeight.
+   * @return Value of property unpackImageHeight.
+   */
+  public int getUnpackImageHeight() {
+
+    return this.unpackImageHeight;
+  }
+
+  /**
+   * Setter for property unpackImageHeight.
+   * @param unpackImageHeight New value of property unpackImageHeight.
+   */
+  public void setUnpackImageHeight(int unpackImageHeight) {
+
+    this.unpackImageHeight = unpackImageHeight;
+  }
+  
+  
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
new file mode 100644
index 0000000..5f086ce
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
@@ -0,0 +1,2447 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.glu.GLU;
+import java.nio.*;
+import com.jogamp.common.nio.Buffers;
+
+/**
+ *
+ * @author  Administrator
+ */
+public class ScaleInternal {
+  
+  public static final float UINT_MAX = (float)(0x00000000FFFFFFFF);
+  
+  public static void scale_internal( int components, int widthin, int heightin,
+          ShortBuffer datain, int widthout, int heightout, ShortBuffer dataout ) {
+    float x, lowx, highx, convx, halfconvx;
+    float y, lowy, highy, convy, halfconvy;
+    float xpercent, ypercent;
+    float percent;
+    // Max components in a format is 4, so...
+    float[] totals = new float[4];
+    float area;
+    int i, j, k, yint, xint, xindex, yindex;
+    int temp;
+    
+    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+      HalveImage.halveImage( components, widthin, heightin, datain, dataout );
+      return;
+    }
+    convy = (float)heightin / heightout;
+    convx = (float)widthin / widthout;
+    halfconvx = convx / 2;
+    halfconvy = convy / 2;
+    for( i = 0; i < heightout; i++ ) {
+      y = convy * ( i + 0.5f );
+      if( heightin > heightout ) {
+        highy = y + halfconvy;
+        lowy = y - halfconvy;
+      } else {
+        highy = y + 0.5f;
+        lowy = y - 0.5f;
+      }
+      for( j = 0; j < widthout; j++ ) {
+        x = convx * ( j + 0.5f );
+        if( widthin > widthout ) {
+          highx = x + halfconvx;
+          lowx = x - halfconvx;
+        } else {
+          highx = x + 0.5f;
+          lowx = x - 0.5f;
+        }
+        // Ok, now apply box filter to box that goes from (lowx, lowy)
+        // to (highx, highy) on input data into this pixel on output
+        // data.
+        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+        area = 0.0f;
+        
+        y = lowy;
+        yint = (int)Math.floor( y );
+        while( y < highy ) {
+          yindex = ( yint + heightin ) % heightin;
+          if( highy < yint + 1 ) {
+            ypercent = highy - y;
+          } else {
+            ypercent = yint + 1 - y;
+          }
+          
+          x = lowx;
+          xint = (int)Math.floor( x );
+          
+          while( x < highx ) {
+            xindex = ( xint + widthin ) % widthin;
+            if( highx < xint + 1 ) {
+              xpercent = highx -x;
+            } else {
+              xpercent = xint + 1 - x;
+            }
+            
+            percent = xpercent * ypercent;
+            area += percent;
+            temp = ( xindex + ( yindex * widthin) ) * components;
+            for( k = 0; k < components; k++ ) {
+              totals[k] += datain.get( temp + k ) * percent; 
+            }
+            
+            xint++;
+            x = xint;
+          }
+          yint++;
+          y = yint;
+        }
+        
+        temp = ( j + ( i * widthout ) ) * components;
+        for( k = 0; k < components; k++ ) {
+          // totals[] should be rounded in the case of enlarging an RGB
+          // ramp when the type is 332 or 4444
+          dataout.put(  temp + k, (short)((totals[k] + 0.5f) / area) );
+        }
+      }
+    }
+  }
+  
+  public static void scale_internal_ubyte( int components, int widthin, int heightin,
+                              ByteBuffer datain, int widthout, int heightout, 
+                              ByteBuffer dataout, int element_size, int ysize, int group_size ) {
+    float x, convx;
+    float y, convy;
+    float percent;
+    // Max components in a format is 4, so...
+    float[] totals = new float[4];
+    float area;
+    int i, j, k, xindex;
+    
+    int temp, temp0;
+    int temp_index;
+    int outindex;
+    
+    int lowx_int, highx_int, lowy_int, highy_int;
+    float x_percent, y_percent;
+    float lowx_float, highx_float, lowy_float, highy_float;
+    float convy_float, convx_float;
+    int convy_int, convx_int;
+    int l, m;
+    int left, right;
+    
+    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+      HalveImage.halveImage_ubyte( components, widthin, heightin, datain, dataout, 
+                        element_size, ysize, group_size );
+      return;
+    }
+    convy = (float)heightin / heightout;
+    convx = (float)widthin / widthout;
+    convy_int = (int)Math.floor( convy );
+    convy_float = convy - convy_int;
+    convx_int = (int)Math.floor( convx );
+    convx_float = convx - convx_int;
+    
+    area = convx * convy;
+    
+    lowy_int = 0;
+    lowy_float = 0.0f;
+    highy_int = convy_int;
+    highy_float = convy_float;
+    
+    for( i = 0; i < heightout; i++ ) {
+      // Clamp here to be sure we don't read beyond input buffer.
+      if (highy_int >= heightin)
+        highy_int = heightin - 1;
+      lowx_int = 0;
+      lowx_float = 0.0f;
+      highx_int = convx_int;
+      highx_float = convx_float;
+      
+      for( j = 0; j < widthout; j++ ) {
+        
+        // Ok, now apply box filter to box that goes from (lowx, lowy)
+        // to (highx, highy) on input data into this pixel on output
+        // data.
+        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+        
+        // caulate the value for pixels in the 1st row
+        xindex = lowx_int * group_size;
+
+        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+          
+          y_percent = 1 - lowy_float;
+          temp = xindex + lowy_int * ysize;
+          percent = y_percent * ( 1 - lowx_float );
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += ( 0x000000FF & datain.get() ) * percent;
+          }
+          left = temp;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              totals[k] += ( 0x000000FF & datain.get() ) * y_percent;
+            }
+          }
+          temp += group_size;
+          right = temp;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += ( 0x000000FF & datain.get() ) * percent;
+          }
+          
+          // calculate the value for pixels in the last row
+          y_percent = highy_float;
+          percent = y_percent * ( 1 - lowx_float );
+          temp = xindex + highy_int * ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += ( 0x000000FF & datain.get() ) * percent;
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              totals[k] += ( 0x000000FF & datain.get() ) * y_percent;
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += ( 0x000000FF & datain.get() ) * percent;
+          }
+          
+          // calculate the value for the pixels in the 1st and last column
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            left += ysize;
+            right += ysize;
+            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+              float f = 0.0f;
+              datain.position( left );
+              f = ( 0x000000FF & datain.get() ) * ( 1.0f - lowx_float );
+              datain.position( right );
+              f += ( 0x000000FF & datain.get() ) * highx_float;
+              totals[k] += f;
+            }
+          }
+        } else if( highy_int > lowy_int ) {
+          x_percent = highx_float - lowx_float;
+          percent = ( 1 - lowy_float) * x_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += ( 0x000000FF & datain.get() ) * percent;
+          }
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            temp += ysize;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              totals[k] += ( 0x000000FF & datain.get() ) * x_percent;
+            }
+          }
+          percent = x_percent * highy_float;
+          temp += ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += ( 0x000000FF & datain.get() ) * percent;
+          }
+        } else if( highx_int > lowx_int ) {
+          y_percent = highy_float - lowy_float;
+          percent = ( 1 - lowx_float ) * y_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += ( 0x000000FF & datain.get() ) * percent;
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              totals[k] += ( 0x000000FF & datain.get() ) * y_percent;
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += ( 0x000000FF & datain.get() ) * percent;
+          }
+        } else {
+          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += ( 0x000000FF & datain.get() ) * percent;
+          }
+        }
+
+        // this is for the pixels in the body
+        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+        for( m = lowy_int + 1; m < highy_int; m++ ) {
+          temp = temp0;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              totals[k] += ( 0x000000FF & datain.get() );
+            }
+            temp += group_size;
+          }
+          temp0 += ysize;
+        }
+        
+        outindex = ( j + ( i * widthout ) ) * components;
+        for( k = 0; k < components; k++ ) {
+          dataout.position( outindex + k );
+          dataout.put( (byte)(totals[k] / area) );
+        }
+        lowx_int = highx_int;
+        lowx_float = highx_float;
+        highx_int += convx_int;
+        highx_float += convx_float;
+        if( highx_float > 1.0f ) {
+          highx_float -= 1.0f;
+          highx_int++;
+        }
+
+        // Clamp to make sure we don't run off the right edge
+        if (highx_int > widthin - 1) {
+          int delta = (highx_int - widthin + 1);
+          lowx_int -= delta;
+          highx_int -= delta;
+        }
+      }
+      lowy_int = highy_int;
+      lowy_float = highy_float;
+      highy_int += convy_int;
+      highy_float += convy_float;
+      if( highy_float > 1.0f ) {
+        highy_float -= 1.0f;
+        highy_int++;
+      }
+    }
+  }
+  
+  public static void scale_internal_byte( int components, int widthin, int heightin,
+                              ByteBuffer datain, int widthout, int heightout, 
+                              ByteBuffer dataout, int element_size, int ysize,
+                              int group_size ) {
+    float x, convx;
+    float y, convy;
+    float percent;
+    // Max components in a format is 4, so...
+    float[] totals = new float[4];
+    float area;
+    int i, j, k, xindex;
+    
+    int temp, temp0;
+    int temp_index;
+    int outindex;
+    
+    int lowx_int, highx_int, lowy_int, highy_int;
+    float x_percent, y_percent;
+    float lowx_float, highx_float, lowy_float, highy_float;
+    float convy_float, convx_float;
+    int convy_int, convx_int;
+    int l, m;
+    int left, right;
+    
+    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+      HalveImage.halveImage_byte( components, widthin, heightin, datain, dataout, 
+                        element_size, ysize, group_size );
+      return;
+    }
+    convy = (float)heightin / heightout;
+    convx = (float)widthin / widthout;
+    convy_int = (int)Math.floor( convy );
+    convy_float = convy - convy_int;
+    convx_int = (int)Math.floor( convx );
+    convx_float = convx - convx_int;
+    
+    area = convx * convy;
+    
+    lowy_int = 0;
+    lowy_float = 0.0f;
+    highy_int = convy_int;
+    highy_float = convy_float;
+    
+    for( i = 0; i < heightout; i++ ) {
+      // Clamp here to be sure we don't read beyond input buffer.
+      if (highy_int >= heightin)
+        highy_int = heightin - 1;
+      lowx_int = 0;
+      lowx_float = 0.0f;
+      highx_int = convx_int;
+      highx_float = convx_float;
+      
+      for( j = 0; j < widthout; j++ ) {
+        
+        // Ok, now apply box filter to box that goes from (lowx, lowy)
+        // to (highx, highy) on input data into this pixel on output
+        // data.
+        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+        
+        // caulate the value for pixels in the 1st row
+        xindex = lowx_int * group_size;
+        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+          
+          y_percent = 1 - lowy_float;
+          temp = xindex + lowy_int * ysize;
+          percent = y_percent * ( 1 - lowx_float );
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += datain.get() * percent;
+          }
+          left = temp;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              totals[k] += datain.get() * y_percent;
+            }
+          }
+          temp += group_size;
+          right = temp;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += datain.get() * percent;
+          }
+          
+          // calculate the value for pixels in the last row
+          y_percent = highy_float;
+          percent = y_percent * ( 1 - lowx_float );
+          temp = xindex + highy_int * ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += datain.get() * percent;
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              totals[k] += datain.get() * y_percent;
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += datain.get() * percent;
+          }
+          
+          // calculate the value for the pixels in the 1st and last column
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            left += ysize;
+            right += ysize;
+            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+              float f = 0.0f;
+              datain.position( left );
+              f = datain.get() * ( 1 - lowx_float );
+              datain.position( right );
+              f += datain.get() * highx_float;
+              totals[k] += f;
+            }
+          }
+        } else if( highy_int > lowy_int ) {
+          x_percent = highx_float - lowx_float;
+          percent = ( 1 - lowy_float) * x_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += datain.get() * percent;
+          }
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            temp += ysize;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              totals[k] += datain.get() * x_percent;
+            }
+          }
+          percent = x_percent * highy_float;
+          temp += ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += datain.get() * percent;
+          }
+        } else if( highx_int > lowx_int ) {
+          y_percent = highy_float - lowy_float;
+          percent = ( 1 - lowx_float ) * y_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += datain.get() * percent;
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              totals[k] += datain.get() * y_percent;
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += datain.get() * percent;
+          }
+        } else {
+          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            totals[k] += datain.get() * percent;
+          }
+        }
+        
+        // this is for the pixels in the body
+        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+        for( m = lowy_int + 1; m < highy_int; m++ ) {
+          temp = temp0;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              totals[k] += datain.get();
+            }
+            temp += group_size;
+          }
+          temp0 += ysize;
+        }
+        
+        outindex = ( j + ( i * widthout ) ) * components;
+        for( k = 0; k < components; k++ ) {
+          dataout.position( outindex + k );
+          dataout.put( (byte)(totals[k] / area) );
+        }
+        lowx_int = highx_int;
+        lowx_float = highx_float;
+        highx_int += convx_int;
+        highx_float += convx_float;
+        if( highx_float > 1.0f ) {
+          highx_float -= 1.0f;
+          highx_int++;
+        }
+
+        // Clamp to make sure we don't run off the right edge
+        if (highx_int > widthin - 1) {
+          int delta = (highx_int - widthin + 1);
+          lowx_int -= delta;
+          highx_int -= delta;
+        }
+      }
+      lowy_int = highy_int;
+      lowy_float = highy_float;
+      highy_int += convy_int;
+      highy_float += convy_float;
+      if( highy_float > 1.0f ) {
+        highy_float -= 1.0f;
+        highy_int++;
+      }
+    }
+  }
+  
+  public static void scale_internal_ushort( int components, int widthin, int heightin,
+                              ByteBuffer datain, int widthout, int heightout, 
+                              ShortBuffer dataout, int element_size, int ysize, 
+                              int group_size, boolean myswap_bytes ) {
+    float x, convx;
+    float y, convy;
+    float percent;
+    // Max components in a format is 4, so...
+    float[] totals = new float[4];
+    float area;
+    int i, j, k, xindex;
+    
+    int temp, temp0;
+    int temp_index;
+    int outindex;
+    
+    int lowx_int, highx_int, lowy_int, highy_int;
+    float x_percent, y_percent;
+    float lowx_float, highx_float, lowy_float, highy_float;
+    float convy_float, convx_float;
+    int convy_int, convx_int;
+    int l, m;
+    int left, right;
+    
+    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+      HalveImage.halveImage_ushort( components, widthin, heightin, datain, dataout, 
+                        element_size, ysize, group_size, myswap_bytes );
+      return;
+    }
+    convy = (float)heightin / heightout;
+    convx = (float)widthin / widthout;
+    convy_int = (int)Math.floor( convy );
+    convy_float = convy - convy_int;
+    convx_int = (int)Math.floor( convx );
+    convx_float = convx - convx_int;
+    
+    area = convx * convy;
+    
+    lowy_int = 0;
+    lowy_float = 0.0f;
+    highy_int = convy_int;
+    highy_float = convy_float;
+    
+    for( i = 0; i < heightout; i++ ) {
+      // Clamp here to be sure we don't read beyond input buffer.
+      if (highy_int >= heightin)
+        highy_int = heightin - 1;
+      lowx_int = 0;
+      lowx_float = 0.0f;
+      highx_int = convx_int;
+      highx_float = convx_float;
+      
+      for( j = 0; j < widthout; j++ ) {
+        
+        // Ok, now apply box filter to box that goes from (lowx, lowy)
+        // to (highx, highy) on input data into this pixel on output
+        // data.
+        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+        
+        // caulate the value for pixels in the 1st row
+        xindex = lowx_int * group_size;
+        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+          
+          y_percent = 1 - lowy_float;
+          temp = xindex + lowy_int * ysize;
+          percent = y_percent * ( 1 - lowx_float );
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += ( 0x0000FFFF & ((int)Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * percent;
+            } else {
+              totals[k] += ( 0x0000FFFF & datain.getShort() ) * percent;
+            }
+          }
+          left = temp;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                totals[k] += ( 0x0000FFFF & ((int)Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * y_percent;
+              } else {
+                totals[k] += ( 0x0000FFFF & datain.getShort()) * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          right = temp;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += ( 0x0000FFFF & (Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * percent;
+            } else {
+              totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
+            }
+          }
+          
+          // calculate the value for pixels in the last row
+          y_percent = highy_float;
+          percent = y_percent * ( 1 - lowx_float );
+          temp = xindex + highy_int * ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
+            } else {
+              totals[k] += ( 0x0000FFFF & datain.getShort() ) * percent;
+            }
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                totals[k] += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * y_percent;
+              } else {
+                totals[k] += ( 0x0000FFFF & datain.getShort()) * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
+            } else {
+              totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
+            }
+          }
+          
+          // calculate the value for the pixels in the 1st and last column
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            left += ysize;
+            right += ysize;
+            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+              if( myswap_bytes ) {
+                datain.position( left );
+                float f = (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES(datain.getShort())) * ( 1 - lowx_float );
+                datain.position( right );
+                f += ((0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES(datain.getShort())) * highx_float);
+                totals[k] += f;
+              } else {
+                datain.position( left );
+                float f = ((0x0000FFFF & datain.getShort()) * ( 1 - lowx_float ));
+                datain.position( right );
+                f += ((0x0000FFFF & datain.getShort()) * highx_float);
+                totals[k] += f;
+              }
+            }
+          }
+        } else if( highy_int > lowy_int ) {
+          x_percent = highx_float - lowx_float;
+          percent = ( 1 - lowy_float) * x_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() )) * percent;
+            } else {
+              totals[k] += (0x0000FFFF & datain.getShort()) * percent;
+            }
+          }
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            temp += ysize;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * x_percent;
+              } else {
+                totals[k] += (0x0000FFFF & datain.getShort()) * x_percent;
+              }
+            }
+          }
+          percent = x_percent * highy_float;
+          temp += ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() )) * percent;
+            } else {
+              totals[k] += (0x0000FFFF & datain.getShort()) * percent;
+            }
+          }
+        } else if( highx_int > lowx_int ) {
+          y_percent = highy_float - lowy_float;
+          percent = ( 1 - lowx_float ) * y_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
+            } else {
+              totals[k] += (0x0000FFFF & datain.getShort()) * percent;
+            }
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * y_percent;
+              } else {
+                totals[k] += (0x0000FFFF & datain.getShort()) * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
+            } else {
+              totals[k] += (0x0000FFFF & datain.getShort()) * percent;
+            }
+          }
+        } else {
+          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
+            } else {
+              totals[k] += (0x0000FFFF & datain.getShort()) * percent;
+            }
+          }
+        }
+        
+        // this is for the pixels in the body
+        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+        for( m = lowy_int + 1; m < highy_int; m++ ) {
+          temp = temp0;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()));
+              } else {
+                totals[k] += (0x0000FFFF & datain.getShort());
+              }
+            }
+            temp += group_size;
+          }
+          temp0 += ysize;
+        }
+        
+        outindex = ( j + ( i * widthout ) ) * components;
+        for( k = 0; k < components; k++ ) {
+          dataout.position( outindex + k );
+          dataout.put( (short)(totals[k] / area) );
+        }
+        lowx_int = highx_int;
+        lowx_float = highx_float;
+        highx_int += convx_int;
+        highx_float += convx_float;
+        if( highx_float > 1.0f ) {
+          highx_float -= 1.0f;
+          highx_int++;
+        }
+
+        // Clamp to make sure we don't run off the right edge
+        if (highx_int > widthin - 1) {
+          int delta = (highx_int - widthin + 1);
+          lowx_int -= delta;
+          highx_int -= delta;
+        }
+      }
+      lowy_int = highy_int;
+      lowy_float = highy_float;
+      highy_int += convy_int;
+      highy_float += convy_float;
+      if( highy_float > 1.0f ) {
+        highy_float -= 1.0f;
+        highy_int++;
+      }
+    }
+  }
+  
+  public static void scale_internal_short( int components, int widthin, int heightin,
+                              ByteBuffer datain, int widthout, int heightout,
+                              ShortBuffer dataout, int element_size, int ysize, 
+                              int group_size, boolean myswap_bytes ) {
+    float x, convx;
+    float y, convy;
+    float percent;
+    // Max components in a format is 4, so...
+    float[] totals = new float[4];
+    float area;
+    int i, j, k, xindex;
+    
+    int temp, temp0;
+    int temp_index;
+    int outindex;
+    
+    int lowx_int, highx_int, lowy_int, highy_int;
+    float x_percent, y_percent;
+    float lowx_float, highx_float, lowy_float, highy_float;
+    float convy_float, convx_float;
+    int convy_int, convx_int;
+    int l, m;
+    int left, right;
+    
+    int swapbuf; // unsigned buffer
+    
+    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+      HalveImage.halveImage_short( components, widthin, heightin, datain, dataout, 
+                        element_size, ysize, group_size, myswap_bytes );
+      return;
+    }
+    convy = (float)heightin / heightout;
+    convx = (float)widthin / widthout;
+    convy_int = (int)Math.floor( convy );
+    convy_float = convy - convy_int;
+    convx_int = (int)Math.floor( convx );
+    convx_float = convx - convx_int;
+    
+    area = convx * convy;
+    
+    lowy_int = 0;
+    lowy_float = 0.0f;
+    highy_int = convy_int;
+    highy_float = convy_float;
+    
+    for( i = 0; i < heightout; i++ ) {
+      // Clamp here to be sure we don't read beyond input buffer.
+      if (highy_int >= heightin)
+        highy_int = heightin - 1;
+      lowx_int = 0;
+      lowx_float = 0.0f;
+      highx_int = convx_int;
+      highx_float = convx_float;
+      
+      for( j = 0; j < widthout; j++ ) {
+        
+        // Ok, now apply box filter to box that goes from (lowx, lowy)
+        // to (highx, highy) on input data into this pixel on output
+        // data.
+        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+        
+        // caulate the value for pixels in the 1st row
+        xindex = lowx_int * group_size;
+        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+          
+          y_percent = 1 - lowy_float;
+          temp = xindex + lowy_int * ysize;
+          percent = y_percent * ( 1 - lowx_float );
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getShort() * percent;
+            }
+          }
+          left = temp;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+                totals[k] += swapbuf * y_percent;
+              } else {
+                totals[k] += datain.getShort() * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          right = temp;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getShort() * percent;
+            }
+          }
+          
+          // calculate the value for pixels in the last row
+          y_percent = highy_float;
+          percent = y_percent * ( 1 - lowx_float );
+          temp = xindex + highy_int * ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getShort() * percent;
+            }
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+                totals[k] += swapbuf * y_percent;
+              } else {
+                totals[k] += datain.getShort() * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getShort() * percent;
+            }
+          }
+          
+          // calculate the value for the pixels in the 1st and last column
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            left += ysize;
+            right += ysize;
+            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+              if( myswap_bytes ) {
+                datain.position( left );
+                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+                totals[k] += swapbuf * ( 1 - lowx_float );
+                datain.position( right );
+                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+                totals[k] += swapbuf * highx_float;
+              } else {
+                datain.position( left );
+                totals[k] += datain.getShort() * ( 1 - lowx_float );
+                datain.position( right );
+                totals[k] += datain.getShort() * highx_float;
+              }
+            }
+          }
+        } else if( highy_int > lowy_int ) {
+          x_percent = highx_float - lowx_float;
+          percent = ( 1 - lowy_float) * x_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getShort() * percent;
+            }
+          }
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            temp += ysize;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort());
+                totals[k] += swapbuf * x_percent;
+              } else {
+                totals[k] += datain.getShort() * x_percent;
+              }
+            }
+          }
+          percent = x_percent * highy_float;
+          temp += ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getShort() * percent;
+            }
+          }
+        } else if( highx_int > lowx_int ) {
+          y_percent = highy_float - lowy_float;
+          percent = ( 1 - lowx_float ) * y_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getShort() * percent;
+            }
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+                totals[k] += swapbuf * y_percent;
+              } else {
+                totals[k] += datain.getShort() * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getShort() * percent;
+            }
+          }
+        } else {
+          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getShort() * percent;
+            }
+          }
+        }
+        
+        // this is for the pixels in the body
+        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+        for( m = lowy_int + 1; m < highy_int; m++ ) {
+          temp = temp0;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+                totals[k] += swapbuf;
+              } else {
+                totals[k] += datain.getShort();
+              }
+            }
+            temp += group_size;
+          }
+          temp0 += ysize;
+        }
+        
+        outindex = ( j + ( i * widthout ) ) * components;
+        for( k = 0; k < components; k++ ) {
+          dataout.position( outindex + k );
+          dataout.put( (short)(totals[k] / area) );
+        }
+        lowx_int = highx_int;
+        lowx_float = highx_float;
+        highx_int += convx_int;
+        highx_float += convx_float;
+        if( highx_float > 1.0f ) {
+          highx_float -= 1.0f;
+          highx_int++;
+        }
+
+        // Clamp to make sure we don't run off the right edge
+        if (highx_int > widthin - 1) {
+          int delta = (highx_int - widthin + 1);
+          lowx_int -= delta;
+          highx_int -= delta;
+        }
+      }
+      lowy_int = highy_int;
+      lowy_float = highy_float;
+      highy_int += convy_int;
+      highy_float += convy_float;
+      if( highy_float > 1.0f ) {
+        highy_float -= 1.0f;
+        highy_int++;
+      }
+    }
+  }
+  
+  public static void scale_internal_uint( int components, int widthin, int heightin,
+                              ByteBuffer datain, int widthout, int heightout, 
+                              IntBuffer dataout, int element_size, int ysize, 
+                              int group_size, boolean myswap_bytes ) {
+    float x, convx;
+    float y, convy;
+    float percent;
+    // Max components in a format is 4, so...
+    float[] totals = new float[4];
+    float area;
+    int i, j, k, xindex;
+    
+    int temp, temp0;
+    int temp_index;
+    int outindex;
+    
+    int lowx_int, highx_int, lowy_int, highy_int;
+    float x_percent, y_percent;
+    float lowx_float, highx_float, lowy_float, highy_float;
+    float convy_float, convx_float;
+    int convy_int, convx_int;
+    int l, m;
+    int left, right;
+    
+    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+      HalveImage.halveImage_uint( components, widthin, heightin, datain, dataout, 
+                        element_size, ysize, group_size, myswap_bytes );
+      return;
+    }
+    convy = (float)heightin / heightout;
+    convx = (float)widthin / widthout;
+    convy_int = (int)Math.floor( convy );
+    convy_float = convy - convy_int;
+    convx_int = (int)Math.floor( convx );
+    convx_float = convx - convx_int;
+    
+    area = convx * convy;
+    
+    lowy_int = 0;
+    lowy_float = 0.0f;
+    highy_int = convy_int;
+    highy_float = convy_float;
+    
+    for( i = 0; i < heightout; i++ ) {
+      // Clamp here to be sure we don't read beyond input buffer.
+      if (highy_int >= heightin)
+        highy_int = heightin - 1;
+      lowx_int = 0;
+      lowx_float = 0.0f;
+      highx_int = convx_int;
+      highx_float = convx_float;
+      
+      for( j = 0; j < widthout; j++ ) {
+        
+        // Ok, now apply box filter to box that goes from (lowx, lowy)
+        // to (highx, highy) on input data into this pixel on output
+        // data.
+        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+        
+        // caulate the value for pixels in the 1st row
+        xindex = lowx_int * group_size;
+        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+          
+          y_percent = 1 - lowy_float;
+          temp = xindex + lowy_int * ysize;
+          percent = y_percent * ( 1 - lowx_float );
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
+            } else {
+              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+            }
+          }
+          left = temp;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * y_percent;
+              } else {
+                totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          right = temp;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
+            } else {
+              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+            }
+          }
+          
+          // calculate the value for pixels in the last row
+          y_percent = highy_float;
+          percent = y_percent * ( 1 - lowx_float );
+          temp = xindex + highy_int * ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
+            } else {
+              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+            }
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * y_percent;
+              } else {
+                totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
+            } else {
+              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+            }
+          }
+          
+          // calculate the value for the pixels in the 1st and last column
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            left += ysize;
+            right += ysize;
+            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+              if( myswap_bytes ) {
+                datain.position( left );
+                totals[k] += ((0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES(datain.getInt())) * ( 1 - lowx_float ));
+                datain.position( right );
+                totals[k] += ((0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES(datain.getInt())) * highx_float);
+              } else {
+                datain.position( left );
+                totals[k] += ((0x00000000FFFFFFFF & datain.getInt()) * ( 1 - lowx_float ));
+                datain.position( right );
+                totals[k] += ((0x00000000FFFFFFFF & datain.getInt()) * highx_float);
+              }
+            }
+          }
+        } else if( highy_int > lowy_int ) {
+          x_percent = highx_float - lowx_float;
+          percent = ( 1 - lowy_float) * x_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
+            } else {
+              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+            }
+          }
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            temp += ysize;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * x_percent;
+              } else {
+                totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * x_percent;
+              }
+            }
+          }
+          percent = x_percent * highy_float;
+          temp += ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
+            } else {
+              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+            }
+          }
+        } else if( highx_int > lowx_int ) {
+          y_percent = highy_float - lowy_float;
+          percent = ( 1 - lowx_float ) * y_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
+            } else {
+              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+            }
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * y_percent;
+              } else {
+                totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
+            } else {
+              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+            }
+          }
+        } else {
+          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            long tempInt0 = ( 0xFFFFFFFFL & datain.getInt( temp_index ) );
+            datain.position( temp_index );
+            long tempInt1 = ( 0xFFFFFFFFL & datain.getInt() );
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
+            } else {
+              totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+            }
+          }
+        }
+        
+        // this is for the pixels in the body
+        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+        for( m = lowy_int + 1; m < highy_int; m++ ) {
+          temp = temp0;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()));
+              } else {
+                totals[k] += (0x00000000FFFFFFFF & datain.getInt());
+              }
+            }
+            temp += group_size;
+          }
+          temp0 += ysize;
+        }
+        
+        outindex = ( j + ( i * widthout ) ) * components;
+        float value = 0.0f;
+        for( k = 0; k < components; k++ ) {
+          value = totals[k] / area;
+          dataout.position( outindex + k );
+          if( value >= UINT_MAX ) {
+            dataout.put( (int)value );
+          } else {
+            dataout.put( (int)(totals[k] / area) );
+          }
+        }
+        lowx_int = highx_int;
+        lowx_float = highx_float;
+        highx_int += convx_int;
+        highx_float += convx_float;
+        if( highx_float > 1.0f ) {
+          highx_float -= 1.0f;
+          highx_int++;
+        }
+
+        // Clamp to make sure we don't run off the right edge
+        if (highx_int > widthin - 1) {
+          int delta = (highx_int - widthin + 1);
+          lowx_int -= delta;
+          highx_int -= delta;
+        }
+      }
+      lowy_int = highy_int;
+      lowy_float = highy_float;
+      highy_int += convy_int;
+      highy_float += convy_float;
+      if( highy_float > 1.0f ) {
+        highy_float -= 1.0f;
+        highy_int++;
+      }
+    }
+  }
+  
+  public static void scale_internal_int( int components, int widthin, int heightin,
+                              ByteBuffer datain, int widthout, int heightout, 
+                              IntBuffer dataout, int element_size, int ysize, 
+                              int group_size, boolean myswap_bytes ) {
+    float x, convx;
+    float y, convy;
+    float percent;
+    // Max components in a format is 4, so...
+    float[] totals = new float[4];
+    float area;
+    int i, j, k, xindex;
+    
+    int temp, temp0;
+    int temp_index;
+    int outindex;
+    
+    int lowx_int, highx_int, lowy_int, highy_int;
+    float x_percent, y_percent;
+    float lowx_float, highx_float, lowy_float, highy_float;
+    float convy_float, convx_float;
+    int convy_int, convx_int;
+    int l, m;
+    int left, right;
+    
+    long swapbuf; // unsigned buffer
+    
+    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+      HalveImage.halveImage_int( components, widthin, heightin, datain, dataout, 
+                        element_size, ysize, group_size, myswap_bytes );
+      return;
+    }
+    convy = (float)heightin / heightout;
+    convx = (float)widthin / widthout;
+    convy_int = (int)Math.floor( convy );
+    convy_float = convy - convy_int;
+    convx_int = (int)Math.floor( convx );
+    convx_float = convx - convx_int;
+    
+    area = convx * convy;
+    
+    lowy_int = 0;
+    lowy_float = 0.0f;
+    highy_int = convy_int;
+    highy_float = convy_float;
+    
+    for( i = 0; i < heightout; i++ ) {
+      // Clamp here to be sure we don't read beyond input buffer.
+      if (highy_int >= heightin)
+        highy_int = heightin - 1;
+      lowx_int = 0;
+      lowx_float = 0.0f;
+      highx_int = convx_int;
+      highx_float = convx_float;
+      
+      for( j = 0; j < widthout; j++ ) {
+        
+        // Ok, now apply box filter to box that goes from (lowx, lowy)
+        // to (highx, highy) on input data into this pixel on output
+        // data.
+        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+        
+        // caulate the value for pixels in the 1st row
+        xindex = lowx_int * group_size;
+        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+          
+          y_percent = 1 - lowy_float;
+          temp = xindex + lowy_int * ysize;
+          percent = y_percent * ( 1 - lowx_float );
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getInt() * percent;
+            }
+          }
+          left = temp;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+                totals[k] += swapbuf * y_percent;
+              } else {
+                totals[k] += datain.getInt() * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          right = temp;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getInt() * percent;
+            }
+          }
+          
+          // calculate the value for pixels in the last row
+          y_percent = highy_float;
+          percent = y_percent * ( 1 - lowx_float );
+          temp = xindex + highy_int * ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getInt() * percent;
+            }
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+                totals[k] += swapbuf * y_percent;
+              } else {
+                totals[k] += datain.getInt() * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getInt() * percent;
+            }
+          }
+          
+          // calculate the value for the pixels in the 1st and last column
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            left += ysize;
+            right += ysize;
+            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+              if( myswap_bytes ) {
+                datain.position( left );
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+                totals[k] += swapbuf * ( 1 - lowx_float );
+                datain.position( right );
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+                totals[k] += swapbuf * highx_float;
+              } else {
+                datain.position( left );
+                totals[k] += (datain.getInt() * ( 1 - lowx_float ));
+                datain.position( right );
+                totals[k] += (datain.getInt() * highx_float);
+              }
+            }
+          }
+        } else if( highy_int > lowy_int ) {
+          x_percent = highx_float - lowx_float;
+          percent = ( 1 - lowy_float) * x_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getInt() * percent;
+            }
+          }
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            temp += ysize;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+                totals[k] += swapbuf * x_percent;
+              } else {
+                totals[k] += datain.getInt() * x_percent;
+              }
+            }
+          }
+          percent = x_percent * highy_float;
+          temp += ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getInt() * percent;
+            }
+          }
+        } else if( highx_int > lowx_int ) {
+          y_percent = highy_float - lowy_float;
+          percent = ( 1 - lowx_float ) * y_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getInt() * percent;
+            }
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+                totals[k] += swapbuf * y_percent;
+              } else {
+                totals[k] += datain.getInt() * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getInt() * percent;
+            }
+          }
+        } else {
+          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getInt() * percent;
+            }
+          }
+        }
+        
+        // this is for the pixels in the body
+        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+        for( m = lowy_int + 1; m < highy_int; m++ ) {
+          temp = temp0;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+                totals[k] += swapbuf;
+              } else {
+                totals[k] += datain.getInt();
+              }
+            }
+            temp += group_size;
+          }
+          temp0 += ysize;
+        }
+        
+        outindex = ( j + ( i * widthout ) ) * components;
+        for( k = 0; k < components; k++ ) {
+          dataout.position( outindex + k );
+          dataout.put( (int)(totals[k] / area) );
+        }
+        lowx_int = highx_int;
+        lowx_float = highx_float;
+        highx_int += convx_int;
+        highx_float += convx_float;
+        if( highx_float > 1.0f ) {
+          highx_float -= 1.0f;
+          highx_int++;
+        }
+
+        // Clamp to make sure we don't run off the right edge
+        if (highx_int > widthin - 1) {
+          int delta = (highx_int - widthin + 1);
+          lowx_int -= delta;
+          highx_int -= delta;
+        }
+      }
+      lowy_int = highy_int;
+      lowy_float = highy_float;
+      highy_int += convy_int;
+      highy_float += convy_float;
+      if( highy_float > 1.0f ) {
+        highy_float -= 1.0f;
+        highy_int++;
+      }
+    }
+  }
+  
+  public static void scale_internal_float( int components, int widthin, int heightin,
+                              ByteBuffer datain, int widthout, int heightout, 
+                              FloatBuffer dataout, int element_size, int ysize, 
+                              int group_size, boolean myswap_bytes ) {
+    float x, convx;
+    float y, convy;
+    float percent;
+    // Max components in a format is 4, so...
+    float[] totals = new float[4];
+    float area;
+    int i, j, k, xindex;
+    
+    int temp, temp0;
+    int temp_index;
+    int outindex;
+    
+    int lowx_int, highx_int, lowy_int, highy_int;
+    float x_percent, y_percent;
+    float lowx_float, highx_float, lowy_float, highy_float;
+    float convy_float, convx_float;
+    int convy_int, convx_int;
+    int l, m;
+    int left, right;
+    
+    float swapbuf; // unsigned buffer
+    
+    if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+      HalveImage.halveImage_float( components, widthin, heightin, datain, dataout, 
+                        element_size, ysize, group_size, myswap_bytes );
+      return;
+    }
+    convy = (float)heightin / heightout;
+    convx = (float)widthin / widthout;
+    convy_int = (int)Math.floor( convy );
+    convy_float = convy - convy_int;
+    convx_int = (int)Math.floor( convx );
+    convx_float = convx - convx_int;
+    
+    area = convx * convy;
+    
+    lowy_int = 0;
+    lowy_float = 0.0f;
+    highy_int = convy_int;
+    highy_float = convy_float;
+    
+    for( i = 0; i < heightout; i++ ) {
+      // Clamp here to be sure we don't read beyond input buffer.
+      if (highy_int >= heightin)
+        highy_int = heightin - 1;
+      lowx_int = 0;
+      lowx_float = 0.0f;
+      highx_int = convx_int;
+      highx_float = convx_float;
+      
+      for( j = 0; j < widthout; j++ ) {
+        
+        // Ok, now apply box filter to box that goes from (lowx, lowy)
+        // to (highx, highy) on input data into this pixel on output
+        // data.
+        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+        
+        // caulate the value for pixels in the 1st row
+        xindex = lowx_int * group_size;
+        if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+          
+          y_percent = 1 - lowy_float;
+          temp = xindex + lowy_int * ysize;
+          percent = y_percent * ( 1 - lowx_float );
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getFloat() * percent;
+            }
+          }
+          left = temp;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+                totals[k] += swapbuf * y_percent;
+              } else {
+                totals[k] += datain.getFloat() * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          right = temp;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getFloat() * percent;
+            }
+          }
+          
+          // calculate the value for pixels in the last row
+          y_percent = highy_float;
+          percent = y_percent * ( 1 - lowx_float );
+          temp = xindex + highy_int * ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getFloat() * percent;
+            }
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+                totals[k] += swapbuf * y_percent;
+              } else {
+                totals[k] += datain.getFloat() * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getFloat() * percent;
+            }
+          }
+          
+          // calculate the value for the pixels in the 1st and last column
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            left += ysize;
+            right += ysize;
+            for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+              if( myswap_bytes ) {
+                datain.position( left );
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+                totals[k] += swapbuf * ( 1 - lowx_float );
+                datain.position( right );
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+                totals[k] += swapbuf * highx_float;
+              } else {
+                datain.position( left );
+                totals[k] += (datain.getFloat() * ( 1 - lowx_float ));
+                datain.position( right );
+                totals[k] += (datain.getFloat() * highx_float);
+              }
+            }
+          }
+        } else if( highy_int > lowy_int ) {
+          x_percent = highx_float - lowx_float;
+          percent = ( 1 - lowy_float) * x_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getFloat() * percent;
+            }
+          }
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            temp += ysize;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+                totals[k] += swapbuf * x_percent;
+              } else {
+                totals[k] += datain.getFloat() * x_percent;
+              }
+            }
+          }
+          percent = x_percent * highy_float;
+          temp += ysize;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getFloat() * percent;
+            }
+          }
+        } else if( highx_int > lowx_int ) {
+          y_percent = highy_float - lowy_float;
+          percent = ( 1 - lowx_float ) * y_percent;
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getFloat() * percent;
+            }
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += group_size;
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+                totals[k] += swapbuf * y_percent;
+              } else {
+                totals[k] += datain.getFloat() * y_percent;
+              }
+            }
+          }
+          temp += group_size;
+          percent = y_percent * highx_float;
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getFloat() * percent;
+            }
+          }
+        } else {
+          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+          temp = xindex + (lowy_int * ysize);
+          for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+            datain.position( temp_index );
+            if( myswap_bytes ) {
+              swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+              totals[k] += swapbuf * percent;
+            } else {
+              totals[k] += datain.getFloat() * percent;
+            }
+          }
+        }
+        
+        // this is for the pixels in the body
+        temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+        for( m = lowy_int + 1; m < highy_int; m++ ) {
+          temp = temp0;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+              datain.position( temp_index );
+              if( myswap_bytes ) {
+                swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+                totals[k] += swapbuf;
+              } else {
+                totals[k] += datain.getFloat();
+              }
+            }
+            temp += group_size;
+          }
+          temp0 += ysize;
+        }
+        
+        outindex = ( j + ( i * widthout ) ) * components;
+        for( k = 0; k < components; k++ ) {
+          dataout.position( outindex + k );
+          dataout.put( (totals[k] / area) );
+        }
+        lowx_int = highx_int;
+        lowx_float = highx_float;
+        highx_int += convx_int;
+        highx_float += convx_float;
+        if( highx_float > 1.0f ) {
+          highx_float -= 1.0f;
+          highx_int++;
+        }
+
+        // Clamp to make sure we don't run off the right edge
+        if (highx_int > widthin - 1) {
+          int delta = (highx_int - widthin + 1);
+          lowx_int -= delta;
+          highx_int -= delta;
+        }
+      }
+      lowy_int = highy_int;
+      lowy_float = highy_float;
+      highy_int += convy_int;
+      highy_float += convy_float;
+      if( highy_float > 1.0f ) {
+        highy_float -= 1.0f;
+        highy_int++;
+      }
+    }
+  }
+  
+  public static void scaleInternalPackedPixel( int components, Extract extract, 
+              int widthIn, int heightIn, ByteBuffer dataIn, int widthOut,
+              int heightOut, ByteBuffer dataOut, int pixelSizeInBytes,
+              int rowSizeInBytes, boolean isSwap ) {
+    float x, convx;
+    float y, convy;
+    float percent;
+    
+    // max components in a format is 4, so
+    float[] totals = new float[4];
+    float[] extractTotals = new float[4];
+    float[] extractMoreTotals = new float[4];
+    float[] shoveTotals = new float[4];
+    
+    float area;
+    int i, j, k, xindex;
+    
+    int temp, temp0;
+    int temp_index;
+    int outIndex = 0;
+    
+    int lowx_int, highx_int, lowy_int, highy_int;
+    float x_percent, y_percent;
+    float lowx_float, highx_float, lowy_float, highy_float;
+    float convy_float, convx_float;
+    int convy_int, convx_int;
+    int l, m;
+    int left, right;
+    
+    if( widthIn == widthOut * 2 && heightIn == heightOut * 2 ) {
+      HalveImage.halveImagePackedPixel( components, extract, widthIn, heightIn, dataIn, dataOut,
+                              pixelSizeInBytes, rowSizeInBytes, isSwap );
+      return;
+    }
+    convy = (float)heightIn / (float)heightOut;
+    convx = (float)widthIn / (float)widthOut;
+    convy_int = (int)Math.floor( convy );
+    convy_float = convy - convy_int;
+    convx_int = (int)Math.floor( convx );
+    convx_float = convx - convx_int;
+    
+    area = convx * convy;
+    
+    lowy_int = 0;
+    lowy_float = 0.0f;
+    highy_int = convy_int;
+    highy_float = convx_float;
+    
+    for( i = 0; i < heightOut; i++ ) {
+      // Clamp here to be sure we don't read beyond input buffer.
+      if (highy_int >= heightIn)
+        highy_int = heightIn - 1;
+      lowx_int = 0;
+      lowx_float = 0.0f;
+      highx_int = convx_int;
+      highx_float = convx_float;
+      
+      for( j = 0; j < widthOut; j++ ) {
+        // ok now apply box filter to box that goes from( lowx, lowy )
+        // to ( highx, highy ) on input data into this pixel on output data
+        totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+        
+        // calculate that value for pixels in the 1st row
+        xindex = lowx_int * pixelSizeInBytes;
+        if( (highy_int > lowy_int) && (highx_int > lowx_int) ) {
+          
+          y_percent = 1 - lowy_float;
+          temp = xindex + lowy_int * rowSizeInBytes;
+          percent = y_percent * ( 1 - lowx_float );
+          dataIn.position( temp );
+          extract.extract( isSwap, dataIn, extractTotals );
+          for( k = 0; k < components; k++ ) {
+            totals[k] += extractTotals[k] * percent;
+          }
+          left = temp;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += pixelSizeInBytes;
+            dataIn.position( temp );
+            extract.extract( isSwap, dataIn, extractTotals );
+            for( k = 0; k < components; k++ ) {
+              totals[k] += extractTotals[k] * y_percent;
+            }
+          }
+          temp += pixelSizeInBytes;
+          right = temp;
+          percent = y_percent * highx_float;
+          dataIn.position( temp );
+          extract.extract( isSwap, dataIn, extractTotals );
+          for( k = 0; k < components; k++ ) {
+            totals[k] += extractTotals[k] * percent;
+          }
+          // calculate the value for pixels in the last row
+          
+          y_percent = highy_float;
+          percent = y_percent * ( 1 - lowx_float );
+          temp = xindex + highy_int * rowSizeInBytes;
+          dataIn.position( temp );
+          extract.extract( isSwap, dataIn, extractTotals );
+          for( k = 0; k < components; k++ ) {
+            totals[k] += extractTotals[k] * percent;
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += pixelSizeInBytes;
+            dataIn.position( temp );
+            extract.extract( isSwap, dataIn, extractTotals );
+            for( k = 0; k < components; k++ ) {
+              totals[k] += extractTotals[k] * y_percent;
+            }
+          }
+          temp += pixelSizeInBytes;
+          percent = y_percent * highx_float;
+          dataIn.position( temp );
+          for( k = 0; k < components; k++ ) {
+            totals[k] += extractTotals[k] * percent;
+          }
+          
+          // calculate the value for pixels in the 1st and last column
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            left += rowSizeInBytes;
+            right += rowSizeInBytes;
+            dataIn.position( left );
+            extract.extract( isSwap, dataIn, extractTotals );
+            dataIn.position( right );
+            extract.extract( isSwap, dataIn, extractMoreTotals );
+            for( k = 0; k < components; k++ ) {
+              totals[k] += ( extractTotals[k] * ( 1 - lowx_float ) + extractMoreTotals[k] * highx_float );
+            }
+          }
+        } else if( highy_int > lowy_int ) {
+          x_percent = highx_float - lowx_float;
+          percent = ( 1 - lowy_float ) * x_percent;
+          temp = xindex + lowy_int * rowSizeInBytes;
+          dataIn.position( temp );
+          extract.extract( isSwap, dataIn, extractTotals );
+          for( k = 0; k < components; k++ ) {
+            totals[k] += extractTotals[k] * percent;
+          }
+          for( m = lowy_int + 1; m < highy_int; m++ ) {
+            temp += rowSizeInBytes;
+            dataIn.position( temp );
+            extract.extract( isSwap, dataIn, extractTotals );
+            for( k = 0; k < components; k++ ) {
+              totals[k] += extractTotals[k] * x_percent;
+            }
+          }
+          percent = x_percent * highy_float;
+          temp += rowSizeInBytes;
+          dataIn.position( temp );
+          extract.extract( isSwap, dataIn, extractTotals );
+          for( k = 0; k < components; k++ ) {
+            totals[k] += extractTotals[k] * percent;
+          }
+        } else if( highx_int > lowx_int ) {
+          y_percent = highy_float - lowy_float;
+          percent = ( 1 - lowx_float ) * y_percent;
+          temp = xindex + lowy_int * rowSizeInBytes;
+          dataIn.position( temp );
+          extract.extract( isSwap, dataIn, extractTotals );
+          for( k = 0; k < components; k++ ) {
+            totals[k] += extractTotals[k] * percent;
+          }
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            temp += pixelSizeInBytes;
+            dataIn.position( temp );
+            extract.extract( isSwap, dataIn, extractTotals );
+            for( k = 0; k < components; k++ ) {
+              totals[k] += extractTotals[k] * y_percent;
+            }
+          }
+          temp += pixelSizeInBytes;
+          percent = y_percent * highx_float;
+          dataIn.position( temp );
+          extract.extract( isSwap, dataIn, extractTotals );
+          for( k = 0; k < components; k++ ) {
+            totals[k] += extractTotals[k] * percent;
+          }
+        } else {
+          percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+          temp = xindex + lowy_int * rowSizeInBytes;
+          dataIn.position( temp );
+          extract.extract( isSwap, dataIn, extractTotals );
+          for( k = 0; k < components; k++ ) {
+            totals[k] += extractTotals[k] * percent;
+          }
+        }
+        
+        // this is for the pixels in the body
+        temp0 = xindex + pixelSizeInBytes + ( lowy_int + 1 ) * rowSizeInBytes;
+        for( m = lowy_int + 1; m < highy_int; m++ ) {
+          temp = temp0;
+          for( l = lowx_int + 1; l < highx_int; l++ ) {
+            dataIn.position( temp );
+            extract.extract( isSwap, dataIn, extractTotals );
+            for( k = 0; k < components; k++ ) {
+              totals[k] += extractTotals[k] * percent;
+            }
+            temp += pixelSizeInBytes;
+          }
+          temp0 += rowSizeInBytes;
+        }
+        
+        outIndex = ( j + ( i * widthOut ) );
+        for( k = 0; k < components; k++ ) {
+          shoveTotals[k] = totals[k] / area;
+        }
+        extract.shove( shoveTotals, outIndex, dataOut );
+        lowx_int = highx_int;
+        lowx_float = highx_float;
+        highx_int += convx_int;
+        highx_float += convx_float;
+        if( highx_float > 1.0f ) {
+          highx_float -= 1.0f;
+          highx_int++;
+        }
+
+        // Clamp to make sure we don't run off the right edge
+        if (highx_int > widthIn - 1) {
+          int delta = (highx_int - widthIn + 1);
+          lowx_int -= delta;
+          highx_int -= delta;
+        }
+      }
+      lowy_int = highy_int;
+      lowy_float = highy_float;
+      highy_int += convy_int;
+      highy_float += convy_float;
+      if( highy_float > 1.0f ) {
+        highy_float -= 1.0f;
+        highy_int++;
+      }
+    }
+    assert( outIndex == ( widthOut * heightOut - 1) );
+  }
+  
+  public static void scaleInternal3D( int components, int widthIn, int heightIn,
+          int depthIn, ShortBuffer dataIn, int widthOut, int heightOut,
+          int depthOut, ShortBuffer dataOut ) {
+    float x, lowx, highx, convx, halfconvx;
+    float y, lowy, highy, convy, halfconvy;
+    float z, lowz, highz, convz, halfconvz;
+    float xpercent, ypercent, zpercent;
+    float percent;
+    // max compnents in a format is 4
+    float[] totals = new float[4];
+    float volume;
+    int i, j, d, k, zint, yint, xint, xindex, yindex, zindex;
+    int temp;
+    
+    lowy = highy = lowx = highx = 0.0f;
+    
+    convz = (float)depthIn / depthOut;
+    convy = (float)heightIn / heightOut;
+    convx = (float)widthIn / widthOut;
+    halfconvz = convz / 2.0f;
+    halfconvy = convy / 2.0f;
+    halfconvx = convx / 2.0f;
+    for( d = 0; d < depthOut; d++ ) {
+      z = convz * ( d + 0.5f );
+      if( depthIn > depthOut ) {
+        highz = z + halfconvz;
+        lowz = z - halfconvz;
+      } else {
+        highz = z + 0.5f;
+        lowz = z - 0.5f;
+      }
+      for( i = 0; i < heightOut; i++ ) {
+        y = convy * ( i + 0.5f );
+        if( heightIn > heightOut ) {
+          highz = y + halfconvy;
+          lowz = y - halfconvy;
+        } else {
+          highz = y + 0.5f;
+          lowz = y - 0.5f;
+        }
+        for( j = 0; j < widthOut; j++ ) {
+          x = convx * ( j + 0.5f );
+          if( depthIn > depthOut ) {
+            highz = x + halfconvx;
+            lowz = x - halfconvx;
+          } else {
+            highz = x + 0.5f;
+            lowz = x - 0.5f;
+          }
+          
+          // Ok, now apply box filter to box that goes from ( lowx, lowy, lowz )
+          // to ( highx, highy, highz ) on input data into this pixel on output data
+          
+          totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+          volume = 0.0f;
+          
+          z = lowz;
+          zint = (int)(Math.floor( z ) );
+          while( z < highz ) {
+            zindex = ( zint + depthIn ) % depthIn;
+            if( highz < zint + 1 ) {
+              zpercent = highz - z;
+            } else {
+              zpercent = zint + 1 - z;
+            }
+            
+            y = lowy;
+            yint = (int)(Math.floor( y ) );
+            while( y < highy ) {
+              yindex = ( yint + heightIn ) % heightIn;
+              if( highy < yint + 1 ) {
+                ypercent = highy - y;
+              } else {
+                ypercent = yint + 1 - y;
+              }
+              
+              x = lowx;
+              xint = (int)(Math.floor( x ) );
+              
+              while( x < highx ) {
+                xindex = (xint + widthIn ) % widthIn;
+                if( highx < xint + 1 ) {
+                  xpercent = highx - x;
+                } else {
+                  xpercent = xint + 1 - x;
+                }
+                
+                percent = xpercent * ypercent * zpercent;
+                volume += percent;
+                
+                temp = (xindex + ( yindex *widthIn) + (zindex * widthIn *heightIn)) * components;
+                for( k = 0; k < components; k++ ) {
+                  assert( 0 <= (temp+k) && (temp+k) < (widthIn * heightIn * depthIn * components) );
+                  totals[k] += dataIn.get( temp + k ) * percent;
+                }
+                xint++;
+                x = xint;
+              } // while x
+              yint++;
+              y = yint;
+            } // while y
+            zint++;
+            z = zint;
+          } // while z
+          
+          temp = ( j + ( i * widthOut ) + (d * widthOut * heightOut ) ) * components;
+          for( k = 0; k < components; k++ ) {
+            // totals should be rounded in the case of enlarging an rgb ramp when the type is 332 or 4444
+            assert( 0 <= ( temp + k ) && ( temp + k ) < (widthOut * heightOut* depthOut * components) );
+            dataOut.put( temp + k, (short)((totals[k] + 0.5f) / volume ) );
+          }
+        }
+      }
+    }
+  }
+  
+  public static int gluScaleImage3D( GL gl, int format, int widthIn, int heightIn, 
+          int depthIn, int typeIn, ByteBuffer dataIn, int widthOut, int heightOut, 
+          int depthOut, int typeOut, ByteBuffer dataOut ) {
+    int components;
+    ShortBuffer beforeImage, afterImage;
+    PixelStorageModes psm = new PixelStorageModes();
+    
+    if( widthIn == 0 || heightIn == 0 || depthIn == 0 ||
+            widthOut == 0 || heightOut == 0 || depthOut == 0 ) {
+      return( 0 );
+    }
+    
+    if( widthIn < 0 || heightIn < 0 || depthIn < 0 ||
+            widthOut < 0 || heightOut < 0 || depthOut < 0 ) {
+      return( GLU.GLU_INVALID_VALUE );
+    }
+    
+    if( !Mipmap.legalFormat(format) || !Mipmap.legalType(typeIn) || 
+            !Mipmap.legalType(typeOut) || typeIn == GL2.GL_BITMAP ||
+            typeOut == GL2.GL_BITMAP ) {
+      return( GLU.GLU_INVALID_ENUM );
+    }
+    
+    if( !Mipmap.isLegalFormatForPackedPixelType( format, typeIn ) ) {
+      return( GLU.GLU_INVALID_OPERATION );
+    }
+    
+    if( !Mipmap.isLegalFormatForPackedPixelType( format, typeOut ) ) {
+      return( GLU.GLU_INVALID_OPERATION );
+    }
+    
+    try {
+        beforeImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn, 
+                heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+        afterImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn, 
+                heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+    } catch( OutOfMemoryError err ) {
+      return( GLU.GLU_OUT_OF_MEMORY );
+    }
+    Mipmap.retrieveStoreModes3D( gl, psm );
+    
+    Image.fillImage3D( psm, widthIn, heightIn, depthIn, format, typeIn,
+            Mipmap.is_index( format ), dataIn, beforeImage );
+    components = Mipmap.elements_per_group( format, 0 );
+    ScaleInternal.scaleInternal3D( components, widthIn, heightIn, depthIn,
+            beforeImage, widthOut, heightOut, depthOut, afterImage );
+    Image.emptyImage3D( psm, widthOut, heightOut, depthOut, format, typeOut,
+            Mipmap.is_index( format ), afterImage, dataOut );
+    
+    return( 0 );
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
new file mode 100644
index 0000000..38113f6
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
@@ -0,0 +1,226 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author  Administrator
+ */
+public class Type_Widget {
+  
+  ByteBuffer buffer;
+  
+  /** Creates a new instance of Type_Widget */
+  public Type_Widget() {
+    // can't make this direct, because JVM doesn't allocate small direct buffers efficiently
+    // see https://jogamp.org/bugzilla/show_bug.cgi?id=463 for details
+    buffer = ByteBuffer.allocate( 4 );
+  }
+  
+  public void setUB0( byte b ) {
+    buffer.position( 0 );
+    buffer.put( b );
+  }
+  
+  public byte getUB0() {
+    buffer.position( 0 );
+    return( buffer.get() );
+  }
+  
+  public void setUB1( byte b ) {
+    buffer.position( 1 );
+    buffer.put( b );
+  }
+  
+  public byte getUB1() {
+    buffer.position( 1 );
+    return( buffer.get() );
+  }
+  
+  public void setUB2( byte b ) {
+    buffer.position( 2 );
+    buffer.put( b );
+  }
+  
+  public byte getUB2() {
+    buffer.position( 2 );
+    return( buffer.get() );
+  }
+  
+  public void setUB3( byte b ) {
+    buffer.position( 3 );
+    buffer.put( b );
+  }
+  
+  public byte getUB3() {
+    buffer.position( 3 );
+    return( buffer.get() );
+  }
+  
+  public void setUS0( short s ) {
+    buffer.position( 0 );
+    buffer.putShort( s );
+  }
+  
+  public short getUS0() {
+    buffer.position( 0 );
+    return( buffer.getShort() );
+  }
+  
+  public void setUS1( short s ) {
+    buffer.position( 2 );
+    buffer.putShort( s );
+  }
+  
+  public short getUS1() {
+   buffer.position( 2 );
+   return( buffer.getShort() );
+  }
+  
+  public void setUI( int i ) {
+    buffer.position( 0 );
+    buffer.putInt( i );
+  }
+  
+  public int getUI() {
+    buffer.position( 0 );
+    return( buffer.getInt() );
+  }
+  
+  public void setB0( byte b ) {
+    buffer.position( 0 );
+    buffer.put( b );
+  }
+  
+  public byte getB0() {
+    buffer.position( 0 );
+    return( buffer.get() );
+  }
+  
+  public void setB1( byte b ) {
+    buffer.position( 1 );
+    buffer.put( b );
+  }
+  
+  public byte getB1() {
+    buffer.position( 1 );
+    return( buffer.get() );
+  }
+  
+  public void setB2( byte b ) {
+    buffer.position( 2 );
+    buffer.put( b );
+  }
+  
+  public byte getB2() {
+    buffer.position( 2 );
+    return( buffer.get() );
+  }
+  
+  public void setB3( byte b ) {
+    buffer.position( 3 );
+    buffer.put( b );
+  }
+  
+  public byte getB3() {
+    buffer.position( 3 );
+    return( buffer.get() );
+  }
+  
+  public void setS0( short s ) {
+    buffer.position( 0 );
+    buffer.putShort( s );
+  }
+  
+  public short getS0() {
+    buffer.position( 0 );
+    return( buffer.getShort() );
+  }
+  
+  public void setS1( short s ) {
+    buffer.position( 2 );
+    buffer.putShort( s );
+  }
+  
+  public short getS1() {
+    buffer.position( 2 );
+    return( buffer.getShort() );
+  }
+  
+  public void setI( int i ) {
+    buffer.position( 0 );
+    buffer.putInt( i );
+  }
+  
+  public int getI() {
+    buffer.position( 0 );
+    return( buffer.getInt() );
+  }
+  
+  public void setF( float f ) {
+    buffer.position( 0 );
+    buffer.putFloat( f );
+  }
+  
+  public float getF() {
+    buffer.position( 0 );
+    return( buffer.getFloat() );
+  }
+  
+  public ByteBuffer getBuffer() {
+    buffer.rewind();
+    return( buffer );
+  }
+  
+  public static void main( String args[] ) {
+    Type_Widget t = new Type_Widget();
+    t.setI( 1000000 );
+    
+    System.out.println("int: " + Integer.toHexString( t.getI() ) );
+    
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
new file mode 100644
index 0000000..422f8d4
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
@@ -0,0 +1,258 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+*/
+
+/**
+ * Trimming arc
+ * @author Tomas Hrasky
+ *
+ */
+public class Arc {
+  /**
+   * Corresponding picewise-linear arc
+   */
+  public PwlArc pwlArc;
+
+  /**
+   * Arc type
+   */
+  private long type;
+
+  /**
+   * Arc link in linked list
+   */
+  public Arc link;
+
+  /**
+   * Previous arc
+   */
+  Arc prev;
+
+  /**
+   * Next arc
+   */
+  Arc next;
+
+  /**
+   * Corresponding berizer type arc
+   */
+  private BezierArc bezierArc;
+
+  /**
+   * Makes new arc at specified side
+   * 
+   * @param side
+   *            which side doeas this arc form
+   */
+  public Arc(int side) {
+    bezierArc = null;
+    pwlArc = null;
+    type = 0;
+    setside(side);
+    // nuid=_nuid
+  }
+
+  /**
+   * Sets side the arc is at
+   * 
+   * @param side
+   *            arc side
+   */
+  private void setside(int side) {
+    // DONE
+    clearside();
+    type |= side << 8;
+  }
+
+  /**
+   * Unsets side
+   */
+  private void clearside() {
+    // DONE
+    type &= ~(0x7 << 8);
+  }
+
+  // this one replaces enum arc_side 
+  /**
+   * Side not specified
+   */
+  public static final int ARC_NONE = 0;
+
+  /**
+   * Arc on right
+   */
+  public static final int ARC_RIGHT = 1;
+
+  /**
+   * Arc on top
+   */
+  public static final int ARC_TOP = 2;
+
+  /**
+   * Arc on left
+   */
+  public static final int ARC_LEFT = 3;
+
+  /**
+   * Arc on bottom
+   */
+  public static final int ARC_BOTTOM = 4;
+
+  /**
+   * Bezier type flag
+   */
+  private static final long BEZIER_TAG = 1 << 13;
+
+  /**
+   * Arc type flag
+   */
+  private static final long ARC_TAG = 1 << 3;
+
+  /**
+   * Tail type tag
+   */
+  private static final long TAIL_TAG = 1 << 6;
+
+  /**
+   * Appends arc to the list
+   * 
+   * @param jarc
+   *            arc to be append
+   * @return this
+   */
+  public Arc append(Arc jarc) {
+    // DONE
+    if (jarc != null) {
+      next = jarc.next;
+      prev = jarc;
+      next.prev = this;
+      prev.next = this;
+    } else {
+      next = this;
+      prev = this;
+    }
+
+    return this;
+  }
+
+  /**
+   * Unused
+   * 
+   * @return true
+   */
+  public boolean check() {
+    return true;
+  }
+
+  /**
+   * Sets bezier type flag
+   */
+  public void setbezier() {
+    // DONE
+    type |= BEZIER_TAG;
+
+  }
+
+  /**
+   * Returns tail of linked list coords
+   * 
+   * @return tail coords
+   */
+  public float[] tail() {
+    // DONE
+    return pwlArc.pts[0].param;
+  }
+
+  /**
+   * Returns head of linked list coords
+   * 
+   * @return head coords
+   */
+  public float[] head() {
+    // DONE
+    return next.pwlArc.pts[0].param;
+  }
+
+  /**
+   * Returns whether arc is marked with arc_tag
+   * 
+   * @return is arc marked with arc_tag
+   */
+  public boolean ismarked() {
+    // DONE
+    return ((type & ARC_TAG) > 0) ? true : false;
+  }
+
+  /**
+   * Cleans arc_tag flag
+   */
+  public void clearmark() {
+    // DONE
+    type &= (~ARC_TAG);
+  }
+
+  /**
+   * Sets arc_tag flag
+   */
+  public void setmark() {
+    // DONE
+    type |= ARC_TAG;
+  }
+
+  /**
+   * sets tail tag
+   */
+  public void setitail() {
+    // DONE
+    type |= TAIL_TAG;
+  }
+
+  /**
+   * Returns whether arc is marked tail
+   * 
+   * @return is tail
+   */
+  public boolean getitail() {
+    return false;
+  }
+
+  /**
+   * Unsets tail tag
+   */
+  public void clearitail() {
+    // DONE
+    type &= (~TAIL_TAG);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
new file mode 100644
index 0000000..0d04d4c
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
@@ -0,0 +1,63 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class for sorting list of Arcs
+ * @author Tomas Hrasky
+ *
+ */
+public class ArcSdirSorter {
+
+  /**
+   * Makes new ArcSdirSorter with Subdivider
+   * @param subdivider subdivider
+   */ 
+  public ArcSdirSorter(Subdivider subdivider) {
+    //TODO
+    //			System.out.println("TODO arcsdirsorter.constructor");
+  }
+
+  /**
+   * Sorts list of arcs
+   * @param list  arc list to be sorted
+   * @param count size of list
+   */
+  public void qsort(CArrayOfArcs list, int count) {
+    // TODO
+    //			System.out.println("TODO arcsdirsorter.qsort");
+  }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
new file mode 100644
index 0000000..bee98b8
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
@@ -0,0 +1,60 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class for sorting list of Arcs
+ * @author Tomas Hrasky
+ *
+ */
+public class ArcTdirSorter {
+  /**
+   * Makes new ArcSdirSorter with Subdivider
+   * @param subdivider subdivider
+   */ 
+  public ArcTdirSorter(Subdivider subdivider) {
+    // TODO Auto-generated constructor stub
+    //			System.out.println("TODO arcTsorter.konstruktor");
+  }
+  /**
+   * Sorts list of arcs
+   * @param list  arc list to be sorted
+   * @param count size of list
+   */
+  public void qsort(CArrayOfArcs list, int count) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO arcTsorter.qsort");
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java
new file mode 100644
index 0000000..2e4d3eb
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java
@@ -0,0 +1,90 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class for arc tesselation
+ * @author Tomas Hrasky
+ *
+ */
+public class ArcTesselator {
+
+  /**
+   * Makes given arc an bezier arc
+   * @param arc arc to work with
+   * @param s1 minimum s param
+   * @param s2 maximum s param
+   * @param t1 minimum t param
+   * @param t2 maximum s param
+   */
+  public void bezier(Arc arc, float s1, float s2, float t1, float t2) {
+    // DONE
+    TrimVertex[] p = new TrimVertex[2];
+    p[0] = new TrimVertex();
+    p[1] = new TrimVertex();
+    arc.pwlArc = new PwlArc(2, p);
+    p[0].param[0] = s1;
+    p[0].param[1] = s2;
+    p[1].param[0] = t1;
+    p[1].param[1] = t2;
+    arc.setbezier();
+  }
+
+  /**
+   * Empty method
+   * @param newright arc to work with
+   * @param s first tail
+   * @param t2 second tail
+   * @param t1 third tail
+   * @param f stepsize
+   */
+  public void pwl_right(Arc newright, float s, float t1, float t2, float f) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO arctesselator.pwl_right");
+  }
+
+  /**
+   * Empty method
+   * @param newright arc to work with
+   * @param s first tail
+   * @param t2 second tail
+   * @param t1 third tail
+   * @param f stepsize
+   */
+  public void pwl_left(Arc newright, float s, float t2, float t1, float f) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO arctesselator.pwl_left");
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
new file mode 100644
index 0000000..4959f80
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
@@ -0,0 +1,217 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class responsible for rendering
+ * @author Tomas Hrasky
+ *
+ */
+public abstract class Backend {
+
+  /**
+   * Fill surface
+   */
+  public static final int N_MESHFILL = 0;
+
+  /**
+   * Draw surface as wire model
+   */
+  public static final int N_MESHLINE = 1;
+
+  /**
+   * Draw surface with points
+   */
+  public static final int N_MESHPOINT = 2;
+
+  /**
+   * Object rendering curves
+   */
+  protected CurveEvaluator curveEvaluator;
+
+  /**
+   * Object rendering surfaces
+   */
+  protected SurfaceEvaluator surfaceEvaluator;
+
+  /**
+   * Makes new backend 
+   */
+  public Backend() {
+    // curveEvaluator = new OpenGLCurveEvaluator();
+    // surfaceEvaluator = new OpenGLSurfaceEvaluator();
+  }
+
+  /**
+   * Begin a curve
+   */
+  public void bgncurv() {
+    // DONE
+    curveEvaluator.bgnmap1f();
+
+  }
+
+  /**
+   * End a curve
+   */
+  public void endcurv() {
+    // DONE
+    curveEvaluator.endmap1f();
+
+  }
+
+  /**
+   * Make cuve with given parameters
+   * @param type curve type
+   * @param ps control points
+   * @param stride control points coordinates number
+   * @param order order of curve
+   * @param ulo smallest u
+   * @param uhi highest u
+   */
+  public void curvpts(int type, CArrayOfFloats ps, int stride, int order,
+                      float ulo, float uhi) {
+    // DONE
+    curveEvaluator.map1f(type, ulo, uhi, stride, order, ps);
+    curveEvaluator.enable(type);
+  }
+
+  /**
+   * Draw curve
+   * @param u1 smallest u
+   * @param u2 highest u
+   * @param nu number of pieces
+   */
+  public void curvgrid(float u1, float u2, int nu) {
+    // DONE
+    curveEvaluator.mapgrid1f(nu, u1, u2);
+
+  }
+
+  /**
+   * Evaluates curve mesh
+   * @param from low param
+   * @param n step
+   */
+  public void curvmesh(int from, int n) {
+    // DONE
+    curveEvaluator.mapmesh1f(N_MESHFILL, from, from + n);
+  }
+
+  /**
+   * Begin surface
+   * @param wiretris use triangles
+   * @param wirequads use quads
+   */
+  public void bgnsurf(int wiretris, int wirequads) {
+    // DONE
+    surfaceEvaluator.bgnmap2f();
+
+    if (wiretris > 0)
+      surfaceEvaluator.polymode(NurbsConsts.N_MESHLINE);
+    else
+      surfaceEvaluator.polymode(NurbsConsts.N_MESHFILL);
+  }
+
+  /**
+   * End surface
+   */
+  public void endsurf() {
+    // DONE
+    surfaceEvaluator.endmap2f();
+  }
+
+  /**
+   * Empty method
+   * @param ulo low u param
+   * @param uhi hig u param
+   * @param vlo low v param
+   * @param vhi high v param
+   */
+  public void patch(float ulo, float uhi, float vlo, float vhi) {
+    // DONE
+    surfaceEvaluator.domain2f(ulo, uhi, vlo, vhi);
+  }
+
+  /**
+   * Draw surface
+   * @param u0 lowest u
+   * @param u1 highest u
+   * @param nu number of pieces in u direction
+   * @param v0 lowest v
+   * @param v1 highest v
+   * @param nv number of pieces in v direction
+   */
+  public void surfgrid(float u0, float u1, int nu, float v0, float v1, int nv) {
+    // DONE
+    surfaceEvaluator.mapgrid2f(nu, u0, u1, nv, v0, v1);
+
+  }
+
+  /**
+   * Evaluates surface mesh
+   * @param u u param
+   * @param v v param
+   * @param n step in u direction
+   * @param m step in v direction
+   */
+  public void surfmesh(int u, int v, int n, int m) {
+    //			System.out.println("TODO backend.surfmesh wireframequads");
+    // TODO wireframequads
+    surfaceEvaluator.mapmesh2f(NurbsConsts.N_MESHFILL, u, u + n, v, v + m);
+  }
+
+  /**
+   * Make surface
+   * @param type surface type
+   * @param pts control points
+   * @param ustride control points coordinates in u direction
+   * @param vstride control points coordinates in v direction
+   * @param uorder surface order in u direction
+   * @param vorder surface order in v direction
+   * @param ulo lowest u
+   * @param uhi hightest u
+   * @param vlo lowest v
+   * @param vhi hightest v
+   */
+  public void surfpts(int type, CArrayOfFloats pts, int ustride, int vstride,
+                      int uorder, int vorder, float ulo, float uhi, float vlo, float vhi) {
+    // DONE
+    surfaceEvaluator.map2f(type, ulo, uhi, ustride, uorder, vlo, vhi,
+                           vstride, vorder, pts);
+    surfaceEvaluator.enable(type);
+
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/BezierArc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/BezierArc.java
new file mode 100644
index 0000000..9f7984b
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/BezierArc.java
@@ -0,0 +1,44 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Empty class
+ * @author Tomas Hrasky
+ *
+ */
+public class BezierArc {
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
new file mode 100644
index 0000000..df8b16a
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
@@ -0,0 +1,155 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding trimming arcs
+ * @author Tomas Hrasky
+ *
+ */
+public class Bin {
+
+  /**
+   * Head of linked list of arcs
+   */
+  private Arc head;
+
+  /**
+   * Current arc
+   */
+  private Arc current;
+
+  /**
+   * Indicates whether there are any Arcs in linked list
+   * @return true if there are any Arcs in linked list
+   */
+  public boolean isnonempty() {
+    // DONE
+    return this.head != null ? true : false;
+  }
+
+  /**
+   * Adds and arc to linked list
+   * @param jarc added arc
+   */
+  public void addarc(Arc jarc) {
+    // DONE
+    // if (head == null)
+    // head = jarc;
+    // else {
+    jarc.link = head;
+    head = jarc;
+    // }
+
+  }
+
+  /**
+   * Returns number of arcs in linked list
+   * @return number of arcs
+   */
+  public int numarcs() {
+    // DONE
+    int count = 0;
+    for (Arc jarc = firstarc(); jarc != null; jarc = nextarc())
+      count++;
+    return count;
+  }
+
+  /**
+   * Removes first arc in list
+   * @return new linked list head
+   */
+  public Arc removearc() {
+    // DONE
+    Arc jarc = head;
+    if (jarc != null)
+      head = jarc.link;
+    return jarc;
+
+  }
+
+  /**
+   * Consolidates linked list
+   */
+  public void adopt() {
+    // DONE
+    markall();
+
+    Arc orphan;
+    while ((orphan = removearc()) != null) {
+      for (Arc parent = orphan.next; !parent.equals(orphan); parent = parent.next) {
+        if (!parent.ismarked()) {
+          orphan.link = parent.link;
+          parent.link = orphan;
+          orphan.clearmark();
+          break;
+        }
+      }
+    }
+
+  }
+
+  /**
+   * Marks all arc in linked list
+   */
+  private void markall() {
+    // DONE
+    for (Arc jarc = firstarc(); jarc != null; jarc = nextarc())
+      jarc.setmark();
+  }
+
+  /**
+   * Returns first arc in linked list
+   * @return first arc in linked list
+   */
+  private Arc firstarc() {
+    // DONE
+    current = head;
+    return nextarc();
+  }
+
+  /**
+   * Returns next arc in linked list
+   * @return next arc
+   * 
+   */
+  private Arc nextarc() {
+    // DONE
+    Arc jarc = current;
+    if (jarc != null)
+      current = jarc.link;
+    return jarc;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java
new file mode 100644
index 0000000..f45571d
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java
@@ -0,0 +1,59 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding break point parameters
+ * 
+ * @author Tomas Hrasky
+ * 
+ */
+public class Breakpt {
+
+  /**
+   * Breakpoint multiplicity
+   */
+  public int multi;
+
+  /**
+   * Breakpint value
+   */
+  public float value;
+
+  /**
+   * Breakpoint deficit (how many times it has to be added)
+   */
+  public int def;
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
new file mode 100644
index 0000000..aaa8cb5
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
@@ -0,0 +1,194 @@
+package jogamp.opengl.glu.nurbs;
+
+/**
+ * Class replacing C language pointer
+ * 
+ * @author Tomas Hrasky
+ * 
+ */
+public class CArrayOfArcs {
+  /**
+   * Underlaying array
+   */
+  private Arc[] array;
+
+  /**
+   * Pointer to array member
+   */
+  private int pointer;
+
+  /**
+   * Don't check for array borders?
+   */
+  private boolean noCheck = true;
+
+  /**
+   * Makes new CArray
+   * 
+   * @param array
+   *            underlaying array
+   * @param pointer
+   *            pointer (index) to array
+   */
+  public CArrayOfArcs(Arc[] array, int pointer) {
+    this.array = array;
+    // this.pointer=pointer;
+    setPointer(pointer);
+  }
+
+  /**
+   * Makes new CArray from other CArray
+   * 
+   * @param carray
+   *            reference array
+   */
+  public CArrayOfArcs(CArrayOfArcs carray) {
+    this.array = carray.array;
+    // this.pointer=carray.pointer;
+    setPointer(carray.pointer);
+  }
+
+  /**
+   * Makes new CArray with pointer set to 0
+   * 
+   * @param ctlarray
+   *            underlaying array
+   */
+  public CArrayOfArcs(Arc[] ctlarray) {
+    this.array = ctlarray;
+    this.pointer = 0;
+  }
+
+  /**
+   * Returns element at pointer
+   * 
+   * @return element at pointer
+   */
+  public Arc get() {
+    return array[pointer];
+  }
+
+  /**
+   * Increases pointer by one (++)
+   */
+  public void pp() {
+    // pointer++;
+    setPointer(pointer + 1);
+  }
+
+  /**
+   * Sets element at pointer
+   * 
+   * @param f
+   *            desired value
+   */
+  public void set(Arc f) {
+    array[pointer] = f;
+
+  }
+
+  /**
+   * Returns array element at specified index
+   * 
+   * @param i
+   *            array index
+   * @return element at index
+   */
+  public Arc get(int i) {
+    return array[i];
+  }
+
+  /**
+   * Returns array element at specified index relatively to pointer
+   * 
+   * @param i
+   *            relative index
+   * @return element at relative index
+   */
+  public Arc getRelative(int i) {
+    return array[pointer + i];
+  }
+
+  /**
+   * Sets value of element at specified index relatively to pointer
+   * 
+   * @param i
+   *            relative index
+   * @param value
+   *            value to be set
+   */
+  public void setRelative(int i, Arc value) {
+    array[pointer + i] = value;
+  }
+
+  /**
+   * Lessens pointer by value
+   * 
+   * @param i
+   *            lessen by
+   */
+  public void lessenPointerBy(int i) {
+    // pointer-=i;
+    setPointer(pointer - i);
+  }
+
+  /**
+   * Returns pointer value
+   * 
+   * @return pointer value
+   */
+  public int getPointer() {
+    return pointer;
+  }
+
+  /**
+   * Sets ponter value
+   * 
+   * @param pointer
+   *            pointer value to be set
+   */
+  public void setPointer(int pointer) {
+    if (!noCheck && pointer > array.length)
+      throw new IllegalArgumentException("Pointer " + pointer
+                                         + " out of bounds " + array.length);
+    this.pointer = pointer;
+  }
+
+  /**
+   * Raises pointer by value
+   * 
+   * @param i
+   *            raise by
+   */
+  public void raisePointerBy(int i) {
+    // pointer+=i;
+    setPointer(pointer + i);
+  }
+
+  /**
+   * Lessens ponter by one (--)
+   */
+  public void mm() {
+    // pointer--;
+    setPointer(pointer - 1);
+  }
+
+  /**
+   * Returns underlaying array
+   * 
+   * @return underlaying array
+   */
+  public Arc[] getArray() {
+    return array;
+  }
+
+  /**
+   * Sets underlaying array
+   * 
+   * @param array
+   *            underlaying array
+   */
+  public void setArray(Arc[] array) {
+    this.array = array;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
new file mode 100644
index 0000000..5112b07
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
@@ -0,0 +1,130 @@
+package jogamp.opengl.glu.nurbs;
+
+/**
+ * Class replacing C language pointer
+ * 
+ * @author Tomas Hrasky
+ * 
+ */
+public class CArrayOfBreakpts {
+  /**
+   * Underlaying array
+   */
+  private Breakpt[] pole;
+
+  /**
+   * Pointer to array member
+   */
+  private int pointer;
+
+  /**
+   * Makes new CArray
+   * 
+   * @param array
+   *            underlaying array
+   * @param pointer
+   *            pointer (index) to array
+   */
+  public CArrayOfBreakpts(Breakpt[] array, int pointer) {
+    this.pole = array;
+    this.pointer = pointer;
+  }
+
+  /**
+   * Makes new CArray from other CArray
+   * 
+   * @param carray
+   *            reference array
+   */
+  public CArrayOfBreakpts(CArrayOfBreakpts carray) {
+    this.pole = carray.pole;
+    this.pointer = carray.pointer;
+  }
+
+  /**
+   * Returns element at pointer
+   * 
+   * @return element at pointer
+   */
+  public Breakpt get() {
+    return pole[pointer];
+  }
+
+  /**
+   * Increases pointer by one (++)
+   */
+  public void pp() {
+    pointer++;
+  }
+
+  /**
+   * Sets element at pointer
+   * 
+   * @param f
+   *            desired value
+   */
+  public void set(Breakpt f) {
+    pole[pointer] = f;
+
+  }
+
+  /**
+   * Returns array element at specified index
+   * 
+   * @param i
+   *            array index
+   * @return element at index
+   */
+  public Breakpt get(int i) {
+    return pole[i];
+  }
+
+  /**
+   * Lessens pointer by value
+   * 
+   * @param i
+   *            lessen by
+   */
+  public void lessenPointerBy(int i) {
+    pointer -= i;
+
+  }
+
+  /**
+   * Returns pointer value
+   * 
+   * @return pointer value
+   */
+  public int getPointer() {
+    return pointer;
+  }
+
+  /**
+   * Sets ponter value
+   * 
+   * @param pointer
+   *            pointer value to be set
+   */
+  public void setPointer(int pointer) {
+    this.pointer = pointer;
+  }
+
+  /**
+   * Raises pointer by value
+   * 
+   * @param i
+   *            raise by
+   */
+  public void raisePointerBy(int i) {
+    pointer += i;
+
+  }
+
+  /**
+   * Lessens ponter by one (--)
+   */
+  public void mm() {
+    pointer--;
+
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
new file mode 100644
index 0000000..39ef841
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
@@ -0,0 +1,195 @@
+package jogamp.opengl.glu.nurbs;
+
+/**
+ * Class replacing C language pointer
+ * 
+ * @author Tomas Hrasky
+ * 
+ */
+public class CArrayOfFloats {
+
+  /**
+   * Underlaying array
+   */
+  private float[] array;
+
+  /**
+   * Pointer to array member
+   */
+  private int pointer;
+
+  /**
+   * Don't check for array borders?
+   */
+  private boolean noCheck = true;
+
+  /**
+   * Makes new CArray
+   * 
+   * @param array
+   *            underlaying array
+   * @param pointer
+   *            pointer (index) to array
+   */
+  public CArrayOfFloats(float[] array, int pointer) {
+    this.array = array;
+    // this.pointer=pointer;
+    setPointer(pointer);
+  }
+
+  /**
+   * Makes new CArray from other CArray
+   * 
+   * @param carray
+   *            reference array
+   */
+  public CArrayOfFloats(CArrayOfFloats carray) {
+    this.array = carray.array;
+    // this.pointer=carray.pointer;
+    setPointer(carray.pointer);
+  }
+
+  /**
+   * Makes new CArray with pointer set to 0
+   * 
+   * @param ctlarray
+   *            underlaying array
+   */
+  public CArrayOfFloats(float[] ctlarray) {
+    this.array = ctlarray;
+    this.pointer = 0;
+  }
+
+  /**
+   * Returns element at pointer
+   * 
+   * @return element at pointer
+   */
+  public float get() {
+    return array[pointer];
+  }
+
+  /**
+   * Increases pointer by one (++)
+   */
+  public void pp() {
+    // pointer++;
+    setPointer(pointer + 1);
+  }
+
+  /**
+   * Sets element at pointer
+   * 
+   * @param f
+   *            desired value
+   */
+  public void set(float f) {
+    array[pointer] = f;
+
+  }
+
+  /**
+   * Returns array element at specified index
+   * 
+   * @param i
+   *            array index
+   * @return element at index
+   */
+  public float get(int i) {
+    return array[i];
+  }
+
+  /**
+   * Returns array element at specified index relatively to pointer
+   * 
+   * @param i
+   *            relative index
+   * @return element at relative index
+   */
+  public float getRelative(int i) {
+    return array[pointer + i];
+  }
+
+  /**
+   * Sets value of element at specified index relatively to pointer
+   * 
+   * @param i
+   *            relative index
+   * @param value
+   *            value to be set
+   */
+  public void setRelative(int i, float value) {
+    array[pointer + i] = value;
+  }
+
+  /**
+   * Lessens pointer by value
+   * 
+   * @param i
+   *            lessen by
+   */
+  public void lessenPointerBy(int i) {
+    // pointer-=i;
+    setPointer(pointer - i);
+  }
+
+  /**
+   * Returns pointer value
+   * 
+   * @return pointer value
+   */
+  public int getPointer() {
+    return pointer;
+  }
+
+  /**
+   * Sets ponter value
+   * 
+   * @param pointer
+   *            pointer value to be set
+   */
+  public void setPointer(int pointer) {
+    if (!noCheck && pointer > array.length)
+      throw new IllegalArgumentException("Pointer " + pointer
+                                         + " out of bounds " + array.length);
+    this.pointer = pointer;
+  }
+
+  /**
+   * Raises pointer by value
+   * 
+   * @param i
+   *            raise by
+   */
+  public void raisePointerBy(int i) {
+    // pointer+=i;
+    setPointer(pointer + i);
+  }
+
+  /**
+   * Lessens ponter by one (--)
+   */
+  public void mm() {
+    // pointer--;
+    setPointer(pointer - 1);
+  }
+
+  /**
+   * Returns underlaying array
+   * 
+   * @return underlaying array
+   */
+  public float[] getArray() {
+    return array;
+  }
+
+  /**
+   * Sets underlaying array
+   * 
+   * @param array
+   *            underlaying array
+   */
+  public void setArray(float[] array) {
+    this.array = array;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
new file mode 100644
index 0000000..4b21f2d
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
@@ -0,0 +1,160 @@
+package jogamp.opengl.glu.nurbs;
+
+/**
+ * Class replacing C language pointer
+ * 
+ * @author Tomas Hrasky
+ * 
+ */
+public class CArrayOfQuiltspecs {
+  /**
+   * Underlaying array
+   */
+  private Quiltspec[] array;
+
+  /**
+   * Pointer to array member
+   */
+  private int pointer;
+
+  /**
+   * Makes new CArray
+   * 
+   * @param array
+   *            underlaying array
+   * @param pointer
+   *            pointer (index) to array
+   */
+  public CArrayOfQuiltspecs(Quiltspec[] array, int pointer) {
+    this.array = array;
+    this.pointer = pointer;
+  }
+
+  /**
+   * Makes new CArray from other CArray
+   * 
+   * @param carray
+   *            reference array
+   */
+  public CArrayOfQuiltspecs(CArrayOfQuiltspecs carray) {
+    this.array = carray.array;
+    this.pointer = carray.pointer;
+  }
+
+  /**
+   * Makes new CArray with pointer set to 0
+   * 
+   * @param array
+   *            underlaying array
+   */
+  public CArrayOfQuiltspecs(Quiltspec[] array) {
+    this.array = array;
+    this.pointer = 0;
+  }
+
+  /**
+   * Returns element at pointer
+   * 
+   * @return element at pointer
+   */
+  public Quiltspec get() {
+    return array[pointer];
+  }
+
+  /**
+   * Increases pointer by one (++)
+   */
+  public void pp() {
+    pointer++;
+  }
+
+  /**
+   * Sets element at pointer
+   * 
+   * @param f
+   *            desired value
+   */
+  public void set(Quiltspec f) {
+    array[pointer] = f;
+
+  }
+
+  /**
+   * Returns array element at specified index
+   * 
+   * @param i
+   *            array index
+   * @return element at index
+   */
+  public Quiltspec get(int i) {
+    return array[i];
+  }
+
+  /**
+   * Lessens pointer by value
+   * 
+   * @param i
+   *            lessen by
+   */
+  public void lessenPointerBy(int i) {
+    pointer -= i;
+
+  }
+
+  /**
+   * Returns pointer value
+   * 
+   * @return pointer value
+   */
+  public int getPointer() {
+    return pointer;
+  }
+
+  /**
+   * Sets ponter value
+   * 
+   * @param pointer
+   *            pointer value to be set
+   */
+  public void setPointer(int pointer) {
+    this.pointer = pointer;
+  }
+
+  /**
+   * Raises pointer by value
+   * 
+   * @param i
+   *            raise by
+   */
+  public void raisePointerBy(int i) {
+    pointer += i;
+
+  }
+
+  /**
+   * Lessens ponter by one (--)
+   */
+  public void mm() {
+    pointer--;
+
+  }
+
+  /**
+   * Returns underlaying array
+   * 
+   * @return underlaying array
+   */
+  public Quiltspec[] getArray() {
+    return array;
+  }
+
+  /**
+   * Sets underlaying array
+   * 
+   * @param array
+   *            underlaying array
+   */
+  public void setArray(Quiltspec[] array) {
+    this.array = array;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
new file mode 100644
index 0000000..b0ff4e6
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
@@ -0,0 +1,238 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding curve definition
+ * @author Tomáš Hráský
+ *
+ */
+public class Curve {
+
+  /**
+   * Maximum coordinates per control point
+   */
+  private static final int MAXCOORDS = 5;
+
+  /**
+   * Max curve order
+   */
+  private static final int MAXORDER = 24;
+
+  /**
+   * Next curve in linked list
+   */
+  public Curve next;
+
+  /**
+   * OpenGL maps
+   */
+  private Mapdesc mapdesc;
+
+  /**
+   * Does the curve need sampling
+   */
+  private boolean needsSampling;
+
+  /**
+   * Culling
+   */
+  private int cullval;
+
+  /**
+   * Number of coords
+   */
+  private int stride;
+
+  /**
+   * Curve order
+   */
+  private int order;
+
+  /**
+   * Holds conversion range borders
+   */
+  private float[] range;
+
+  /**
+   * Subdivision stepsize
+   */
+  public float stepsize;
+
+  /**
+   * Minimal subdivision stepsize
+   */
+  private float minstepsize;
+
+  /**
+   * Sampling points
+   */
+  float[] spts;
+
+  /**
+   * Makes new Curve
+   * 
+   * @param geo
+   * @param pta
+   * @param ptb
+   * @param c
+   *            next curve in linked list
+   */
+  public Curve(Quilt geo, float[] pta, float[] ptb, Curve c) {
+
+    spts = new float[MAXORDER * MAXCOORDS];
+
+    mapdesc = geo.mapdesc;
+
+    next = c;
+    needsSampling = mapdesc.isRangeSampling() ? true : false;
+
+    cullval = mapdesc.isCulling() ? Subdivider.CULL_ACCEPT
+      : Subdivider.CULL_TRIVIAL_REJECT;
+    order = geo.qspec.get(0).order;
+    stride = MAXCOORDS;
+
+    // CArrayOfFloats ps = geo.cpts;
+    CArrayOfFloats ps = new CArrayOfFloats(geo.cpts.getArray(), 0);
+    CArrayOfQuiltspecs qs = geo.qspec;
+    ps.raisePointerBy(qs.get().offset);
+    ps.raisePointerBy(qs.get().index * qs.get().order * qs.get().stride);
+
+    if (needsSampling) {
+      mapdesc.xformSampling(ps, qs.get().order, qs.get().stride, spts,
+                            stride);
+    }
+    if (cullval == Subdivider.CULL_ACCEPT) {
+      //				System.out.println("TODO curve.Curve-cullval");
+      // mapdesc.xformCulling(ps,qs.get().order,qs.get().stride,cpts,stride);
+    }
+
+    range = new float[3];
+    range[0] = qs.get().breakpoints[qs.get().index];
+    range[1] = qs.get().breakpoints[qs.get().index + 1];
+    range[2] = range[1] - range[0];
+    // TODO it is necessary to solve problem with "this" pointer here 
+    if (range[0] != pta[0]) {
+      //				System.out.println("TODO curve.Curve-range0");
+      // Curve lower=new Curve(this,pta,0);
+      // lower.next=next;
+      // this=lower;
+    }
+    if (range[1] != ptb[0]) {
+      //				System.out.println("TODO curve.Curve-range1");
+      // Curve lower=new Curve(this,ptb,0);
+    }
+  }
+
+  /**
+   * Checks culling type
+   * @return Subdivider.CULL_ACCEPT
+   */
+  public int cullCheck() {
+    if (cullval == Subdivider.CULL_ACCEPT) {
+      //				System.out.println("TODO curve.cullval");
+      // cullval=mapdesc.cullCheck(cpts,order,stride);
+    }
+    // TODO compute cullval and return the computed value
+    // return cullval;
+    return Subdivider.CULL_ACCEPT;
+  }
+
+  /**
+   * Computes subdivision step size
+   */
+  public void getStepSize() {
+    minstepsize = 0;
+    if (mapdesc.isConstantSampling()) {
+      setstepsize(mapdesc.maxrate);
+    } else if (mapdesc.isDomainSampling()) {
+      setstepsize(mapdesc.maxrate * range[2]);
+    } else {
+      assert (order <= MAXORDER);
+
+      float tmp[][] = new float[MAXORDER][MAXCOORDS];
+
+      int tstride = (MAXORDER);
+
+      int val = 0;
+      // mapdesc.project(spts,stride,tmp,tstride,order);
+
+      //				System.out.println("TODO curve.getsptepsize mapdesc.project");
+
+      if (val == 0) {
+        setstepsize(mapdesc.maxrate);
+      } else {
+        float t = mapdesc.getProperty(NurbsConsts.N_PIXEL_TOLERANCE);
+        if (mapdesc.isParametricDistanceSampling()) {
+          //						System.out.println("TODO curve.getstepsize - parametric");
+        } else if (mapdesc.isPathLengthSampling()) {
+          //						System.out.println("TODO curve.getstepsize - pathlength");
+        } else {
+          setstepsize(mapdesc.maxrate);
+        }
+      }
+
+    }
+
+  }
+
+  /**
+   * Sets maximum subdivision step size
+   * @param max maximum subdivision step size
+   */
+  private void setstepsize(float max) {
+    // DONE
+    stepsize = (max >= 1) ? (range[2] / max) : range[2];
+    minstepsize = stepsize;
+  }
+
+  /**
+   * Clamps the curve
+   */
+  public void clamp() {
+    // DONE
+    if (stepsize < minstepsize)
+      stepsize = mapdesc.clampfactor * minstepsize;
+  }
+
+  /**
+   * Tells whether curve needs subdivision
+   * 
+   * @return curve needs subdivison
+   */
+  public boolean needsSamplingSubdivision() {
+    return (stepsize < minstepsize);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CurveEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CurveEvaluator.java
new file mode 100644
index 0000000..92dadf6
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CurveEvaluator.java
@@ -0,0 +1,86 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class rendering curves with OpenGL
+ * @author Tomáš Hráský
+ *
+ */
+public interface CurveEvaluator {
+  /**
+   * Pushes eval bit
+   */
+  public void bgnmap1f();
+
+  /**
+   * Pops all OpenGL attributes
+   */
+  public void endmap1f() ;
+
+  /**
+   * Initializes opengl evaluator
+   * @param type curve type
+   * @param ulo lowest u
+   * @param uhi highest u
+   * @param stride control point coords
+   * @param order curve order
+   * @param ps control points
+   */
+  public void map1f(int type, float ulo, float uhi, int stride, int order,
+                    CArrayOfFloats ps) ;
+
+  /**
+   * Calls opengl enable
+   * @param type what to enable
+   */
+  public void enable(int type) ;
+
+  /**
+   * Calls glMapGrid1f
+   * @param nu steps
+   * @param u1 low u
+   * @param u2 high u
+   */
+  public void mapgrid1f(int nu, float u1, float u2) ;
+
+  /**
+   * Evaluates a curve using glEvalMesh1f
+   * @param style Backend.N_MESHFILL/N_MESHLINE/N_MESHPOINT
+   * @param from lowest param
+   * @param to highest param
+   */
+  public void mapmesh1f(int style, int from, int to) ;
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java
new file mode 100644
index 0000000..80baf20
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java
@@ -0,0 +1,121 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class for woking with linked list of curves
+ * @author Tomas Hrasky
+ *
+ */
+public class Curvelist {
+
+  /**
+   * Head of linked list
+   */
+  private Curve curve;
+
+  /**
+   * Holds conversion range borders
+   */
+  float[] range;
+
+  /**
+   * Subdivision step size
+   */
+  public float stepsize;
+
+  /**
+   * Do curves need subdivision?
+   */
+  private boolean needsSubdivision;
+
+  /**
+   * Makes new instance on top of specified lis of Quilts
+   * @param qlist underlaying list of quilts
+   * @param pta range start
+   * @param ptb range end
+   */
+  public Curvelist(Quilt qlist, float[] pta, float[] ptb) {
+    // DONE
+    curve = null;
+    range = new float[3];
+
+    for (Quilt q = qlist; q != null; q = q.next) {
+      curve = new Curve(q, pta, ptb, curve);
+    }
+    range[0] = pta[0];
+    range[1] = ptb[0];
+    range[2] = range[1] - range[0];
+  }
+
+  /**
+   * Compute step size
+   */
+  public void getstepsize() {
+    // DONE
+    stepsize = range[2];
+    Curve c;
+    for (c = curve; c != null; c = c.next) {
+      c.getStepSize();
+      c.clamp();
+      stepsize = (c.stepsize < stepsize) ? c.stepsize : stepsize;
+      if (c.needsSamplingSubdivision())
+        break;
+    }
+    needsSubdivision = (c != null) ? true : false;
+
+  }
+
+  /**
+   * Indicates whether curves need subdivision
+   * @return curves need subdivision
+   */
+  public boolean needsSamplingSubdivision() {
+    // DONE
+    return needsSubdivision;
+  }
+
+  /**
+   * Checks for culling
+   * @return Subdivider.CULL_TRIVIAL_REJECT or Subdivider.CULL_ACCEPT
+   */
+  public int cullCheck() {
+    // DONE
+    for (Curve c = curve; c != null; c = c.next)
+      if (c.cullCheck() == Subdivider.CULL_TRIVIAL_REJECT)
+        return Subdivider.CULL_TRIVIAL_REJECT;
+    return Subdivider.CULL_ACCEPT;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java
new file mode 100644
index 0000000..5c80ffd
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java
@@ -0,0 +1,56 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+import java.lang.reflect.Method;
+
+/**
+ * Display list
+ * @author Tomas Hrasky
+ *
+ */
+public class DisplayList {
+
+  /**
+   * Append action to the display list
+   * @param src source object to invoke method on
+   * @param m invoked method
+   * @param arg method argument
+   */
+  public void append(Object src, Method m, Object arg) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO displaylist append");
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
new file mode 100644
index 0000000..6983691
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
@@ -0,0 +1,130 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+import java.util.Arrays;
+
+/**
+ * List of breakpoints
+ * @author Tomas Hrasky
+ *
+ */
+public class Flist {
+
+  /**
+   * Data elements end index
+   * 
+   */
+  public int end;
+
+  /**
+   *Data elements start index 
+   */
+  public int start;
+
+  /**
+   * Breakpoint values
+   */
+  public float[] pts;
+
+  /**
+   * Number of array fields
+   */
+  private int npts;
+
+  /**
+   * Grows list
+   * @param maxpts maximum desired size
+   */
+  public void grow(int maxpts) {
+    // DONE
+    if (npts < maxpts) {
+      // npts=2*maxpts;
+      npts = maxpts;
+      pts = new float[npts];
+    }
+    start = 0;
+    end = 0;
+  }
+
+  /**
+   * Removes duplicate array elemnts 
+   */
+  public void filter() {
+    // INFO the aim of this method is to remove duplicates from array
+
+    Arrays.sort(pts);
+
+    start = 0;
+
+    int j = 0;
+
+    for (int i = 1; i < end; i++) {
+      if (pts[i] == pts[i - j - 1])
+        j++;
+      pts[i - j] = pts[i];
+    }
+
+    end -= j;
+
+  }
+
+  /**
+   * Sets start and and to real start and end of array elements
+   * @param from start from
+   * @param to end at
+   */
+  public void taper(float from, float to) {
+    // DONE
+
+    while (pts[start] != from) {
+      start++;
+    }
+
+    while (pts[end - 1] != to) {
+      end--;
+    }
+
+  }
+
+  /**
+   * Adds breakpoint value
+   * @param f value
+   */
+  public void add(float f) {
+    //DONE
+    pts[end++] = f;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
new file mode 100644
index 0000000..4f97b12
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
@@ -0,0 +1,557 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Knot vector specification
+ * 
+ * @author Tomas Hrasky
+ * 
+ */
+public class Knotspec {
+
+  /**
+   * Begin of input knots
+   */
+  public CArrayOfFloats inkbegin;
+
+  /**
+   * End of input knots
+   */
+  public CArrayOfFloats inkend;
+
+  /**
+   * Stride before knot operations
+   */
+  public int prestride;
+
+  /**
+   * Curve order
+   */
+  public int order;
+
+  /**
+   * Next knot specification in linked list (used in surfaces)
+   */
+  public Knotspec next;
+
+  /**
+   * Last knot
+   */
+  public CArrayOfFloats klast;
+
+  /**
+   * First knot
+   */
+  CArrayOfFloats kfirst;
+
+  /**
+   * Beginning of breakpoints
+   */
+  CArrayOfBreakpts bbegin;
+
+  /**
+   * End of breakpoints
+   */
+  CArrayOfBreakpts bend;
+
+  /**
+   * Considered left end knot
+   */
+  CArrayOfFloats kleft;
+
+  /**
+   * Considered right end knot
+   */
+  CArrayOfFloats kright;
+
+  /**
+   * Offset before knot operations
+   */
+  int preoffset;
+
+  /**
+   * Control points array Length after knot operations
+   */
+  int postwidth;
+
+  /**
+   * Beginning of coeficients array
+   */
+  private CArrayOfFloats sbegin;
+
+  /**
+   * Beginning of output knots
+   */
+  private CArrayOfFloats outkbegin;
+
+  /**
+   * End of output knots
+   */
+  private CArrayOfFloats outkend;
+
+  /**
+   * Control points aray length before knot operations
+   */
+  int prewidth;
+
+  /**
+   * Offset after knot operations
+   */
+  int postoffset;
+
+  /**
+   * Number of control points' coordinates after knot operations
+   */
+  public int poststride;
+
+  /**
+   * Number of control points' coordinates
+   */
+  public int ncoords;
+
+  /**
+   * Tell whether knotspec has already benn transformed
+   */
+  public boolean istransformed;
+
+  /**
+   * Knotspec to be transformed
+   */
+  public Knotspec kspectotrans;
+
+  /**
+   * Finds knot border of knot insertion and required multiplicities
+   */
+  public void preselect() {
+    // DONE
+    float kval;
+
+    klast = new CArrayOfFloats(inkend);
+    klast.lessenPointerBy(order);
+    for (kval = klast.get(); klast.getPointer() != inkend.getPointer(); klast
+           .pp()) {
+      if (!Knotvector.identical(klast.get(), kval))
+        break;
+    }
+
+    kfirst = new CArrayOfFloats(inkbegin);
+    kfirst.raisePointerBy(order - 1);
+    for (kval = kfirst.get(); kfirst.getPointer() != inkend.getPointer(); kfirst
+           .pp()) {
+      if (!Knotvector.identical(kfirst.get(), kval))
+        break;
+    }
+
+    CArrayOfFloats k = new CArrayOfFloats(kfirst);
+    k.mm();
+
+    for (; k.getPointer() >= inkbegin.getPointer(); k.mm())
+      if (!Knotvector.identical(kval, k.get()))
+        break;
+    k.pp();
+
+    Breakpt[] bbeginArray = new Breakpt[(klast.getPointer() - kfirst
+                                         .getPointer()) + 1];
+    for (int i = 0; i < bbeginArray.length; i++)
+      bbeginArray[i] = new Breakpt();
+    bbegin = new CArrayOfBreakpts(bbeginArray, 0);
+    bbegin.get().multi = kfirst.getPointer() - k.getPointer();
+    bbegin.get().value = kval;
+
+    bend = new CArrayOfBreakpts(bbegin);
+    kleft = new CArrayOfFloats(kfirst);
+    kright = new CArrayOfFloats(kfirst);
+
+  }
+
+  /**
+   * Perpares knotspec for transformation
+   */
+  public void select() {
+    // DONE
+    breakpoints();
+    knots();
+    factors();
+
+    preoffset = kleft.getPointer() - (inkbegin.getPointer() + order);
+    postwidth = ((bend.getPointer() - bbegin.getPointer()) * order);
+    prewidth = (outkend.getPointer() - outkbegin.getPointer()) - order;
+    postoffset = (bbegin.get().def > 1) ? (bbegin.get().def - 1) : 0;
+
+  }
+
+  /**
+   * Computes alpha factors for computing new control points
+   */
+  private void factors() {
+    // DONE
+    CArrayOfFloats mid = new CArrayOfFloats(outkend.getArray(), (outkend
+                                                                 .getPointer() - 1)
+                                            - order + bend.get().multi);
+
+    CArrayOfFloats fptr = null;
+    if (sbegin != null)
+      fptr = new CArrayOfFloats(sbegin);
+
+    for (CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend); bpt
+           .getPointer() >= bbegin.getPointer(); bpt.mm()) {
+      mid.lessenPointerBy(bpt.get().multi);
+      int def = bpt.get().def - 1;
+      if (def < 0)
+        continue;
+      float kv = bpt.get().value;
+
+      CArrayOfFloats kf = new CArrayOfFloats(mid.getArray(), (mid
+                                                              .getPointer() - def)
+                                             + (order - 1));
+      for (CArrayOfFloats kl = new CArrayOfFloats(kf.getArray(), kf
+                                                  .getPointer()
+                                                  + def); kl.getPointer() != kf.getPointer(); kl.mm()) {
+        CArrayOfFloats kh, kt;
+        for (kt = new CArrayOfFloats(kl), kh = new CArrayOfFloats(mid); kt
+               .getPointer() != kf.getPointer(); kh.mm(), kt.mm()) {
+          fptr.set((kv - kh.get()) / (kt.get() - kh.get()));
+          fptr.pp();
+        }
+        kl.set(kv);
+      }
+    }
+
+  }
+
+  /**
+   * Makes new knot vector
+   */
+  private void knots() {
+    // DONE
+    CArrayOfFloats inkpt = new CArrayOfFloats(kleft.getArray(), kleft
+                                              .getPointer()
+                                              - order);
+    CArrayOfFloats inkend = new CArrayOfFloats(kright.getArray(), kright
+                                               .getPointer()
+                                               + bend.get().def);
+
+    outkbegin = new CArrayOfFloats(new float[inkend.getPointer()
+                                             - inkpt.getPointer()], 0);
+    CArrayOfFloats outkpt;
+    for (outkpt = new CArrayOfFloats(outkbegin); inkpt.getPointer() != inkend
+           .getPointer(); inkpt.pp(), outkpt.pp()) {
+      outkpt.set(inkpt.get());
+    }
+    outkend = new CArrayOfFloats(outkpt);
+  }
+
+  /**
+   * Analyzes breakpoints
+   */
+  private void breakpoints() {
+    // DONE
+    CArrayOfBreakpts ubpt = new CArrayOfBreakpts(bbegin);
+    CArrayOfBreakpts ubend = new CArrayOfBreakpts(bend);
+    int nfactors = 0;
+
+    ubpt.get().value = ubend.get().value;
+    ubpt.get().multi = ubend.get().multi;
+
+    kleft = new CArrayOfFloats(kright);
+
+    for (; kright.getPointer() != klast.getPointer(); kright.pp()) {
+      if (Knotvector.identical(kright.get(), ubpt.get().value)) {
+        ubpt.get().multi++;
+      } else {
+        ubpt.get().def = order - ubpt.get().multi;
+        nfactors += (ubpt.get().def * (ubpt.get().def - 1)) / 2;
+        ubpt.pp();
+        ubpt.get().value = kright.get();
+        ubpt.get().multi = 1;
+      }
+    }
+    ubpt.get().def = order - ubpt.get().multi;
+    nfactors += (ubpt.get().def * (ubpt.get().def - 1)) / 2;
+
+    bend = new CArrayOfBreakpts(ubpt);
+
+    if (nfactors > 0) {
+      sbegin = new CArrayOfFloats(new float[nfactors], 0);
+    } else {
+      sbegin = null;
+    }
+
+  }
+
+  /**
+   * Copies control points
+   * 
+   * @param _inpt
+   *            input control points
+   * @param _outpt
+   *            output control points
+   */
+  public void copy(CArrayOfFloats _inpt, CArrayOfFloats _outpt) {
+    CArrayOfFloats inpt = new CArrayOfFloats(_inpt);
+    CArrayOfFloats outpt = new CArrayOfFloats(_outpt);
+
+    inpt.raisePointerBy(preoffset);
+    if (next != null) {
+      for (CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
+                                                   outpt.getPointer() + prewidth); outpt.getPointer() != lpt
+             .getPointer(); outpt.raisePointerBy(poststride)) {
+        next.copy(inpt, outpt);
+        inpt.raisePointerBy(prestride);
+      }
+
+    } else {
+      for (CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
+                                                   outpt.getPointer() + prewidth); outpt.getPointer() != lpt
+             .getPointer(); outpt.raisePointerBy(poststride)) {
+        pt_io_copy(outpt, inpt);
+        inpt.raisePointerBy(prestride);
+      }
+    }
+
+  }
+
+  /**
+   * Copies one control point to other
+   * 
+   * @param topt
+   *            source control point
+   * @param frompt
+   *            destination control point
+   */
+  private void pt_io_copy(CArrayOfFloats topt, CArrayOfFloats frompt) {
+    // DONE
+    switch (ncoords) {
+    case 4:
+      topt.setRelative(3, frompt.getRelative(3));
+    case 3:
+      topt.setRelative(2, frompt.getRelative(2));
+    case 2:
+      topt.setRelative(1, frompt.getRelative(1));
+    case 1:
+      topt.set(frompt.get());
+      break;
+    default:
+      // TODO break with copying in general case
+      //				System.out.println("TODO knotspec.pt_io_copy");
+      break;
+    }
+
+  }
+
+  /**
+   * Inserts a knot
+   * 
+   * @param _p
+   *            inserted knot
+   */
+  public void transform(CArrayOfFloats _p) {
+    CArrayOfFloats p = new CArrayOfFloats(_p);
+    // DONE
+    if (next != null) {//surface code
+      if (this.equals(kspectotrans)) {
+        next.transform(p);
+      } else {
+        if (istransformed) {
+          p.raisePointerBy(postoffset);
+          for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
+							p.getPointer() + postwidth); p.getPointer() != pend
+                 .getPointer(); p.raisePointerBy(poststride))
+            next.transform(p);
+
+        } else {
+          CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
+                                                   .getPointer()
+                                                   + prewidth);
+          for (; p.getPointer() != pend.getPointer(); p
+                 .raisePointerBy(poststride))
+            next.transform(p);
+        }
+      }
+
+    } else {//code for curve 
+      if (this.equals(kspectotrans)) {
+        insert(p);
+      } else {
+        if (istransformed) {
+          p.raisePointerBy(postoffset);
+          for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
+							p.getPointer() + postwidth); p.getPointer() != pend
+                 .getPointer(); p.raisePointerBy(poststride)) {
+            kspectotrans.insert(p);
+          }
+        } else {
+          CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
+                                                   .getPointer()
+                                                   + prewidth);
+          for (; p.getPointer() != pend.getPointer(); p
+                 .raisePointerBy(poststride))
+            kspectotrans.insert(p);
+        }
+      }
+    }
+
+  }
+
+  /**
+   * Inserts a knot and computes new control points
+   * 
+   * @param p
+   *            inserted knot
+   */
+  private void insert(CArrayOfFloats p) {
+    // DONE
+    CArrayOfFloats fptr = null;
+    if (sbegin != null)
+      fptr = new CArrayOfFloats(sbegin);
+    CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), p.getPointer()
+                                              + prewidth - poststride);
+    // CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), prewidth -
+    // poststride);
+    CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), p.getPointer()
+                                              + postwidth + postoffset - poststride);
+    // CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), postwidth +
+    // postoffset - poststride);
+    CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend);
+
+    for (CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(), srcpt
+                                                  .getPointer()
+                                                  - poststride * bpt.get().def); srcpt.getPointer() != pend
+           .getPointer(); pend.raisePointerBy(poststride)) {
+      CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
+      for (CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(), srcpt
+                                                  .getPointer()
+                                                  - poststride); p2.getPointer() != pend.getPointer(); p1
+             .setPointer(p2.getPointer()), p2
+             .lessenPointerBy(poststride)) {
+        pt_oo_sum(p1, p1, p2, fptr.get(), 1.0 - fptr.get());
+        fptr.pp();
+      }
+    }
+    bpt.mm();
+    for (; bpt.getPointer() >= bbegin.getPointer(); bpt.mm()) {
+
+      for (int multi = bpt.get().multi; multi > 0; multi--) {
+        pt_oo_copy(dstpt, srcpt);
+        dstpt.lessenPointerBy(poststride);
+        srcpt.lessenPointerBy(poststride);
+      }
+      for (CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(),
+                                                    srcpt.getPointer() - poststride * bpt.get().def); srcpt
+             .getPointer() != pend.getPointer(); pend
+             .raisePointerBy(poststride), dstpt
+             .lessenPointerBy(poststride)) {
+        pt_oo_copy(dstpt, srcpt);
+        CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
+
+        for (CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(),
+                                                    srcpt.getPointer() - poststride); p2.getPointer() != pend
+               .getPointer(); p1.setPointer(p2.getPointer()), p2
+               .lessenPointerBy(poststride)) {
+          pt_oo_sum(p1, p1, p2, fptr.get(), 1.0 - fptr.get());
+          fptr.pp();
+        }
+      }
+    }
+  }
+
+  /**
+   * Copies one control point to another
+   * 
+   * @param topt
+   *            source ctrl point
+   * @param frompt
+   *            distance ctrl point
+   */
+  private void pt_oo_copy(CArrayOfFloats topt, CArrayOfFloats frompt) {
+    // DONE
+    // this is a "trick" with case - "break" is omitted so it comes through all cases
+    switch (ncoords) {
+    case 4:
+      topt.setRelative(3, frompt.getRelative(3));
+    case 3:
+      topt.setRelative(2, frompt.getRelative(2));
+    case 2:
+      topt.setRelative(1, frompt.getRelative(1));
+    case 1:
+      topt.setRelative(0, frompt.getRelative(0));
+      break;
+    default:
+      // default uses memcpy but it is not needed (we probably won't have more than 4 coords)
+      // TODO not sure about it
+      break;
+    }
+
+  }
+
+  /**
+   * Computes new control point
+   * 
+   * @param x
+   *            first point
+   * @param y
+   *            second point
+   * @param z
+   *            third pont
+   * @param a
+   *            alpha
+   * @param b
+   *            1 - alpha
+   */
+  private void pt_oo_sum(CArrayOfFloats x, CArrayOfFloats y,
+                         CArrayOfFloats z, float a, double b) {
+    // DONE
+    switch (ncoords) {
+    case 4:
+      x.setRelative(3, (float) (a * y.getRelative(3) + b
+                                * z.getRelative(3)));
+    case 3:
+      x.setRelative(2, (float) (a * y.getRelative(2) + b
+                                * z.getRelative(2)));
+    case 2:
+      x.setRelative(1, (float) (a * y.getRelative(1) + b
+                                * z.getRelative(1)));
+    case 1:
+      x.setRelative(0, (float) (a * y.getRelative(0) + b
+                                * z.getRelative(0)));
+      break;
+    default:
+      //no need of default - see previous method and its case statement				
+      //				System.out.println("TODO pt_oo_sum default");
+      break;
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
new file mode 100644
index 0000000..89389de
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
@@ -0,0 +1,179 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Knot vector used in curve specification
+ * 
+ * @author Tomas Hrasky
+ * 
+ */
+public class Knotvector {
+
+  /**
+   * Tolerance used when comparing knots - when difference is smaller, knots
+   * are considered equal
+   */
+  public static final float TOLERANCE = 1.0e-5f;
+
+  /**
+   * Maximum curve order
+   */
+  private static final int MAXORDER = 24;
+
+  /**
+   * Number of knots
+   */
+  int knotcount;
+
+  /**
+   * Number of control points' coordinates
+   */
+  int stride;
+
+  /**
+   * Curve order
+   */
+  int order;
+
+  /**
+   * Knots
+   */
+  float[] knotlist;
+
+  /**
+   * Makes new knotvector
+   * 
+   * @param nknots
+   *            number of knots
+   * @param stride
+   *            number of ctrl points' corrdinates
+   * @param order
+   *            curve order
+   * @param knot
+   *            knots
+   */
+  public Knotvector(int nknots, int stride, int order, float[] knot) {
+    // DONE
+    init(nknots, stride, order, knot);
+  }
+
+  /**
+   * Initializes knotvector
+   * 
+   * @param nknots
+   *            number of knots
+   * @param stride
+   *            number of ctrl points' corrdinates
+   * @param order
+   *            curve order
+   * @param knot
+   *            knots
+   */
+  public void init(int nknots, int stride, int order, float[] knot) {
+    // DONE
+    this.knotcount = nknots;
+    this.stride = stride;
+    this.order = order;
+    this.knotlist = new float[nknots];
+    for (int i = 0; i < nknots; i++) {
+      this.knotlist[i] = knot[i];
+    }
+
+  }
+
+  /**
+   * Validates knot vector parameters
+   * 
+   * @return knot vector validity
+   */
+  public int validate() {
+    int kindex = knotcount - 1;
+    if (order < 1 || order > MAXORDER) {
+      return 1;
+    }
+    if (knotcount < 2 * order) {
+      return 2;
+    }
+    if (identical(knotlist[kindex - (order - 1)], knotlist[order - 1])) {
+      return 3;
+    }
+    for (int i = 0; i < kindex; i++) {
+      if (knotlist[i] > knotlist[i + 1])
+        return 4;
+    }
+    int multi = 1;
+    for (; kindex >= 1; kindex--) {
+      if (knotlist[kindex] - knotlist[kindex - 1] < TOLERANCE) {
+        multi++;
+        continue;
+      }
+      if (multi > order) {
+        return 5;
+      }
+      multi = 1;
+    }
+    if (multi > order) {
+      return 5;
+    }
+
+    return 0;
+  }
+
+  /**
+   * Show specified message
+   * 
+   * @param msg
+   *            message to be shown
+   */
+  public void show(String msg) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO knotvector.show");
+
+  }
+
+  /**
+   * Compares two knots for equality
+   * 
+   * @param a
+   *            first knot
+   * @param b
+   *            second knot
+   * @return knots are/are not equal
+   */
+  public static boolean identical(float a, float b) {
+    return ((a - b) < TOLERANCE) ? true : false;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
new file mode 100644
index 0000000..8fab114
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
@@ -0,0 +1,442 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding properties of OpenGL map
+ * @author Tomas Hrasky
+ *
+ */
+public class Mapdesc {
+
+  /**
+   * Maximum control point coords
+   */
+  private static final int MAXCOORDS = 5;
+
+  /**
+   * Next description in list
+   */
+  public Mapdesc next;
+
+  /**
+   * Is map rational
+   */
+  public int isrational;
+
+  /**
+   * Number of control point coords
+   */
+  public int ncoords;
+
+  /**
+   * Map type
+   */
+  private int type;
+
+  /**
+   * Number of homogenous coords
+   */
+  private int hcoords;
+
+  /**
+   * Number of inhomogenous coords
+   */
+  private int inhcoords;
+
+  /**
+   * Not used
+   */
+  private int mask;
+
+  /**
+   * Value of N_PIXEL_TOLERANCE property
+   */
+  private float pixel_tolerance;
+
+  /**
+   * Value of N_ERROR_TOLERANCE property
+   */
+  private float error_tolerance;
+
+  /**
+   * Value of N_BBOX_SUBDIVIDING property
+   */
+  private float bbox_subdividing;
+
+  /**
+   * Value of N_CULLING property
+   */
+  private float culling_method;
+
+  /**
+   * Value of N_SAMPLINGMETHOD property
+   */
+  private float sampling_method;
+
+  /**
+   * Value of N_CLAMPFACTOR property
+   */
+  float clampfactor;
+
+  /**
+   * Value of N_MINSAVINGS property 
+   */
+  private float minsavings;
+
+  /**
+   * Steps in u direction
+   */
+  private float s_steps;
+
+  /**
+   * Steps in v direction
+   */
+  private float t_steps;
+
+  /**
+   * Maximal step
+   */
+  float maxrate;
+
+  /**
+   * Maximal u direction step
+   */
+  private float maxsrate;
+
+  /**
+   * Maximal v direction step
+   */
+  private float maxtrate;
+
+  /**
+   * Not used
+   */
+  private float[][] bmat;
+
+  /**
+   * Sampling matrix
+   */
+  private float[][] smat;
+
+  /**
+   * Not used
+   */
+  private float[][] cmat;
+
+  /**
+   * Not used
+   */
+  private float[] bboxsize;
+
+  /**
+   * Makes new mapdesc 
+   * @param type map type
+   * @param rational is rational
+   * @param ncoords number of control points coords
+   * @param backend backend object
+   */
+  public Mapdesc(int type, int rational, int ncoords, Backend backend) {
+    // DONE
+    this.type = type;
+    this.isrational = rational;
+    this.ncoords = ncoords;
+    this.hcoords = ncoords + (isrational > 0 ? 0 : 1);
+    this.inhcoords = ncoords - (isrational > 0 ? 1 : 0);
+    this.mask = ((1 << (inhcoords * 2)) - 1);
+    next = null;
+
+    assert (hcoords <= MAXCOORDS);
+    assert (inhcoords >= 1);
+
+    pixel_tolerance = 1f;
+    error_tolerance = 1f;
+    bbox_subdividing = NurbsConsts.N_NOBBOXSUBDIVISION;
+    culling_method = NurbsConsts.N_NOCULLING;
+    sampling_method = NurbsConsts.N_NOSAMPLING;
+    clampfactor = NurbsConsts.N_NOCLAMPING;
+    minsavings = NurbsConsts.N_NOSAVINGSSUBDIVISION;
+    s_steps = 0f;
+    t_steps = 0f;
+
+    maxrate = (s_steps < 0) ? 0 : s_steps;
+    maxsrate = (s_steps < 0) ? 0 : s_steps;
+    maxtrate = (t_steps < 0) ? 0 : t_steps;
+    bmat = new float[MAXCOORDS][MAXCOORDS];
+    cmat = new float[MAXCOORDS][MAXCOORDS];
+    smat = new float[MAXCOORDS][MAXCOORDS];
+
+    identify(bmat);
+    identify(cmat);
+    identify(smat);
+    bboxsize = new float[MAXCOORDS];
+    for (int i = 0; i < inhcoords; i++)
+      bboxsize[i] = 1;
+  }
+
+  /**
+   * Make matrix identity matrix
+   * @param arr matrix
+   */
+  private void identify(float[][] arr) {
+    // DONE
+    for (int i = 0; i < MAXCOORDS; i++)
+      for (int j = 0; j < MAXCOORDS; j++)
+        arr[i][j] = 0;
+    for (int i = 0; i < MAXCOORDS; i++)
+      arr[i][i] = 1;
+
+  }
+
+  /**
+   * Tells whether tag is property tag
+   * @param tag property tag
+   * @return is/is not property
+   */
+  public boolean isProperty(int tag) {
+    boolean ret;
+    switch (tag) {
+    case NurbsConsts.N_PIXEL_TOLERANCE:
+    case NurbsConsts.N_ERROR_TOLERANCE:
+    case NurbsConsts.N_CULLING:
+    case NurbsConsts.N_BBOX_SUBDIVIDING:
+    case NurbsConsts.N_S_STEPS:
+    case NurbsConsts.N_T_STEPS:
+    case NurbsConsts.N_SAMPLINGMETHOD:
+    case NurbsConsts.N_CLAMPFACTOR:
+    case NurbsConsts.N_MINSAVINGS:
+      ret = true;
+      break;
+    default:
+      ret = false;
+      break;
+    }
+    return ret;
+  }
+
+  /**
+   * Returns number of control points' coords
+   * @return number of control points' coords
+   */
+  public int getNCoords() {
+    return ncoords;
+  }
+
+  /**
+   * Returns map type
+   * @return map type
+   */
+  public int getType() {
+    return type;
+  }
+
+  /**
+   * Tells whether map is range sampling
+   * @return is map range sampling
+   */
+  public boolean isRangeSampling() {
+    // DONE
+    return (isParametricDistanceSampling() || isPathLengthSampling()
+            || isSurfaceAreaSampling() || isObjectSpaceParaSampling() || isObjectSpacePathSampling());
+  }
+
+  /**
+   * Tells whether map is object space sampling
+   * @return is map object space sampling
+   */
+  private boolean isObjectSpacePathSampling() {
+    // DONE
+    return sampling_method == NurbsConsts.N_OBJECTSPACE_PATH;
+  }
+
+  /**
+   * Tells whether map is object space parasampling
+   * @return is map object space parasampling
+   */
+  private boolean isObjectSpaceParaSampling() {
+    // DONE
+    return sampling_method == NurbsConsts.N_OBJECTSPACE_PARA;
+  }
+
+  /**
+   * Tells whether map is area sampling surface
+   * @return is map area sampling surface
+   */
+  private boolean isSurfaceAreaSampling() {
+    // DONE
+    return sampling_method == NurbsConsts.N_SURFACEAREA;
+  }
+
+  /**
+   * Tells whether map is path length sampling
+   * @return is map path length sampling
+   */
+  boolean isPathLengthSampling() {
+    // DONE
+    return sampling_method == NurbsConsts.N_PATHLENGTH;
+  }
+
+  /**
+   * Tells whether map is parametric distance sampling
+   * @return is map parametric distance sampling
+   */
+  boolean isParametricDistanceSampling() {
+    // DONE
+    return sampling_method == NurbsConsts.N_PARAMETRICDISTANCE;
+  }
+
+  /**
+   * Tells whether map is culling 
+   * @return is map culling
+   */
+  public boolean isCulling() {
+    // DONE
+    return culling_method != NurbsConsts.N_NOCULLING ? true : false;
+  }
+
+  /**
+   * Tells whether map is constantly sampling 
+   * @return is map constant sampling
+   */
+  public boolean isConstantSampling() {
+    return (sampling_method == NurbsConsts.N_FIXEDRATE) ? true : false;
+  }
+
+  /**
+   * Tells whether map is domain sampling 
+   * @return is map domain sampling
+   */
+  public boolean isDomainSampling() {
+    return (sampling_method == NurbsConsts.N_DOMAINDISTANCE) ? true : false;
+  }
+
+  /**
+   * Returns property of specified tag value 
+   * @param tag property tag
+   * @return property value
+   */
+  public float getProperty(int tag) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO mapdesc.getproperty");
+    return 0;
+  }
+
+  /**
+   * Sets property with given tag
+   * @param tag property tag
+   * @param value desired value
+   */
+  public void setProperty(int tag, float value) {
+    // TODO Auto-generated method stub
+    switch (tag) {
+    case NurbsConsts.N_PIXEL_TOLERANCE:
+      pixel_tolerance = value;
+      break;
+    case NurbsConsts.N_ERROR_TOLERANCE:
+      error_tolerance = value;
+      break;
+    case NurbsConsts.N_CULLING:
+      culling_method = value;
+      break;
+    case NurbsConsts.N_BBOX_SUBDIVIDING:
+      if (value <= 0)
+        value = NurbsConsts.N_NOBBOXSUBDIVISION;
+      bbox_subdividing = value;
+      break;
+    case NurbsConsts.N_S_STEPS:
+      if (value < 0)
+        value = 0;
+      s_steps = value;
+      maxrate = value;
+      maxsrate = value;
+      break;
+    case NurbsConsts.N_T_STEPS:
+      if (value < 0)
+        value = 0;
+      t_steps = value;
+      maxtrate = value;
+      break;
+    case NurbsConsts.N_SAMPLINGMETHOD:
+      sampling_method = value;
+      break;
+    case NurbsConsts.N_CLAMPFACTOR:
+      if (value < 0)
+        value = 0;
+      clampfactor = value;
+      break;
+    case NurbsConsts.N_MINSAVINGS:
+      if (value <= 0)
+        value = NurbsConsts.N_NOSAVINGSSUBDIVISION;
+      minsavings = value;
+      break;
+    }
+  }
+
+  /**
+   * Samples curve
+   * @param pts control points
+   * @param order curve order
+   * @param stride number of control points' coordinates
+   * @param sp breakpoints
+   * @param outstride output number of control points' coordinates
+   */
+  public void xformSampling(CArrayOfFloats pts, int order, int stride,
+                            float[] sp, int outstride) {
+    // DONE
+    xFormMat(smat, pts, order, stride, sp, outstride);
+  }
+
+  /**
+   * Empty method
+   * @param mat sampling matrix
+   * @param pts ontrol points
+   * @param order curve order
+   * @param stride number of control points' coordinates
+   * @param cp breakpoints
+   * @param outstride output number of control points' coordinates
+   */
+  private void xFormMat(float[][] mat, CArrayOfFloats pts, int order,
+			int stride, float[] cp, int outstride) {
+    // TODO Auto-generated method stub
+
+    //		System.out.println("TODO mapdsc.xformmat ; change cp from float[] to carrayoffloats");
+
+    if (isrational > 0) {
+
+    } else {
+
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java
new file mode 100644
index 0000000..af80241
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java
@@ -0,0 +1,122 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding list of Mapdescs
+ * @author Tomáš Hráský
+ *
+ */
+public class Maplist {
+  /**
+   * Head of linked list
+   */
+  private Mapdesc maps;
+
+  /**
+   * Backend class
+   */
+  private Backend backend;
+
+  /**
+   * Makes new Maplist
+   * @param backend Backend class
+   */
+  public Maplist(Backend backend) {
+    this.backend = backend;
+  }
+
+  /**
+   * Sets linked list beginning to null
+   */
+  public void initialize() {
+    // TODO mapdespool.clear ?
+    maps = null;
+  }
+
+  /**
+   * Defines new Mapdesc if it is not defined and appends it to linked list
+   * @param type map type
+   * @param rational is map rational
+   * @param ncoords number of coords
+   */
+  public void define(int type, int rational, int ncoords) {
+    // DONE
+    Mapdesc m = locate(type);
+    assert (m == null || (m.isrational == rational && m.ncoords == ncoords));
+    add(type, rational, ncoords);
+
+  }
+
+  /**
+   * Adds new Mapdesc to linked list
+   * @param type map type
+   * @param rational is map rational
+   * @param ncoords number of coords
+   */
+  private void add(int type, int rational, int ncoords) {
+    // DONE
+    Mapdesc map = new Mapdesc(type, rational, ncoords, backend);
+    if (maps == null) {
+      maps = map;
+    } else {
+      map.next = maps;
+      maps = map;
+    }
+  }
+
+  /**
+   * Tries to find Mapdesc in linked list
+   * @param type map type
+   * @return Mapdesc of type or null if there is no such map
+   */
+  public Mapdesc locate(int type) {
+    // DONE
+    Mapdesc m = null;
+    for (m = maps; m != null; m = m.next)
+      if (m.getType() == type)
+        break;
+    return m;
+  }
+
+  /**
+   * Alias for locate
+   * @param type maptype
+   * @return Mapdesc of type or null if there is no such map
+   */
+  public Mapdesc find(int type) {
+    return locate(type);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/NurbsConsts.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/NurbsConsts.java
new file mode 100644
index 0000000..55a176d
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/NurbsConsts.java
@@ -0,0 +1,184 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class hodling NURBS constants as seen in OpenGL GLU documentation
+ * @author JOGL project
+ *
+ */
+public class NurbsConsts {
+  /*
+   * NURBS Properties - one set per map, each takes a single INREAL arg
+   */
+  public static final int N_SAMPLING_TOLERANCE = 1;
+
+  public static final int N_S_RATE = 6;
+
+  public static final int N_T_RATE = 7;
+
+  public static final int N_CLAMPFACTOR = 13;
+
+  public static final float N_NOCLAMPING = 0.0f;
+
+  public static final int N_MINSAVINGS = 14;
+
+  public static final float N_NOSAVINGSSUBDIVISION = 0.0f;
+
+  /*
+   * NURBS Properties - one set per map, each takes an enumerated value
+   */
+  public static final int N_CULLING = 2;
+
+  public static final float N_NOCULLING = 0.0f;
+
+  public static final float N_CULLINGON = 1.0f;
+
+  public static final int N_SAMPLINGMETHOD = 10;
+
+  public static final float N_NOSAMPLING = 0.0f;
+
+  public static final float N_FIXEDRATE = 3.0f;
+
+  public static final float N_DOMAINDISTANCE = 2.0f;
+
+  public static final float N_PARAMETRICDISTANCE = 5.0f;
+
+  public static final float N_PATHLENGTH = 6.0f;
+
+  public static final float N_SURFACEAREA = 7.0f;
+
+  public static final float N_OBJECTSPACE_PARA = 8.0f;
+
+  public static final float N_OBJECTSPACE_PATH = 9.0f;
+
+  public static final int N_BBOX_SUBDIVIDING = 17;
+
+  public static final float N_NOBBOXSUBDIVISION = 0.0f;
+
+  public static final float N_BBOXTIGHT = 1.0f;
+
+  public static final float N_BBOXROUND = 2.0f;
+
+  /*
+   * NURBS Rendering Properties - one set per renderer each takes an
+   * enumerated value
+   */
+  public static final int N_DISPLAY = 3;
+
+  public static final int N_FILL = 1;
+
+  public static final int N_OUTLINE_POLY = 2;
+
+  public static final int N_OUTLINE_TRI = 3;
+
+  public static final int N_OUTLINE_QUAD = 4;
+
+  public static final int N_OUTLINE_PATCH = 5;
+
+  public static final int N_OUTLINE_PARAM = 6;
+
+  public static final int N_OUTLINE_PARAM_S = 7;
+
+  public static final int N_OUTLINE_PARAM_ST = 8;
+
+  public static final int N_OUTLINE_SUBDIV = 9;
+
+  public static final int N_OUTLINE_SUBDIV_S = 10;
+
+  public static final int N_OUTLINE_SUBDIV_ST = 11;
+
+  public static final int N_ISOLINE_S = 12;
+
+  public static final int N_ERRORCHECKING = 4;
+
+  public static final int N_NOMSG = 0;
+
+  public static final int N_MSG = 1;
+
+  /* GL 4.0 propeties not defined above */
+
+  public static final int N_PIXEL_TOLERANCE = N_SAMPLING_TOLERANCE;
+
+  public static final int N_ERROR_TOLERANCE = 20;
+
+  public static final int N_SUBDIVISIONS = 5;
+
+  public static final int N_TILES = 8;
+
+  public static final int N_TMP1 = 9;
+
+  public static final int N_TMP2 = N_SAMPLINGMETHOD;
+
+  public static final int N_TMP3 = 11;
+
+  public static final int N_TMP4 = 12;
+
+  public static final int N_TMP5 = N_CLAMPFACTOR;
+
+  public static final int N_TMP6 = N_MINSAVINGS;
+
+  public static final int N_S_STEPS = N_S_RATE;
+
+  public static final int N_T_STEPS = N_T_RATE;
+
+  /*
+   * NURBS Rendering Properties - one set per map, each takes an INREAL matrix
+   * argument
+   */
+  public static final int N_CULLINGMATRIX = 1;
+
+  public static final int N_SAMPLINGMATRIX = 2;
+
+  public static final int N_BBOXMATRIX = 3;
+
+  /*
+   * NURBS Rendering Properties - one set per map, each takes an INREAL vector
+   * argument
+   */
+  public static final int N_BBOXSIZE = 4;
+
+  /* type argument for trimming curves */
+
+  public static final int N_P2D = 0x8;
+
+  public static final int N_P2DR = 0xd;
+
+  public static final int N_MESHLINE = 1;
+
+  public static final int N_MESHFILL = 0;
+
+  public static final int N_MESHPOINT = 2;
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_curve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_curve.java
new file mode 100644
index 0000000..d6b5654
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_curve.java
@@ -0,0 +1,63 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Struct holding curve links
+ * @author Tomáš Hráský
+ *
+ */
+public class O_curve {
+
+  /**
+   * Curve type
+   */
+  public int curvetype;
+
+  /**
+   * Next curve in linked list
+   */
+  public O_curve next;
+
+  /**
+   * Curve of picewiselinear type
+   */
+  public O_pwlcurve o_pwlcurve;
+
+  /**
+   * NURBS curve
+   */
+  public O_nurbscurve o_nurbscurve;
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
new file mode 100644
index 0000000..05c89eb
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
@@ -0,0 +1,80 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * NURBS curve object
+ * @author Tomáš Hráský
+ *
+ */
+public class O_nurbscurve {
+
+  /**
+   * List of bezier curves
+   */
+  public Quilt bezier_curves;
+
+  /**
+   * Curve type
+   */
+  public int type;
+
+  /**
+   * Was curve used ?
+   */
+  public boolean used;
+
+  /**
+   * Parent curve
+   */
+  public O_curve owner;
+
+  /**
+   * Next curve in list
+   */
+  public O_nurbscurve next;
+
+  /**
+   * Makes new O_nurbscurve
+   * @param realType type of curve 
+   */
+  public O_nurbscurve(int realType) {
+    // DONE
+    this.type = realType;
+    this.owner = null;
+    this.next = null;
+    this.used = false;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java
new file mode 100644
index 0000000..867f436
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java
@@ -0,0 +1,79 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * NURBS surface object
+ * @author Tomáš Hráský
+ *
+ */
+public class O_nurbssurface {
+
+  /**
+   * List of bezier patches forming NURBS surface
+   */
+  public Quilt bezier_patches;
+
+  /**
+   * Was surface used
+   */
+  public boolean used;
+
+  /**
+   * Parent O_surface
+   */
+  public O_surface owner;
+
+  /**
+   * Next surface in list
+   */
+  public O_nurbssurface next;
+
+  /**
+   * Surface type
+   */
+  private int type;
+
+  /**
+   * Makes new O_nurbssurface of type
+   * @param type surface type
+   */
+  public O_nurbssurface(int type) {
+    this.type = type;
+    this.owner = null;
+    this.next = null;
+    this.used = false;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_pwlcurve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_pwlcurve.java
new file mode 100644
index 0000000..27ca350
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_pwlcurve.java
@@ -0,0 +1,44 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Empty class
+ * @author Tomáš Hráský
+ *
+ */
+public class O_pwlcurve {
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_surface.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_surface.java
new file mode 100644
index 0000000..96d455b
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_surface.java
@@ -0,0 +1,52 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Surface object
+ * @author Tomáš Hráský
+ *
+ */
+public class O_surface {
+  /**
+   * NURBS surface
+   */
+  public O_nurbssurface o_nurbssurface;
+
+  /**
+   * Trims
+   */
+  public O_trim o_trim;
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_trim.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_trim.java
new file mode 100644
index 0000000..4cbec01
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_trim.java
@@ -0,0 +1,44 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Empty class
+ * @author Tomáš Hráský
+ *
+ */
+public class O_trim {
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java
new file mode 100644
index 0000000..51c43fc
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java
@@ -0,0 +1,54 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Empty class
+ * @author Tomas Hrasky
+ *
+ */
+public class Patch {
+
+  /**
+   * Empty constructor
+   * @param q
+   * @param pta
+   * @param ptb
+   * @param patch
+   */
+  public Patch(Quilt q, float[] pta, float[] ptb, Patch patch) {
+    //			System.out.println("TODO patch.constructor");
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
new file mode 100644
index 0000000..f60a0cc
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
@@ -0,0 +1,145 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * List of patches
+ * @author Tomáš Hráský
+ *
+ */
+public class Patchlist {
+
+  /**
+   * Array of ranges
+   */
+  public Pspec[] pspec;
+
+  /**
+   * head of list of patches
+   */
+  private Patch patch;
+
+  /**
+   * Makes new list of patches 
+   * @param quilts list of quilts
+   * @param pta low border
+   * @param ptb high border
+   */
+  public Patchlist(Quilt quilts, float[] pta, float[] ptb) {
+    // DONE
+    patch = null;
+
+    for (Quilt q = quilts; q != null; q = q.next)
+      patch = new Patch(q, pta, ptb, patch);
+    pspec[0] = new Pspec();
+    pspec[0].range[0] = pta[0];
+    pspec[0].range[1] = ptb[0];
+    pspec[0].range[2] = ptb[0] - pta[0];
+    pspec[1] = new Pspec();
+    pspec[1].range[0] = pta[1];
+    pspec[1].range[1] = ptb[1];
+    pspec[1].range[2] = ptb[1] - pta[1];
+
+  }
+
+  /**
+   * Empty constructor
+   * @param patchlist
+   * @param param
+   * @param mid
+   */
+  public Patchlist(Patchlist patchlist, int param, float mid) {
+    // TODO Auto-generated constructor stub
+    //			System.out.println("TODO patchlist.konstruktor 2");
+  }
+
+  /**
+   * Empty method
+   * @return 0
+   */
+  public int cullCheck() {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO patchlist.cullcheck");
+    return 0;
+  }
+
+  /**
+   * Empty method
+   */
+  public void getstepsize() {
+    //			System.out.println("TODO patchlist.getsptepsize");
+    // TODO Auto-generated method stub
+
+  }
+
+  /**
+   * Empty method
+   * @return false
+   */
+  public boolean needsSamplingSubdivision() {
+    // TODO Auto-generated method stub
+    //			System.out.println("patchlist.needsSamplingSubdivision");
+    return false;
+  }
+
+  /**
+   * Empty method
+   * @param i
+   * @return false
+   */
+  public boolean needsSubdivision(int i) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO patchlist.needsSubdivision");
+    return false;
+  }
+
+  /**
+   * Empty method
+   * @return false
+   */
+  public boolean needsNonSamplingSubdivision() {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO patchlist.needsNonSamplingSubdivision");
+    return false;
+  }
+
+  /**
+   * Empty method
+   */
+  public void bbox() {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO patchlist.bbox");
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
new file mode 100644
index 0000000..25b4dc4
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
@@ -0,0 +1,75 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class representing property
+ * 
+ * @author Tomas Hrasky
+ * 
+ */
+public class Property {
+
+  /**
+   * Property type
+   */
+  public int type;
+
+  /**
+   * Property id
+   */
+  public int tag;
+
+  /**
+   * Property value
+   */
+  public float value;
+
+  /**
+   * Makes new property with given parameters
+   * 
+   * @param type
+   *            property type
+   * @param tag
+   *            property id
+   * @param value
+   *            property value
+   */
+  public Property(int type, int tag, float value) {
+    this.type = type;
+    this.tag = tag;
+    this.value = value;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Pspec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Pspec.java
new file mode 100644
index 0000000..0289b27
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Pspec.java
@@ -0,0 +1,47 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding range
+ * @author Tomáš Hráský
+ *
+ */
+public class Pspec {
+  /**
+   * Range
+   */
+  public float[] range;
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java
new file mode 100644
index 0000000..bcbd20a
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java
@@ -0,0 +1,71 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Picewiselinar trimming arc
+ * @author Tomáš Hráský
+ *
+ */
+public class PwlArc {
+
+  /**
+   * Number of points
+   */
+  private int npts;
+
+  /**
+   * Vertexes
+   */
+  public TrimVertex[] pts;
+
+  /**
+   * Arc type
+   */
+  private int type;
+
+  /**
+   * Makes new trimming arc
+   * @param i num ber of vertexes
+   * @param p trimming vertexes array
+   */
+  public PwlArc(int i, TrimVertex[] p) {
+    // DONE
+    this.npts = i;
+    this.pts = p;
+    type = NurbsConsts.N_P2D;
+
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java
new file mode 100644
index 0000000..6d732a4
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java
@@ -0,0 +1,282 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class for converting NURBS curves and surfaces to list of bezier arcs or patches repectively
+ * @author Tomáš Hráský
+ *
+ */
+public class Quilt {
+  /**
+   * Maximum quilt dimension
+   */
+  private static final int MAXDIM = 2;
+
+  /**
+   * List of map descriptions
+   */
+  Mapdesc mapdesc;
+
+  /**
+   *  Array of quiltspecs pointer
+   */
+  public CArrayOfQuiltspecs qspec;
+
+  /**
+   * End array of quilt specs pointer
+   */
+  public CArrayOfQuiltspecs eqspec;
+
+  /**
+   * Control points
+   */
+  public CArrayOfFloats cpts;
+
+  /**
+   * Next quilt in list
+   */
+  public Quilt next;
+
+  /**
+   * Makes new quilt with mapdesc
+   * @param mapdesc map description
+   */
+  public Quilt(Mapdesc mapdesc) {
+    // DONE
+    this.mapdesc = mapdesc;
+    Quiltspec[] tmpquilts = new Quiltspec[MAXDIM];
+    for (int i = 0; i < tmpquilts.length; i++)
+      tmpquilts[i] = new Quiltspec();
+    this.qspec = new CArrayOfQuiltspecs(tmpquilts);
+
+  }
+
+  /**
+   * Converts NURBS surface to bezier patches
+   * @param sknotvector knots in u direction
+   * @param tknotvector knots in v direction
+   * @param ctrlarr control points
+   * @param coords control points coords
+   */
+  public void toBezier(Knotvector sknotvector, Knotvector tknotvector,
+                       CArrayOfFloats ctrlarr, int coords) {
+    Splinespec spline = new Splinespec(2);
+    spline.kspecinit(sknotvector, tknotvector);
+    spline.select();
+    spline.layout(coords);
+    spline.setupquilt(this);
+    spline.copy(ctrlarr);
+    spline.transform();
+  }
+
+  /**
+   * Converts NURBS curve to list of bezier curves
+   * @param knots knot vector
+   * @param ctlarray control points
+   * @param ncoords number of coordinates
+   */
+  public void toBezier(Knotvector knots, CArrayOfFloats ctlarray, int ncoords) {
+    // DONE
+    Splinespec spline = new Splinespec(1);
+    spline.kspecinit(knots);
+    spline.select();
+    spline.layout(ncoords);
+    spline.setupquilt(this);
+    spline.copy(ctlarray);
+    spline.transform();
+  }
+
+  /**
+   * Walks thru all arcs/patches
+   * @param pta low border
+   * @param ptb high border
+   * @param backend Backend
+   */
+  public void downloadAll(float[] pta, float[] ptb, Backend backend) {
+    // DONE
+    for (Quilt m = this; m != null; m = m.next) {
+      m.select(pta, ptb);
+      m.download(backend);
+    }
+
+  }
+
+  /**
+   * Renders arcs/patches
+   * @param backend Backend for rendering
+   */
+  private void download(Backend backend) {
+    // DONE
+    if (getDimension() == 2) {
+
+      CArrayOfFloats ps = new CArrayOfFloats(cpts);
+      ps.raisePointerBy(qspec.get(0).offset);
+      ps.raisePointerBy(qspec.get(1).offset);
+      ps.raisePointerBy(qspec.get(0).index * qspec.get(0).order
+                        * qspec.get(0).stride);
+      ps.raisePointerBy(qspec.get(1).index * qspec.get(1).order
+                        * qspec.get(1).stride);
+
+      backend.surfpts(mapdesc.getType(), ps, qspec.get(0).stride, qspec
+                      .get(1).stride, qspec.get(0).order, qspec.get(1).order,
+                      qspec.get(0).breakpoints[qspec.get(0).index],
+                      qspec.get(0).breakpoints[qspec.get(0).index + 1], qspec
+                      .get(1).breakpoints[qspec.get(1).index], qspec
+                      .get(1).breakpoints[qspec.get(1).index + 1]);
+
+    } else {// code for curves
+      // CArrayOfFloats ps=new CArrayOfFloats(cpts);
+      CArrayOfFloats ps = new CArrayOfFloats(cpts.getArray(), 0);
+      ps.raisePointerBy(qspec.get(0).offset);
+      ps.raisePointerBy(qspec.get(0).index * qspec.get(0).order
+                        * qspec.get(0).stride);
+      backend.curvpts(mapdesc.getType(), ps, qspec.get(0).stride, qspec
+                      .get(0).order,
+                      qspec.get(0).breakpoints[qspec.get(0).index],
+                      qspec.get(0).breakpoints[qspec.get(0).index + 1]);
+    }
+
+  }
+
+  /**
+   * Returns quilt dimension
+   * @return quilt dimesion
+   */
+  private int getDimension() {
+    // DONE
+    return eqspec.getPointer() - qspec.getPointer();
+  }
+
+  /**
+   * Finds Quiltspec.index
+   * @param pta range
+   * @param ptb range
+   */
+  private void select(float[] pta, float[] ptb) {
+    // DONE
+    int dim = eqspec.getPointer() - qspec.getPointer();
+    int i, j;
+    for (i = 0; i < dim; i++) {
+      for (j = qspec.get(i).width - 1; j >= 0; j--)
+        if (qspec.get(i).breakpoints[j] <= pta[i]
+            && ptb[i] <= qspec.get(i).breakpoints[j + 1])
+          break;
+      assert (j != -1);
+      qspec.get(i).index = j;
+    }
+  }
+
+  /**
+   * Find range according to breakpoints
+   * @param from low param
+   * @param to high param
+   * @param bpts breakpoints
+   */
+  public void getRange(float[] from, float[] to, Flist bpts) {
+    // DONE
+    getRange(from, to, 0, bpts);
+
+  }
+
+  /**
+   * Find range according to breakpoints
+   * @param from low param
+   * @param to high param
+   * @param i from/to array index
+   * @param list breakpoints
+   */
+  private void getRange(float[] from, float[] to, int i, Flist list) {
+    // DONE
+    Quilt maps = this;
+    from[i] = maps.qspec.get(i).breakpoints[0];
+    to[i] = maps.qspec.get(i).breakpoints[maps.qspec.get(i).width];
+    int maxpts = 0;
+    Quilt m;
+    for (m = maps; m != null; m = m.next) {
+      if (m.qspec.get(i).breakpoints[0] > from[i])
+        from[i] = m.qspec.get(i).breakpoints[0];
+      if (m.qspec.get(i).breakpoints[m.qspec.get(i).width] < to[i])
+        to[i] = m.qspec.get(i).breakpoints[m.qspec.get(i).width];
+      maxpts += m.qspec.get(i).width + 1;
+    }
+    list.grow(maxpts);
+    for (m = maps; m != null; m = m.next) {
+      for (int j = 0; j <= m.qspec.get(i).width; j++) {
+        list.add(m.qspec.get(i).breakpoints[j]);
+      }
+    }
+    list.filter();
+    list.taper(from[i], to[i]);
+  }
+
+  /**
+   * Is this quilt culled
+   * @return 0 or Subdivider.CULL_ACCEPT
+   */
+  public int isCulled() {
+    if (mapdesc.isCulling()) {
+      //				System.out.println("TODO quilt.isculled mapdesc.isculling");
+      return 0;
+    } else {
+      return Subdivider.CULL_ACCEPT;
+    }
+  }
+
+  /**
+   * Finds range for surface
+   * @param from low param
+   * @param to high param
+   * @param slist u direction breakpoints
+   * @param tlist v direction breakpoints
+   */
+  public void getRange(float[] from, float[] to, Flist slist, Flist tlist) {
+    // DONE
+    getRange(from, to, 0, slist);
+    getRange(from, to, 1, tlist);
+
+  }
+
+  /**
+   * Empty method
+   * @param sbrkpts
+   * @param tbrkpts
+   * @param rate
+   */
+  public void findRates(Flist sbrkpts, Flist tbrkpts, float[] rate) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO quilt.findrates");
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Quiltspec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Quiltspec.java
new file mode 100644
index 0000000..eaec1c9
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Quiltspec.java
@@ -0,0 +1,85 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Quilt definition
+ * @author Tomas Hrasky
+ *
+ */
+public class Quiltspec {
+
+  /**
+   * Stride between control points
+   */
+  public int stride;
+
+  /**
+   * Quilt width in breakpoints
+   */
+  public int width;
+
+  /**
+   * Quilt order
+   */
+  public int order;
+
+  /**
+   * Start offset
+   */
+  public int offset;
+
+  /**
+   * Breakpoint index
+   */
+  public int index;
+
+  /**
+   * Boundary
+   */
+  public int[] bdry;
+
+  /**
+   * Breakpoints
+   */
+  public float[] breakpoints;
+
+  /**
+   * Makes new quiltspec
+   */
+  public Quiltspec() {
+    this.bdry = new int[2];
+  }
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/README.txt b/src/jogl/classes/jogamp/opengl/glu/nurbs/README.txt
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/README.txt
rename to src/jogl/classes/jogamp/opengl/glu/nurbs/README.txt
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
new file mode 100644
index 0000000..4729e24
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
@@ -0,0 +1,128 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding rendering params 
+ * @author Tomas Hrasky
+ *
+ */
+public class Renderhints {
+
+  /**
+   * Check for errors
+   */
+  public int errorchecking;
+
+  /**
+   * Maximum subdivisions
+   */
+  public int maxsubdivisions;
+
+  /**
+   * Number of subdivisions
+   */
+  private int subdivisions;
+
+  /**
+   * Display method
+   */
+  int display_method;
+
+  /**
+   * Output triangles
+   */
+  int wiretris;
+
+  /**
+   * Output quads
+   */
+  int wirequads;
+
+  /**
+   * Makes new Renderinghints
+   */
+  public Renderhints() {
+    display_method = NurbsConsts.N_FILL;
+    errorchecking = NurbsConsts.N_MSG;
+    subdivisions = 6;
+    // tmp1=0;
+  }
+
+  /**
+   * Set property value
+   * @param prop property
+   */
+  public void setProperty(Property prop) {
+    switch (prop.type) {
+    case NurbsConsts.N_DISPLAY:
+      display_method = (int) prop.value;
+      break;
+    case NurbsConsts.N_ERRORCHECKING:
+      errorchecking = (int) prop.value;
+      break;
+    case NurbsConsts.N_SUBDIVISIONS:
+      subdivisions = (int) prop.value;
+      break;
+    default:
+      // abort - end program
+      break;
+    }
+  }
+
+  /**
+   * Initialization
+   */
+  public void init() {
+    // DONE
+    maxsubdivisions = subdivisions;
+    if (maxsubdivisions < 0)
+      maxsubdivisions = 0;
+
+    if (display_method == NurbsConsts.N_FILL) {
+      wiretris = 0;
+      wirequads = 0;
+    } else if (display_method == NurbsConsts.N_OUTLINE_TRI) {
+      wiretris = 1;
+      wirequads = 0;
+    } else if (display_method == NurbsConsts.N_OUTLINE_QUAD) {
+      wiretris = 0;
+      wirequads = 1;
+    } else {
+      wiretris = 1;
+      wirequads = 1;
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java
new file mode 100644
index 0000000..f1c779c
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java
@@ -0,0 +1,204 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * NURBS definition
+ * @author Tomas Hrasky
+ *
+ */
+public class Splinespec {
+
+  /**
+   * Dimension
+   */
+  private int dim;
+
+  /**
+   * Knot vector specs
+   */
+  private Knotspec kspec;
+
+  /**
+   * Control points after conversion
+   */
+  private CArrayOfFloats outcpts;
+
+  /**
+   * Makes new Splinespec with given dimension
+   * @param i dimension
+   */
+  public Splinespec(int i) {
+    // DONE
+    this.dim = i;
+  }
+
+  /**
+   * Initializes knotspec according to knotvector
+   * @param knotvector basic knotvector
+   */
+  public void kspecinit(Knotvector knotvector) {
+    // DONE
+    this.kspec = new Knotspec();
+    kspec.inkbegin = new CArrayOfFloats(knotvector.knotlist, 0);
+    kspec.inkend = new CArrayOfFloats(knotvector.knotlist,
+                                      knotvector.knotcount);
+    kspec.prestride = knotvector.stride;
+    kspec.order = knotvector.order;
+    kspec.next = null;
+  }
+
+  /**
+   * Initializes knotspec according to knotvector - SURFACE
+   * @param sknotvector knotvector in u dir
+   * @param tknotvector knotvector in v dir
+   */
+  public void kspecinit(Knotvector sknotvector, Knotvector tknotvector) {
+    // DONE
+    this.kspec = new Knotspec();
+    Knotspec tkspec = new Knotspec();
+
+    kspec.inkbegin = new CArrayOfFloats(sknotvector.knotlist, 0);
+    kspec.inkend = new CArrayOfFloats(sknotvector.knotlist,
+                                      sknotvector.knotcount);
+    kspec.prestride = sknotvector.stride;
+    kspec.order = sknotvector.order;
+    kspec.next = tkspec;
+
+    tkspec.inkbegin = new CArrayOfFloats(tknotvector.knotlist, 0);
+    tkspec.inkend = new CArrayOfFloats(tknotvector.knotlist,
+                                       tknotvector.knotcount);
+    tkspec.prestride = tknotvector.stride;
+    tkspec.order = tknotvector.order;
+    tkspec.next = null;
+  }
+
+  /**
+   * Preselect and select knotspecs
+   */
+  public void select() {
+    // DONE
+    for (Knotspec knotspec = kspec; knotspec != null; knotspec = knotspec.next) {
+      knotspec.preselect();
+      knotspec.select();
+    }
+
+  }
+
+  /**
+   * Prepares for conversion
+   * @param ncoords number of coords
+   */
+  public void layout(int ncoords) {
+    // DONE
+    int stride = ncoords;
+    for (Knotspec knotspec = kspec; knotspec != null; knotspec = knotspec.next) {
+      knotspec.poststride = stride;
+      stride *= (knotspec.bend.getPointer() - knotspec.bbegin
+                 .getPointer())
+        * knotspec.order + knotspec.postoffset;
+      knotspec.preoffset *= knotspec.prestride;
+      knotspec.prewidth *= knotspec.poststride;
+      knotspec.postwidth *= knotspec.poststride;
+      knotspec.postoffset *= knotspec.poststride;
+      knotspec.ncoords = ncoords;
+    }
+    outcpts = new CArrayOfFloats(new float[stride]);
+
+  }
+
+  /**
+   * Prepares quilt for conversion
+   * @param quilt quilt to work with
+   */
+  public void setupquilt(Quilt quilt) {
+    // DONE
+    CArrayOfQuiltspecs qspec = new CArrayOfQuiltspecs(quilt.qspec);
+    quilt.eqspec = new CArrayOfQuiltspecs(qspec.getArray(), dim);
+    for (Knotspec knotspec = kspec; knotspec != null;) {
+      qspec.get().stride = knotspec.poststride;
+      qspec.get().width = knotspec.bend.getPointer()
+        - knotspec.bbegin.getPointer();
+      qspec.get().order = knotspec.order;
+      qspec.get().offset = knotspec.postoffset;
+      qspec.get().index = 0;
+      qspec.get().bdry[0] = (knotspec.kleft.getPointer() == knotspec.kfirst
+                             .getPointer()) ? 1 : 0;
+      qspec.get().bdry[1] = (knotspec.kright.getPointer() == knotspec.klast
+                             .getPointer()) ? 1 : 0;
+      qspec.get().breakpoints = new float[qspec.get().width + 1];
+      CArrayOfFloats k = new CArrayOfFloats(qspec.get().breakpoints, 0);
+      for (CArrayOfBreakpts bk = new CArrayOfBreakpts(knotspec.bbegin); bk
+             .getPointer() <= knotspec.bend.getPointer(); bk.pp()) {
+        k.set(bk.get().value);
+        k.pp();
+      }
+      knotspec = knotspec.next;
+      if (knotspec != null)
+        qspec.pp();
+    }
+    quilt.cpts = new CArrayOfFloats(outcpts);
+    quilt.next = null;
+  }
+
+  /**
+   * Copies array of control points to output array
+   * @param ctlarray control points array
+   */
+  public void copy(CArrayOfFloats ctlarray) {
+    // DONE
+    kspec.copy(ctlarray, outcpts);
+
+  }
+
+  /**
+   * Transforms knotspecs - conversion
+   */
+  public void transform() {
+    // DONE
+    Knotspec knotspec;
+    outcpts.setPointer(0);
+    for (knotspec = kspec; knotspec != null; knotspec = knotspec.next)
+      knotspec.istransformed = false;
+
+    for (knotspec = kspec; knotspec != null; knotspec = knotspec.next) {
+      for (Knotspec kspec2 = kspec; kspec2 != null; kspec2 = kspec2.next)
+        kspec2.kspectotrans = knotspec;
+      kspec.transform(outcpts);
+      knotspec.istransformed = true;
+    }
+
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
new file mode 100644
index 0000000..3378dba
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
@@ -0,0 +1,1167 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class working with curves and surfaces
+ * @author Tomas Hrasky
+ *
+ */
+public class Subdivider {
+  /**
+   * Cull type 
+   */
+  public static final int CULL_TRIVIAL_REJECT = 0;
+
+  /**
+   * Cull type
+   */
+  public static final int CULL_ACCEPT = 1;
+
+  /**
+   * Maximum trimming arcs
+   */
+  private static final int MAXARCS = 10;
+
+  /**
+   * Linked list of Quilts
+   */
+  Quilt qlist;
+
+  /**
+   * Object holding rendering honts information
+   */
+  private Renderhints renderhints;
+
+  /**
+   * Backend object
+   */
+  private Backend backend;
+
+  /**
+   * Number of subdivisions
+   */
+  private int subdivisions;
+
+  /**
+   * U step when using domain distance sampling 
+   */
+  private float domain_distance_u_rate;
+
+  /**
+   * Use domain distance sampling
+   */
+  private int is_domain_distance_sampling;
+
+  /**
+   * Initial class holding trimming arcs
+   */
+  private Bin initialbin;
+
+  /**
+   * Not used
+   */
+  private boolean showDegenerate;
+
+  /**
+   * Is triming arc type bezier arc
+   */
+  private boolean isArcTypeBezier;
+
+  /**
+   * Breakpoints in v direction
+   */
+  private Flist tpbrkpts;
+
+  /**
+   * Breakpoints in u direction
+   */
+  private Flist spbrkpts;
+
+  /**
+   * Unused
+   */
+  private int s_index;
+
+  /**
+   * Head of linked list of trimming arcs
+   */
+  private Arc pjarc;
+
+  /**
+   * Class tesselating trimming arcs
+   */
+  private ArcTesselator arctesselator;
+
+  /**
+   * Unused
+   */
+  private int t_index;
+
+  /**
+   * Breakpoints
+   */
+  private Flist smbrkpts;
+
+  /**
+   * Not used
+   */
+  private float[] stepsizes;
+
+  /**
+   * Domain distance in V direction
+   */
+  private float domain_distance_v_rate;
+
+  /**
+   * Initializes quilt list
+   */
+  public void beginQuilts(Backend backend) {
+    // DONE
+    qlist = null;
+    renderhints = new Renderhints();
+    this.backend = backend;
+
+    initialbin = new Bin();
+    arctesselator = new ArcTesselator();
+  }
+
+  /**
+   * Adds quilt to linked list
+   * @param quilt added quilt
+   */
+  public void addQuilt(Quilt quilt) {
+    // DONE
+    if (qlist == null)
+      qlist = quilt;
+    else {
+      quilt.next = qlist;
+      qlist = quilt;
+    }
+
+  }
+
+  /**
+   * Empty method
+   */
+  public void endQuilts() {
+    // DONE
+  }
+
+  /**
+   * Draws a surface
+   */
+  public void drawSurfaces() {
+    renderhints.init();
+
+    if (qlist == null) {
+      //				System.out.println("qlist is null");
+      return;
+    }
+
+    for (Quilt q = qlist; q != null; q = q.next) {
+      if (q.isCulled() == CULL_TRIVIAL_REJECT) {
+        freejarcs(initialbin);
+        return;
+      }
+    }
+
+    float[] from = new float[2];
+    float[] to = new float[2];
+
+    spbrkpts = new Flist();
+    tpbrkpts = new Flist();
+    qlist.getRange(from, to, spbrkpts, tpbrkpts);
+
+    boolean optimize = (is_domain_distance_sampling > 0 && (renderhints.display_method != NurbsConsts.N_OUTLINE_PATCH));
+
+    // TODO decide whether to optimize (when there is gluNurbsProperty implemented)
+    optimize = true;
+
+    if (!initialbin.isnonempty()) {
+      if (!optimize) {
+        makeBorderTrim(from, to);
+      }
+    } else {
+      float[] rate = new float[2];
+      qlist.findRates(spbrkpts, tpbrkpts, rate);
+      //				System.out.println("subdivider.drawsurfaces decompose");
+    }
+
+    backend.bgnsurf(renderhints.wiretris, renderhints.wirequads);
+
+    // TODO partition test
+
+    if (!initialbin.isnonempty() && optimize) {
+
+      int i, j;
+      int num_u_steps;
+      int num_v_steps;
+      for (i = spbrkpts.start; i < spbrkpts.end - 1; i++) {
+        for (j = tpbrkpts.start; j < tpbrkpts.end - 1; j++) {
+          float[] pta = new float[2];
+          float[] ptb = new float[2];
+
+          pta[0] = spbrkpts.pts[i];
+          ptb[0] = spbrkpts.pts[i + 1];
+          pta[1] = tpbrkpts.pts[j];
+          ptb[1] = tpbrkpts.pts[j + 1];
+          qlist.downloadAll(pta, ptb, backend);
+
+          num_u_steps = (int) (domain_distance_u_rate * (ptb[0] - pta[0]));
+          num_v_steps = (int) (domain_distance_v_rate * (ptb[1] - pta[1]));
+
+          if (num_u_steps <= 0)
+            num_u_steps = 1;
+          if (num_v_steps <= 0)
+            num_v_steps = 1;
+
+          backend.surfgrid(pta[0], ptb[0], num_u_steps, ptb[1],
+                           pta[1], num_v_steps);
+          backend.surfmesh(0, 0, num_u_steps, num_v_steps);
+
+        }
+      }
+
+    } else
+
+      subdivideInS(initialbin);
+
+    backend.endsurf();
+  }
+
+  /**
+   * Empty method
+   * @param initialbin2
+   */
+  private void freejarcs(Bin initialbin2) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.freejarcs");
+  }
+
+  /**
+   * Subdivide in U direction
+   * @param source Trimming arcs source
+   */
+  private void subdivideInS(Bin source) {
+    // DONE
+    if (renderhints.display_method == NurbsConsts.N_OUTLINE_PARAM) {
+      outline(source);
+      freejarcs(source);
+    } else {
+      setArcTypeBezier();
+      setNonDegenerate();
+      splitInS(source, spbrkpts.start, spbrkpts.end);
+    }
+
+  }
+
+  /**
+   * Split in U direction
+   * @param source Trimming arcs source
+   * @param start breakpoints start
+   * @param end breakpoints end
+   */
+  private void splitInS(Bin source, int start, int end) {
+    // DONE
+    if (source.isnonempty()) {
+      if (start != end) {
+        int i = start + (end - start) / 2;
+        Bin left = new Bin();
+        Bin right = new Bin();
+
+        split(source, left, right, 0, spbrkpts.pts[i]);
+        splitInS(left, start, i);
+        splitInS(right, i + 1, end);
+      } else {
+        if (start == spbrkpts.start || start == spbrkpts.end) {
+          freejarcs(source);
+        } else if (renderhints.display_method == NurbsConsts.N_OUTLINE_PARAM_S) {
+          outline(source);
+          freejarcs(source);
+        } else {
+          setArcTypeBezier();
+          setNonDegenerate();
+          s_index = start;
+          splitInT(source, tpbrkpts.start, tpbrkpts.end);
+        }
+      }
+    } else{
+      //				System.out.println("Source is empty - subdivider.splitins");
+    }
+  }
+
+  /**
+   * Split in V direction
+   * @param source
+   * @param start
+   * @param end
+   */
+  private void splitInT(Bin source, int start, int end) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.splitint");
+
+    if (source.isnonempty()) {
+      if (start != end) {
+        int i = start + (end - start) / 2;
+        Bin left = new Bin();
+        Bin right = new Bin();
+        split(source, left, right, 1, tpbrkpts.pts[i + 1]);
+        splitInT(left, start, i);
+        splitInT(right, i + 1, end);
+      } else {
+        if (start == tpbrkpts.start || start == tpbrkpts.end) {
+          freejarcs(source);
+        } else if (renderhints.display_method == NurbsConsts.N_OUTLINE_PARAM_ST) {
+          outline(source);
+          freejarcs(source);
+        } else {
+          t_index = start;
+          setArcTypeBezier();
+          setDegenerate();
+
+          float[] pta = new float[2];
+          float[] ptb = new float[2];
+
+          pta[0] = spbrkpts.pts[s_index - 1];
+          pta[1] = tpbrkpts.pts[t_index - 1];
+
+          ptb[0] = spbrkpts.pts[s_index];
+          ptb[1] = tpbrkpts.pts[t_index];
+          qlist.downloadAll(pta, ptb, backend);
+
+          Patchlist patchlist = new Patchlist(qlist, pta, ptb);
+
+          samplingSplit(source, patchlist,
+                        renderhints.maxsubdivisions, 0);
+          setNonDegenerate();
+          setArcTypeBezier();
+        }
+      }
+    }
+
+  }
+
+  /**
+   * Sample 
+   * @param source
+   * @param patchlist
+   * @param subdivisions
+   * @param param
+   */
+  private void samplingSplit(Bin source, Patchlist patchlist,
+                             int subdivisions, int param) {
+    // DONE
+    if (!source.isnonempty())
+      return;
+    if (patchlist.cullCheck() == CULL_TRIVIAL_REJECT) {
+      freejarcs(source);
+      return;
+    }
+
+    patchlist.getstepsize();
+    if (renderhints.display_method == NurbsConsts.N_OUTLINE_PATCH) {
+      tesselation(source, patchlist);
+      outline(source);
+      freejarcs(source);
+      return;
+    }
+
+    tesselation(source, patchlist);
+    if (patchlist.needsSamplingSubdivision() && subdivisions > 0) {
+      if (!patchlist.needsSubdivision(0)) {
+        param = 1;
+      } else if (patchlist.needsSubdivision(1))
+        param = 0;
+      else
+        param = 1 - param;
+
+      Bin left = new Bin();
+      Bin right = new Bin();
+
+      float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
+
+      split(source, left, right, param, mid);
+      Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
+      samplingSplit(left, subpatchlist, subdivisions - 1, param);
+      samplingSplit(right, subpatchlist, subdivisions - 1, param);
+    } else {
+      setArcTypePwl();
+      setDegenerate();
+      nonSamplingSplit(source, patchlist, subdivisions, param);
+      setDegenerate();
+      setArcTypeBezier();
+    }
+  }
+
+  /**
+   * Not used
+   * @param source
+   * @param patchlist
+   * @param subdivisions
+   * @param param
+   */
+  private void nonSamplingSplit(Bin source, Patchlist patchlist,
+                                int subdivisions, int param) {
+    // DONE
+    if (patchlist.needsNonSamplingSubdivision() && subdivisions > 0) {
+      param = 1 - param;
+
+      Bin left = new Bin();
+      Bin right = new Bin();
+
+      float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
+      split(source, left, right, param, mid);
+      Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
+      if (left.isnonempty()) {
+        if (subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT)
+          freejarcs(left);
+        else
+          nonSamplingSplit(left, subpatchlist, subdivisions - 1,
+                           param);
+      }
+      if (right.isnonempty()) {
+        if (patchlist.cullCheck() == CULL_TRIVIAL_REJECT)
+          freejarcs(right);
+        else
+          nonSamplingSplit(right, subpatchlist, subdivisions - 1,
+                           param);
+      }
+    } else {
+      patchlist.bbox();
+      backend.patch(patchlist.pspec[0].range[0],
+                    patchlist.pspec[0].range[1], patchlist.pspec[1].range[0],
+                    patchlist.pspec[1].range[1]);
+      if (renderhints.display_method == NurbsConsts.N_OUTLINE_SUBDIV) {
+        outline(source);
+        freejarcs(source);
+      } else {
+        setArcTypePwl();
+        setDegenerate();
+        findIrregularS(source);
+        monosplitInS(source, smbrkpts.start, smbrkpts.end);
+      }
+    }
+
+  }
+
+  /**
+   * Not used
+   * @param source
+   * @param start
+   * @param end
+   */
+  private void monosplitInS(Bin source, int start, int end) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.monosplitins");
+  }
+
+  /**
+   * Not used
+   * @param source
+   */
+  private void findIrregularS(Bin source) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.findIrregularS");
+  }
+
+  /**
+   * Not used
+   */
+  private void setArcTypePwl() {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.setarctypepwl");
+  }
+
+  /**
+   * Not used
+   * @param source
+   * @param patchlist
+   */
+  private void tesselation(Bin source, Patchlist patchlist) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.tesselation");
+  }
+
+  /**
+   * Not used
+   */
+  private void setDegenerate() {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.setdegenerate");
+  }
+
+  /**
+   * Not used
+   * @param bin
+   * @param left
+   * @param right
+   * @param param
+   * @param value
+   */
+  private void split(Bin bin, Bin left, Bin right, int param, float value) {
+    // DONE
+    Bin intersections = new Bin();
+    Bin unknown = new Bin();
+
+    partition(bin, left, intersections, right, unknown, param, value);
+
+    int count = intersections.numarcs();
+    // TODO jumpbuffer ??
+
+    if (count % 2 == 0) {
+
+      Arc[] arclist = new Arc[MAXARCS];
+      CArrayOfArcs list;
+      if (count >= MAXARCS) {
+        list = new CArrayOfArcs(new Arc[count]);
+      } else {
+        list = new CArrayOfArcs(arclist);
+      }
+
+      CArrayOfArcs last, lptr;
+      Arc jarc;
+
+      for (last = new CArrayOfArcs(list); (jarc = intersections
+                                           .removearc()) != null; last.pp())
+        last.set(jarc);
+
+      if (param == 0) {// sort into incrasing t order
+        ArcSdirSorter sorter = new ArcSdirSorter(this);
+        sorter.qsort(list, count);
+
+        for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
+               .getPointer(); lptr.raisePointerBy(2))
+          check_s(lptr.get(), lptr.getRelative(1));
+        for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
+               .getPointer(); lptr.raisePointerBy(2))
+          join_s(left, right, lptr.get(), lptr.getRelative(1));
+        for (lptr = new CArrayOfArcs(list); lptr.getPointer() != last
+               .getPointer(); lptr.pp()) {
+          if (lptr.get().head()[0] <= value
+              && lptr.get().tail()[0] <= value)
+            left.addarc(lptr.get());
+          else
+            right.addarc(lptr.get());
+        }
+
+      } else {// sort into decreasing s order
+        ArcTdirSorter sorter = new ArcTdirSorter(this);
+        sorter.qsort(list, count);
+
+        for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
+               .getPointer(); lptr.raisePointerBy(2))
+          check_t(lptr.get(), lptr.getRelative(1));
+        for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
+               .getPointer(); lptr.raisePointerBy(2))
+          join_t(left, right, lptr.get(), lptr.getRelative(1));
+        for (lptr = new CArrayOfArcs(list); lptr.getPointer() != last
+               .getPointer(); lptr.raisePointerBy(2)) {
+          if (lptr.get().head()[0] <= value
+              && lptr.get().tail()[0] <= value)
+            left.addarc(lptr.get());
+          else
+            right.addarc(lptr.get());
+        }
+
+      }
+
+      unknown.adopt();
+    }
+  }
+
+  /**
+   * Not used
+   * @param left
+   * @param right
+   * @param arc
+   * @param relative
+   */
+  private void join_t(Bin left, Bin right, Arc arc, Arc relative) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.join_t");
+  }
+
+  /**
+   * Not used
+   * @param arc
+   * @param relative
+   */
+  private void check_t(Arc arc, Arc relative) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.check_t");
+  }
+
+  /**
+   * Not used
+   * @param left
+   * @param right
+   * @param jarc1
+   * @param jarc2
+   */
+  private void join_s(Bin left, Bin right, Arc jarc1, Arc jarc2) {
+    // DONE
+    if (!jarc1.getitail())
+      jarc1 = jarc1.next;
+    if (!jarc2.getitail())
+      jarc2 = jarc2.next;
+
+    float s = jarc1.tail()[0];
+    float t1 = jarc1.tail()[1];
+    float t2 = jarc2.tail()[1];
+
+    if (t1 == t2) {
+      simplelink(jarc1, jarc2);
+    } else {
+      Arc newright = new Arc(Arc.ARC_RIGHT);
+      Arc newleft = new Arc(Arc.ARC_LEFT);
+      if (isBezierArcType()) {
+        arctesselator.bezier(newright, s, s, t1, t2);
+        arctesselator.bezier(newleft, s, s, t2, t1);
+      } else {
+        arctesselator.pwl_right(newright, s, t1, t2, stepsizes[0]);
+        arctesselator.pwl_left(newright, s, t2, t1, stepsizes[2]);
+      }
+      link(jarc1, jarc2, newright, newleft);
+      left.addarc(newright);
+      right.addarc(newleft);
+    }
+
+  }
+
+  /**
+   * Not used
+   * @param jarc1
+   * @param jarc2
+   * @param newright
+   * @param newleft
+   */
+  private void link(Arc jarc1, Arc jarc2, Arc newright, Arc newleft) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.link");
+  }
+
+  /**
+   * Not used
+   * @return true
+   */
+  private boolean isBezierArcType() {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.isbezierarc");
+    return true;
+  }
+
+  /**
+   * Not used
+   * @param jarc1
+   * @param jarc2
+   */
+  private void simplelink(Arc jarc1, Arc jarc2) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.simplelink");
+  }
+
+  /**
+   * Not used
+   * @param arc
+   * @param relative
+   */
+  private void check_s(Arc arc, Arc relative) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.check_s");
+
+  }
+
+  /**
+   * Not used
+   * @param bin
+   * @param left
+   * @param intersections
+   * @param right
+   * @param unknown
+   * @param param
+   * @param value
+   */
+  private void partition(Bin bin, Bin left, Bin intersections, Bin right,
+                         Bin unknown, int param, float value) {
+
+    Bin headonleft = new Bin();
+    Bin headonright = new Bin();
+    Bin tailonleft = new Bin();
+    Bin tailonright = new Bin();
+
+    for (Arc jarc = bin.removearc(); jarc != null; jarc = bin.removearc()) {
+      float tdiff = jarc.tail()[param] - value;
+      float hdiff = jarc.head()[param] - value;
+
+      if (tdiff > 0) {
+        if (hdiff > 0) {
+          right.addarc(jarc);
+        } else if (hdiff == 0) {
+          tailonright.addarc(jarc);
+        } else {
+          Arc jtemp;
+          switch (arc_split(jarc, param, value, 0)) {
+          case 2:
+            tailonright.addarc(jarc);
+            headonleft.addarc(jarc.next);
+            break;
+            // TODO rest cases
+          default:
+            System.out
+              .println("TODO subdivider.partition rest cases");
+            break;
+          }
+        }
+      } else if (tdiff == 0) {
+        if (hdiff > 0) {
+          headonright.addarc(jarc);
+        } else if (hdiff == 0) {
+          unknown.addarc(jarc);
+        } else {
+          headonright.addarc(jarc);
+        }
+      } else {
+        if (hdiff > 0) {
+          // TODO rest
+          //						System.out.println("TODO subdivider.partition rest of else");
+        } else if (hdiff == 0) {
+          tailonleft.addarc(jarc);
+        } else {
+          left.addarc(jarc);
+        }
+      }
+
+    }
+    if (param == 0) {
+      classify_headonleft_s(headonleft, intersections, left, value);
+      classify_tailonleft_s(tailonleft, intersections, left, value);
+      classify_headonright_s(headonright, intersections, right, value);
+      classify_tailonright_s(tailonright, intersections, right, value);
+    } else {
+      classify_headonleft_t(headonleft, intersections, left, value);
+      classify_tailonleft_t(tailonleft, intersections, left, value);
+      classify_headonright_t(headonright, intersections, right, value);
+      classify_tailonright_t(tailonright, intersections, right, value);
+    }
+  }
+
+  /**
+   * Not used
+   * @param tailonright
+   * @param intersections
+   * @param right
+   * @param value
+   */
+  private void classify_tailonright_t(Bin tailonright, Bin intersections,
+                                      Bin right, float value) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.classify_tailonright_t");
+
+  }
+
+  /**
+   * Not used
+   * @param bin
+   * @param in
+   * @param out
+   * @param val
+   */
+  private void classify_tailonleft_s(Bin bin, Bin in, Bin out, float val) {
+
+    // DONE
+    Arc j;
+    while ((j = bin.removearc()) != null) {
+      j.clearitail();
+
+      float diff = j.next.head()[0] - val;
+      if (diff > 0) {
+        in.addarc(j);
+      } else if (diff < 0) {
+        if (ccwTurn_sl(j, j.next))
+          out.addarc(j);
+        else
+          in.addarc(j);
+      } else {
+        if (j.next.tail()[1] > j.next.head()[1])
+          in.addarc(j);
+        else
+          out.addarc(j);
+      }
+    }
+
+  }
+
+  /**
+   * Not used
+   * @param bin
+   * @param in
+   * @param out
+   * @param val
+   */
+  private void classify_headonright_s(Bin bin, Bin in, Bin out, float val) {
+    // DONE
+    Arc j;
+    while ((j = bin.removearc()) != null) {
+      j.setitail();
+
+      float diff = j.prev.tail()[0] - val;
+      if (diff > 0) {
+        if (ccwTurn_sr(j.prev, j))
+          out.addarc(j);
+        else
+          in.addarc(j);
+      } else if (diff < 0) {
+        out.addarc(j);
+      } else {
+        if (j.prev.tail()[1] > j.prev.head()[1])
+          out.addarc(j);
+        else
+          in.addarc(j);
+      }
+    }
+  }
+
+  /**
+   * Not used
+   * @param prev
+   * @param j
+   * @return false
+   */
+  private boolean ccwTurn_sr(Arc prev, Arc j) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO ccwTurn_sr");
+    return false;
+  }
+
+  /**
+   * Not used
+   * @param headonright
+   * @param intersections
+   * @param right
+   * @param value
+   */
+  private void classify_headonright_t(Bin headonright, Bin intersections,
+                                      Bin right, float value) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.classify_headonright_t");
+  }
+
+  /**
+   * Not used
+   * @param tailonleft
+   * @param intersections
+   * @param left
+   * @param value
+   */
+  private void classify_tailonleft_t(Bin tailonleft, Bin intersections,
+                                     Bin left, float value) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.classify_tailonleft_t");
+  }
+
+  /**
+   * Not used
+   * @param bin
+   * @param in
+   * @param out
+   * @param val
+   */
+  private void classify_headonleft_t(Bin bin, Bin in, Bin out, float val) {
+    // DONE
+    Arc j;
+    while ((j = bin.removearc()) != null) {
+      j.setitail();
+
+      float diff = j.prev.tail()[1] - val;
+      if (diff > 0) {
+        out.addarc(j);
+      } else if (diff < 0) {
+        if (ccwTurn_tl(j.prev, j))
+          out.addarc(j);
+        else
+          in.addarc(j);
+      } else {
+        if (j.prev.tail()[0] > j.prev.head()[0])
+          out.addarc(j);
+        else
+          in.addarc(j);
+      }
+    }
+  }
+
+  /**
+   * Not used
+   * @param prev
+   * @param j
+   * @return false
+   */
+  private boolean ccwTurn_tl(Arc prev, Arc j) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.ccwTurn_tl");
+    return false;
+  }
+
+  /**
+   * Not used
+   * @param bin
+   * @param in
+   * @param out
+   * @param val
+   */
+  private void classify_tailonright_s(Bin bin, Bin in, Bin out, float val) {
+    // DONE
+    Arc j;
+    while ((j = bin.removearc()) != null) {
+      j.clearitail();
+
+      float diff = j.next.head()[0] - val;
+      if (diff > 0) {
+        if (ccwTurn_sr(j, j.next))
+          out.addarc(j);
+        else
+          in.addarc(j);
+      } else if (diff < 0) {
+        in.addarc(j);
+      } else {
+        if (j.next.tail()[1] > j.next.head()[1])
+          out.addarc(j);
+        else
+          in.addarc(j);
+      }
+    }
+
+  }
+
+  /**
+   * Not used
+   * @param bin
+   * @param in
+   * @param out
+   * @param val
+   */
+  private void classify_headonleft_s(Bin bin, Bin in, Bin out, float val) {
+    // DONE
+    Arc j;
+    while ((j = bin.removearc()) != null) {
+      j.setitail();
+
+      float diff = j.prev.tail()[0] - val;
+      if (diff > 0) {
+        out.addarc(j);
+      } else if (diff < 0) {
+        if (ccwTurn_sl(j.prev, j))
+          out.addarc(j);
+        else
+          in.addarc(j);
+      } else {
+        if (j.prev.tail()[1] > j.prev.head()[1])
+          in.addarc(j);
+        else
+          out.addarc(j);
+      }
+    }
+
+  }
+
+  /**
+   * Not used
+   * @param prev
+   * @param j
+   * @return false
+   */
+  private boolean ccwTurn_sl(Arc prev, Arc j) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.ccwTurn_sl");
+    return false;
+  }
+
+  /**
+   * Not used
+   * @param jarc
+   * @param param
+   * @param value
+   * @param i
+   * @return 0
+   */
+  private int arc_split(Arc jarc, int param, float value, int i) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.arc_split");
+    return 0;
+  }
+
+  /**
+   * Not used
+   */
+  private void setNonDegenerate() {
+    // DONE
+    this.showDegenerate = false;
+
+  }
+
+  /**
+   * sets trimming arc default type to bezier
+   */
+  private void setArcTypeBezier() {
+    // DONE
+    isArcTypeBezier = true;
+  }
+
+  /**
+   * Not used
+   * @param source
+   */
+  private void outline(Bin source) {
+    // TODO Auto-generated method stub
+    //			System.out.println("TODO subdivider.outline");
+  }
+
+  /**
+   * Makes default trim along surface borders
+   * @param from range beginnings
+   * @param to range ends
+   */
+  private void makeBorderTrim(float[] from, float[] to) {
+    // DONE
+    float smin = from[0];
+    float smax = to[0];
+
+    float tmin = from[1];
+    float tmax = to[1];
+
+    pjarc = null;
+    Arc jarc = null;
+
+    jarc = new Arc(Arc.ARC_BOTTOM);
+    arctesselator.bezier(jarc, smin, smax, tmin, tmin);
+    initialbin.addarc(jarc);
+    pjarc = jarc.append(pjarc);
+
+    jarc = new Arc(Arc.ARC_RIGHT);
+    arctesselator.bezier(jarc, smax, smax, tmin, tmax);
+    initialbin.addarc(jarc);
+    pjarc = jarc.append(pjarc);
+
+    jarc = new Arc(Arc.ARC_TOP);
+    arctesselator.bezier(jarc, smax, smin, tmax, tmax);
+    initialbin.addarc(jarc);
+    pjarc = jarc.append(pjarc);
+
+    jarc = new Arc(Arc.ARC_LEFT);
+    arctesselator.bezier(jarc, smin, smin, tmax, tmin);
+    initialbin.addarc(jarc);
+    jarc = jarc.append(pjarc);
+
+    // assert (jarc.check() == true);
+  }
+
+  /**
+   * Draws NURBS curve
+   */
+  public void drawCurves() {
+    // DONE
+    float[] from = new float[1];
+    float[] to = new float[1];
+
+    Flist bpts = new Flist();
+    qlist.getRange(from, to, bpts);
+
+    renderhints.init();
+
+    backend.bgncurv();
+
+    for (int i = bpts.start; i < bpts.end - 1; i++) {
+      float[] pta = new float[1];
+      float[] ptb = new float[1];
+      pta[0] = bpts.pts[i];
+      ptb[0] = bpts.pts[i + 1];
+
+      qlist.downloadAll(pta, ptb, backend);
+      Curvelist curvelist = new Curvelist(qlist, pta, ptb);
+      samplingSplit(curvelist, renderhints.maxsubdivisions);
+    }
+    backend.endcurv();
+  }
+
+  /**
+   * Samples a curve in case of need, or sends curve to backend
+   * @param curvelist list of curves
+   * @param maxsubdivisions maximum number of subdivisions
+   */
+  private void samplingSplit(Curvelist curvelist, int maxsubdivisions) {
+    if (curvelist.cullCheck() == CULL_TRIVIAL_REJECT)
+      return;
+
+    curvelist.getstepsize();
+
+    if (curvelist.needsSamplingSubdivision() && (subdivisions > 0)) {
+      // TODO kód
+      //				System.out.println("TODO subdivider-needsSamplingSubdivision");
+    } else {
+      int nu = (int) (1 + curvelist.range[2] / curvelist.stepsize);
+      backend.curvgrid(curvelist.range[0], curvelist.range[1], nu);
+      backend.curvmesh(0, nu);
+    }
+
+  }
+
+  /**
+   * Sets new domain_distance_u_rate value
+   * @param d new domain_distance_u_rate value
+
+  */
+  public void set_domain_distance_u_rate(double d) {
+    // DONE
+    domain_distance_u_rate = (float) d;
+  }
+
+  /**
+   * Sets new domain_distance_v_rate value
+   * @param d new domain_distance_v_rate value
+   */
+  public void set_domain_distance_v_rate(double d) {
+    // DONE
+    domain_distance_v_rate = (float) d;
+  }
+
+  /**
+   * Sets new is_domain_distance_sampling value
+   * @param i new is_domain_distance_sampling value
+   */
+  public void set_is_domain_distance_sampling(int i) {
+    // DONE
+    this.is_domain_distance_sampling = i;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/SurfaceEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/SurfaceEvaluator.java
new file mode 100644
index 0000000..35ad1b7
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/SurfaceEvaluator.java
@@ -0,0 +1,111 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class rendering surfaces with OpenGL
+ * @author Tomas Hrasky
+ *
+ */
+public interface SurfaceEvaluator {
+
+  /**
+   * Pushes eval bit
+   */
+  public void bgnmap2f() ;
+
+  /**
+   * Sets  glPolygonMode
+   * @param style polygon mode (N_MESHFILL/N_MESHLINE/N_MESHPOINT)
+   */
+  public void polymode(int style) ;
+
+  /**
+   * Pops all attributes
+   */
+  public void endmap2f() ;
+
+  /**
+   * Empty method
+   * @param ulo
+   * @param uhi
+   * @param vlo
+   * @param vhi
+   */
+  public void domain2f(float ulo, float uhi, float vlo, float vhi) ;
+
+  /**
+   * Defines 2D mesh
+   * @param nu number of steps in u direction
+   * @param u0 lowest u
+   * @param u1 highest u
+   * @param nv number of steps in v direction
+   * @param v0 lowest v
+   * @param v1 highest v
+   */
+  public void mapgrid2f(int nu, float u0, float u1, int nv, float v0, float v1) ;
+
+  /**
+   * Evaluates surface
+   * @param style surface style
+   * @param umin minimum U
+   * @param umax maximum U
+   * @param vmin minimum V
+   * @param vmax maximum V
+   */
+  public void mapmesh2f(int style, int umin, int umax, int vmin, int vmax) ;
+
+  /**
+   * Initializes evaluator
+   * @param type surface type
+   * @param ulo lowest u
+   * @param uhi highest u
+   * @param ustride number of objects between control points in u direction
+   * @param uorder surface order in u direction
+   * @param vlo lowest v
+   * @param vhi highest v
+   * @param vstride number of control points' coords
+   * @param vorder surface order in v direction
+   * @param pts control points
+   */
+  public void map2f(int type, float ulo, float uhi, int ustride, int uorder,
+                    float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) ;
+
+  /**
+   * Calls opengl enable
+   * @param type what to enable
+   */
+  public void enable(int type) ;
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java
new file mode 100644
index 0000000..e88d697
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java
@@ -0,0 +1,56 @@
+package jogamp.opengl.glu.nurbs;
+
+/*
+ ** License Applicability. Except to the extent portions of this file are
+ ** made subject to an alternative license as permitted in the SGI Free
+ ** Software License B, Version 2.0 (the "License"), the contents of this
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Holds vertex used in trim
+ * 
+ * @author Tomas Hrasky
+ * 
+ */
+public class TrimVertex {
+
+  /**
+   * Trim vertex coords
+   */
+  public float[] param;
+
+  /**
+   * Makes new empty trim vertex
+   */
+  public TrimVertex() {
+    param = new float[2];
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
new file mode 100644
index 0000000..3d669d9
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
@@ -0,0 +1,79 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 2.0 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ * 
+ * http://oss.sgi.com/projects/FreeB
+ * 
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ * 
+ * NOTE:  The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License").   Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License").  This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted.  Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ * 
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package jogamp.opengl.glu.registry;
+
+import javax.media.opengl.glu.GLU;
+
+/**
+ *
+ * @author  Administrator
+ */
+public class Registry {
+  
+  /** Creates a new instance of Registry */
+  public Registry() {
+  }
+  
+  public static String gluGetString(int name) {
+    if( name == GLU.GLU_VERSION ) {
+      return( "1.3" );
+    } else if( name == GLU.GLU_EXTENSIONS ) {
+      return( "GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess " );
+    }
+    return( null );
+  }
+  
+  public static boolean gluCheckExtension( String extName, String extString ) {
+    if( extName == null || extString == null ) {
+      return( false );
+    }
+    if ((extString.indexOf(extName + " ") >= 0) ||
+        extString.endsWith(extName) ||
+        extString.equals(extName)) {
+        return true;
+    }
+    return false;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/ActiveRegion.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/ActiveRegion.java
new file mode 100644
index 0000000..13c226a
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/ActiveRegion.java
@@ -0,0 +1,69 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+
+class ActiveRegion {
+    GLUhalfEdge eUp;		/* upper edge, directed right to left */
+    DictNode nodeUp;	/* dictionary node corresponding to eUp */
+    int windingNumber;	/* used to determine which regions are
+                                 * inside the polygon */
+    boolean inside;		/* is this region inside the polygon? */
+    boolean sentinel;	/* marks fake edges at t = +/-infinity */
+    boolean dirty;		/* marks regions where the upper or lower
+                                 * edge has changed, but we haven't checked
+                                 * whether they intersect yet */
+    boolean fixUpperEdge;	/* marks temporary edges introduced when
+                                 * we process a "right vertex" (one without
+                                 * any edges leaving to the right) */
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/CachedVertex.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/CachedVertex.java
new file mode 100644
index 0000000..91072e3
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/CachedVertex.java
@@ -0,0 +1,58 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class CachedVertex {
+    public double[] coords = new double[3];
+    public Object data;
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java
new file mode 100644
index 0000000..3ac9df6
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java
@@ -0,0 +1,140 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class Dict {
+    DictNode head;
+    Object frame;
+    DictLeq leq;
+
+    private Dict() {
+    }
+
+    static Dict dictNewDict(Object frame, DictLeq leq) {
+        Dict dict = new Dict();
+        dict.head = new DictNode();
+
+        dict.head.key = null;
+        dict.head.next = dict.head;
+        dict.head.prev = dict.head;
+
+        dict.frame = frame;
+        dict.leq = leq;
+
+        return dict;
+    }
+
+    static void dictDeleteDict(Dict dict) {
+        dict.head = null;
+        dict.frame = null;
+        dict.leq = null;
+    }
+
+    static DictNode dictInsert(Dict dict, Object key) {
+        return dictInsertBefore(dict, dict.head, key);
+    }
+
+    static DictNode dictInsertBefore(Dict dict, DictNode node, Object key) {
+        do {
+            node = node.prev;
+        } while (node.key != null && !dict.leq.leq(dict.frame, node.key, key));
+
+        DictNode newNode = new DictNode();
+        newNode.key = key;
+        newNode.next = node.next;
+        node.next.prev = newNode;
+        newNode.prev = node;
+        node.next = newNode;
+
+        return newNode;
+    }
+
+    static Object dictKey(DictNode aNode) {
+        return aNode.key;
+    }
+
+    static DictNode dictSucc(DictNode aNode) {
+        return aNode.next;
+    }
+
+    static DictNode dictPred(DictNode aNode) {
+        return aNode.prev;
+    }
+
+    static DictNode dictMin(Dict aDict) {
+        return aDict.head.next;
+    }
+
+    static DictNode dictMax(Dict aDict) {
+        return aDict.head.prev;
+    }
+
+    static void dictDelete(Dict dict, DictNode node) {
+        node.next.prev = node.prev;
+        node.prev.next = node.next;
+    }
+
+    static DictNode dictSearch(Dict dict, Object key) {
+        DictNode node = dict.head;
+
+        do {
+            node = node.next;
+        } while (node.key != null && !(dict.leq.leq(dict.frame, key, node.key)));
+
+        return node;
+    }
+
+    public interface DictLeq {
+        boolean leq(Object frame, Object key1, Object key2);
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/DictNode.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/DictNode.java
new file mode 100644
index 0000000..93cf231
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/DictNode.java
@@ -0,0 +1,59 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class DictNode {
+    Object key;
+    DictNode next;
+    DictNode prev;
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUface.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUface.java
new file mode 100644
index 0000000..b15bf71
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUface.java
@@ -0,0 +1,65 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class GLUface {
+    public GLUface next;		/* next face (never NULL) */
+    public GLUface prev;		/* previous face (never NULL) */
+    public GLUhalfEdge anEdge;	/* a half edge with this left face */
+    public Object data;		/* room for client's data */
+
+    /* Internal data (keep hidden) */
+    public GLUface trail;		/* "stack" for conversion to strips */
+    public boolean marked;		/* flag for conversion to strips */
+    public boolean inside;		/* this face is in the polygon interior */
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
new file mode 100644
index 0000000..385a438
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
@@ -0,0 +1,71 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class GLUhalfEdge {
+    public GLUhalfEdge next;		/* doubly-linked list (prev==Sym->next) */
+    public GLUhalfEdge Sym;		/* same edge, opposite direction */
+    public GLUhalfEdge Onext;		/* next edge CCW around origin */
+    public GLUhalfEdge Lnext;		/* next edge CCW around left face */
+    public GLUvertex Org;		/* origin vertex (Overtex too long) */
+    public jogamp.opengl.glu.tessellator.GLUface Lface;		/* left face */
+
+    /* Internal data (keep hidden) */
+    public jogamp.opengl.glu.tessellator.ActiveRegion activeRegion;	/* a region with this upper edge (sweep.c) */
+    public int winding;	/* change in winding number when crossing */
+    public boolean first;
+
+    public GLUhalfEdge(boolean first) {
+        this.first = first;
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUmesh.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUmesh.java
new file mode 100644
index 0000000..dfdf5be
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUmesh.java
@@ -0,0 +1,60 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class GLUmesh {
+    GLUvertex vHead = new GLUvertex();		/* dummy header for vertex list */
+    jogamp.opengl.glu.tessellator.GLUface fHead = new GLUface();		/* dummy header for face list */
+    jogamp.opengl.glu.tessellator.GLUhalfEdge eHead = new GLUhalfEdge(true);		/* dummy header for edge list */
+    jogamp.opengl.glu.tessellator.GLUhalfEdge eHeadSym = new GLUhalfEdge(false);	/* and its symmetric counterpart */
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
new file mode 100644
index 0000000..182820b
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
@@ -0,0 +1,646 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+import jogamp.opengl.glu.tessellator.*;
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+public class GLUtessellatorImpl implements GLUtessellator {
+    public static final int TESS_MAX_CACHE = 100;
+
+    private int state;		/* what begin/end calls have we seen? */
+
+    private GLUhalfEdge lastEdge;	/* lastEdge->Org is the most recent vertex */
+    GLUmesh mesh;		/* stores the input contours, and eventually
+                                   the tessellation itself */
+
+    /*** state needed for projecting onto the sweep plane ***/
+
+    double[] normal = new double[3];	/* user-specified normal (if provided) */
+    double[] sUnit = new double[3];	/* unit vector in s-direction (debugging) */
+    double[] tUnit = new double[3];	/* unit vector in t-direction (debugging) */
+
+    /*** state needed for the line sweep ***/
+
+    private double relTolerance;	/* tolerance for merging features */
+    int windingRule;	/* rule for determining polygon interior */
+    boolean fatalError;	/* fatal error: needed combine callback */
+
+    Dict dict;		/* edge dictionary for sweep line */
+    PriorityQ pq;		/* priority queue of vertex events */
+    GLUvertex event;		/* current sweep event being processed */
+
+    /*** state needed for rendering callbacks (see render.c) ***/
+
+    boolean flagBoundary;	/* mark boundary edges (use EdgeFlag) */
+    boolean boundaryOnly;	/* Extract contours, not triangles */
+    boolean avoidDegenerateTris; /* JOGL-specific hint to try to improve triangulation
+                                    by avoiding producing degenerate (zero-area) triangles;
+                                    has not been tested exhaustively and is therefore an option */
+
+    GLUface lonelyTriList;
+    /* list of triangles which could not be rendered as strips or fans */
+
+
+
+    /*** state needed to cache single-contour polygons for renderCache() */
+
+    private boolean flushCacheOnNextVertex;		/* empty cache on next vertex() call */
+    int cacheCount;		/* number of cached vertices */
+    CachedVertex[] cache = new CachedVertex[TESS_MAX_CACHE];	/* the vertex data */
+
+    /*** rendering callbacks that also pass polygon data  ***/
+    private Object polygonData;		/* client data for current polygon */
+
+    private GLUtessellatorCallback callBegin;
+    private GLUtessellatorCallback callEdgeFlag;
+    private GLUtessellatorCallback callVertex;
+    private GLUtessellatorCallback callEnd;
+//    private GLUtessellatorCallback callMesh;
+    private GLUtessellatorCallback callError;
+    private GLUtessellatorCallback callCombine;
+
+    private GLUtessellatorCallback callBeginData;
+    private GLUtessellatorCallback callEdgeFlagData;
+    private GLUtessellatorCallback callVertexData;
+    private GLUtessellatorCallback callEndData;
+//    private GLUtessellatorCallback callMeshData;
+    private GLUtessellatorCallback callErrorData;
+    private GLUtessellatorCallback callCombineData;
+
+    private static final double GLU_TESS_DEFAULT_TOLERANCE = 0.0;
+//    private static final int GLU_TESS_MESH = 100112;	/* void (*)(GLUmesh *mesh)	    */
+    private static GLUtessellatorCallback NULL_CB = new GLUtessellatorCallbackAdapter();
+
+//    #define MAX_FAST_ALLOC	(MAX(sizeof(EdgePair), \
+//                 MAX(sizeof(GLUvertex),sizeof(GLUface))))
+
+    private GLUtessellatorImpl() {
+        state = TessState.T_DORMANT;
+
+        normal[0] = 0;
+        normal[1] = 0;
+        normal[2] = 0;
+
+        relTolerance = GLU_TESS_DEFAULT_TOLERANCE;
+        windingRule = GLU.GLU_TESS_WINDING_ODD;
+        flagBoundary = false;
+        boundaryOnly = false;
+
+        callBegin = NULL_CB;
+        callEdgeFlag = NULL_CB;
+        callVertex = NULL_CB;
+        callEnd = NULL_CB;
+        callError = NULL_CB;
+        callCombine = NULL_CB;
+//        callMesh = NULL_CB;
+
+        callBeginData = NULL_CB;
+        callEdgeFlagData = NULL_CB;
+        callVertexData = NULL_CB;
+        callEndData = NULL_CB;
+        callErrorData = NULL_CB;
+        callCombineData = NULL_CB;
+
+        polygonData = null;
+
+        for (int i = 0; i < cache.length; i++) {
+            cache[i] = new CachedVertex();
+        }
+    }
+
+    static public GLUtessellator gluNewTess()
+    {
+        return new GLUtessellatorImpl();
+    }
+
+
+    private void makeDormant() {
+        /* Return the tessellator to its original dormant state. */
+
+        if (mesh != null) {
+            Mesh.__gl_meshDeleteMesh(mesh);
+        }
+        state = TessState.T_DORMANT;
+        lastEdge = null;
+        mesh = null;
+    }
+
+    private void requireState(int newState) {
+        if (state != newState) gotoState(newState);
+    }
+
+    private void gotoState(int newState) {
+        while (state != newState) {
+            /* We change the current state one level at a time, to get to
+             * the desired state.
+             */
+            if (state < newState) {
+                if (state == TessState.T_DORMANT) {
+                    callErrorOrErrorData(GLU.GLU_TESS_MISSING_BEGIN_POLYGON);
+                    gluTessBeginPolygon(null);
+                } else if (state == TessState.T_IN_POLYGON) {
+                    callErrorOrErrorData(GLU.GLU_TESS_MISSING_BEGIN_CONTOUR);
+                    gluTessBeginContour();
+                }
+            } else {
+                if (state == TessState.T_IN_CONTOUR) {
+                    callErrorOrErrorData(GLU.GLU_TESS_MISSING_END_CONTOUR);
+                    gluTessEndContour();
+                } else if (state == TessState.T_IN_POLYGON) {
+                    callErrorOrErrorData(GLU.GLU_TESS_MISSING_END_POLYGON);
+                    /* gluTessEndPolygon( tess ) is too much work! */
+                    makeDormant();
+                }
+            }
+        }
+    }
+
+    public void gluDeleteTess() {
+        requireState(TessState.T_DORMANT);
+    }
+
+    public void gluTessProperty(int which, double value) {
+        switch (which) {
+            case GLU.GLU_TESS_TOLERANCE:
+                if (value < 0.0 || value > 1.0) break;
+                relTolerance = value;
+                return;
+
+            case GLU.GLU_TESS_WINDING_RULE:
+                int windingRule = (int) value;
+                if (windingRule != value) break;	/* not an integer */
+
+                switch (windingRule) {
+                    case GLU.GLU_TESS_WINDING_ODD:
+                    case GLU.GLU_TESS_WINDING_NONZERO:
+                    case GLU.GLU_TESS_WINDING_POSITIVE:
+                    case GLU.GLU_TESS_WINDING_NEGATIVE:
+                    case GLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
+                        this.windingRule = windingRule;
+                        return;
+                    default:
+                        break;
+                }
+
+            case GLU.GLU_TESS_BOUNDARY_ONLY:
+                boundaryOnly = (value != 0);
+                return;
+
+            case GLU.GLU_TESS_AVOID_DEGENERATE_TRIANGLES:
+                avoidDegenerateTris = (value != 0);
+                return;
+
+            default:
+                callErrorOrErrorData(GLU.GLU_INVALID_ENUM);
+                return;
+        }
+        callErrorOrErrorData(GLU.GLU_INVALID_VALUE);
+    }
+
+/* Returns tessellator property */
+    public void gluGetTessProperty(int which, double[] value, int value_offset) {
+        switch (which) {
+            case GLU.GLU_TESS_TOLERANCE:
+/* tolerance should be in range [0..1] */
+                assert (0.0 <= relTolerance && relTolerance <= 1.0);
+                value[value_offset] = relTolerance;
+                break;
+            case GLU.GLU_TESS_WINDING_RULE:
+                assert (windingRule == GLU.GLU_TESS_WINDING_ODD ||
+                        windingRule == GLU.GLU_TESS_WINDING_NONZERO ||
+                        windingRule == GLU.GLU_TESS_WINDING_POSITIVE ||
+                        windingRule == GLU.GLU_TESS_WINDING_NEGATIVE ||
+                        windingRule == GLU.GLU_TESS_WINDING_ABS_GEQ_TWO);
+                value[value_offset] = windingRule;
+                break;
+            case GLU.GLU_TESS_BOUNDARY_ONLY:
+                assert (boundaryOnly == true || boundaryOnly == false);
+                value[value_offset] = boundaryOnly ? 1 : 0;
+                break;
+            case GLU.GLU_TESS_AVOID_DEGENERATE_TRIANGLES:
+                value[value_offset] = avoidDegenerateTris ? 1 : 0;
+                break;
+            default:
+                value[value_offset] = 0.0;
+                callErrorOrErrorData(GLU.GLU_INVALID_ENUM);
+                break;
+        }
+    } /* gluGetTessProperty() */
+
+    public void gluTessNormal(double x, double y, double z) {
+        normal[0] = x;
+        normal[1] = y;
+        normal[2] = z;
+    }
+
+    public void gluTessCallback(int which, GLUtessellatorCallback aCallback) {
+        switch (which) {
+            case GLU.GLU_TESS_BEGIN:
+                callBegin = aCallback == null ? NULL_CB : aCallback;
+                return;
+            case GLU.GLU_TESS_BEGIN_DATA:
+                callBeginData = aCallback == null ? NULL_CB : aCallback;
+                return;
+            case GLU.GLU_TESS_EDGE_FLAG:
+                callEdgeFlag = aCallback == null ? NULL_CB : aCallback;
+/* If the client wants boundary edges to be flagged,
+ * we render everything as separate triangles (no strips or fans).
+ */
+                flagBoundary = aCallback != null;
+                return;
+            case GLU.GLU_TESS_EDGE_FLAG_DATA:
+                callEdgeFlagData = callBegin = aCallback == null ? NULL_CB : aCallback;
+/* If the client wants boundary edges to be flagged,
+ * we render everything as separate triangles (no strips or fans).
+ */
+                flagBoundary = (aCallback != null);
+                return;
+            case GLU.GLU_TESS_VERTEX:
+                callVertex = aCallback == null ? NULL_CB : aCallback;
+                return;
+            case GLU.GLU_TESS_VERTEX_DATA:
+                callVertexData = aCallback == null ? NULL_CB : aCallback;
+                return;
+            case GLU.GLU_TESS_END:
+                callEnd = aCallback == null ? NULL_CB : aCallback;
+                return;
+            case GLU.GLU_TESS_END_DATA:
+                callEndData = aCallback == null ? NULL_CB : aCallback;
+                return;
+            case GLU.GLU_TESS_ERROR:
+                callError = aCallback == null ? NULL_CB : aCallback;
+                return;
+            case GLU.GLU_TESS_ERROR_DATA:
+                callErrorData = aCallback == null ? NULL_CB : aCallback;
+                return;
+            case GLU.GLU_TESS_COMBINE:
+                callCombine = aCallback == null ? NULL_CB : aCallback;
+                return;
+            case GLU.GLU_TESS_COMBINE_DATA:
+                callCombineData = aCallback == null ? NULL_CB : aCallback;
+                return;
+//            case GLU_TESS_MESH:
+//                callMesh = aCallback == null ? NULL_CB : aCallback;
+//                return;
+            default:
+                callErrorOrErrorData(GLU.GLU_INVALID_ENUM);
+                return;
+        }
+    }
+
+    private boolean addVertex(double[] coords, Object vertexData) {
+        GLUhalfEdge e;
+
+        e = lastEdge;
+        if (e == null) {
+/* Make a self-loop (one vertex, one edge). */
+
+            e = Mesh.__gl_meshMakeEdge(mesh);
+            if (e == null) return false;
+            if (!Mesh.__gl_meshSplice(e, e.Sym)) return false;
+        } else {
+/* Create a new vertex and edge which immediately follow e
+ * in the ordering around the left face.
+ */
+            if (Mesh.__gl_meshSplitEdge(e) == null) return false;
+            e = e.Lnext;
+        }
+
+/* The new vertex is now e.Org. */
+        e.Org.data = vertexData;
+        e.Org.coords[0] = coords[0];
+        e.Org.coords[1] = coords[1];
+        e.Org.coords[2] = coords[2];
+
+/* The winding of an edge says how the winding number changes as we
+ * cross from the edge''s right face to its left face.  We add the
+ * vertices in such an order that a CCW contour will add +1 to
+ * the winding number of the region inside the contour.
+ */
+        e.winding = 1;
+        e.Sym.winding = -1;
+
+        lastEdge = e;
+
+        return true;
+    }
+
+    private void cacheVertex(double[] coords, Object vertexData) {
+        if (cache[cacheCount] == null) {
+            cache[cacheCount] = new CachedVertex();
+        }
+
+        CachedVertex v = cache[cacheCount];
+
+        v.data = vertexData;
+        v.coords[0] = coords[0];
+        v.coords[1] = coords[1];
+        v.coords[2] = coords[2];
+        ++cacheCount;
+    }
+
+
+    private boolean flushCache() {
+        CachedVertex[] v = cache;
+
+        mesh = Mesh.__gl_meshNewMesh();
+        if (mesh == null) return false;
+
+        for (int i = 0; i < cacheCount; i++) {
+            CachedVertex vertex = v[i];
+            if (!addVertex(vertex.coords, vertex.data)) return false;
+        }
+        cacheCount = 0;
+        flushCacheOnNextVertex = false;
+
+        return true;
+    }
+
+    public void gluTessVertex(double[] coords, int coords_offset, Object vertexData) {
+        int i;
+        boolean tooLarge = false;
+        double x;
+        double[] clamped = new double[3];
+
+        requireState(TessState.T_IN_CONTOUR);
+
+        if (flushCacheOnNextVertex) {
+            if (!flushCache()) {
+                callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
+                return;
+            }
+            lastEdge = null;
+        }
+        for (i = 0; i < 3; ++i) {
+            x = coords[i+coords_offset];
+            if (x < -GLU.GLU_TESS_MAX_COORD) {
+                x = -GLU.GLU_TESS_MAX_COORD;
+                tooLarge = true;
+            }
+            if (x > GLU.GLU_TESS_MAX_COORD) {
+                x = GLU.GLU_TESS_MAX_COORD;
+                tooLarge = true;
+            }
+            clamped[i] = x;
+        }
+        if (tooLarge) {
+            callErrorOrErrorData(GLU.GLU_TESS_COORD_TOO_LARGE);
+        }
+
+        if (mesh == null) {
+            if (cacheCount < TESS_MAX_CACHE) {
+                cacheVertex(clamped, vertexData);
+                return;
+            }
+            if (!flushCache()) {
+                callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
+                return;
+            }
+        }
+
+        if (!addVertex(clamped, vertexData)) {
+            callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
+        }
+    }
+
+
+    public void gluTessBeginPolygon(Object data) {
+        requireState(TessState.T_DORMANT);
+
+        state = TessState.T_IN_POLYGON;
+        cacheCount = 0;
+        flushCacheOnNextVertex = false;
+        mesh = null;
+
+        polygonData = data;
+    }
+
+
+    public void gluTessBeginContour() {
+        requireState(TessState.T_IN_POLYGON);
+
+        state = TessState.T_IN_CONTOUR;
+        lastEdge = null;
+        if (cacheCount > 0) {
+/* Just set a flag so we don't get confused by empty contours
+ * -- these can be generated accidentally with the obsolete
+ * NextContour() interface.
+ */
+            flushCacheOnNextVertex = true;
+        }
+    }
+
+
+    public void gluTessEndContour() {
+        requireState(TessState.T_IN_CONTOUR);
+        state = TessState.T_IN_POLYGON;
+    }
+
+    public void gluTessEndPolygon() {
+        GLUmesh mesh;
+
+        try {
+            requireState(TessState.T_IN_POLYGON);
+            state = TessState.T_DORMANT;
+
+            if (this.mesh == null) {
+                if (!flagBoundary /*&& callMesh == NULL_CB*/) {
+
+/* Try some special code to make the easy cases go quickly
+ * (eg. convex polygons).  This code does NOT handle multiple contours,
+ * intersections, edge flags, and of course it does not generate
+ * an explicit mesh either.
+ */
+                    if (Render.__gl_renderCache(this)) {
+                        polygonData = null;
+                        return;
+                    }
+                }
+                if (!flushCache()) throw new RuntimeException(); /* could've used a label*/
+            }
+
+/* Determine the polygon normal and project vertices onto the plane
+         * of the polygon.
+         */
+            Normal.__gl_projectPolygon(this);
+
+/* __gl_computeInterior( tess ) computes the planar arrangement specified
+ * by the given contours, and further subdivides this arrangement
+ * into regions.  Each region is marked "inside" if it belongs
+ * to the polygon, according to the rule given by windingRule.
+ * Each interior region is guaranteed be monotone.
+ */
+            if (!Sweep.__gl_computeInterior(this)) {
+                throw new RuntimeException();	/* could've used a label */
+            }
+
+            mesh = this.mesh;
+            if (!fatalError) {
+                boolean rc = true;
+
+/* If the user wants only the boundary contours, we throw away all edges
+ * except those which separate the interior from the exterior.
+ * Otherwise we tessellate all the regions marked "inside".
+ */
+                if (boundaryOnly) {
+                    rc = TessMono.__gl_meshSetWindingNumber(mesh, 1, true);
+                } else {
+                    rc = TessMono.__gl_meshTessellateInterior(mesh, avoidDegenerateTris);
+                }
+                if (!rc) throw new RuntimeException();	/* could've used a label */
+
+                Mesh.__gl_meshCheckMesh(mesh);
+
+                if (callBegin != NULL_CB || callEnd != NULL_CB
+                        || callVertex != NULL_CB || callEdgeFlag != NULL_CB
+                        || callBeginData != NULL_CB
+                        || callEndData != NULL_CB
+                        || callVertexData != NULL_CB
+                        || callEdgeFlagData != NULL_CB) {
+                    if (boundaryOnly) {
+                        Render.__gl_renderBoundary(this, mesh);  /* output boundary contours */
+                    } else {
+                        Render.__gl_renderMesh(this, mesh);	   /* output strips and fans */
+                    }
+                }
+//                if (callMesh != NULL_CB) {
+//
+///* Throw away the exterior faces, so that all faces are interior.
+//                 * This way the user doesn't have to check the "inside" flag,
+//                 * and we don't need to even reveal its existence.  It also leaves
+//                 * the freedom for an implementation to not generate the exterior
+//                 * faces in the first place.
+//                 */
+//                    TessMono.__gl_meshDiscardExterior(mesh);
+//                    callMesh.mesh(mesh);		/* user wants the mesh itself */
+//                    mesh = null;
+//                    polygonData = null;
+//                    return;
+//                }
+            }
+            Mesh.__gl_meshDeleteMesh(mesh);
+            polygonData = null;
+            mesh = null;
+        } catch (Exception e) {
+            e.printStackTrace();
+            callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
+        }
+    }
+
+    /*******************************************************/
+
+/* Obsolete calls -- for backward compatibility */
+
+    public void gluBeginPolygon() {
+        gluTessBeginPolygon(null);
+        gluTessBeginContour();
+    }
+
+
+/*ARGSUSED*/
+    public void gluNextContour(int type) {
+        gluTessEndContour();
+        gluTessBeginContour();
+    }
+
+
+    public void gluEndPolygon() {
+        gluTessEndContour();
+        gluTessEndPolygon();
+    }
+
+    void callBeginOrBeginData(int a) {
+        if (callBeginData != NULL_CB)
+            callBeginData.beginData(a, polygonData);
+        else
+            callBegin.begin(a);
+    }
+
+    void callVertexOrVertexData(Object a) {
+        if (callVertexData != NULL_CB)
+            callVertexData.vertexData(a, polygonData);
+        else
+            callVertex.vertex(a);
+    }
+
+    void callEdgeFlagOrEdgeFlagData(boolean a) {
+        if (callEdgeFlagData != NULL_CB)
+            callEdgeFlagData.edgeFlagData(a, polygonData);
+        else
+            callEdgeFlag.edgeFlag(a);
+    }
+
+    void callEndOrEndData() {
+        if (callEndData != NULL_CB)
+            callEndData.endData(polygonData);
+        else
+            callEnd.end();
+    }
+
+    void callCombineOrCombineData(double[] coords, Object[] vertexData, float[] weights, Object[] outData) {
+        if (callCombineData != NULL_CB)
+            callCombineData.combineData(coords, vertexData, weights, outData, polygonData);
+        else
+            callCombine.combine(coords, vertexData, weights, outData);
+    }
+
+    void callErrorOrErrorData(int a) {
+        if (callErrorData != NULL_CB)
+            callErrorData.errorData(a, polygonData);
+        else
+            callError.error(a);
+    }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUvertex.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUvertex.java
new file mode 100644
index 0000000..c30d759
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUvertex.java
@@ -0,0 +1,65 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class GLUvertex {
+    public GLUvertex next;		/* next vertex (never NULL) */
+    public GLUvertex prev;		/* previous vertex (never NULL) */
+    public jogamp.opengl.glu.tessellator.GLUhalfEdge anEdge;	/* a half-edge with this origin */
+    public Object data;		/* client's data */
+
+    /* Internal data (keep hidden) */
+    public double[] coords = new double[3];	/* vertex location in 3D */
+    public double s, t;		/* projection onto the sweep plane */
+    public int pqHandle;	/* to allow deletion from priority queue */
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java
new file mode 100644
index 0000000..3da2d26
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java
@@ -0,0 +1,338 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class Geom {
+    private Geom() {
+    }
+
+    /* Given three vertices u,v,w such that VertLeq(u,v) && VertLeq(v,w),
+     * evaluates the t-coord of the edge uw at the s-coord of the vertex v.
+     * Returns v->t - (uw)(v->s), ie. the signed distance from uw to v.
+     * If uw is vertical (and thus passes thru v), the result is zero.
+     *
+     * The calculation is extremely accurate and stable, even when v
+     * is very close to u or w.  In particular if we set v->t = 0 and
+     * let r be the negated result (this evaluates (uw)(v->s)), then
+     * r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t).
+     */
+    static double EdgeEval(GLUvertex u, GLUvertex v, GLUvertex w) {
+        double gapL, gapR;
+
+        assert (VertLeq(u, v) && VertLeq(v, w));
+
+        gapL = v.s - u.s;
+        gapR = w.s - v.s;
+
+        if (gapL + gapR > 0) {
+            if (gapL < gapR) {
+                return (v.t - u.t) + (u.t - w.t) * (gapL / (gapL + gapR));
+            } else {
+                return (v.t - w.t) + (w.t - u.t) * (gapR / (gapL + gapR));
+            }
+        }
+        /* vertical line */
+        return 0;
+    }
+
+    static double EdgeSign(GLUvertex u, GLUvertex v, GLUvertex w) {
+        double gapL, gapR;
+
+        assert (VertLeq(u, v) && VertLeq(v, w));
+
+        gapL = v.s - u.s;
+        gapR = w.s - v.s;
+
+        if (gapL + gapR > 0) {
+            return (v.t - w.t) * gapL + (v.t - u.t) * gapR;
+        }
+        /* vertical line */
+        return 0;
+    }
+
+
+    /***********************************************************************
+     * Define versions of EdgeSign, EdgeEval with s and t transposed.
+     */
+
+    static double TransEval(GLUvertex u, GLUvertex v, GLUvertex w) {
+        /* Given three vertices u,v,w such that TransLeq(u,v) && TransLeq(v,w),
+         * evaluates the t-coord of the edge uw at the s-coord of the vertex v.
+         * Returns v->s - (uw)(v->t), ie. the signed distance from uw to v.
+         * If uw is vertical (and thus passes thru v), the result is zero.
+         *
+         * The calculation is extremely accurate and stable, even when v
+         * is very close to u or w.  In particular if we set v->s = 0 and
+         * let r be the negated result (this evaluates (uw)(v->t)), then
+         * r is guaranteed to satisfy MIN(u->s,w->s) <= r <= MAX(u->s,w->s).
+         */
+        double gapL, gapR;
+
+        assert (TransLeq(u, v) && TransLeq(v, w));
+
+        gapL = v.t - u.t;
+        gapR = w.t - v.t;
+
+        if (gapL + gapR > 0) {
+            if (gapL < gapR) {
+                return (v.s - u.s) + (u.s - w.s) * (gapL / (gapL + gapR));
+            } else {
+                return (v.s - w.s) + (w.s - u.s) * (gapR / (gapL + gapR));
+            }
+        }
+        /* vertical line */
+        return 0;
+    }
+
+    static double TransSign(GLUvertex u, GLUvertex v, GLUvertex w) {
+        /* Returns a number whose sign matches TransEval(u,v,w) but which
+         * is cheaper to evaluate.  Returns > 0, == 0 , or < 0
+         * as v is above, on, or below the edge uw.
+         */
+        double gapL, gapR;
+
+        assert (TransLeq(u, v) && TransLeq(v, w));
+
+        gapL = v.t - u.t;
+        gapR = w.t - v.t;
+
+        if (gapL + gapR > 0) {
+            return (v.s - w.s) * gapL + (v.s - u.s) * gapR;
+        }
+        /* vertical line */
+        return 0;
+    }
+
+
+    static boolean VertCCW(GLUvertex u, GLUvertex v, GLUvertex w) {
+        /* For almost-degenerate situations, the results are not reliable.
+         * Unless the floating-point arithmetic can be performed without
+         * rounding errors, *any* implementation will give incorrect results
+         * on some degenerate inputs, so the client must have some way to
+         * handle this situation.
+         */
+        return (u.s * (v.t - w.t) + v.s * (w.t - u.t) + w.s * (u.t - v.t)) >= 0;
+    }
+
+/* Given parameters a,x,b,y returns the value (b*x+a*y)/(a+b),
+ * or (x+y)/2 if a==b==0.  It requires that a,b >= 0, and enforces
+ * this in the rare case that one argument is slightly negative.
+ * The implementation is extremely stable numerically.
+ * In particular it guarantees that the result r satisfies
+ * MIN(x,y) <= r <= MAX(x,y), and the results are very accurate
+ * even when a and b differ greatly in magnitude.
+ */
+    static double Interpolate(double a, double x, double b, double y) {
+        a = (a < 0) ? 0 : a;
+        b = (b < 0) ? 0 : b;
+        if (a <= b) {
+            if (b == 0) {
+                return (x + y) / 2.0;
+            } else {
+                return (x + (y - x) * (a / (a + b)));
+            }
+        } else {
+            return (y + (x - y) * (b / (a + b)));
+        }
+    }
+
+    static void EdgeIntersect(GLUvertex o1, GLUvertex d1,
+                              GLUvertex o2, GLUvertex d2,
+                              GLUvertex v)
+/* Given edges (o1,d1) and (o2,d2), compute their point of intersection.
+ * The computed point is guaranteed to lie in the intersection of the
+ * bounding rectangles defined by each edge.
+ */ {
+        double z1, z2;
+
+        /* This is certainly not the most efficient way to find the intersection
+         * of two line segments, but it is very numerically stable.
+         *
+         * Strategy: find the two middle vertices in the VertLeq ordering,
+         * and interpolate the intersection s-value from these.  Then repeat
+         * using the TransLeq ordering to find the intersection t-value.
+         */
+
+        if (!VertLeq(o1, d1)) {
+            GLUvertex temp = o1;
+            o1 = d1;
+            d1 = temp;
+        }
+        if (!VertLeq(o2, d2)) {
+            GLUvertex temp = o2;
+            o2 = d2;
+            d2 = temp;
+        }
+        if (!VertLeq(o1, o2)) {
+            GLUvertex temp = o1;
+            o1 = o2;
+            o2 = temp;
+            temp = d1;
+            d1 = d2;
+            d2 = temp;
+        }
+
+        if (!VertLeq(o2, d1)) {
+            /* Technically, no intersection -- do our best */
+            v.s = (o2.s + d1.s) / 2.0;
+        } else if (VertLeq(d1, d2)) {
+            /* Interpolate between o2 and d1 */
+            z1 = EdgeEval(o1, o2, d1);
+            z2 = EdgeEval(o2, d1, d2);
+            if (z1 + z2 < 0) {
+                z1 = -z1;
+                z2 = -z2;
+            }
+            v.s = Interpolate(z1, o2.s, z2, d1.s);
+        } else {
+            /* Interpolate between o2 and d2 */
+            z1 = EdgeSign(o1, o2, d1);
+            z2 = -EdgeSign(o1, d2, d1);
+            if (z1 + z2 < 0) {
+                z1 = -z1;
+                z2 = -z2;
+            }
+            v.s = Interpolate(z1, o2.s, z2, d2.s);
+        }
+
+        /* Now repeat the process for t */
+
+        if (!TransLeq(o1, d1)) {
+            GLUvertex temp = o1;
+            o1 = d1;
+            d1 = temp;
+        }
+        if (!TransLeq(o2, d2)) {
+            GLUvertex temp = o2;
+            o2 = d2;
+            d2 = temp;
+        }
+        if (!TransLeq(o1, o2)) {
+            GLUvertex temp = o2;
+            o2 = o1;
+            o1 = temp;
+            temp = d2;
+            d2 = d1;
+            d1 = temp;
+        }
+
+        if (!TransLeq(o2, d1)) {
+            /* Technically, no intersection -- do our best */
+            v.t = (o2.t + d1.t) / 2.0;
+        } else if (TransLeq(d1, d2)) {
+            /* Interpolate between o2 and d1 */
+            z1 = TransEval(o1, o2, d1);
+            z2 = TransEval(o2, d1, d2);
+            if (z1 + z2 < 0) {
+                z1 = -z1;
+                z2 = -z2;
+            }
+            v.t = Interpolate(z1, o2.t, z2, d1.t);
+        } else {
+            /* Interpolate between o2 and d2 */
+            z1 = TransSign(o1, o2, d1);
+            z2 = -TransSign(o1, d2, d1);
+            if (z1 + z2 < 0) {
+                z1 = -z1;
+                z2 = -z2;
+            }
+            v.t = Interpolate(z1, o2.t, z2, d2.t);
+        }
+    }
+
+    static boolean VertEq(GLUvertex u, GLUvertex v) {
+        return u.s == v.s && u.t == v.t;
+    }
+
+    static boolean VertLeq(GLUvertex u, GLUvertex v) {
+        return u.s < v.s || (u.s == v.s && u.t <= v.t);
+    }
+
+/* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */
+
+    static boolean TransLeq(GLUvertex u, GLUvertex v) {
+        return u.t < v.t || (u.t == v.t && u.s <= v.s);
+    }
+
+    static boolean EdgeGoesLeft(GLUhalfEdge e) {
+        return VertLeq(e.Sym.Org, e.Org);
+    }
+
+    static boolean EdgeGoesRight(GLUhalfEdge e) {
+        return VertLeq(e.Org, e.Sym.Org);
+    }
+
+    static double VertL1dist(GLUvertex u, GLUvertex v) {
+        return Math.abs(u.s - v.s) + Math.abs(u.t - v.t);
+    }
+
+    /***********************************************************************/
+
+    // Compute the cosine of the angle between the edges between o and
+    // v1 and between o and v2
+    static double EdgeCos(GLUvertex o, GLUvertex v1, GLUvertex v2) {
+        double ov1s = v1.s - o.s;
+        double ov1t = v1.t - o.t;
+        double ov2s = v2.s - o.s;
+        double ov2t = v2.t - o.t;
+        double dotp = ov1s * ov2s + ov1t * ov2t;
+        double len = Math.sqrt(ov1s * ov1s + ov1t * ov1t) * Math.sqrt(ov2s * ov2s + ov2t * ov2t);
+        if (len > 0.0) {
+            dotp /= len;
+        }
+        return dotp;
+    }
+
+    static final double EPSILON = 1.0e-5;
+    static final double ONE_MINUS_EPSILON = 1.0 - EPSILON;
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
new file mode 100644
index 0000000..942dfe8
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
@@ -0,0 +1,734 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class Mesh {
+    private Mesh() {
+    }
+
+    /************************ Utility Routines ************************/
+/* MakeEdge creates a new pair of half-edges which form their own loop.
+ * No vertex or face structures are allocated, but these must be assigned
+ * before the current edge operation is completed.
+ */
+    static jogamp.opengl.glu.tessellator.GLUhalfEdge MakeEdge(jogamp.opengl.glu.tessellator.GLUhalfEdge eNext) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge eSym;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge ePrev;
+
+//        EdgePair * pair = (EdgePair *)
+//        memAlloc(sizeof(EdgePair));
+//        if (pair == NULL) return NULL;
+//
+//        e = &pair - > e;
+        e = new jogamp.opengl.glu.tessellator.GLUhalfEdge(true);
+//        eSym = &pair - > eSym;
+        eSym = new jogamp.opengl.glu.tessellator.GLUhalfEdge(false);
+
+
+        /* Make sure eNext points to the first edge of the edge pair */
+        if (!eNext.first) {
+            eNext = eNext.Sym;
+        }
+
+        /* Insert in circular doubly-linked list before eNext.
+         * Note that the prev pointer is stored in Sym->next.
+         */
+        ePrev = eNext.Sym.next;
+        eSym.next = ePrev;
+        ePrev.Sym.next = e;
+        e.next = eNext;
+        eNext.Sym.next = eSym;
+
+        e.Sym = eSym;
+        e.Onext = e;
+        e.Lnext = eSym;
+        e.Org = null;
+        e.Lface = null;
+        e.winding = 0;
+        e.activeRegion = null;
+
+        eSym.Sym = e;
+        eSym.Onext = eSym;
+        eSym.Lnext = e;
+        eSym.Org = null;
+        eSym.Lface = null;
+        eSym.winding = 0;
+        eSym.activeRegion = null;
+
+        return e;
+    }
+
+/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
+ * CS348a notes (see mesh.h).  Basically it modifies the mesh so that
+ * a->Onext and b->Onext are exchanged.  This can have various effects
+ * depending on whether a and b belong to different face or vertex rings.
+ * For more explanation see __gl_meshSplice() below.
+ */
+    static void Splice(jogamp.opengl.glu.tessellator.GLUhalfEdge a, jogamp.opengl.glu.tessellator.GLUhalfEdge b) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge aOnext = a.Onext;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge bOnext = b.Onext;
+
+        aOnext.Sym.Lnext = b;
+        bOnext.Sym.Lnext = a;
+        a.Onext = bOnext;
+        b.Onext = aOnext;
+    }
+
+/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
+ * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
+ * a place to insert the new vertex in the global vertex list.  We insert
+ * the new vertex *before* vNext so that algorithms which walk the vertex
+ * list will not see the newly created vertices.
+ */
+    static void MakeVertex(jogamp.opengl.glu.tessellator.GLUvertex newVertex,
+                           jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, jogamp.opengl.glu.tessellator.GLUvertex vNext) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+        jogamp.opengl.glu.tessellator.GLUvertex vPrev;
+        jogamp.opengl.glu.tessellator.GLUvertex vNew = newVertex;
+
+        assert (vNew != null);
+
+        /* insert in circular doubly-linked list before vNext */
+        vPrev = vNext.prev;
+        vNew.prev = vPrev;
+        vPrev.next = vNew;
+        vNew.next = vNext;
+        vNext.prev = vNew;
+
+        vNew.anEdge = eOrig;
+        vNew.data = null;
+        /* leave coords, s, t undefined */
+
+        /* fix other edges on this vertex loop */
+        e = eOrig;
+        do {
+            e.Org = vNew;
+            e = e.Onext;
+        } while (e != eOrig);
+    }
+
+/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
+ * face of all edges in the face loop to which eOrig belongs.  "fNext" gives
+ * a place to insert the new face in the global face list.  We insert
+ * the new face *before* fNext so that algorithms which walk the face
+ * list will not see the newly created faces.
+ */
+    static void MakeFace(jogamp.opengl.glu.tessellator.GLUface newFace, jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, jogamp.opengl.glu.tessellator.GLUface fNext) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+        jogamp.opengl.glu.tessellator.GLUface fPrev;
+        jogamp.opengl.glu.tessellator.GLUface fNew = newFace;
+
+        assert (fNew != null);
+
+        /* insert in circular doubly-linked list before fNext */
+        fPrev = fNext.prev;
+        fNew.prev = fPrev;
+        fPrev.next = fNew;
+        fNew.next = fNext;
+        fNext.prev = fNew;
+
+        fNew.anEdge = eOrig;
+        fNew.data = null;
+        fNew.trail = null;
+        fNew.marked = false;
+
+        /* The new face is marked "inside" if the old one was.  This is a
+         * convenience for the common case where a face has been split in two.
+         */
+        fNew.inside = fNext.inside;
+
+        /* fix other edges on this face loop */
+        e = eOrig;
+        do {
+            e.Lface = fNew;
+            e = e.Lnext;
+        } while (e != eOrig);
+    }
+
+/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
+ * and removes from the global edge list.
+ */
+    static void KillEdge(jogamp.opengl.glu.tessellator.GLUhalfEdge eDel) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge ePrev, eNext;
+
+        /* Half-edges are allocated in pairs, see EdgePair above */
+        if (!eDel.first) {
+            eDel = eDel.Sym;
+        }
+
+        /* delete from circular doubly-linked list */
+        eNext = eDel.next;
+        ePrev = eDel.Sym.next;
+        eNext.Sym.next = ePrev;
+        ePrev.Sym.next = eNext;
+    }
+
+
+/* KillVertex( vDel ) destroys a vertex and removes it from the global
+ * vertex list.  It updates the vertex loop to point to a given new vertex.
+ */
+    static void KillVertex(jogamp.opengl.glu.tessellator.GLUvertex vDel, jogamp.opengl.glu.tessellator.GLUvertex newOrg) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e, eStart = vDel.anEdge;
+        jogamp.opengl.glu.tessellator.GLUvertex vPrev, vNext;
+
+        /* change the origin of all affected edges */
+        e = eStart;
+        do {
+            e.Org = newOrg;
+            e = e.Onext;
+        } while (e != eStart);
+
+        /* delete from circular doubly-linked list */
+        vPrev = vDel.prev;
+        vNext = vDel.next;
+        vNext.prev = vPrev;
+        vPrev.next = vNext;
+    }
+
+/* KillFace( fDel ) destroys a face and removes it from the global face
+ * list.  It updates the face loop to point to a given new face.
+ */
+    static void KillFace(jogamp.opengl.glu.tessellator.GLUface fDel, jogamp.opengl.glu.tessellator.GLUface newLface) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e, eStart = fDel.anEdge;
+        jogamp.opengl.glu.tessellator.GLUface fPrev, fNext;
+
+        /* change the left face of all affected edges */
+        e = eStart;
+        do {
+            e.Lface = newLface;
+            e = e.Lnext;
+        } while (e != eStart);
+
+        /* delete from circular doubly-linked list */
+        fPrev = fDel.prev;
+        fNext = fDel.next;
+        fNext.prev = fPrev;
+        fPrev.next = fNext;
+    }
+
+
+    /****************** Basic Edge Operations **********************/
+
+/* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face).
+ * The loop consists of the two new half-edges.
+ */
+    public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshMakeEdge(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+        jogamp.opengl.glu.tessellator.GLUvertex newVertex1 = new jogamp.opengl.glu.tessellator.GLUvertex();
+        jogamp.opengl.glu.tessellator.GLUvertex newVertex2 = new jogamp.opengl.glu.tessellator.GLUvertex();
+        jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+
+        e = MakeEdge(mesh.eHead);
+        if (e == null) return null;
+
+        MakeVertex(newVertex1, e, mesh.vHead);
+        MakeVertex(newVertex2, e.Sym, mesh.vHead);
+        MakeFace(newFace, e, mesh.fHead);
+        return e;
+    }
+
+
+/* __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the
+ * mesh connectivity and topology.  It changes the mesh so that
+ *	eOrg->Onext <- OLD( eDst->Onext )
+ *	eDst->Onext <- OLD( eOrg->Onext )
+ * where OLD(...) means the value before the meshSplice operation.
+ *
+ * This can have two effects on the vertex structure:
+ *  - if eOrg->Org != eDst->Org, the two vertices are merged together
+ *  - if eOrg->Org == eDst->Org, the origin is split into two vertices
+ * In both cases, eDst->Org is changed and eOrg->Org is untouched.
+ *
+ * Similarly (and independently) for the face structure,
+ *  - if eOrg->Lface == eDst->Lface, one loop is split into two
+ *  - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
+ * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
+ *
+ * Some special cases:
+ * If eDst == eOrg, the operation has no effect.
+ * If eDst == eOrg->Lnext, the new face will have a single edge.
+ * If eDst == eOrg->Lprev, the old face will have a single edge.
+ * If eDst == eOrg->Onext, the new vertex will have a single edge.
+ * If eDst == eOrg->Oprev, the old vertex will have a single edge.
+ */
+    public static boolean __gl_meshSplice(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
+        boolean joiningLoops = false;
+        boolean joiningVertices = false;
+
+        if (eOrg == eDst) return true;
+
+        if (eDst.Org != eOrg.Org) {
+            /* We are merging two disjoint vertices -- destroy eDst->Org */
+            joiningVertices = true;
+            KillVertex(eDst.Org, eOrg.Org);
+        }
+        if (eDst.Lface != eOrg.Lface) {
+            /* We are connecting two disjoint loops -- destroy eDst.Lface */
+            joiningLoops = true;
+            KillFace(eDst.Lface, eOrg.Lface);
+        }
+
+        /* Change the edge structure */
+        Splice(eDst, eOrg);
+
+        if (!joiningVertices) {
+            jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
+
+            /* We split one vertex into two -- the new vertex is eDst.Org.
+             * Make sure the old vertex points to a valid half-edge.
+             */
+            MakeVertex(newVertex, eDst, eOrg.Org);
+            eOrg.Org.anEdge = eOrg;
+        }
+        if (!joiningLoops) {
+            jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+
+            /* We split one loop into two -- the new loop is eDst.Lface.
+             * Make sure the old face points to a valid half-edge.
+             */
+            MakeFace(newFace, eDst, eOrg.Lface);
+            eOrg.Lface.anEdge = eOrg;
+        }
+
+        return true;
+    }
+
+
+/* __gl_meshDelete( eDel ) removes the edge eDel.  There are several cases:
+ * if (eDel.Lface != eDel.Rface), we join two loops into one; the loop
+ * eDel.Lface is deleted.  Otherwise, we are splitting one loop into two;
+ * the newly created loop will contain eDel.Dst.  If the deletion of eDel
+ * would create isolated vertices, those are deleted as well.
+ *
+ * This function could be implemented as two calls to __gl_meshSplice
+ * plus a few calls to memFree, but this would allocate and delete
+ * unnecessary vertices and faces.
+ */
+    static boolean __gl_meshDelete(jogamp.opengl.glu.tessellator.GLUhalfEdge eDel) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge eDelSym = eDel.Sym;
+        boolean joiningLoops = false;
+
+        /* First step: disconnect the origin vertex eDel.Org.  We make all
+         * changes to get a consistent mesh in this "intermediate" state.
+         */
+        if (eDel.Lface != eDel.Sym.Lface) {
+            /* We are joining two loops into one -- remove the left face */
+            joiningLoops = true;
+            KillFace(eDel.Lface, eDel.Sym.Lface);
+        }
+
+        if (eDel.Onext == eDel) {
+            KillVertex(eDel.Org, null);
+        } else {
+            /* Make sure that eDel.Org and eDel.Sym.Lface point to valid half-edges */
+            eDel.Sym.Lface.anEdge = eDel.Sym.Lnext;
+            eDel.Org.anEdge = eDel.Onext;
+
+            Splice(eDel, eDel.Sym.Lnext);
+            if (!joiningLoops) {
+                jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+
+                /* We are splitting one loop into two -- create a new loop for eDel. */
+                MakeFace(newFace, eDel, eDel.Lface);
+            }
+        }
+
+        /* Claim: the mesh is now in a consistent state, except that eDel.Org
+         * may have been deleted.  Now we disconnect eDel.Dst.
+         */
+        if (eDelSym.Onext == eDelSym) {
+            KillVertex(eDelSym.Org, null);
+            KillFace(eDelSym.Lface, null);
+        } else {
+            /* Make sure that eDel.Dst and eDel.Lface point to valid half-edges */
+            eDel.Lface.anEdge = eDelSym.Sym.Lnext;
+            eDelSym.Org.anEdge = eDelSym.Onext;
+            Splice(eDelSym, eDelSym.Sym.Lnext);
+        }
+
+        /* Any isolated vertices or faces have already been freed. */
+        KillEdge(eDel);
+
+        return true;
+    }
+
+
+    /******************** Other Edge Operations **********************/
+
+/* All these routines can be implemented with the basic edge
+ * operations above.  They are provided for convenience and efficiency.
+ */
+
+
+/* __gl_meshAddEdgeVertex( eOrg ) creates a new edge eNew such that
+ * eNew == eOrg.Lnext, and eNew.Dst is a newly created vertex.
+ * eOrg and eNew will have the same left face.
+ */
+    static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshAddEdgeVertex(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge eNewSym;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
+
+        eNewSym = eNew.Sym;
+
+        /* Connect the new edge appropriately */
+        Splice(eNew, eOrg.Lnext);
+
+        /* Set the vertex and face information */
+        eNew.Org = eOrg.Sym.Org;
+        {
+            jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
+
+            MakeVertex(newVertex, eNewSym, eNew.Org);
+        }
+        eNew.Lface = eNewSym.Lface = eOrg.Lface;
+
+        return eNew;
+    }
+
+
+/* __gl_meshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
+ * such that eNew == eOrg.Lnext.  The new vertex is eOrg.Sym.Org == eNew.Org.
+ * eOrg and eNew will have the same left face.
+ */
+    public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshSplitEdge(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge eNew;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge tempHalfEdge = __gl_meshAddEdgeVertex(eOrg);
+
+        eNew = tempHalfEdge.Sym;
+
+        /* Disconnect eOrg from eOrg.Sym.Org and connect it to eNew.Org */
+        Splice(eOrg.Sym, eOrg.Sym.Sym.Lnext);
+        Splice(eOrg.Sym, eNew);
+
+        /* Set the vertex and face information */
+        eOrg.Sym.Org = eNew.Org;
+        eNew.Sym.Org.anEdge = eNew.Sym;	/* may have pointed to eOrg.Sym */
+        eNew.Sym.Lface = eOrg.Sym.Lface;
+        eNew.winding = eOrg.winding;	/* copy old winding information */
+        eNew.Sym.winding = eOrg.Sym.winding;
+
+        return eNew;
+    }
+
+
+/* __gl_meshConnect( eOrg, eDst ) creates a new edge from eOrg.Sym.Org
+ * to eDst.Org, and returns the corresponding half-edge eNew.
+ * If eOrg.Lface == eDst.Lface, this splits one loop into two,
+ * and the newly created loop is eNew.Lface.  Otherwise, two disjoint
+ * loops are merged into one, and the loop eDst.Lface is destroyed.
+ *
+ * If (eOrg == eDst), the new face will have only two edges.
+ * If (eOrg.Lnext == eDst), the old face is reduced to a single edge.
+ * If (eOrg.Lnext.Lnext == eDst), the old face is reduced to two edges.
+ */
+    static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshConnect(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge eNewSym;
+        boolean joiningLoops = false;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
+
+        eNewSym = eNew.Sym;
+
+        if (eDst.Lface != eOrg.Lface) {
+            /* We are connecting two disjoint loops -- destroy eDst.Lface */
+            joiningLoops = true;
+            KillFace(eDst.Lface, eOrg.Lface);
+        }
+
+        /* Connect the new edge appropriately */
+        Splice(eNew, eOrg.Lnext);
+        Splice(eNewSym, eDst);
+
+        /* Set the vertex and face information */
+        eNew.Org = eOrg.Sym.Org;
+        eNewSym.Org = eDst.Org;
+        eNew.Lface = eNewSym.Lface = eOrg.Lface;
+
+        /* Make sure the old face points to a valid half-edge */
+        eOrg.Lface.anEdge = eNewSym;
+
+        if (!joiningLoops) {
+            jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+
+            /* We split one loop into two -- the new loop is eNew.Lface */
+            MakeFace(newFace, eNew, eOrg.Lface);
+        }
+        return eNew;
+    }
+
+
+    /******************** Other Operations **********************/
+
+/* __gl_meshZapFace( fZap ) destroys a face and removes it from the
+ * global face list.  All edges of fZap will have a null pointer as their
+ * left face.  Any edges which also have a null pointer as their right face
+ * are deleted entirely (along with any isolated vertices this produces).
+ * An entire mesh can be deleted by zapping its faces, one at a time,
+ * in any order.  Zapped faces cannot be used in further mesh operations!
+ */
+    static void __gl_meshZapFace(jogamp.opengl.glu.tessellator.GLUface fZap) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = fZap.anEdge;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e, eNext, eSym;
+        jogamp.opengl.glu.tessellator.GLUface fPrev, fNext;
+
+        /* walk around face, deleting edges whose right face is also null */
+        eNext = eStart.Lnext;
+        do {
+            e = eNext;
+            eNext = e.Lnext;
+
+            e.Lface = null;
+            if (e.Sym.Lface == null) {
+                /* delete the edge -- see __gl_MeshDelete above */
+
+                if (e.Onext == e) {
+                    KillVertex(e.Org, null);
+                } else {
+                    /* Make sure that e.Org points to a valid half-edge */
+                    e.Org.anEdge = e.Onext;
+                    Splice(e, e.Sym.Lnext);
+                }
+                eSym = e.Sym;
+                if (eSym.Onext == eSym) {
+                    KillVertex(eSym.Org, null);
+                } else {
+                    /* Make sure that eSym.Org points to a valid half-edge */
+                    eSym.Org.anEdge = eSym.Onext;
+                    Splice(eSym, eSym.Sym.Lnext);
+                }
+                KillEdge(e);
+            }
+        } while (e != eStart);
+
+        /* delete from circular doubly-linked list */
+        fPrev = fZap.prev;
+        fNext = fZap.next;
+        fNext.prev = fPrev;
+        fPrev.next = fNext;
+    }
+
+
+/* __gl_meshNewMesh() creates a new mesh with no edges, no vertices,
+ * and no loops (what we usually call a "face").
+ */
+    public static jogamp.opengl.glu.tessellator.GLUmesh __gl_meshNewMesh() {
+        jogamp.opengl.glu.tessellator.GLUvertex v;
+        jogamp.opengl.glu.tessellator.GLUface f;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge eSym;
+        jogamp.opengl.glu.tessellator.GLUmesh mesh = new jogamp.opengl.glu.tessellator.GLUmesh();
+
+        v = mesh.vHead;
+        f = mesh.fHead;
+        e = mesh.eHead;
+        eSym = mesh.eHeadSym;
+
+        v.next = v.prev = v;
+        v.anEdge = null;
+        v.data = null;
+
+        f.next = f.prev = f;
+        f.anEdge = null;
+        f.data = null;
+        f.trail = null;
+        f.marked = false;
+        f.inside = false;
+
+        e.next = e;
+        e.Sym = eSym;
+        e.Onext = null;
+        e.Lnext = null;
+        e.Org = null;
+        e.Lface = null;
+        e.winding = 0;
+        e.activeRegion = null;
+
+        eSym.next = eSym;
+        eSym.Sym = e;
+        eSym.Onext = null;
+        eSym.Lnext = null;
+        eSym.Org = null;
+        eSym.Lface = null;
+        eSym.winding = 0;
+        eSym.activeRegion = null;
+
+        return mesh;
+    }
+
+
+/* __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in
+ * both meshes, and returns the new mesh (the old meshes are destroyed).
+ */
+    static jogamp.opengl.glu.tessellator.GLUmesh __gl_meshUnion(jogamp.opengl.glu.tessellator.GLUmesh mesh1, jogamp.opengl.glu.tessellator.GLUmesh mesh2) {
+        jogamp.opengl.glu.tessellator.GLUface f1 = mesh1.fHead;
+        jogamp.opengl.glu.tessellator.GLUvertex v1 = mesh1.vHead;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e1 = mesh1.eHead;
+        jogamp.opengl.glu.tessellator.GLUface f2 = mesh2.fHead;
+        jogamp.opengl.glu.tessellator.GLUvertex v2 = mesh2.vHead;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e2 = mesh2.eHead;
+
+        /* Add the faces, vertices, and edges of mesh2 to those of mesh1 */
+        if (f2.next != f2) {
+            f1.prev.next = f2.next;
+            f2.next.prev = f1.prev;
+            f2.prev.next = f1;
+            f1.prev = f2.prev;
+        }
+
+        if (v2.next != v2) {
+            v1.prev.next = v2.next;
+            v2.next.prev = v1.prev;
+            v2.prev.next = v1;
+            v1.prev = v2.prev;
+        }
+
+        if (e2.next != e2) {
+            e1.Sym.next.Sym.next = e2.next;
+            e2.next.Sym.next = e1.Sym.next;
+            e2.Sym.next.Sym.next = e1;
+            e1.Sym.next = e2.Sym.next;
+        }
+
+        return mesh1;
+    }
+
+
+/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
+ */
+    static void __gl_meshDeleteMeshZap(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+        jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
+
+        while (fHead.next != fHead) {
+            __gl_meshZapFace(fHead.next);
+        }
+        assert (mesh.vHead.next == mesh.vHead);
+    }
+
+/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
+ */
+    public static void __gl_meshDeleteMesh(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+        jogamp.opengl.glu.tessellator.GLUface f, fNext;
+        jogamp.opengl.glu.tessellator.GLUvertex v, vNext;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e, eNext;
+
+        for (f = mesh.fHead.next; f != mesh.fHead; f = fNext) {
+            fNext = f.next;
+        }
+
+        for (v = mesh.vHead.next; v != mesh.vHead; v = vNext) {
+            vNext = v.next;
+        }
+
+        for (e = mesh.eHead.next; e != mesh.eHead; e = eNext) {
+            /* One call frees both e and e.Sym (see EdgePair above) */
+            eNext = e.next;
+        }
+    }
+
+/* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
+ */
+    public static void __gl_meshCheckMesh(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+        jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
+        jogamp.opengl.glu.tessellator.GLUvertex vHead = mesh.vHead;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge eHead = mesh.eHead;
+        jogamp.opengl.glu.tessellator.GLUface f, fPrev;
+        jogamp.opengl.glu.tessellator.GLUvertex v, vPrev;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e, ePrev;
+
+        fPrev = fHead;
+        for (fPrev = fHead; (f = fPrev.next) != fHead; fPrev = f) {
+            assert (f.prev == fPrev);
+            e = f.anEdge;
+            do {
+                assert (e.Sym != e);
+                assert (e.Sym.Sym == e);
+                assert (e.Lnext.Onext.Sym == e);
+                assert (e.Onext.Sym.Lnext == e);
+                assert (e.Lface == f);
+                e = e.Lnext;
+            } while (e != f.anEdge);
+        }
+        assert (f.prev == fPrev && f.anEdge == null && f.data == null);
+
+        vPrev = vHead;
+        for (vPrev = vHead; (v = vPrev.next) != vHead; vPrev = v) {
+            assert (v.prev == vPrev);
+            e = v.anEdge;
+            do {
+                assert (e.Sym != e);
+                assert (e.Sym.Sym == e);
+                assert (e.Lnext.Onext.Sym == e);
+                assert (e.Onext.Sym.Lnext == e);
+                assert (e.Org == v);
+                e = e.Onext;
+            } while (e != v.anEdge);
+        }
+        assert (v.prev == vPrev && v.anEdge == null && v.data == null);
+
+        ePrev = eHead;
+        for (ePrev = eHead; (e = ePrev.next) != eHead; ePrev = e) {
+            assert (e.Sym.next == ePrev.Sym);
+            assert (e.Sym != e);
+            assert (e.Sym.Sym == e);
+            assert (e.Org != null);
+            assert (e.Sym.Org != null);
+            assert (e.Lnext.Onext.Sym == e);
+            assert (e.Onext.Sym.Lnext == e);
+        }
+        assert (e.Sym.next == ePrev.Sym
+                && e.Sym == mesh.eHeadSym
+                && e.Sym.Sym == e
+                && e.Org == null && e.Sym.Org == null
+                && e.Lface == null && e.Sym.Lface == null);
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
new file mode 100644
index 0000000..7d5acd9
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
@@ -0,0 +1,288 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+class Normal {
+    private Normal() {
+    }
+
+    static boolean SLANTED_SWEEP = false;
+    static double S_UNIT_X;	/* Pre-normalized */
+    static double S_UNIT_Y;
+    private static final boolean TRUE_PROJECT = false;
+
+    static {
+        if (SLANTED_SWEEP) {
+/* The "feature merging" is not intended to be complete.  There are
+ * special cases where edges are nearly parallel to the sweep line
+ * which are not implemented.  The algorithm should still behave
+ * robustly (ie. produce a reasonable tesselation) in the presence
+ * of such edges, however it may miss features which could have been
+ * merged.  We could minimize this effect by choosing the sweep line
+ * direction to be something unusual (ie. not parallel to one of the
+ * coordinate axes).
+ */
+            S_UNIT_X = 0.50941539564955385;	/* Pre-normalized */
+            S_UNIT_Y = 0.86052074622010633;
+        } else {
+            S_UNIT_X = 1.0;
+            S_UNIT_Y = 0.0;
+        }
+    }
+
+    private static double Dot(double[] u, double[] v) {
+        return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);
+    }
+
+    static void Normalize(double[] v) {
+        double len = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
+
+        assert (len > 0);
+        len = Math.sqrt(len);
+        v[0] /= len;
+        v[1] /= len;
+        v[2] /= len;
+    }
+
+    static int LongAxis(double[] v) {
+        int i = 0;
+
+        if (Math.abs(v[1]) > Math.abs(v[0])) {
+            i = 1;
+        }
+        if (Math.abs(v[2]) > Math.abs(v[i])) {
+            i = 2;
+        }
+        return i;
+    }
+
+    static void ComputeNormal(GLUtessellatorImpl tess, double[] norm) {
+        jogamp.opengl.glu.tessellator.GLUvertex v, v1, v2;
+        double c, tLen2, maxLen2;
+        double[] maxVal, minVal, d1, d2, tNorm;
+        jogamp.opengl.glu.tessellator.GLUvertex[] maxVert, minVert;
+        jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
+        int i;
+
+        maxVal = new double[3];
+        minVal = new double[3];
+        minVert = new jogamp.opengl.glu.tessellator.GLUvertex[3];
+        maxVert = new jogamp.opengl.glu.tessellator.GLUvertex[3];
+        d1 = new double[3];
+        d2 = new double[3];
+        tNorm = new double[3];
+
+        maxVal[0] = maxVal[1] = maxVal[2] = -2 * GLU.GLU_TESS_MAX_COORD;
+        minVal[0] = minVal[1] = minVal[2] = 2 * GLU.GLU_TESS_MAX_COORD;
+
+        for (v = vHead.next; v != vHead; v = v.next) {
+            for (i = 0; i < 3; ++i) {
+                c = v.coords[i];
+                if (c < minVal[i]) {
+                    minVal[i] = c;
+                    minVert[i] = v;
+                }
+                if (c > maxVal[i]) {
+                    maxVal[i] = c;
+                    maxVert[i] = v;
+                }
+            }
+        }
+
+/* Find two vertices separated by at least 1/sqrt(3) of the maximum
+         * distance between any two vertices
+         */
+        i = 0;
+        if (maxVal[1] - minVal[1] > maxVal[0] - minVal[0]) {
+            i = 1;
+        }
+        if (maxVal[2] - minVal[2] > maxVal[i] - minVal[i]) {
+            i = 2;
+        }
+        if (minVal[i] >= maxVal[i]) {
+/* All vertices are the same -- normal doesn't matter */
+            norm[0] = 0;
+            norm[1] = 0;
+            norm[2] = 1;
+            return;
+        }
+
+/* Look for a third vertex which forms the triangle with maximum area
+         * (Length of normal == twice the triangle area)
+         */
+        maxLen2 = 0;
+        v1 = minVert[i];
+        v2 = maxVert[i];
+        d1[0] = v1.coords[0] - v2.coords[0];
+        d1[1] = v1.coords[1] - v2.coords[1];
+        d1[2] = v1.coords[2] - v2.coords[2];
+        for (v = vHead.next; v != vHead; v = v.next) {
+            d2[0] = v.coords[0] - v2.coords[0];
+            d2[1] = v.coords[1] - v2.coords[1];
+            d2[2] = v.coords[2] - v2.coords[2];
+            tNorm[0] = d1[1] * d2[2] - d1[2] * d2[1];
+            tNorm[1] = d1[2] * d2[0] - d1[0] * d2[2];
+            tNorm[2] = d1[0] * d2[1] - d1[1] * d2[0];
+            tLen2 = tNorm[0] * tNorm[0] + tNorm[1] * tNorm[1] + tNorm[2] * tNorm[2];
+            if (tLen2 > maxLen2) {
+                maxLen2 = tLen2;
+                norm[0] = tNorm[0];
+                norm[1] = tNorm[1];
+                norm[2] = tNorm[2];
+            }
+        }
+
+        if (maxLen2 <= 0) {
+/* All points lie on a single line -- any decent normal will do */
+            norm[0] = norm[1] = norm[2] = 0;
+            norm[LongAxis(d1)] = 1;
+        }
+    }
+
+    static void CheckOrientation(GLUtessellatorImpl tess) {
+        double area;
+        jogamp.opengl.glu.tessellator.GLUface f, fHead = tess.mesh.fHead;
+        jogamp.opengl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+
+/* When we compute the normal automatically, we choose the orientation
+ * so that the the sum of the signed areas of all contours is non-negative.
+ */
+        area = 0;
+        for (f = fHead.next; f != fHead; f = f.next) {
+            e = f.anEdge;
+            if (e.winding <= 0) continue;
+            do {
+                area += (e.Org.s - e.Sym.Org.s) * (e.Org.t + e.Sym.Org.t);
+                e = e.Lnext;
+            } while (e != f.anEdge);
+        }
+        if (area < 0) {
+/* Reverse the orientation by flipping all the t-coordinates */
+            for (v = vHead.next; v != vHead; v = v.next) {
+                v.t = -v.t;
+            }
+            tess.tUnit[0] = -tess.tUnit[0];
+            tess.tUnit[1] = -tess.tUnit[1];
+            tess.tUnit[2] = -tess.tUnit[2];
+        }
+    }
+
+/* Determine the polygon normal and project vertices onto the plane
+ * of the polygon.
+ */
+    public static void __gl_projectPolygon(GLUtessellatorImpl tess) {
+        jogamp.opengl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead;
+        double w;
+        double[] norm = new double[3];
+        double[] sUnit, tUnit;
+        int i;
+        boolean computedNormal = false;
+
+        norm[0] = tess.normal[0];
+        norm[1] = tess.normal[1];
+        norm[2] = tess.normal[2];
+        if (norm[0] == 0 && norm[1] == 0 && norm[2] == 0) {
+            ComputeNormal(tess, norm);
+            computedNormal = true;
+        }
+        sUnit = tess.sUnit;
+        tUnit = tess.tUnit;
+        i = LongAxis(norm);
+
+        if (TRUE_PROJECT) {
+/* Choose the initial sUnit vector to be approximately perpendicular
+ * to the normal.
+ */
+            Normalize(norm);
+
+            sUnit[i] = 0;
+            sUnit[(i + 1) % 3] = S_UNIT_X;
+            sUnit[(i + 2) % 3] = S_UNIT_Y;
+
+/* Now make it exactly perpendicular */
+            w = Dot(sUnit, norm);
+            sUnit[0] -= w * norm[0];
+            sUnit[1] -= w * norm[1];
+            sUnit[2] -= w * norm[2];
+            Normalize(sUnit);
+
+/* Choose tUnit so that (sUnit,tUnit,norm) form a right-handed frame */
+            tUnit[0] = norm[1] * sUnit[2] - norm[2] * sUnit[1];
+            tUnit[1] = norm[2] * sUnit[0] - norm[0] * sUnit[2];
+            tUnit[2] = norm[0] * sUnit[1] - norm[1] * sUnit[0];
+            Normalize(tUnit);
+        } else {
+/* Project perpendicular to a coordinate axis -- better numerically */
+            sUnit[i] = 0;
+            sUnit[(i + 1) % 3] = S_UNIT_X;
+            sUnit[(i + 2) % 3] = S_UNIT_Y;
+
+            tUnit[i] = 0;
+            tUnit[(i + 1) % 3] = (norm[i] > 0) ? -S_UNIT_Y : S_UNIT_Y;
+            tUnit[(i + 2) % 3] = (norm[i] > 0) ? S_UNIT_X : -S_UNIT_X;
+        }
+
+/* Project the vertices onto the sweep plane */
+        for (v = vHead.next; v != vHead; v = v.next) {
+            v.s = Dot(v.coords, sUnit);
+            v.t = Dot(v.coords, tUnit);
+        }
+        if (computedNormal) {
+            CheckOrientation(tess);
+        }
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java
new file mode 100644
index 0000000..25405ad
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java
@@ -0,0 +1,100 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+abstract class PriorityQ {
+    public static final int INIT_SIZE = 32;
+
+    public static class PQnode {
+        int handle;
+    }
+
+    public static class PQhandleElem {
+        Object key;
+        int node;
+    }
+
+    public static interface Leq {
+        boolean leq(Object key1, Object key2);
+    }
+
+    //    #ifdef FOR_TRITE_TEST_PROGRAM
+//    private static boolean LEQ(PriorityQCommon.Leq leq, Object x,Object y) {
+//        return pq.leq.leq(x,y);
+//    }
+//    #else
+/* Violates modularity, but a little faster */
+//    #include "geom.h"
+    public static boolean LEQ(Leq leq, Object x, Object y) {
+        return jogamp.opengl.glu.tessellator.Geom.VertLeq((jogamp.opengl.glu.tessellator.GLUvertex) x, (jogamp.opengl.glu.tessellator.GLUvertex) y);
+    }
+
+    static PriorityQ pqNewPriorityQ(Leq leq) {
+        return new PriorityQSort(leq);
+    }
+
+    abstract void pqDeletePriorityQ();
+
+    abstract boolean pqInit();
+
+    abstract int pqInsert(Object keyNew);
+
+    abstract Object pqExtractMin();
+
+    abstract void pqDelete(int hCurr);
+
+    abstract Object pqMinimum();
+
+    abstract boolean pqIsEmpty();
+//    #endif
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
new file mode 100644
index 0000000..899df2e
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
@@ -0,0 +1,262 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
+    jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] nodes;
+    jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] handles;
+    int size, max;
+    int freeList;
+    boolean initialized;
+    jogamp.opengl.glu.tessellator.PriorityQ.Leq leq;
+
+/* really __gl_pqHeapNewPriorityQ */
+    public PriorityQHeap(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
+        size = 0;
+        max = jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE;
+        nodes = new jogamp.opengl.glu.tessellator.PriorityQ.PQnode[jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE + 1];
+        for (int i = 0; i < nodes.length; i++) {
+            nodes[i] = new PQnode();
+        }
+        handles = new jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE + 1];
+        for (int i = 0; i < handles.length; i++) {
+            handles[i] = new PQhandleElem();
+        }
+        initialized = false;
+        freeList = 0;
+        this.leq = leq;
+
+        nodes[1].handle = 1;	/* so that Minimum() returns NULL */
+        handles[1].key = null;
+    }
+
+/* really __gl_pqHeapDeletePriorityQ */
+    void pqDeletePriorityQ() {
+        handles = null;
+        nodes = null;
+    }
+
+    void FloatDown(int curr) {
+        jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+        jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+        int hCurr, hChild;
+        int child;
+
+        hCurr = n[curr].handle;
+        for (; ;) {
+            child = curr << 1;
+            if (child < size && LEQ(leq, h[n[child + 1].handle].key,
+                    h[n[child].handle].key)) {
+                ++child;
+            }
+
+            assert (child <= max);
+
+            hChild = n[child].handle;
+            if (child > size || LEQ(leq, h[hCurr].key, h[hChild].key)) {
+                n[curr].handle = hCurr;
+                h[hCurr].node = curr;
+                break;
+            }
+            n[curr].handle = hChild;
+            h[hChild].node = curr;
+            curr = child;
+        }
+    }
+
+
+    void FloatUp(int curr) {
+        jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+        jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+        int hCurr, hParent;
+        int parent;
+
+        hCurr = n[curr].handle;
+        for (; ;) {
+            parent = curr >> 1;
+            hParent = n[parent].handle;
+            if (parent == 0 || LEQ(leq, h[hParent].key, h[hCurr].key)) {
+                n[curr].handle = hCurr;
+                h[hCurr].node = curr;
+                break;
+            }
+            n[curr].handle = hParent;
+            h[hParent].node = curr;
+            curr = parent;
+        }
+    }
+
+/* really __gl_pqHeapInit */
+    boolean pqInit() {
+        int i;
+
+        /* This method of building a heap is O(n), rather than O(n lg n). */
+
+        for (i = size; i >= 1; --i) {
+            FloatDown(i);
+        }
+        initialized = true;
+
+        return true;
+    }
+
+/* really __gl_pqHeapInsert */
+/* returns LONG_MAX iff out of memory */
+    int pqInsert(Object keyNew) {
+        int curr;
+        int free;
+
+        curr = ++size;
+        if ((curr * 2) > max) {
+            jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] saveNodes = nodes;
+            jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] saveHandles = handles;
+
+            /* If the heap overflows, double its size. */
+            max <<= 1;
+//            pq->nodes = (PQnode *)memRealloc( pq->nodes, (size_t) ((pq->max + 1) * sizeof( pq->nodes[0] )));
+            PriorityQ.PQnode[] pqNodes = new PriorityQ.PQnode[max + 1];
+            System.arraycopy( nodes, 0, pqNodes, 0, nodes.length );
+            for (int i = nodes.length; i < pqNodes.length; i++) {
+                pqNodes[i] = new PQnode();
+            }
+            nodes = pqNodes;
+            if (nodes == null) {
+                nodes = saveNodes;	/* restore ptr to free upon return */
+                return Integer.MAX_VALUE;
+            }
+
+//            pq->handles = (PQhandleElem *)memRealloc( pq->handles,(size_t)((pq->max + 1) * sizeof( pq->handles[0] )));
+            PriorityQ.PQhandleElem[] pqHandles = new PriorityQ.PQhandleElem[max + 1];
+            System.arraycopy( handles, 0, pqHandles, 0, handles.length );
+            for (int i = handles.length; i < pqHandles.length; i++) {
+                pqHandles[i] = new PQhandleElem();
+            }
+            handles = pqHandles;
+            if (handles == null) {
+                handles = saveHandles; /* restore ptr to free upon return */
+                return Integer.MAX_VALUE;
+            }
+        }
+
+        if (freeList == 0) {
+            free = curr;
+        } else {
+            free = freeList;
+            freeList = handles[free].node;
+        }
+
+        nodes[curr].handle = free;
+        handles[free].node = curr;
+        handles[free].key = keyNew;
+
+        if (initialized) {
+            FloatUp(curr);
+        }
+        assert (free != Integer.MAX_VALUE);
+        return free;
+    }
+
+/* really __gl_pqHeapExtractMin */
+    Object pqExtractMin() {
+        jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+        jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+        int hMin = n[1].handle;
+        Object min = h[hMin].key;
+
+        if (size > 0) {
+            n[1].handle = n[size].handle;
+            h[n[1].handle].node = 1;
+
+            h[hMin].key = null;
+            h[hMin].node = freeList;
+            freeList = hMin;
+
+            if (--size > 0) {
+                FloatDown(1);
+            }
+        }
+        return min;
+    }
+
+/* really __gl_pqHeapDelete */
+    void pqDelete(int hCurr) {
+        jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+        jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+        int curr;
+
+        assert (hCurr >= 1 && hCurr <= max && h[hCurr].key != null);
+
+        curr = h[hCurr].node;
+        n[curr].handle = n[size].handle;
+        h[n[curr].handle].node = curr;
+
+        if (curr <= --size) {
+            if (curr <= 1 || LEQ(leq, h[n[curr >> 1].handle].key, h[n[curr].handle].key)) {
+                FloatDown(curr);
+            } else {
+                FloatUp(curr);
+            }
+        }
+        h[hCurr].key = null;
+        h[hCurr].node = freeList;
+        freeList = hCurr;
+    }
+
+    Object pqMinimum() {
+        return handles[nodes[1].handle].key;
+    }
+
+    boolean pqIsEmpty() {
+        return size == 0;
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
new file mode 100644
index 0000000..f37f98a
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
@@ -0,0 +1,278 @@
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
+    jogamp.opengl.glu.tessellator.PriorityQHeap heap;
+    Object[] keys;
+
+    // JAVA: 'order' contains indices into the keys array.
+    // This simulates the indirect pointers used in the original C code
+    // (from Frank Suykens, Luciad.com).
+    int[] order;
+    int size, max;
+    boolean initialized;
+    jogamp.opengl.glu.tessellator.PriorityQ.Leq leq;
+
+    public PriorityQSort(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
+        heap = new jogamp.opengl.glu.tessellator.PriorityQHeap(leq);
+
+        keys = new Object[jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE];
+
+        size = 0;
+        max = jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE;
+        initialized = false;
+        this.leq = leq;
+    }
+
+/* really __gl_pqSortDeletePriorityQ */
+    void pqDeletePriorityQ() {
+        if (heap != null) heap.pqDeletePriorityQ();
+        order = null;
+        keys = null;
+    }
+
+    private static boolean LT(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) {
+        return (!jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, y, x));
+    }
+
+    private static boolean GT(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) {
+        return (!jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, x, y));
+    }
+
+    private static void Swap(int[] array, int a, int b) {
+        if (true) {
+            int tmp = array[a];
+            array[a] = array[b];
+            array[b] = tmp;
+        } else {
+
+        }
+    }
+
+    private static class Stack {
+        int p, r;
+    }
+
+/* really __gl_pqSortInit */
+    boolean pqInit() {
+        int p, r, i, j;
+        int piv;
+        Stack[] stack = new Stack[50];
+        for (int k = 0; k < stack.length; k++) {
+            stack[k] = new Stack();
+        }
+        int top = 0;
+
+        int seed = 2016473283;
+
+        /* Create an array of indirect pointers to the keys, so that we
+         * the handles we have returned are still valid.
+         */
+        order = new int[size + 1];
+/* the previous line is a patch to compensate for the fact that IBM */
+/* machines return a null on a malloc of zero bytes (unlike SGI),   */
+/* so we have to put in this defense to guard against a memory      */
+/* fault four lines down. from fossum at austin.ibm.com.               */
+        p = 0;
+        r = size - 1;
+        for (piv = 0, i = p; i <= r; ++piv, ++i) {
+            // indirect pointers: keep an index into the keys array, not a direct pointer to its contents
+            order[i] = piv;
+        }
+
+        /* Sort the indirect pointers in descending order,
+         * using randomized Quicksort
+         */
+        stack[top].p = p;
+        stack[top].r = r;
+        ++top;
+        while (--top >= 0) {
+            p = stack[top].p;
+            r = stack[top].r;
+            while (r > p + 10) {
+                seed = Math.abs( seed * 1539415821 + 1 );
+                i = p + seed % (r - p + 1);
+                piv = order[i];
+                order[i] = order[p];
+                order[p] = piv;
+                i = p - 1;
+                j = r + 1;
+                do {
+                    do {
+                        ++i;
+                    } while (GT(leq, keys[order[i]], keys[piv]));
+                    do {
+                        --j;
+                    } while (LT(leq, keys[order[j]], keys[piv]));
+                    Swap(order, i, j);
+                } while (i < j);
+                Swap(order, i, j);	/* Undo last swap */
+                if (i - p < r - j) {
+                    stack[top].p = j + 1;
+                    stack[top].r = r;
+                    ++top;
+                    r = i - 1;
+                } else {
+                    stack[top].p = p;
+                    stack[top].r = i - 1;
+                    ++top;
+                    p = j + 1;
+                }
+            }
+            /* Insertion sort small lists */
+            for (i = p + 1; i <= r; ++i) {
+                piv = order[i];
+                for (j = i; j > p && LT(leq, keys[order[j - 1]], keys[piv]); --j) {
+                    order[j] = order[j - 1];
+                }
+                order[j] = piv;
+            }
+        }
+        max = size;
+        initialized = true;
+        heap.pqInit();	/* always succeeds */
+
+/*        #ifndef NDEBUG
+        p = order;
+        r = p + size - 1;
+        for (i = p; i < r; ++i) {
+            Assertion.doAssert(LEQ(     * * (i + 1), **i ));
+        }
+        #endif*/
+
+        return true;
+    }
+
+/* really __gl_pqSortInsert */
+/* returns LONG_MAX iff out of memory */
+    int pqInsert(Object keyNew) {
+        int curr;
+
+        if (initialized) {
+            return heap.pqInsert(keyNew);
+        }
+        curr = size;
+        if (++size >= max) {
+            Object[] saveKey = keys;
+
+            /* If the heap overflows, double its size. */
+            max <<= 1;
+//            pq->keys = (PQHeapKey *)memRealloc( pq->keys,(size_t)(pq->max * sizeof( pq->keys[0] )));
+            Object[] pqKeys = new Object[max];
+            System.arraycopy( keys, 0, pqKeys, 0, keys.length );
+            keys = pqKeys;
+            if (keys == null) {
+                keys = saveKey;	/* restore ptr to free upon return */
+                return Integer.MAX_VALUE;
+            }
+        }
+        assert curr != Integer.MAX_VALUE;
+        keys[curr] = keyNew;
+
+        /* Negative handles index the sorted array. */
+        return -(curr + 1);
+    }
+
+/* really __gl_pqSortExtractMin */
+    Object pqExtractMin() {
+        Object sortMin, heapMin;
+
+        if (size == 0) {
+            return heap.pqExtractMin();
+        }
+        sortMin = keys[order[size - 1]];
+        if (!heap.pqIsEmpty()) {
+            heapMin = heap.pqMinimum();
+            if (LEQ(leq, heapMin, sortMin)) {
+                return heap.pqExtractMin();
+            }
+        }
+        do {
+            --size;
+        } while (size > 0 && keys[order[size - 1]] == null);
+        return sortMin;
+    }
+
+/* really __gl_pqSortMinimum */
+    Object pqMinimum() {
+        Object sortMin, heapMin;
+
+        if (size == 0) {
+            return heap.pqMinimum();
+        }
+        sortMin = keys[order[size - 1]];
+        if (!heap.pqIsEmpty()) {
+            heapMin = heap.pqMinimum();
+            if (jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, heapMin, sortMin)) {
+                return heapMin;
+            }
+        }
+        return sortMin;
+    }
+
+/* really __gl_pqSortIsEmpty */
+    boolean pqIsEmpty() {
+        return (size == 0) && heap.pqIsEmpty();
+    }
+
+/* really __gl_pqSortDelete */
+    void pqDelete(int curr) {
+        if (curr >= 0) {
+            heap.pqDelete(curr);
+            return;
+        }
+        curr = -(curr + 1);
+        assert curr < max && keys[curr] != null;
+
+        keys[curr] = null;
+        while (size > 0 && keys[order[size - 1]] == null) {
+            --size;
+        }
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
new file mode 100644
index 0000000..34b7ee5
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
@@ -0,0 +1,557 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+class Render {
+    private static final boolean USE_OPTIMIZED_CODE_PATH = false;
+
+    private Render() {
+    }
+
+    private static final RenderFan renderFan = new RenderFan();
+    private static final RenderStrip renderStrip = new RenderStrip();
+    private static final RenderTriangle renderTriangle = new RenderTriangle();
+
+/* This structure remembers the information we need about a primitive
+ * to be able to render it later, once we have determined which
+ * primitive is able to use the most triangles.
+ */
+    private static class FaceCount {
+        public FaceCount() {
+        }
+
+        public FaceCount(long size, jogamp.opengl.glu.tessellator.GLUhalfEdge eStart, renderCallBack render) {
+            this.size = size;
+            this.eStart = eStart;
+            this.render = render;
+        }
+
+        long size;		/* number of triangles used */
+        jogamp.opengl.glu.tessellator.GLUhalfEdge eStart;	/* edge where this primitive starts */
+        renderCallBack render;
+    };
+
+    private static interface renderCallBack {
+        void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size);
+    }
+
+    /************************ Strips and Fans decomposition ******************/
+
+/* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle
+ * fans, strips, and separate triangles.  A substantial effort is made
+ * to use as few rendering primitives as possible (ie. to make the fans
+ * and strips as large as possible).
+ *
+ * The rendering output is provided as callbacks (see the api).
+ */
+    public static void __gl_renderMesh(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+        jogamp.opengl.glu.tessellator.GLUface f;
+
+        /* Make a list of separate triangles so we can render them all at once */
+        tess.lonelyTriList = null;
+
+        for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
+            f.marked = false;
+        }
+        for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
+
+            /* We examine all faces in an arbitrary order.  Whenever we find
+             * an unprocessed face F, we output a group of faces including F
+             * whose size is maximum.
+             */
+            if (f.inside && !f.marked) {
+                RenderMaximumFaceGroup(tess, f);
+                assert (f.marked);
+            }
+        }
+        if (tess.lonelyTriList != null) {
+            RenderLonelyTriangles(tess, tess.lonelyTriList);
+            tess.lonelyTriList = null;
+        }
+    }
+
+
+    static void RenderMaximumFaceGroup(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUface fOrig) {
+        /* We want to find the largest triangle fan or strip of unmarked faces
+         * which includes the given face fOrig.  There are 3 possible fans
+         * passing through fOrig (one centered at each vertex), and 3 possible
+         * strips (one for each CCW permutation of the vertices).  Our strategy
+         * is to try all of these, and take the primitive which uses the most
+         * triangles (a greedy approach).
+         */
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e = fOrig.anEdge;
+        FaceCount max = new FaceCount();
+        FaceCount newFace = new FaceCount();
+
+        max.size = 1;
+        max.eStart = e;
+        max.render = renderTriangle;
+
+        if (!tess.flagBoundary) {
+            newFace = MaximumFan(e);
+            if (newFace.size > max.size) {
+                max = newFace;
+            }
+            newFace = MaximumFan(e.Lnext);
+            if (newFace.size > max.size) {
+                max = newFace;
+            }
+            newFace = MaximumFan(e.Onext.Sym);
+            if (newFace.size > max.size) {
+                max = newFace;
+            }
+
+            newFace = MaximumStrip(e);
+            if (newFace.size > max.size) {
+                max = newFace;
+            }
+            newFace = MaximumStrip(e.Lnext);
+            if (newFace.size > max.size) {
+                max = newFace;
+            }
+            newFace = MaximumStrip(e.Onext.Sym);
+            if (newFace.size > max.size) {
+                max = newFace;
+            }
+        }
+        max.render.render(tess, max.eStart, max.size);
+    }
+
+
+/* Macros which keep track of faces we have marked temporarily, and allow
+ * us to backtrack when necessary.  With triangle fans, this is not
+ * really necessary, since the only awkward case is a loop of triangles
+ * around a single origin vertex.  However with strips the situation is
+ * more complicated, and we need a general tracking method like the
+ * one here.
+ */
+    private static boolean Marked(jogamp.opengl.glu.tessellator.GLUface f) {
+        return !f.inside || f.marked;
+    }
+
+    private static GLUface AddToTrail(jogamp.opengl.glu.tessellator.GLUface f, jogamp.opengl.glu.tessellator.GLUface t) {
+        f.trail = t;
+        f.marked = true;
+        return f;
+    }
+
+    private static void FreeTrail(jogamp.opengl.glu.tessellator.GLUface t) {
+        if (true) {
+            while (t != null) {
+                t.marked = false;
+                t = t.trail;
+            }
+        } else {
+            /* absorb trailing semicolon */
+        }
+    }
+
+    static FaceCount MaximumFan(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
+        /* eOrig.Lface is the face we want to render.  We want to find the size
+         * of a maximal fan around eOrig.Org.  To do this we just walk around
+         * the origin vertex as far as possible in both directions.
+         */
+        FaceCount newFace = new FaceCount(0, null, renderFan);
+        jogamp.opengl.glu.tessellator.GLUface trail = null;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+
+        for (e = eOrig; !Marked(e.Lface); e = e.Onext) {
+            trail = AddToTrail(e.Lface, trail);
+            ++newFace.size;
+        }
+        for (e = eOrig; !Marked(e.Sym.Lface); e = e.Sym.Lnext) {
+            trail = AddToTrail(e.Sym.Lface, trail);
+            ++newFace.size;
+        }
+        newFace.eStart = e;
+        /*LINTED*/
+        FreeTrail(trail);
+        return newFace;
+    }
+
+
+    private static boolean IsEven(long n) {
+        return (n & 0x1L) == 0;
+    }
+
+    static FaceCount MaximumStrip(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
+        /* Here we are looking for a maximal strip that contains the vertices
+         * eOrig.Org, eOrig.Dst, eOrig.Lnext.Dst (in that order or the
+         * reverse, such that all triangles are oriented CCW).
+         *
+         * Again we walk forward and backward as far as possible.  However for
+         * strips there is a twist: to get CCW orientations, there must be
+         * an *even* number of triangles in the strip on one side of eOrig.
+         * We walk the strip starting on a side with an even number of triangles;
+         * if both side have an odd number, we are forced to shorten one side.
+         */
+        FaceCount newFace = new FaceCount(0, null, renderStrip);
+        long headSize = 0, tailSize = 0;
+        jogamp.opengl.glu.tessellator.GLUface trail = null;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e, eTail, eHead;
+
+        for (e = eOrig; !Marked(e.Lface); ++tailSize, e = e.Onext) {
+            trail = AddToTrail(e.Lface, trail);
+            ++tailSize;
+            e = e.Lnext.Sym;
+            if (Marked(e.Lface)) break;
+            trail = AddToTrail(e.Lface, trail);
+        }
+        eTail = e;
+
+        for (e = eOrig; !Marked(e.Sym.Lface); ++headSize, e = e.Sym.Onext.Sym) {
+            trail = AddToTrail(e.Sym.Lface, trail);
+            ++headSize;
+            e = e.Sym.Lnext;
+            if (Marked(e.Sym.Lface)) break;
+            trail = AddToTrail(e.Sym.Lface, trail);
+        }
+        eHead = e;
+
+        newFace.size = tailSize + headSize;
+        if (IsEven(tailSize)) {
+            newFace.eStart = eTail.Sym;
+        } else if (IsEven(headSize)) {
+            newFace.eStart = eHead;
+        } else {
+            /* Both sides have odd length, we must shorten one of them.  In fact,
+             * we must start from eHead to guarantee inclusion of eOrig.Lface.
+             */
+            --newFace.size;
+            newFace.eStart = eHead.Onext;
+        }
+        /*LINTED*/
+        FreeTrail(trail);
+        return newFace;
+    }
+
+    private static class RenderTriangle implements renderCallBack {
+        public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+            /* Just add the triangle to a triangle list, so we can render all
+             * the separate triangles at once.
+             */
+            assert (size == 1);
+            tess.lonelyTriList = AddToTrail(e.Lface, tess.lonelyTriList);
+        }
+    }
+
+
+    static void RenderLonelyTriangles(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUface f) {
+        /* Now we render all the separate triangles which could not be
+         * grouped into a triangle fan or strip.
+         */
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+        int newState;
+        int edgeState = -1;	/* force edge state output for first vertex */
+
+        tess.callBeginOrBeginData(GL.GL_TRIANGLES);
+
+        for (; f != null; f = f.trail) {
+            /* Loop once for each edge (there will always be 3 edges) */
+
+            e = f.anEdge;
+            do {
+                if (tess.flagBoundary) {
+                    /* Set the "edge state" to true just before we output the
+                     * first vertex of each edge on the polygon boundary.
+                     */
+                    newState = (!e.Sym.Lface.inside) ? 1 : 0;
+                    if (edgeState != newState) {
+                        edgeState = newState;
+                        tess.callEdgeFlagOrEdgeFlagData( edgeState != 0);
+                    }
+                }
+                tess.callVertexOrVertexData( e.Org.data);
+
+                e = e.Lnext;
+            } while (e != f.anEdge);
+        }
+        tess.callEndOrEndData();
+    }
+
+    private static class RenderFan implements renderCallBack {
+        public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+            /* Render as many CCW triangles as possible in a fan starting from
+             * edge "e".  The fan *should* contain exactly "size" triangles
+             * (otherwise we've goofed up somewhere).
+             */
+            tess.callBeginOrBeginData( GL.GL_TRIANGLE_FAN);
+            tess.callVertexOrVertexData( e.Org.data);
+            tess.callVertexOrVertexData( e.Sym.Org.data);
+
+            while (!Marked(e.Lface)) {
+                e.Lface.marked = true;
+                --size;
+                e = e.Onext;
+                tess.callVertexOrVertexData( e.Sym.Org.data);
+            }
+
+            assert (size == 0);
+            tess.callEndOrEndData();
+        }
+    }
+
+    private static class RenderStrip implements renderCallBack {
+        public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+            /* Render as many CCW triangles as possible in a strip starting from
+             * edge "e".  The strip *should* contain exactly "size" triangles
+             * (otherwise we've goofed up somewhere).
+             */
+            tess.callBeginOrBeginData( GL.GL_TRIANGLE_STRIP);
+            tess.callVertexOrVertexData( e.Org.data);
+            tess.callVertexOrVertexData( e.Sym.Org.data);
+
+            while (!Marked(e.Lface)) {
+                e.Lface.marked = true;
+                --size;
+                e = e.Lnext.Sym;
+                tess.callVertexOrVertexData( e.Org.data);
+                if (Marked(e.Lface)) break;
+
+                e.Lface.marked = true;
+                --size;
+                e = e.Onext;
+                tess.callVertexOrVertexData( e.Sym.Org.data);
+            }
+
+            assert (size == 0);
+            tess.callEndOrEndData();
+        }
+    }
+
+    /************************ Boundary contour decomposition ******************/
+
+/* __gl_renderBoundary( tess, mesh ) takes a mesh, and outputs one
+ * contour for each face marked "inside".  The rendering output is
+ * provided as callbacks (see the api).
+ */
+    public static void __gl_renderBoundary(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+        jogamp.opengl.glu.tessellator.GLUface f;
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+
+        for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
+            if (f.inside) {
+                tess.callBeginOrBeginData( GL.GL_LINE_LOOP);
+                e = f.anEdge;
+                do {
+                    tess.callVertexOrVertexData( e.Org.data);
+                    e = e.Lnext;
+                } while (e != f.anEdge);
+                tess.callEndOrEndData();
+            }
+        }
+    }
+
+
+    /************************ Quick-and-dirty decomposition ******************/
+
+    private static final int SIGN_INCONSISTENT = 2;
+
+    static int ComputeNormal(GLUtessellatorImpl tess, double[] norm, boolean check)
+/*
+ * If check==false, we compute the polygon normal and place it in norm[].
+ * If check==true, we check that each triangle in the fan from v0 has a
+ * consistent orientation with respect to norm[].  If triangles are
+ * consistently oriented CCW, return 1; if CW, return -1; if all triangles
+ * are degenerate return 0; otherwise (no consistent orientation) return
+ * SIGN_INCONSISTENT.
+ */ {
+        jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
+//            CachedVertex vn = v0 + tess.cacheCount;
+        int vn = tess.cacheCount;
+//            CachedVertex vc;
+        int vc;
+        double dot, xc, yc, zc, xp, yp, zp;
+        double[] n = new double[3];
+        int sign = 0;
+
+        /* Find the polygon normal.  It is important to get a reasonable
+         * normal even when the polygon is self-intersecting (eg. a bowtie).
+         * Otherwise, the computed normal could be very tiny, but perpendicular
+         * to the true plane of the polygon due to numerical noise.  Then all
+         * the triangles would appear to be degenerate and we would incorrectly
+         * decompose the polygon as a fan (or simply not render it at all).
+         *
+         * We use a sum-of-triangles normal algorithm rather than the more
+         * efficient sum-of-trapezoids method (used in CheckOrientation()
+         * in normal.c).  This lets us explicitly reverse the signed area
+         * of some triangles to get a reasonable normal in the self-intersecting
+         * case.
+         */
+        if (!check) {
+            norm[0] = norm[1] = norm[2] = 0.0;
+        }
+
+        vc = 1;
+        xc = v[vc].coords[0] - v[0].coords[0];
+        yc = v[vc].coords[1] - v[0].coords[1];
+        zc = v[vc].coords[2] - v[0].coords[2];
+        while (++vc < vn) {
+            xp = xc;
+            yp = yc;
+            zp = zc;
+            xc = v[vc].coords[0] - v[0].coords[0];
+            yc = v[vc].coords[1] - v[0].coords[1];
+            zc = v[vc].coords[2] - v[0].coords[2];
+
+            /* Compute (vp - v0) cross (vc - v0) */
+            n[0] = yp * zc - zp * yc;
+            n[1] = zp * xc - xp * zc;
+            n[2] = xp * yc - yp * xc;
+
+            dot = n[0] * norm[0] + n[1] * norm[1] + n[2] * norm[2];
+            if (!check) {
+                /* Reverse the contribution of back-facing triangles to get
+                 * a reasonable normal for self-intersecting polygons (see above)
+                 */
+                if (dot >= 0) {
+                    norm[0] += n[0];
+                    norm[1] += n[1];
+                    norm[2] += n[2];
+                } else {
+                    norm[0] -= n[0];
+                    norm[1] -= n[1];
+                    norm[2] -= n[2];
+                }
+            } else if (dot != 0) {
+                /* Check the new orientation for consistency with previous triangles */
+                if (dot > 0) {
+                    if (sign < 0) return SIGN_INCONSISTENT;
+                    sign = 1;
+                } else {
+                    if (sign > 0) return SIGN_INCONSISTENT;
+                    sign = -1;
+                }
+            }
+        }
+        return sign;
+    }
+
+/* __gl_renderCache( tess ) takes a single contour and tries to render it
+ * as a triangle fan.  This handles convex polygons, as well as some
+ * non-convex polygons if we get lucky.
+ *
+ * Returns true if the polygon was successfully rendered.  The rendering
+ * output is provided as callbacks (see the api).
+ */
+    public static boolean __gl_renderCache(GLUtessellatorImpl tess) {
+        jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
+//            CachedVertex vn = v0 + tess.cacheCount;
+        int vn = tess.cacheCount;
+//            CachedVertex vc;
+        int vc;
+        double[] norm = new double[3];
+        int sign;
+
+        if (tess.cacheCount < 3) {
+            /* Degenerate contour -- no output */
+            return true;
+        }
+
+        norm[0] = tess.normal[0];
+        norm[1] = tess.normal[1];
+        norm[2] = tess.normal[2];
+        if (norm[0] == 0 && norm[1] == 0 && norm[2] == 0) {
+            ComputeNormal( tess, norm, false);
+        }
+
+        sign = ComputeNormal( tess, norm, true);
+        if (sign == SIGN_INCONSISTENT) {
+            /* Fan triangles did not have a consistent orientation */
+            return false;
+        }
+        if (sign == 0) {
+            /* All triangles were degenerate */
+            return true;
+        }
+
+        if ( !USE_OPTIMIZED_CODE_PATH ) {
+            return false;
+        } else {
+            /* Make sure we do the right thing for each winding rule */
+            switch (tess.windingRule) {
+                case GLU.GLU_TESS_WINDING_ODD:
+                case GLU.GLU_TESS_WINDING_NONZERO:
+                    break;
+                case GLU.GLU_TESS_WINDING_POSITIVE:
+                    if (sign < 0) return true;
+                    break;
+                case GLU.GLU_TESS_WINDING_NEGATIVE:
+                    if (sign > 0) return true;
+                    break;
+                case GLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
+                    return true;
+            }
+
+            tess.callBeginOrBeginData( tess.boundaryOnly ? GL.GL_LINE_LOOP
+                    : (tess.cacheCount > 3) ? GL.GL_TRIANGLE_FAN
+                    : GL.GL_TRIANGLES);
+
+            tess.callVertexOrVertexData( v[0].data);
+            if (sign > 0) {
+                for (vc = 1; vc < vn; ++vc) {
+                    tess.callVertexOrVertexData( v[vc].data);
+                }
+            } else {
+                for (vc = vn - 1; vc > 0; --vc) {
+                    tess.callVertexOrVertexData( v[vc].data);
+                }
+            }
+            tess.callEndOrEndData();
+            return true;
+        }
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
new file mode 100644
index 0000000..95eb5dd
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
@@ -0,0 +1,1353 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+class Sweep {
+    private Sweep() {
+    }
+
+//    #ifdef FOR_TRITE_TEST_PROGRAM
+//    extern void DebugEvent( GLUtessellator *tess );
+//    #else
+    private static void DebugEvent(GLUtessellatorImpl tess) {
+
+    }
+//    #endif
+
+/*
+ * Invariants for the Edge Dictionary.
+ * - each pair of adjacent edges e2=Succ(e1) satisfies EdgeLeq(e1,e2)
+ *   at any valid location of the sweep event
+ * - if EdgeLeq(e2,e1) as well (at any valid sweep event), then e1 and e2
+ *   share a common endpoint
+ * - for each e, e.Dst has been processed, but not e.Org
+ * - each edge e satisfies VertLeq(e.Dst,event) && VertLeq(event,e.Org)
+ *   where "event" is the current sweep line event.
+ * - no edge e has zero length
+ *
+ * Invariants for the Mesh (the processed portion).
+ * - the portion of the mesh left of the sweep line is a planar graph,
+ *   ie. there is *some* way to embed it in the plane
+ * - no processed edge has zero length
+ * - no two processed vertices have identical coordinates
+ * - each "inside" region is monotone, ie. can be broken into two chains
+ *   of monotonically increasing vertices according to VertLeq(v1,v2)
+ *   - a non-invariant: these chains may intersect (very slightly)
+ *
+ * Invariants for the Sweep.
+ * - if none of the edges incident to the event vertex have an activeRegion
+ *   (ie. none of these edges are in the edge dictionary), then the vertex
+ *   has only right-going edges.
+ * - if an edge is marked "fixUpperEdge" (it is a temporary edge introduced
+ *   by ConnectRightVertex), then it is the only right-going edge from
+ *   its associated vertex.  (This says that these edges exist only
+ *   when it is necessary.)
+ */
+
+/* When we merge two edges into one, we need to compute the combined
+ * winding of the new edge.
+ */
+    private static void AddWinding(GLUhalfEdge eDst, GLUhalfEdge eSrc) {
+        eDst.winding += eSrc.winding;
+        eDst.Sym.winding += eSrc.Sym.winding;
+    }
+
+
+    private static ActiveRegion RegionBelow(ActiveRegion r) {
+        return ((ActiveRegion) Dict.dictKey(Dict.dictPred(r.nodeUp)));
+    }
+
+    private static ActiveRegion RegionAbove(ActiveRegion r) {
+        return ((ActiveRegion) Dict.dictKey(Dict.dictSucc(r.nodeUp)));
+    }
+
+    static boolean EdgeLeq(GLUtessellatorImpl tess, ActiveRegion reg1, ActiveRegion reg2)
+/*
+ * Both edges must be directed from right to left (this is the canonical
+ * direction for the upper edge of each region).
+ *
+ * The strategy is to evaluate a "t" value for each edge at the
+ * current sweep line position, given by tess.event.  The calculations
+ * are designed to be very stable, but of course they are not perfect.
+ *
+ * Special case: if both edge destinations are at the sweep event,
+ * we sort the edges by slope (they would otherwise compare equally).
+ */ {
+        GLUvertex event = tess.event;
+        GLUhalfEdge e1, e2;
+        double t1, t2;
+
+        e1 = reg1.eUp;
+        e2 = reg2.eUp;
+
+        if (e1.Sym.Org == event) {
+            if (e2.Sym.Org == event) {
+                /* Two edges right of the sweep line which meet at the sweep event.
+                 * Sort them by slope.
+                 */
+                if (Geom.VertLeq(e1.Org, e2.Org)) {
+                    return Geom.EdgeSign(e2.Sym.Org, e1.Org, e2.Org) <= 0;
+                }
+                return Geom.EdgeSign(e1.Sym.Org, e2.Org, e1.Org) >= 0;
+            }
+            return Geom.EdgeSign(e2.Sym.Org, event, e2.Org) <= 0;
+        }
+        if (e2.Sym.Org == event) {
+            return Geom.EdgeSign(e1.Sym.Org, event, e1.Org) >= 0;
+        }
+
+        /* General case - compute signed distance *from* e1, e2 to event */
+        t1 = Geom.EdgeEval(e1.Sym.Org, event, e1.Org);
+        t2 = Geom.EdgeEval(e2.Sym.Org, event, e2.Org);
+        return (t1 >= t2);
+    }
+
+
+    static void DeleteRegion(GLUtessellatorImpl tess, ActiveRegion reg) {
+        if (reg.fixUpperEdge) {
+            /* It was created with zero winding number, so it better be
+             * deleted with zero winding number (ie. it better not get merged
+             * with a real edge).
+             */
+            assert (reg.eUp.winding == 0);
+        }
+        reg.eUp.activeRegion = null;
+        Dict.dictDelete(tess.dict, reg.nodeUp); /* __gl_dictListDelete */
+    }
+
+
+    static boolean FixUpperEdge(ActiveRegion reg, GLUhalfEdge newEdge)
+/*
+ * Replace an upper edge which needs fixing (see ConnectRightVertex).
+ */ {
+        assert (reg.fixUpperEdge);
+        if (!Mesh.__gl_meshDelete(reg.eUp)) return false;
+        reg.fixUpperEdge = false;
+        reg.eUp = newEdge;
+        newEdge.activeRegion = reg;
+
+        return true;
+    }
+
+    static ActiveRegion TopLeftRegion(ActiveRegion reg) {
+        GLUvertex org = reg.eUp.Org;
+        GLUhalfEdge e;
+
+        /* Find the region above the uppermost edge with the same origin */
+        do {
+            reg = RegionAbove(reg);
+        } while (reg.eUp.Org == org);
+
+        /* If the edge above was a temporary edge introduced by ConnectRightVertex,
+         * now is the time to fix it.
+         */
+        if (reg.fixUpperEdge) {
+            e = Mesh.__gl_meshConnect(RegionBelow(reg).eUp.Sym, reg.eUp.Lnext);
+            if (e == null) return null;
+            if (!FixUpperEdge(reg, e)) return null;
+            reg = RegionAbove(reg);
+        }
+        return reg;
+    }
+
+    static ActiveRegion TopRightRegion(ActiveRegion reg) {
+        GLUvertex dst = reg.eUp.Sym.Org;
+
+        /* Find the region above the uppermost edge with the same destination */
+        do {
+            reg = RegionAbove(reg);
+        } while (reg.eUp.Sym.Org == dst);
+        return reg;
+    }
+
+    static ActiveRegion AddRegionBelow(GLUtessellatorImpl tess,
+                                       ActiveRegion regAbove,
+                                       GLUhalfEdge eNewUp)
+/*
+ * Add a new active region to the sweep line, *somewhere* below "regAbove"
+ * (according to where the new edge belongs in the sweep-line dictionary).
+ * The upper edge of the new region will be "eNewUp".
+ * Winding number and "inside" flag are not updated.
+ */ {
+        ActiveRegion regNew = new ActiveRegion();
+        if (regNew == null) throw new RuntimeException();
+
+        regNew.eUp = eNewUp;
+        /* __gl_dictListInsertBefore */
+        regNew.nodeUp = Dict.dictInsertBefore(tess.dict, regAbove.nodeUp, regNew);
+        if (regNew.nodeUp == null) throw new RuntimeException();
+        regNew.fixUpperEdge = false;
+        regNew.sentinel = false;
+        regNew.dirty = false;
+
+        eNewUp.activeRegion = regNew;
+        return regNew;
+    }
+
+    static boolean IsWindingInside(GLUtessellatorImpl tess, int n) {
+        switch (tess.windingRule) {
+            case GLU.GLU_TESS_WINDING_ODD:
+                return (n & 1) != 0;
+            case GLU.GLU_TESS_WINDING_NONZERO:
+                return (n != 0);
+            case GLU.GLU_TESS_WINDING_POSITIVE:
+                return (n > 0);
+            case GLU.GLU_TESS_WINDING_NEGATIVE:
+                return (n < 0);
+            case GLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
+                return (n >= 2) || (n <= -2);
+        }
+        /*LINTED*/
+//        assert (false);
+        throw new InternalError();
+        /*NOTREACHED*/
+    }
+
+
+    static void ComputeWinding(GLUtessellatorImpl tess, ActiveRegion reg) {
+        reg.windingNumber = RegionAbove(reg).windingNumber + reg.eUp.winding;
+        reg.inside = IsWindingInside(tess, reg.windingNumber);
+    }
+
+
+    static void FinishRegion(GLUtessellatorImpl tess, ActiveRegion reg)
+/*
+ * Delete a region from the sweep line.  This happens when the upper
+ * and lower chains of a region meet (at a vertex on the sweep line).
+ * The "inside" flag is copied to the appropriate mesh face (we could
+ * not do this before -- since the structure of the mesh is always
+ * changing, this face may not have even existed until now).
+ */ {
+        GLUhalfEdge e = reg.eUp;
+        GLUface f = e.Lface;
+
+        f.inside = reg.inside;
+        f.anEdge = e;   /* optimization for __gl_meshTessellateMonoRegion() */
+        DeleteRegion(tess, reg);
+    }
+
+
+    static GLUhalfEdge FinishLeftRegions(GLUtessellatorImpl tess,
+                                         ActiveRegion regFirst, ActiveRegion regLast)
+/*
+ * We are given a vertex with one or more left-going edges.  All affected
+ * edges should be in the edge dictionary.  Starting at regFirst.eUp,
+ * we walk down deleting all regions where both edges have the same
+ * origin vOrg.  At the same time we copy the "inside" flag from the
+ * active region to the face, since at this point each face will belong
+ * to at most one region (this was not necessarily true until this point
+ * in the sweep).  The walk stops at the region above regLast; if regLast
+ * is null we walk as far as possible.  At the same time we relink the
+ * mesh if necessary, so that the ordering of edges around vOrg is the
+ * same as in the dictionary.
+ */ {
+        ActiveRegion reg, regPrev;
+        GLUhalfEdge e, ePrev;
+
+        regPrev = regFirst;
+        ePrev = regFirst.eUp;
+        while (regPrev != regLast) {
+            regPrev.fixUpperEdge = false;	/* placement was OK */
+            reg = RegionBelow(regPrev);
+            e = reg.eUp;
+            if (e.Org != ePrev.Org) {
+                if (!reg.fixUpperEdge) {
+                    /* Remove the last left-going edge.  Even though there are no further
+                     * edges in the dictionary with this origin, there may be further
+                     * such edges in the mesh (if we are adding left edges to a vertex
+                     * that has already been processed).  Thus it is important to call
+                     * FinishRegion rather than just DeleteRegion.
+                     */
+                    FinishRegion(tess, regPrev);
+                    break;
+                }
+                /* If the edge below was a temporary edge introduced by
+                 * ConnectRightVertex, now is the time to fix it.
+                 */
+                e = Mesh.__gl_meshConnect(ePrev.Onext.Sym, e.Sym);
+                if (e == null) throw new RuntimeException();
+                if (!FixUpperEdge(reg, e)) throw new RuntimeException();
+            }
+
+            /* Relink edges so that ePrev.Onext == e */
+            if (ePrev.Onext != e) {
+                if (!Mesh.__gl_meshSplice(e.Sym.Lnext, e)) throw new RuntimeException();
+                if (!Mesh.__gl_meshSplice(ePrev, e)) throw new RuntimeException();
+            }
+            FinishRegion(tess, regPrev);	/* may change reg.eUp */
+            ePrev = reg.eUp;
+            regPrev = reg;
+        }
+        return ePrev;
+    }
+
+
+    static void AddRightEdges(GLUtessellatorImpl tess, ActiveRegion regUp,
+                              GLUhalfEdge eFirst, GLUhalfEdge eLast, GLUhalfEdge eTopLeft,
+                              boolean cleanUp)
+/*
+ * Purpose: insert right-going edges into the edge dictionary, and update
+ * winding numbers and mesh connectivity appropriately.  All right-going
+ * edges share a common origin vOrg.  Edges are inserted CCW starting at
+ * eFirst; the last edge inserted is eLast.Sym.Lnext.  If vOrg has any
+ * left-going edges already processed, then eTopLeft must be the edge
+ * such that an imaginary upward vertical segment from vOrg would be
+ * contained between eTopLeft.Sym.Lnext and eTopLeft; otherwise eTopLeft
+ * should be null.
+ */ {
+        ActiveRegion reg, regPrev;
+        GLUhalfEdge e, ePrev;
+        boolean firstTime = true;
+
+        /* Insert the new right-going edges in the dictionary */
+        e = eFirst;
+        do {
+            assert (Geom.VertLeq(e.Org, e.Sym.Org));
+            AddRegionBelow(tess, regUp, e.Sym);
+            e = e.Onext;
+        } while (e != eLast);
+
+        /* Walk *all* right-going edges from e.Org, in the dictionary order,
+         * updating the winding numbers of each region, and re-linking the mesh
+         * edges to match the dictionary ordering (if necessary).
+         */
+        if (eTopLeft == null) {
+            eTopLeft = RegionBelow(regUp).eUp.Sym.Onext;
+        }
+        regPrev = regUp;
+        ePrev = eTopLeft;
+        for (; ;) {
+            reg = RegionBelow(regPrev);
+            e = reg.eUp.Sym;
+            if (e.Org != ePrev.Org) break;
+
+            if (e.Onext != ePrev) {
+                /* Unlink e from its current position, and relink below ePrev */
+                if (!Mesh.__gl_meshSplice(e.Sym.Lnext, e)) throw new RuntimeException();
+                if (!Mesh.__gl_meshSplice(ePrev.Sym.Lnext, e)) throw new RuntimeException();
+            }
+            /* Compute the winding number and "inside" flag for the new regions */
+            reg.windingNumber = regPrev.windingNumber - e.winding;
+            reg.inside = IsWindingInside(tess, reg.windingNumber);
+
+            /* Check for two outgoing edges with same slope -- process these
+             * before any intersection tests (see example in __gl_computeInterior).
+             */
+            regPrev.dirty = true;
+            if (!firstTime && CheckForRightSplice(tess, regPrev)) {
+                AddWinding(e, ePrev);
+                DeleteRegion(tess, regPrev);
+                if (!Mesh.__gl_meshDelete(ePrev)) throw new RuntimeException();
+            }
+            firstTime = false;
+            regPrev = reg;
+            ePrev = e;
+        }
+        regPrev.dirty = true;
+        assert (regPrev.windingNumber - e.winding == reg.windingNumber);
+
+        if (cleanUp) {
+            /* Check for intersections between newly adjacent edges. */
+            WalkDirtyRegions(tess, regPrev);
+        }
+    }
+
+
+    static void CallCombine(GLUtessellatorImpl tess, GLUvertex isect,
+                            Object[] data, float[] weights, boolean needed) {
+        double[] coords = new double[3];
+
+        /* Copy coord data in case the callback changes it. */
+        coords[0] = isect.coords[0];
+        coords[1] = isect.coords[1];
+        coords[2] = isect.coords[2];
+
+        Object[] outData = new Object[1];
+        tess.callCombineOrCombineData(coords, data, weights, outData);
+        isect.data = outData[0];
+        if (isect.data == null) {
+            if (!needed) {
+                isect.data = data[0];
+            } else if (!tess.fatalError) {
+                /* The only way fatal error is when two edges are found to intersect,
+                 * but the user has not provided the callback necessary to handle
+                 * generated intersection points.
+                 */
+                tess.callErrorOrErrorData(GLU.GLU_TESS_NEED_COMBINE_CALLBACK);
+                tess.fatalError = true;
+            }
+        }
+    }
+
+    static void SpliceMergeVertices(GLUtessellatorImpl tess, GLUhalfEdge e1,
+                                    GLUhalfEdge e2)
+/*
+ * Two vertices with idential coordinates are combined into one.
+ * e1.Org is kept, while e2.Org is discarded.
+ */ {
+        Object[] data = new Object[4];
+        float[] weights = new float[]{0.5f, 0.5f, 0.0f, 0.0f};
+
+        data[0] = e1.Org.data;
+        data[1] = e2.Org.data;
+        CallCombine(tess, e1.Org, data, weights, false);
+        if (!Mesh.__gl_meshSplice(e1, e2)) throw new RuntimeException();
+    }
+
+    static void VertexWeights(GLUvertex isect, GLUvertex org, GLUvertex dst,
+                              float[] weights)
+/*
+ * Find some weights which describe how the intersection vertex is
+ * a linear combination of "org" and "dest".  Each of the two edges
+ * which generated "isect" is allocated 50% of the weight; each edge
+ * splits the weight between its org and dst according to the
+ * relative distance to "isect".
+ */ {
+        double t1 = Geom.VertL1dist(org, isect);
+        double t2 = Geom.VertL1dist(dst, isect);
+
+        weights[0] = (float) (0.5 * t2 / (t1 + t2));
+        weights[1] = (float) (0.5 * t1 / (t1 + t2));
+        isect.coords[0] += weights[0] * org.coords[0] + weights[1] * dst.coords[0];
+        isect.coords[1] += weights[0] * org.coords[1] + weights[1] * dst.coords[1];
+        isect.coords[2] += weights[0] * org.coords[2] + weights[1] * dst.coords[2];
+    }
+
+
+    static void GetIntersectData(GLUtessellatorImpl tess, GLUvertex isect,
+                                 GLUvertex orgUp, GLUvertex dstUp,
+                                 GLUvertex orgLo, GLUvertex dstLo)
+/*
+ * We've computed a new intersection point, now we need a "data" pointer
+ * from the user so that we can refer to this new vertex in the
+ * rendering callbacks.
+ */ {
+        Object[] data = new Object[4];
+        float[] weights = new float[4];
+        float[] weights1 = new float[2];
+        float[] weights2 = new float[2];
+
+        data[0] = orgUp.data;
+        data[1] = dstUp.data;
+        data[2] = orgLo.data;
+        data[3] = dstLo.data;
+
+        isect.coords[0] = isect.coords[1] = isect.coords[2] = 0;
+        VertexWeights(isect, orgUp, dstUp, weights1);
+        VertexWeights(isect, orgLo, dstLo, weights2);
+        System.arraycopy(weights1, 0, weights, 0, 2);
+        System.arraycopy(weights2, 0, weights, 2, 2);
+
+        CallCombine(tess, isect, data, weights, true);
+    }
+
+    static boolean CheckForRightSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
+/*
+ * Check the upper and lower edge of "regUp", to make sure that the
+ * eUp.Org is above eLo, or eLo.Org is below eUp (depending on which
+ * origin is leftmost).
+ *
+ * The main purpose is to splice right-going edges with the same
+ * dest vertex and nearly identical slopes (ie. we can't distinguish
+ * the slopes numerically).  However the splicing can also help us
+ * to recover from numerical errors.  For example, suppose at one
+ * point we checked eUp and eLo, and decided that eUp.Org is barely
+ * above eLo.  Then later, we split eLo into two edges (eg. from
+ * a splice operation like this one).  This can change the result of
+ * our test so that now eUp.Org is incident to eLo, or barely below it.
+ * We must correct this condition to maintain the dictionary invariants.
+ *
+ * One possibility is to check these edges for intersection again
+ * (ie. CheckForIntersect).  This is what we do if possible.  However
+ * CheckForIntersect requires that tess.event lies between eUp and eLo,
+ * so that it has something to fall back on when the intersection
+ * calculation gives us an unusable answer.  So, for those cases where
+ * we can't check for intersection, this routine fixes the problem
+ * by just splicing the offending vertex into the other edge.
+ * This is a guaranteed solution, no matter how degenerate things get.
+ * Basically this is a combinatorial solution to a numerical problem.
+ */ {
+        ActiveRegion regLo = RegionBelow(regUp);
+        GLUhalfEdge eUp = regUp.eUp;
+        GLUhalfEdge eLo = regLo.eUp;
+
+        if (Geom.VertLeq(eUp.Org, eLo.Org)) {
+            if (Geom.EdgeSign(eLo.Sym.Org, eUp.Org, eLo.Org) > 0) return false;
+
+            /* eUp.Org appears to be below eLo */
+            if (!Geom.VertEq(eUp.Org, eLo.Org)) {
+                /* Splice eUp.Org into eLo */
+                if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
+                if (!Mesh.__gl_meshSplice(eUp, eLo.Sym.Lnext)) throw new RuntimeException();
+                regUp.dirty = regLo.dirty = true;
+
+            } else if (eUp.Org != eLo.Org) {
+                /* merge the two vertices, discarding eUp.Org */
+                tess.pq.pqDelete(eUp.Org.pqHandle); /* __gl_pqSortDelete */
+                SpliceMergeVertices(tess, eLo.Sym.Lnext, eUp);
+            }
+        } else {
+            if (Geom.EdgeSign(eUp.Sym.Org, eLo.Org, eUp.Org) < 0) return false;
+
+            /* eLo.Org appears to be above eUp, so splice eLo.Org into eUp */
+            RegionAbove(regUp).dirty = regUp.dirty = true;
+            if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
+            if (!Mesh.__gl_meshSplice(eLo.Sym.Lnext, eUp)) throw new RuntimeException();
+        }
+        return true;
+    }
+
+    static boolean CheckForLeftSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
+/*
+ * Check the upper and lower edge of "regUp", to make sure that the
+ * eUp.Sym.Org is above eLo, or eLo.Sym.Org is below eUp (depending on which
+ * destination is rightmost).
+ *
+ * Theoretically, this should always be true.  However, splitting an edge
+ * into two pieces can change the results of previous tests.  For example,
+ * suppose at one point we checked eUp and eLo, and decided that eUp.Sym.Org
+ * is barely above eLo.  Then later, we split eLo into two edges (eg. from
+ * a splice operation like this one).  This can change the result of
+ * the test so that now eUp.Sym.Org is incident to eLo, or barely below it.
+ * We must correct this condition to maintain the dictionary invariants
+ * (otherwise new edges might get inserted in the wrong place in the
+ * dictionary, and bad stuff will happen).
+ *
+ * We fix the problem by just splicing the offending vertex into the
+ * other edge.
+ */ {
+        ActiveRegion regLo = RegionBelow(regUp);
+        GLUhalfEdge eUp = regUp.eUp;
+        GLUhalfEdge eLo = regLo.eUp;
+        GLUhalfEdge e;
+
+        assert (!Geom.VertEq(eUp.Sym.Org, eLo.Sym.Org));
+
+        if (Geom.VertLeq(eUp.Sym.Org, eLo.Sym.Org)) {
+            if (Geom.EdgeSign(eUp.Sym.Org, eLo.Sym.Org, eUp.Org) < 0) return false;
+
+            /* eLo.Sym.Org is above eUp, so splice eLo.Sym.Org into eUp */
+            RegionAbove(regUp).dirty = regUp.dirty = true;
+            e = Mesh.__gl_meshSplitEdge(eUp);
+            if (e == null) throw new RuntimeException();
+            if (!Mesh.__gl_meshSplice(eLo.Sym, e)) throw new RuntimeException();
+            e.Lface.inside = regUp.inside;
+        } else {
+            if (Geom.EdgeSign(eLo.Sym.Org, eUp.Sym.Org, eLo.Org) > 0) return false;
+
+            /* eUp.Sym.Org is below eLo, so splice eUp.Sym.Org into eLo */
+            regUp.dirty = regLo.dirty = true;
+            e = Mesh.__gl_meshSplitEdge(eLo);
+            if (e == null) throw new RuntimeException();
+            if (!Mesh.__gl_meshSplice(eUp.Lnext, eLo.Sym)) throw new RuntimeException();
+            e.Sym.Lface.inside = regUp.inside;
+        }
+        return true;
+    }
+
+
+    static boolean CheckForIntersect(GLUtessellatorImpl tess, ActiveRegion regUp)
+/*
+ * Check the upper and lower edges of the given region to see if
+ * they intersect.  If so, create the intersection and add it
+ * to the data structures.
+ *
+ * Returns true if adding the new intersection resulted in a recursive
+ * call to AddRightEdges(); in this case all "dirty" regions have been
+ * checked for intersections, and possibly regUp has been deleted.
+ */ {
+        ActiveRegion regLo = RegionBelow(regUp);
+        GLUhalfEdge eUp = regUp.eUp;
+        GLUhalfEdge eLo = regLo.eUp;
+        GLUvertex orgUp = eUp.Org;
+        GLUvertex orgLo = eLo.Org;
+        GLUvertex dstUp = eUp.Sym.Org;
+        GLUvertex dstLo = eLo.Sym.Org;
+        double tMinUp, tMaxLo;
+        GLUvertex isect = new GLUvertex();
+        GLUvertex orgMin;
+        GLUhalfEdge e;
+
+        assert (!Geom.VertEq(dstLo, dstUp));
+        assert (Geom.EdgeSign(dstUp, tess.event, orgUp) <= 0);
+        assert (Geom.EdgeSign(dstLo, tess.event, orgLo) >= 0);
+        assert (orgUp != tess.event && orgLo != tess.event);
+        assert (!regUp.fixUpperEdge && !regLo.fixUpperEdge);
+
+        if (orgUp == orgLo) return false;	/* right endpoints are the same */
+
+        tMinUp = Math.min(orgUp.t, dstUp.t);
+        tMaxLo = Math.max(orgLo.t, dstLo.t);
+        if (tMinUp > tMaxLo) return false;	/* t ranges do not overlap */
+
+        if (Geom.VertLeq(orgUp, orgLo)) {
+            if (Geom.EdgeSign(dstLo, orgUp, orgLo) > 0) return false;
+        } else {
+            if (Geom.EdgeSign(dstUp, orgLo, orgUp) < 0) return false;
+        }
+
+        /* At this point the edges intersect, at least marginally */
+        DebugEvent(tess);
+
+        Geom.EdgeIntersect(dstUp, orgUp, dstLo, orgLo, isect);
+        /* The following properties are guaranteed: */
+        assert (Math.min(orgUp.t, dstUp.t) <= isect.t);
+        assert (isect.t <= Math.max(orgLo.t, dstLo.t));
+        assert (Math.min(dstLo.s, dstUp.s) <= isect.s);
+        assert (isect.s <= Math.max(orgLo.s, orgUp.s));
+
+        if (Geom.VertLeq(isect, tess.event)) {
+            /* The intersection point lies slightly to the left of the sweep line,
+             * so move it until it''s slightly to the right of the sweep line.
+             * (If we had perfect numerical precision, this would never happen
+             * in the first place).  The easiest and safest thing to do is
+             * replace the intersection by tess.event.
+             */
+            isect.s = tess.event.s;
+            isect.t = tess.event.t;
+        }
+        /* Similarly, if the computed intersection lies to the right of the
+         * rightmost origin (which should rarely happen), it can cause
+         * unbelievable inefficiency on sufficiently degenerate inputs.
+         * (If you have the test program, try running test54.d with the
+         * "X zoom" option turned on).
+         */
+        orgMin = Geom.VertLeq(orgUp, orgLo) ? orgUp : orgLo;
+        if (Geom.VertLeq(orgMin, isect)) {
+            isect.s = orgMin.s;
+            isect.t = orgMin.t;
+        }
+
+        if (Geom.VertEq(isect, orgUp) || Geom.VertEq(isect, orgLo)) {
+            /* Easy case -- intersection at one of the right endpoints */
+            CheckForRightSplice(tess, regUp);
+            return false;
+        }
+
+        if ((!Geom.VertEq(dstUp, tess.event)
+                && Geom.EdgeSign(dstUp, tess.event, isect) >= 0)
+                || (!Geom.VertEq(dstLo, tess.event)
+                && Geom.EdgeSign(dstLo, tess.event, isect) <= 0)) {
+            /* Very unusual -- the new upper or lower edge would pass on the
+             * wrong side of the sweep event, or through it.  This can happen
+             * due to very small numerical errors in the intersection calculation.
+             */
+            if (dstLo == tess.event) {
+                /* Splice dstLo into eUp, and process the new region(s) */
+                if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
+                if (!Mesh.__gl_meshSplice(eLo.Sym, eUp)) throw new RuntimeException();
+                regUp = TopLeftRegion(regUp);
+                if (regUp == null) throw new RuntimeException();
+                eUp = RegionBelow(regUp).eUp;
+                FinishLeftRegions(tess, RegionBelow(regUp), regLo);
+                AddRightEdges(tess, regUp, eUp.Sym.Lnext, eUp, eUp, true);
+                return true;
+            }
+            if (dstUp == tess.event) {
+                /* Splice dstUp into eLo, and process the new region(s) */
+                if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
+                if (!Mesh.__gl_meshSplice(eUp.Lnext, eLo.Sym.Lnext)) throw new RuntimeException();
+                regLo = regUp;
+                regUp = TopRightRegion(regUp);
+                e = RegionBelow(regUp).eUp.Sym.Onext;
+                regLo.eUp = eLo.Sym.Lnext;
+                eLo = FinishLeftRegions(tess, regLo, null);
+                AddRightEdges(tess, regUp, eLo.Onext, eUp.Sym.Onext, e, true);
+                return true;
+            }
+            /* Special case: called from ConnectRightVertex.  If either
+             * edge passes on the wrong side of tess.event, split it
+             * (and wait for ConnectRightVertex to splice it appropriately).
+             */
+            if (Geom.EdgeSign(dstUp, tess.event, isect) >= 0) {
+                RegionAbove(regUp).dirty = regUp.dirty = true;
+                if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
+                eUp.Org.s = tess.event.s;
+                eUp.Org.t = tess.event.t;
+            }
+            if (Geom.EdgeSign(dstLo, tess.event, isect) <= 0) {
+                regUp.dirty = regLo.dirty = true;
+                if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
+                eLo.Org.s = tess.event.s;
+                eLo.Org.t = tess.event.t;
+            }
+            /* leave the rest for ConnectRightVertex */
+            return false;
+        }
+
+        /* General case -- split both edges, splice into new vertex.
+         * When we do the splice operation, the order of the arguments is
+         * arbitrary as far as correctness goes.  However, when the operation
+         * creates a new face, the work done is proportional to the size of
+         * the new face.  We expect the faces in the processed part of
+         * the mesh (ie. eUp.Lface) to be smaller than the faces in the
+         * unprocessed original contours (which will be eLo.Sym.Lnext.Lface).
+         */
+        if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
+        if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
+        if (!Mesh.__gl_meshSplice(eLo.Sym.Lnext, eUp)) throw new RuntimeException();
+        eUp.Org.s = isect.s;
+        eUp.Org.t = isect.t;
+        eUp.Org.pqHandle = tess.pq.pqInsert(eUp.Org); /* __gl_pqSortInsert */
+        if (eUp.Org.pqHandle == Long.MAX_VALUE) {
+            tess.pq.pqDeletePriorityQ();	/* __gl_pqSortDeletePriorityQ */
+            tess.pq = null;
+            throw new RuntimeException();
+        }
+        GetIntersectData(tess, eUp.Org, orgUp, dstUp, orgLo, dstLo);
+        RegionAbove(regUp).dirty = regUp.dirty = regLo.dirty = true;
+        return false;
+    }
+
+    static void WalkDirtyRegions(GLUtessellatorImpl tess, ActiveRegion regUp)
+/*
+ * When the upper or lower edge of any region changes, the region is
+ * marked "dirty".  This routine walks through all the dirty regions
+ * and makes sure that the dictionary invariants are satisfied
+ * (see the comments at the beginning of this file).  Of course
+ * new dirty regions can be created as we make changes to restore
+ * the invariants.
+ */ {
+        ActiveRegion regLo = RegionBelow(regUp);
+        GLUhalfEdge eUp, eLo;
+
+        for (; ;) {
+            /* Find the lowest dirty region (we walk from the bottom up). */
+            while (regLo.dirty) {
+                regUp = regLo;
+                regLo = RegionBelow(regLo);
+            }
+            if (!regUp.dirty) {
+                regLo = regUp;
+                regUp = RegionAbove(regUp);
+                if (regUp == null || !regUp.dirty) {
+                    /* We've walked all the dirty regions */
+                    return;
+                }
+            }
+            regUp.dirty = false;
+            eUp = regUp.eUp;
+            eLo = regLo.eUp;
+
+            if (eUp.Sym.Org != eLo.Sym.Org) {
+                /* Check that the edge ordering is obeyed at the Dst vertices. */
+                if (CheckForLeftSplice(tess, regUp)) {
+
+                    /* If the upper or lower edge was marked fixUpperEdge, then
+                     * we no longer need it (since these edges are needed only for
+                     * vertices which otherwise have no right-going edges).
+                     */
+                    if (regLo.fixUpperEdge) {
+                        DeleteRegion(tess, regLo);
+                        if (!Mesh.__gl_meshDelete(eLo)) throw new RuntimeException();
+                        regLo = RegionBelow(regUp);
+                        eLo = regLo.eUp;
+                    } else if (regUp.fixUpperEdge) {
+                        DeleteRegion(tess, regUp);
+                        if (!Mesh.__gl_meshDelete(eUp)) throw new RuntimeException();
+                        regUp = RegionAbove(regLo);
+                        eUp = regUp.eUp;
+                    }
+                }
+            }
+            if (eUp.Org != eLo.Org) {
+                if (eUp.Sym.Org != eLo.Sym.Org
+                        && !regUp.fixUpperEdge && !regLo.fixUpperEdge
+                        && (eUp.Sym.Org == tess.event || eLo.Sym.Org == tess.event)) {
+                    /* When all else fails in CheckForIntersect(), it uses tess.event
+                     * as the intersection location.  To make this possible, it requires
+                     * that tess.event lie between the upper and lower edges, and also
+                     * that neither of these is marked fixUpperEdge (since in the worst
+                     * case it might splice one of these edges into tess.event, and
+                     * violate the invariant that fixable edges are the only right-going
+                     * edge from their associated vertex).
+                         */
+                    if (CheckForIntersect(tess, regUp)) {
+                        /* WalkDirtyRegions() was called recursively; we're done */
+                        return;
+                    }
+                } else {
+                    /* Even though we can't use CheckForIntersect(), the Org vertices
+                     * may violate the dictionary edge ordering.  Check and correct this.
+                     */
+                    CheckForRightSplice(tess, regUp);
+                }
+            }
+            if (eUp.Org == eLo.Org && eUp.Sym.Org == eLo.Sym.Org) {
+                /* A degenerate loop consisting of only two edges -- delete it. */
+                AddWinding(eLo, eUp);
+                DeleteRegion(tess, regUp);
+                if (!Mesh.__gl_meshDelete(eUp)) throw new RuntimeException();
+                regUp = RegionAbove(regLo);
+            }
+        }
+    }
+
+
+    static void ConnectRightVertex(GLUtessellatorImpl tess, ActiveRegion regUp,
+                                   GLUhalfEdge eBottomLeft)
+/*
+ * Purpose: connect a "right" vertex vEvent (one where all edges go left)
+ * to the unprocessed portion of the mesh.  Since there are no right-going
+ * edges, two regions (one above vEvent and one below) are being merged
+ * into one.  "regUp" is the upper of these two regions.
+ *
+ * There are two reasons for doing this (adding a right-going edge):
+ *  - if the two regions being merged are "inside", we must add an edge
+ *    to keep them separated (the combined region would not be monotone).
+ *  - in any case, we must leave some record of vEvent in the dictionary,
+ *    so that we can merge vEvent with features that we have not seen yet.
+ *    For example, maybe there is a vertical edge which passes just to
+ *    the right of vEvent; we would like to splice vEvent into this edge.
+ *
+ * However, we don't want to connect vEvent to just any vertex.  We don''t
+ * want the new edge to cross any other edges; otherwise we will create
+ * intersection vertices even when the input data had no self-intersections.
+ * (This is a bad thing; if the user's input data has no intersections,
+ * we don't want to generate any false intersections ourselves.)
+ *
+ * Our eventual goal is to connect vEvent to the leftmost unprocessed
+ * vertex of the combined region (the union of regUp and regLo).
+ * But because of unseen vertices with all right-going edges, and also
+ * new vertices which may be created by edge intersections, we don''t
+ * know where that leftmost unprocessed vertex is.  In the meantime, we
+ * connect vEvent to the closest vertex of either chain, and mark the region
+ * as "fixUpperEdge".  This flag says to delete and reconnect this edge
+ * to the next processed vertex on the boundary of the combined region.
+ * Quite possibly the vertex we connected to will turn out to be the
+ * closest one, in which case we won''t need to make any changes.
+ */ {
+        GLUhalfEdge eNew;
+        GLUhalfEdge eTopLeft = eBottomLeft.Onext;
+        ActiveRegion regLo = RegionBelow(regUp);
+        GLUhalfEdge eUp = regUp.eUp;
+        GLUhalfEdge eLo = regLo.eUp;
+        boolean degenerate = false;
+
+        if (eUp.Sym.Org != eLo.Sym.Org) {
+            CheckForIntersect(tess, regUp);
+        }
+
+        /* Possible new degeneracies: upper or lower edge of regUp may pass
+         * through vEvent, or may coincide with new intersection vertex
+         */
+        if (Geom.VertEq(eUp.Org, tess.event)) {
+            if (!Mesh.__gl_meshSplice(eTopLeft.Sym.Lnext, eUp)) throw new RuntimeException();
+            regUp = TopLeftRegion(regUp);
+            if (regUp == null) throw new RuntimeException();
+            eTopLeft = RegionBelow(regUp).eUp;
+            FinishLeftRegions(tess, RegionBelow(regUp), regLo);
+            degenerate = true;
+        }
+        if (Geom.VertEq(eLo.Org, tess.event)) {
+            if (!Mesh.__gl_meshSplice(eBottomLeft, eLo.Sym.Lnext)) throw new RuntimeException();
+            eBottomLeft = FinishLeftRegions(tess, regLo, null);
+            degenerate = true;
+        }
+        if (degenerate) {
+            AddRightEdges(tess, regUp, eBottomLeft.Onext, eTopLeft, eTopLeft, true);
+            return;
+        }
+
+        /* Non-degenerate situation -- need to add a temporary, fixable edge.
+         * Connect to the closer of eLo.Org, eUp.Org.
+         */
+        if (Geom.VertLeq(eLo.Org, eUp.Org)) {
+            eNew = eLo.Sym.Lnext;
+        } else {
+            eNew = eUp;
+        }
+        eNew = Mesh.__gl_meshConnect(eBottomLeft.Onext.Sym, eNew);
+        if (eNew == null) throw new RuntimeException();
+
+        /* Prevent cleanup, otherwise eNew might disappear before we've even
+         * had a chance to mark it as a temporary edge.
+         */
+        AddRightEdges(tess, regUp, eNew, eNew.Onext, eNew.Onext, false);
+        eNew.Sym.activeRegion.fixUpperEdge = true;
+        WalkDirtyRegions(tess, regUp);
+    }
+
+/* Because vertices at exactly the same location are merged together
+ * before we process the sweep event, some degenerate cases can't occur.
+ * However if someone eventually makes the modifications required to
+ * merge features which are close together, the cases below marked
+ * TOLERANCE_NONZERO will be useful.  They were debugged before the
+ * code to merge identical vertices in the main loop was added.
+ */
+    private static final boolean TOLERANCE_NONZERO = false;
+
+    static void ConnectLeftDegenerate(GLUtessellatorImpl tess,
+                                      ActiveRegion regUp, GLUvertex vEvent)
+/*
+ * The event vertex lies exacty on an already-processed edge or vertex.
+ * Adding the new vertex involves splicing it into the already-processed
+ * part of the mesh.
+ */ {
+        GLUhalfEdge e, eTopLeft, eTopRight, eLast;
+        ActiveRegion reg;
+
+        e = regUp.eUp;
+        if (Geom.VertEq(e.Org, vEvent)) {
+            /* e.Org is an unprocessed vertex - just combine them, and wait
+             * for e.Org to be pulled from the queue
+             */
+            assert (TOLERANCE_NONZERO);
+            SpliceMergeVertices(tess, e, vEvent.anEdge);
+            return;
+        }
+
+        if (!Geom.VertEq(e.Sym.Org, vEvent)) {
+            /* General case -- splice vEvent into edge e which passes through it */
+            if (Mesh.__gl_meshSplitEdge(e.Sym) == null) throw new RuntimeException();
+            if (regUp.fixUpperEdge) {
+                /* This edge was fixable -- delete unused portion of original edge */
+                if (!Mesh.__gl_meshDelete(e.Onext)) throw new RuntimeException();
+                regUp.fixUpperEdge = false;
+            }
+            if (!Mesh.__gl_meshSplice(vEvent.anEdge, e)) throw new RuntimeException();
+            SweepEvent(tess, vEvent);	/* recurse */
+            return;
+        }
+
+        /* vEvent coincides with e.Sym.Org, which has already been processed.
+         * Splice in the additional right-going edges.
+         */
+        assert (TOLERANCE_NONZERO);
+        regUp = TopRightRegion(regUp);
+        reg = RegionBelow(regUp);
+        eTopRight = reg.eUp.Sym;
+        eTopLeft = eLast = eTopRight.Onext;
+        if (reg.fixUpperEdge) {
+            /* Here e.Sym.Org has only a single fixable edge going right.
+             * We can delete it since now we have some real right-going edges.
+             */
+            assert (eTopLeft != eTopRight);   /* there are some left edges too */
+            DeleteRegion(tess, reg);
+            if (!Mesh.__gl_meshDelete(eTopRight)) throw new RuntimeException();
+            eTopRight = eTopLeft.Sym.Lnext;
+        }
+        if (!Mesh.__gl_meshSplice(vEvent.anEdge, eTopRight)) throw new RuntimeException();
+        if (!Geom.EdgeGoesLeft(eTopLeft)) {
+            /* e.Sym.Org had no left-going edges -- indicate this to AddRightEdges() */
+            eTopLeft = null;
+        }
+        AddRightEdges(tess, regUp, eTopRight.Onext, eLast, eTopLeft, true);
+    }
+
+
+    static void ConnectLeftVertex(GLUtessellatorImpl tess, GLUvertex vEvent)
+/*
+ * Purpose: connect a "left" vertex (one where both edges go right)
+ * to the processed portion of the mesh.  Let R be the active region
+ * containing vEvent, and let U and L be the upper and lower edge
+ * chains of R.  There are two possibilities:
+ *
+ * - the normal case: split R into two regions, by connecting vEvent to
+ *   the rightmost vertex of U or L lying to the left of the sweep line
+ *
+ * - the degenerate case: if vEvent is close enough to U or L, we
+ *   merge vEvent into that edge chain.  The subcases are:
+ *	- merging with the rightmost vertex of U or L
+ *	- merging with the active edge of U or L
+ *	- merging with an already-processed portion of U or L
+ */ {
+        ActiveRegion regUp, regLo, reg;
+        GLUhalfEdge eUp, eLo, eNew;
+        ActiveRegion tmp = new ActiveRegion();
+
+        /* assert ( vEvent.anEdge.Onext.Onext == vEvent.anEdge ); */
+
+        /* Get a pointer to the active region containing vEvent */
+        tmp.eUp = vEvent.anEdge.Sym;
+        /* __GL_DICTLISTKEY */ /* __gl_dictListSearch */
+        regUp = (ActiveRegion) Dict.dictKey(Dict.dictSearch(tess.dict, tmp));
+        regLo = RegionBelow(regUp);
+        eUp = regUp.eUp;
+        eLo = regLo.eUp;
+
+        /* Try merging with U or L first */
+        if (Geom.EdgeSign(eUp.Sym.Org, vEvent, eUp.Org) == 0) {
+            ConnectLeftDegenerate(tess, regUp, vEvent);
+            return;
+        }
+
+        /* Connect vEvent to rightmost processed vertex of either chain.
+         * e.Sym.Org is the vertex that we will connect to vEvent.
+         */
+        reg = Geom.VertLeq(eLo.Sym.Org, eUp.Sym.Org) ? regUp : regLo;
+
+        if (regUp.inside || reg.fixUpperEdge) {
+            if (reg == regUp) {
+                eNew = Mesh.__gl_meshConnect(vEvent.anEdge.Sym, eUp.Lnext);
+                if (eNew == null) throw new RuntimeException();
+            } else {
+                GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(eLo.Sym.Onext.Sym, vEvent.anEdge);
+                if (tempHalfEdge == null) throw new RuntimeException();
+
+                eNew = tempHalfEdge.Sym;
+            }
+            if (reg.fixUpperEdge) {
+                if (!FixUpperEdge(reg, eNew)) throw new RuntimeException();
+            } else {
+                ComputeWinding(tess, AddRegionBelow(tess, regUp, eNew));
+            }
+            SweepEvent(tess, vEvent);
+        } else {
+            /* The new vertex is in a region which does not belong to the polygon.
+             * We don''t need to connect this vertex to the rest of the mesh.
+             */
+            AddRightEdges(tess, regUp, vEvent.anEdge, vEvent.anEdge, null, true);
+        }
+    }
+
+
+    static void SweepEvent(GLUtessellatorImpl tess, GLUvertex vEvent)
+/*
+ * Does everything necessary when the sweep line crosses a vertex.
+ * Updates the mesh and the edge dictionary.
+ */ {
+        ActiveRegion regUp, reg;
+        GLUhalfEdge e, eTopLeft, eBottomLeft;
+
+        tess.event = vEvent;		/* for access in EdgeLeq() */
+        DebugEvent(tess);
+
+        /* Check if this vertex is the right endpoint of an edge that is
+         * already in the dictionary.  In this case we don't need to waste
+         * time searching for the location to insert new edges.
+         */
+        e = vEvent.anEdge;
+        while (e.activeRegion == null) {
+            e = e.Onext;
+            if (e == vEvent.anEdge) {
+                /* All edges go right -- not incident to any processed edges */
+                ConnectLeftVertex(tess, vEvent);
+                return;
+            }
+        }
+
+        /* Processing consists of two phases: first we "finish" all the
+         * active regions where both the upper and lower edges terminate
+         * at vEvent (ie. vEvent is closing off these regions).
+         * We mark these faces "inside" or "outside" the polygon according
+         * to their winding number, and delete the edges from the dictionary.
+         * This takes care of all the left-going edges from vEvent.
+         */
+        regUp = TopLeftRegion(e.activeRegion);
+        if (regUp == null) throw new RuntimeException();
+        reg = RegionBelow(regUp);
+        eTopLeft = reg.eUp;
+        eBottomLeft = FinishLeftRegions(tess, reg, null);
+
+        /* Next we process all the right-going edges from vEvent.  This
+         * involves adding the edges to the dictionary, and creating the
+         * associated "active regions" which record information about the
+         * regions between adjacent dictionary edges.
+         */
+        if (eBottomLeft.Onext == eTopLeft) {
+            /* No right-going edges -- add a temporary "fixable" edge */
+            ConnectRightVertex(tess, regUp, eBottomLeft);
+        } else {
+            AddRightEdges(tess, regUp, eBottomLeft.Onext, eTopLeft, eTopLeft, true);
+        }
+    }
+
+
+/* Make the sentinel coordinates big enough that they will never be
+ * merged with real input features.  (Even with the largest possible
+ * input contour and the maximum tolerance of 1.0, no merging will be
+ * done with coordinates larger than 3 * GLU_TESS_MAX_COORD).
+ */
+    private static final double SENTINEL_COORD = (4.0 * GLU.GLU_TESS_MAX_COORD);
+
+    static void AddSentinel(GLUtessellatorImpl tess, double t)
+/*
+ * We add two sentinel edges above and below all other edges,
+ * to avoid special cases at the top and bottom.
+ */ {
+        GLUhalfEdge e;
+        ActiveRegion reg = new ActiveRegion();
+        if (reg == null) throw new RuntimeException();
+
+        e = Mesh.__gl_meshMakeEdge(tess.mesh);
+        if (e == null) throw new RuntimeException();
+
+        e.Org.s = SENTINEL_COORD;
+        e.Org.t = t;
+        e.Sym.Org.s = -SENTINEL_COORD;
+        e.Sym.Org.t = t;
+        tess.event = e.Sym.Org;		/* initialize it */
+
+        reg.eUp = e;
+        reg.windingNumber = 0;
+        reg.inside = false;
+        reg.fixUpperEdge = false;
+        reg.sentinel = true;
+        reg.dirty = false;
+        reg.nodeUp = Dict.dictInsert(tess.dict, reg); /* __gl_dictListInsertBefore */
+        if (reg.nodeUp == null) throw new RuntimeException();
+    }
+
+
+    static void InitEdgeDict(final GLUtessellatorImpl tess)
+/*
+ * We maintain an ordering of edge intersections with the sweep line.
+ * This order is maintained in a dynamic dictionary.
+ */ {
+        /* __gl_dictListNewDict */
+        tess.dict = Dict.dictNewDict(tess, new Dict.DictLeq() {
+            public boolean leq(Object frame, Object key1, Object key2) {
+                return EdgeLeq(tess, (ActiveRegion) key1, (ActiveRegion) key2);
+            }
+        });
+        if (tess.dict == null) throw new RuntimeException();
+
+        AddSentinel(tess, -SENTINEL_COORD);
+        AddSentinel(tess, SENTINEL_COORD);
+    }
+
+
+    static void DoneEdgeDict(GLUtessellatorImpl tess) {
+        ActiveRegion reg;
+        int fixedEdges = 0;
+
+        /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */
+        while ((reg = (ActiveRegion) Dict.dictKey(Dict.dictMin(tess.dict))) != null) {
+            /*
+             * At the end of all processing, the dictionary should contain
+             * only the two sentinel edges, plus at most one "fixable" edge
+             * created by ConnectRightVertex().
+             */
+            if (!reg.sentinel) {
+                assert (reg.fixUpperEdge);
+                assert (++fixedEdges == 1);
+            }
+            assert (reg.windingNumber == 0);
+            DeleteRegion(tess, reg);
+/*    __gl_meshDelete( reg.eUp );*/
+        }
+        Dict.dictDeleteDict(tess.dict);	/* __gl_dictListDeleteDict */
+    }
+
+
+    static void RemoveDegenerateEdges(GLUtessellatorImpl tess)
+/*
+ * Remove zero-length edges, and contours with fewer than 3 vertices.
+ */ {
+        GLUhalfEdge e, eNext, eLnext;
+        GLUhalfEdge eHead = tess.mesh.eHead;
+
+        /*LINTED*/
+        for (e = eHead.next; e != eHead; e = eNext) {
+            eNext = e.next;
+            eLnext = e.Lnext;
+
+            if (Geom.VertEq(e.Org, e.Sym.Org) && e.Lnext.Lnext != e) {
+                /* Zero-length edge, contour has at least 3 edges */
+
+                SpliceMergeVertices(tess, eLnext, e);	/* deletes e.Org */
+                if (!Mesh.__gl_meshDelete(e)) throw new RuntimeException(); /* e is a self-loop */
+                e = eLnext;
+                eLnext = e.Lnext;
+            }
+            if (eLnext.Lnext == e) {
+                /* Degenerate contour (one or two edges) */
+
+                if (eLnext != e) {
+                    if (eLnext == eNext || eLnext == eNext.Sym) {
+                        eNext = eNext.next;
+                    }
+                    if (!Mesh.__gl_meshDelete(eLnext)) throw new RuntimeException();
+                }
+                if (e == eNext || e == eNext.Sym) {
+                    eNext = eNext.next;
+                }
+                if (!Mesh.__gl_meshDelete(e)) throw new RuntimeException();
+            }
+        }
+    }
+
+    static boolean InitPriorityQ(GLUtessellatorImpl tess)
+/*
+ * Insert all vertices into the priority queue which determines the
+ * order in which vertices cross the sweep line.
+ */ {
+        PriorityQ pq;
+        GLUvertex v, vHead;
+
+        /* __gl_pqSortNewPriorityQ */
+        pq = tess.pq = PriorityQ.pqNewPriorityQ(new PriorityQ.Leq() {
+            public boolean leq(Object key1, Object key2) {
+                return Geom.VertLeq(((GLUvertex) key1), (GLUvertex) key2);
+            }
+        });
+        if (pq == null) return false;
+
+        vHead = tess.mesh.vHead;
+        for (v = vHead.next; v != vHead; v = v.next) {
+            v.pqHandle = pq.pqInsert(v); /* __gl_pqSortInsert */
+            if (v.pqHandle == Long.MAX_VALUE) break;
+        }
+        if (v != vHead || !pq.pqInit()) { /* __gl_pqSortInit */
+            tess.pq.pqDeletePriorityQ();	/* __gl_pqSortDeletePriorityQ */
+            tess.pq = null;
+            return false;
+        }
+
+        return true;
+    }
+
+
+    static void DonePriorityQ(GLUtessellatorImpl tess) {
+        tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
+    }
+
+
+    static boolean RemoveDegenerateFaces(GLUmesh mesh)
+/*
+ * Delete any degenerate faces with only two edges.  WalkDirtyRegions()
+ * will catch almost all of these, but it won't catch degenerate faces
+ * produced by splice operations on already-processed edges.
+ * The two places this can happen are in FinishLeftRegions(), when
+ * we splice in a "temporary" edge produced by ConnectRightVertex(),
+ * and in CheckForLeftSplice(), where we splice already-processed
+ * edges to ensure that our dictionary invariants are not violated
+ * by numerical errors.
+ *
+ * In both these cases it is *very* dangerous to delete the offending
+ * edge at the time, since one of the routines further up the stack
+ * will sometimes be keeping a pointer to that edge.
+ */ {
+        GLUface f, fNext;
+        GLUhalfEdge e;
+
+        /*LINTED*/
+        for (f = mesh.fHead.next; f != mesh.fHead; f = fNext) {
+            fNext = f.next;
+            e = f.anEdge;
+            assert (e.Lnext != e);
+
+            if (e.Lnext.Lnext == e) {
+                /* A face with only two edges */
+                AddWinding(e.Onext, e);
+                if (!Mesh.__gl_meshDelete(e)) return false;
+            }
+        }
+        return true;
+    }
+
+    public static boolean __gl_computeInterior(GLUtessellatorImpl tess)
+/*
+ * __gl_computeInterior( tess ) computes the planar arrangement specified
+ * by the given contours, and further subdivides this arrangement
+ * into regions.  Each region is marked "inside" if it belongs
+ * to the polygon, according to the rule given by tess.windingRule.
+ * Each interior region is guaranteed be monotone.
+ */ {
+        GLUvertex v, vNext;
+
+        tess.fatalError = false;
+
+        /* Each vertex defines an event for our sweep line.  Start by inserting
+         * all the vertices in a priority queue.  Events are processed in
+         * lexicographic order, ie.
+         *
+         *	e1 < e2  iff  e1.x < e2.x || (e1.x == e2.x && e1.y < e2.y)
+         */
+        RemoveDegenerateEdges(tess);
+        if (!InitPriorityQ(tess)) return false; /* if error */
+        InitEdgeDict(tess);
+
+        /* __gl_pqSortExtractMin */
+        while ((v = (GLUvertex) tess.pq.pqExtractMin()) != null) {
+            for (; ;) {
+                vNext = (GLUvertex) tess.pq.pqMinimum(); /* __gl_pqSortMinimum */
+                if (vNext == null || !Geom.VertEq(vNext, v)) break;
+
+                /* Merge together all vertices at exactly the same location.
+                 * This is more efficient than processing them one at a time,
+                 * simplifies the code (see ConnectLeftDegenerate), and is also
+                 * important for correct handling of certain degenerate cases.
+                 * For example, suppose there are two identical edges A and B
+                 * that belong to different contours (so without this code they would
+                 * be processed by separate sweep events).  Suppose another edge C
+                 * crosses A and B from above.  When A is processed, we split it
+                 * at its intersection point with C.  However this also splits C,
+                 * so when we insert B we may compute a slightly different
+                 * intersection point.  This might leave two edges with a small
+                 * gap between them.  This kind of error is especially obvious
+                 * when using boundary extraction (GLU_TESS_BOUNDARY_ONLY).
+                 */
+                vNext = (GLUvertex) tess.pq.pqExtractMin(); /* __gl_pqSortExtractMin*/
+                SpliceMergeVertices(tess, v.anEdge, vNext.anEdge);
+            }
+            SweepEvent(tess, v);
+        }
+
+        /* Set tess.event for debugging purposes */
+        /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */
+        tess.event = ((ActiveRegion) Dict.dictKey(Dict.dictMin(tess.dict))).eUp.Org;
+        DebugEvent(tess);
+        DoneEdgeDict(tess);
+        DonePriorityQ(tess);
+
+        if (!RemoveDegenerateFaces(tess.mesh)) return false;
+        Mesh.__gl_meshCheckMesh(tess.mesh);
+
+        return true;
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java
new file mode 100644
index 0000000..5db543c
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java
@@ -0,0 +1,241 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class TessMono {
+/* __gl_meshTessellateMonoRegion( face ) tessellates a monotone region
+ * (what else would it do??)  The region must consist of a single
+ * loop of half-edges (see mesh.h) oriented CCW.  "Monotone" in this
+ * case means that any vertical line intersects the interior of the
+ * region in a single interval.
+ *
+ * Tessellation consists of adding interior edges (actually pairs of
+ * half-edges), to split the region into non-overlapping triangles.
+ *
+ * The basic idea is explained in Preparata and Shamos (which I don''t
+ * have handy right now), although their implementation is more
+ * complicated than this one.  The are two edge chains, an upper chain
+ * and a lower chain.  We process all vertices from both chains in order,
+ * from right to left.
+ *
+ * The algorithm ensures that the following invariant holds after each
+ * vertex is processed: the untessellated region consists of two
+ * chains, where one chain (say the upper) is a single edge, and
+ * the other chain is concave.  The left vertex of the single edge
+ * is always to the left of all vertices in the concave chain.
+ *
+ * Each step consists of adding the rightmost unprocessed vertex to one
+ * of the two chains, and forming a fan of triangles from the rightmost
+ * of two chain endpoints.  Determining whether we can add each triangle
+ * to the fan is a simple orientation test.  By making the fan as large
+ * as possible, we restore the invariant (check it yourself).
+ */
+    static boolean __gl_meshTessellateMonoRegion(GLUface face, boolean avoidDegenerateTris) {
+        GLUhalfEdge up, lo;
+
+        /* All edges are oriented CCW around the boundary of the region.
+         * First, find the half-edge whose origin vertex is rightmost.
+         * Since the sweep goes from left to right, face->anEdge should
+         * be close to the edge we want.
+         */
+        up = face.anEdge;
+        assert (up.Lnext != up && up.Lnext.Lnext != up);
+
+        for (; Geom.VertLeq(up.Sym.Org, up.Org); up = up.Onext.Sym)
+            ;
+        for (; Geom.VertLeq(up.Org, up.Sym.Org); up = up.Lnext)
+            ;
+        lo = up.Onext.Sym;
+
+        boolean mustConnect = false; // hack for avoidDegenerateTris
+
+        while (up.Lnext != lo) {
+            if (avoidDegenerateTris && !mustConnect) {
+                // Skip over regions where several vertices are collinear,
+                // to try to avoid producing degenerate (zero-area) triangles
+                //
+                // The "mustConnect" flag is a hack to try to avoid
+                // skipping too large regions and causing incorrect
+                // triangulations. This entire modification is overall
+                // not robust and needs more work
+                if (Geom.EdgeCos(lo.Lnext.Org, lo.Org, lo.Lnext.Lnext.Org) <= -Geom.ONE_MINUS_EPSILON) {
+                    // Lines around lo
+                    do {
+                        lo = lo.Onext.Sym;
+                        mustConnect = true;
+                    } while (up.Lnext != lo &&
+                             Geom.EdgeCos(lo.Lnext.Org, lo.Org, lo.Lnext.Lnext.Org) <= -Geom.ONE_MINUS_EPSILON);
+                } else if (Geom.EdgeCos(up.Onext.Sym.Org, up.Org, up.Onext.Sym.Onext.Sym.Org) <= -Geom.ONE_MINUS_EPSILON) {
+                    // Lines around up
+                    do {
+                        up = up.Lnext;
+                        mustConnect = true;
+                    } while (up.Lnext != lo &&
+                             Geom.EdgeCos(up.Onext.Sym.Org, up.Org, up.Onext.Sym.Onext.Sym.Org) <= -Geom.ONE_MINUS_EPSILON);
+                }
+
+                if (up.Lnext == lo)
+                    break;
+            }
+
+            if (Geom.VertLeq(up.Sym.Org, lo.Org)) {
+                /* up.Sym.Org is on the left.  It is safe to form triangles from lo.Org.
+                 * The EdgeGoesLeft test guarantees progress even when some triangles
+                 * are CW, given that the upper and lower chains are truly monotone.
+                 */
+                while (lo.Lnext != up && (Geom.EdgeGoesLeft(lo.Lnext)
+                        || Geom.EdgeSign(lo.Org, lo.Sym.Org, lo.Lnext.Sym.Org) <= 0)) {
+                    GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
+                    mustConnect = false;
+                    if (tempHalfEdge == null) return false;
+                    lo = tempHalfEdge.Sym;
+                }
+                lo = lo.Onext.Sym;
+            } else {
+                /* lo.Org is on the left.  We can make CCW triangles from up.Sym.Org. */
+                while (lo.Lnext != up && (Geom.EdgeGoesRight(up.Onext.Sym)
+                        || Geom.EdgeSign(up.Sym.Org, up.Org, up.Onext.Sym.Org) >= 0)) {
+                    GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(up, up.Onext.Sym);
+                    mustConnect = false;
+                    if (tempHalfEdge == null) return false;
+                    up = tempHalfEdge.Sym;
+                }
+                up = up.Lnext;
+            }
+        }
+
+        /* Now lo.Org == up.Sym.Org == the leftmost vertex.  The remaining region
+         * can be tessellated in a fan from this leftmost vertex.
+         */
+        assert (lo.Lnext != up);
+        while (lo.Lnext.Lnext != up) {
+            GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
+            if (tempHalfEdge == null) return false;
+            lo = tempHalfEdge.Sym;
+        }
+
+        return true;
+    }
+
+
+/* __gl_meshTessellateInterior( mesh ) tessellates each region of
+ * the mesh which is marked "inside" the polygon.  Each such region
+ * must be monotone.
+ */
+    public static boolean __gl_meshTessellateInterior(GLUmesh mesh, boolean avoidDegenerateTris) {
+        GLUface f, next;
+
+        /*LINTED*/
+        for (f = mesh.fHead.next; f != mesh.fHead; f = next) {
+            /* Make sure we don''t try to tessellate the new triangles. */
+            next = f.next;
+            if (f.inside) {
+                if (!__gl_meshTessellateMonoRegion(f, avoidDegenerateTris)) return false;
+            }
+        }
+
+        return true;
+    }
+
+
+/* __gl_meshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
+ * which are not marked "inside" the polygon.  Since further mesh operations
+ * on NULL faces are not allowed, the main purpose is to clean up the
+ * mesh so that exterior loops are not represented in the data structure.
+ */
+    public static void __gl_meshDiscardExterior(GLUmesh mesh) {
+        GLUface f, next;
+
+        /*LINTED*/
+        for (f = mesh.fHead.next; f != mesh.fHead; f = next) {
+            /* Since f will be destroyed, save its next pointer. */
+            next = f.next;
+            if (!f.inside) {
+                Mesh.__gl_meshZapFace(f);
+            }
+        }
+    }
+
+    private static final int MARKED_FOR_DELETION = 0x7fffffff;
+
+/* __gl_meshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
+ * winding numbers on all edges so that regions marked "inside" the
+ * polygon have a winding number of "value", and regions outside
+ * have a winding number of 0.
+ *
+ * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
+ * separate an interior region from an exterior one.
+ */
+    public static boolean __gl_meshSetWindingNumber(GLUmesh mesh, int value, boolean keepOnlyBoundary) {
+        GLUhalfEdge e, eNext;
+
+        for (e = mesh.eHead.next; e != mesh.eHead; e = eNext) {
+            eNext = e.next;
+            if (e.Sym.Lface.inside != e.Lface.inside) {
+
+                /* This is a boundary edge (one side is interior, one is exterior). */
+                e.winding = (e.Lface.inside) ? value : -value;
+            } else {
+
+                /* Both regions are interior, or both are exterior. */
+                if (!keepOnlyBoundary) {
+                    e.winding = 0;
+                } else {
+                    if (!Mesh.__gl_meshDelete(e)) return false;
+                }
+            }
+        }
+        return true;
+    }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/TessState.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/TessState.java
new file mode 100644
index 0000000..c25de2d
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/TessState.java
@@ -0,0 +1,59 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 2.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE:  The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License").   Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License").  This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted.  Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package jogamp.opengl.glu.tessellator;
+
+class TessState {
+    public static final int T_DORMANT = 0;
+    public static final int T_IN_POLYGON = 1;
+    public static final int T_IN_CONTOUR = 2;
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
new file mode 100644
index 0000000..0858897
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -0,0 +1,328 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+import java.nio.*;
+import java.util.*;
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import jogamp.opengl.*;
+import com.jogamp.gluegen.runtime.ProcAddressTable;
+import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
+
+public abstract class MacOSXCGLContext extends GLContextImpl
+{	
+  protected boolean isNSContext;
+  private CGLExt cglExt;
+  // Table that holds the addresses of the native C-language entry points for
+  // CGL extension functions.
+  private CGLExtProcAddressTable cglExtProcAddressTable;
+  
+  protected MacOSXCGLContext(GLDrawableImpl drawable,
+                   GLContext shareWith) {
+    super(drawable, shareWith);
+  }
+  
+  public Object getPlatformGLExtensions() {
+    return getCGLExt();
+  }
+
+  protected boolean isNSContext() { return isNSContext; }
+
+  public CGLExt getCGLExt() {
+    if (cglExt == null) {
+      cglExt = new CGLExtImpl(this);
+    }
+    return cglExt;
+  }
+
+  public final ProcAddressTable getPlatformExtProcAddressTable() {
+    return getCGLExtProcAddressTable();
+  }
+
+  public final CGLExtProcAddressTable getCGLExtProcAddressTable() {
+    return cglExtProcAddressTable;
+  }
+
+  protected Map/*<String, String>*/ getFunctionNameMap() { return null; }
+
+  protected Map/*<String, String>*/ getExtensionNameMap() { return null; }
+
+  protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+      return 0; // FIXME
+  }
+
+  protected void destroyContextARBImpl(long _context) {
+      // FIXME
+  }
+
+  public final boolean isGLReadDrawableAvailable() {
+    return false;
+  }
+
+  /**
+   * Creates and initializes an appropriate OpenGl Context (NS). Should only be
+   * called by {@link makeCurrentImpl()}.
+   */
+  protected boolean create(boolean pbuffer, boolean floatingPoint) {
+    MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(this);
+    long share = 0;
+    if (other != null) {
+      if (!other.isNSContext()) {
+        throw new GLException("GLContextShareSet is not a NS Context");
+      }
+      share = other.getHandle();
+      if (share == 0) {
+        throw new GLException("GLContextShareSet returned a NULL OpenGL context");
+      }
+    }
+    MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    GLCapabilitiesImmutable capabilitiesRequested = (GLCapabilitiesImmutable) config.getRequestedCapabilities();
+    GLProfile glProfile = capabilitiesRequested.getGLProfile();
+    if(glProfile.isGL3()) {
+        throw new GLException("GL3 profile currently not supported on MacOSX, due to the lack of a OpenGL 3.1 implementation");
+    }
+    // HACK .. bring in OnScreen/PBuffer selection to the DrawableFactory !!
+    GLCapabilities capabilities = (GLCapabilities) capabilitiesRequested.cloneMutable();
+    capabilities.setPBuffer(pbuffer);
+    capabilities.setPbufferFloatingPointBuffers(floatingPoint);
+
+    long pixelFormat = MacOSXCGLGraphicsConfiguration.GLCapabilities2NSPixelFormat(capabilities);
+    if (pixelFormat == 0) {
+      throw new GLException("Unable to allocate pixel format with requested GLCapabilities");
+    }
+    config.setChosenPixelFormat(pixelFormat);
+    try {
+      int[] viewNotReady = new int[1];
+      // Try to allocate a context with this
+      contextHandle = CGL.createContext(share,
+                                    drawable.getHandle(),
+                                    pixelFormat,
+                                    viewNotReady, 0);
+      if (contextHandle == 0) {
+        if (viewNotReady[0] == 1) {
+          if (DEBUG) {
+            System.err.println("!!! View not ready for " + getClass().getName());
+          }
+          // View not ready at the window system level -- this is OK
+          return false;
+        }
+        throw new GLException("Error creating NSOpenGLContext with requested pixel format");
+      }
+
+      if (!pbuffer && !capabilities.isBackgroundOpaque()) {
+          // Set the context opacity
+          CGL.setContextOpacity(contextHandle, 0);
+      }
+
+      GLCapabilitiesImmutable caps = MacOSXCGLGraphicsConfiguration.NSPixelFormat2GLCapabilities(glProfile, pixelFormat);
+      config.setChosenCapabilities(caps);
+    } finally {
+      CGL.deletePixelFormat(pixelFormat);
+    }
+    if (!CGL.makeCurrentContext(contextHandle)) {
+      throw new GLException("Error making Context (NS) current");
+    }
+    isNSContext = true;
+    setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);
+    GLContextShareSet.contextCreated(this);
+    return true;
+  }
+
+  protected void makeCurrentImpl(boolean newCreated) throws GLException {
+    if ( isNSContext ) {
+        if (!CGL.makeCurrentContext(contextHandle)) {
+          throw new GLException("Error making Context (NS) current");
+        }
+    } else {
+        if (CGL.kCGLNoError != CGL.CGLSetCurrentContext(contextHandle)) {
+          throw new GLException("Error making Context (CGL) current");
+        }
+    }
+  }
+	
+  protected void releaseImpl() throws GLException {
+    if ( isNSContext ) {
+        if (!CGL.clearCurrentContext(contextHandle)) {
+          throw new GLException("Error freeing OpenGL Context (NS)");
+        }
+    } else {
+        CGL.CGLReleaseContext(contextHandle);
+    }
+  }
+	
+  protected void destroyImpl() throws GLException {
+    if ( !isNSContext ) {
+      if (CGL.kCGLNoError != CGL.CGLDestroyContext(contextHandle)) {
+        throw new GLException("Unable to delete OpenGL Context (CGL)");
+      }
+      if (DEBUG) {
+        System.err.println("!!! Destroyed OpenGL Context (CGL) " + contextHandle);
+      }
+    } else {
+      if (!CGL.deleteContext(contextHandle)) {
+        throw new GLException("Unable to delete OpenGL Context (NS)");
+      }
+      if (DEBUG) {
+        System.err.println("!!! Destroyed OpenGL Context (NS) " + contextHandle);
+      }
+    }
+  }
+
+  protected void copyImpl(GLContext source, int mask) throws GLException {
+    long dst = getHandle();
+    long src = source.getHandle();
+    if( !isNSContext() ) {
+        if ( ((MacOSXCGLContext)source).isNSContext() ) {
+          throw new GLException("Source OpenGL Context is NS ; Destination Context is CGL.");
+        }
+        CGL.CGLCopyContext(src, dst, mask);
+    } else {
+        if ( !((MacOSXCGLContext)source).isNSContext() ) {
+          throw new GLException("Source OpenGL Context is CGL ; Destination Context is NS.");
+        }
+        CGL.copyContext(dst, src, mask);
+    }
+  }
+
+  protected final void updateGLXProcAddressTable() {
+    AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice();
+    String key = adevice.getUniqueID();
+    if (DEBUG) {
+      System.err.println(getThreadName() + ": !!! Initializing CGL extension address table: "+key);
+    }
+    CGLExtProcAddressTable table = null;
+    synchronized(mappedContextTypeObjectLock) {
+        table = (CGLExtProcAddressTable) mappedGLXProcAddress.get( key );
+    }
+    if(null != table) {
+        cglExtProcAddressTable = table;
+        if(DEBUG) {
+            System.err.println(getThreadName() + ": !!! GLContext CGL ProcAddressTable reusing key("+key+") -> "+table.hashCode());
+        }
+    } else {
+        if (cglExtProcAddressTable == null) {
+          // FIXME: cache ProcAddressTables by capability bits so we can
+          // share them among contexts with the same capabilities
+          cglExtProcAddressTable = new CGLExtProcAddressTable(new GLProcAddressResolver());
+        }
+        resetProcAddressTable(getCGLExtProcAddressTable());
+        synchronized(mappedContextTypeObjectLock) {
+            mappedGLXProcAddress.put(key, getCGLExtProcAddressTable());
+            if(DEBUG) {
+                System.err.println(getThreadName() + ": !!! GLContext CGL ProcAddressTable mapping key("+key+") -> "+getCGLExtProcAddressTable().hashCode());
+            }
+        }
+    }
+  }
+	
+  public String getPlatformExtensionsString()
+  {
+    return "";
+  }
+	
+  protected void swapBuffers() {
+    DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)config.getChosenCapabilities();
+    if(caps.isOnscreen()) {
+        if(isNSContext) {
+            if (!CGL.flushBuffer(contextHandle)) {
+              throw new GLException("Error swapping buffers (NS)");
+            }
+        } else {
+            if (CGL.kCGLNoError != CGL.CGLFlushDrawable(contextHandle)) {
+              throw new GLException("Error swapping buffers (CGL)");
+            }
+        }
+    }
+  }
+
+  protected void setSwapIntervalImpl(int interval) {
+    if( ! isCreated() ) {
+        throw new GLException("OpenGL context not created");
+    } 
+    if ( isNSContext ) {
+        CGL.setSwapInterval(contextHandle, interval);
+    } else {
+        int[] lval = new int[] { (int) interval } ;
+        CGL.CGLSetParameter(contextHandle, CGL.kCGLCPSwapInterval, lval, 0);
+    }
+    currentSwapInterval = interval ;
+  }
+
+  public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+    // FIXME: apparently the Apple extension doesn't require a custom memory allocator
+    throw new GLException("Not yet implemented");
+  }
+
+  public boolean isExtensionAvailable(String glExtensionName) {
+    if (glExtensionName.equals("GL_ARB_pbuffer") ||
+        glExtensionName.equals("GL_ARB_pixel_format")) {
+      return true;
+    }
+    return super.isExtensionAvailable(glExtensionName);
+  }
+  
+  public int getOffscreenContextPixelDataType() {
+    throw new GLException("Should not call this");
+  }
+
+  public int getOffscreenContextReadBuffer() {
+    throw new GLException("Should not call this");
+  }
+
+  public boolean offscreenImageNeedsVerticalFlip() {
+    throw new GLException("Should not call this");
+  }
+
+  public void bindPbufferToTexture() {
+    throw new GLException("Should not call this");
+  }
+    
+  public void releasePbufferFromTexture() {
+    throw new GLException("Should not call this");
+  }
+    
+  // Support for "mode switching" as described in MacOSXCGLDrawable
+  public abstract void setOpenGLMode(int mode);
+  public abstract int  getOpenGLMode();
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
new file mode 100644
index 0000000..10e061d
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+
+public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
+  // The Java2D/OpenGL pipeline on OS X uses low-level CGLContextObjs
+  // to represent the contexts for e.g. the Java2D back buffer. When
+  // the Java2D/JOGL bridge is active, this means that if we want to
+  // be able to share textures and display lists with the Java2D
+  // contexts, we need to use the CGL APIs rather than the NSOpenGL
+  // APIs on the JOGL side. For example, if we create a pbuffer using
+  // the NSOpenGL APIs and want to share textures and display lists
+  // between it and the Java2D back buffer, there is no way to do so,
+  // because the Java2D context is actually a CGLContextObj and the
+  // NSOpenGLContext's initWithFormat:shareContext: only accepts an
+  // NSOpenGLContext as its second argument. Of course there is no way
+  // to wrap an NSOpenGLContext around an arbitrary CGLContextObj.
+  //
+  // The situation we care most about is allowing a GLPbuffer to share
+  // textures, etc. with a GLJPanel when the Java2D/JOGL bridge is
+  // active; several of the demos rely on this functionality. We aim
+  // to get there by allowing a GLPBuffer to switch its implementation
+  // between using an NSOpenGLPixelBuffer and a CGLPBufferObj. In
+  // order to track whether this has been done we need to have the
+  // notion of a "mode" of both the MacOSXCGLDrawable and the
+  // MacOSXGLContext. Initially the mode is "unspecified", meaning it
+  // leans toward the default (NSOpenGL). If sharing is requested
+  // between either a GLJPanel and a GLPbuffer or a GLCanvas and a
+  // GLPbuffer, the GLPbuffer will be switched into the appropriate
+  // mode: CGL mode for a GLJPanel and NSOpenGL mode for a GLCanvas.
+  // To avoid thrashing we support exactly one such switch during the
+  // lifetime of a given GLPbuffer. This is not a fully general
+  // solution (for example, you can't share textures among a
+  // GLPbuffer, a GLJPanel and a GLCanvas simultaneously) but should
+  // be enough to get things off the ground.
+  public static final int NSOPENGL_MODE = 1;
+  public static final int CGL_MODE      = 2;
+
+  public MacOSXCGLDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+    super(factory, comp, realized);
+ }
+
+  protected void setRealizedImpl() {
+  }
+
+  public GLDynamicLookupHelper getGLDynamicLookupHelper() {
+    return getFactoryImpl().getGLDynamicLookupHelper(0);
+  }
+
+  protected static String getThreadName() {
+    return Thread.currentThread().getName();
+  }
+
+  // Support for "mode switching" as per above
+  public abstract void setOpenGLMode(int mode);
+  public abstract int  getOpenGLMode();
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
new file mode 100644
index 0000000..6ce7934
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+import java.nio.*;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.macosx.MacOSXGraphicsDevice;
+import javax.media.opengl.*;
+
+import com.jogamp.common.JogampRuntimeException;
+import com.jogamp.common.util.*;
+import java.util.ArrayList;
+import jogamp.opengl.*;
+import jogamp.nativewindow.WrappedSurface;
+
+public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
+  private static final DesktopGLDynamicLookupHelper macOSXCGLDynamicLookupHelper;
+
+  static {
+        DesktopGLDynamicLookupHelper tmp = null;
+        try {
+            tmp = new DesktopGLDynamicLookupHelper(new MacOSXCGLDynamicLibraryBundleInfo());
+        } catch (GLException gle) {
+            if(DEBUG) {
+                gle.printStackTrace();
+            }
+        }
+        macOSXCGLDynamicLookupHelper = tmp;
+        /** FIXME ?? 
+        if(null!=macOSXCGLDynamicLookupHelper) {
+            CGL.getCGLProcAddressTable().reset(macOSXCGLDynamicLookupHelper);
+        } */
+  }
+
+  public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
+      return macOSXCGLDynamicLookupHelper;
+  }
+
+  public MacOSXCGLDrawableFactory() {
+    super();
+
+    // Register our GraphicsConfigurationFactory implementations
+    // The act of constructing them causes them to be registered
+    new MacOSXCGLGraphicsConfigurationFactory();
+    if(GLProfile.isAWTAvailable()) {
+        try {
+          ReflectionUtil.createInstance("jogamp.opengl.macosx.cgl.awt.MacOSXAWTCGLGraphicsConfigurationFactory",
+                                        null, getClass().getClassLoader());
+        } catch (JogampRuntimeException jre) { /* n/a .. */ }
+    }
+
+    defaultDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+  }
+
+  static class SharedResource {
+      private MacOSXCGLDrawable drawable;
+      private MacOSXCGLContext context;
+
+      SharedResource(MacOSXCGLDrawable draw, MacOSXCGLContext ctx) {
+          drawable = draw;
+          context = ctx;
+      }
+  }
+  HashMap/*<connection, SharedResource>*/ sharedMap = new HashMap();
+  MacOSXGraphicsDevice defaultDevice;
+
+  public final AbstractGraphicsDevice getDefaultDevice() {
+      return defaultDevice;
+  }
+
+  public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+      if(device instanceof MacOSXGraphicsDevice) {
+          return true;
+      }
+      return false;
+  }
+
+  protected final GLContext getOrCreateSharedContextImpl(AbstractGraphicsDevice device) {
+        // FIXME: not implemented .. needs a dummy OSX surface
+        return null;
+  }
+
+  protected AbstractGraphicsDevice getOrCreateSharedDeviceImpl(AbstractGraphicsDevice device) {
+      return device; // nothing to do, no native open device
+  }
+
+  protected final void shutdownInstance() {}
+
+  protected List/*GLCapabilitiesImmutable*/ getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+      return new ArrayList(0);
+  }
+
+  protected GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+    if (target == null) {
+      throw new IllegalArgumentException("Null target");
+    }
+    return new MacOSXOnscreenCGLDrawable(this, target);
+  }
+
+  protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
+    AbstractGraphicsConfiguration config = target.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+    if(!caps.isPBuffer()) {
+        return new MacOSXOffscreenCGLDrawable(this, target);
+    }
+
+    // PBuffer GLDrawable Creation
+    /**
+     * FIXME: Think about this ..
+     * should not be necessary ? ..
+    final List returnList = new ArrayList();
+    final GLDrawableFactory factory = this;
+    Runnable r = new Runnable() {
+        public void run() {
+          returnList.add(new MacOSXPbufferCGLDrawable(factory, target));
+        }
+      };
+    maybeDoSingleThreadedWorkaround(r);
+    return (GLDrawableImpl) returnList.get(0);
+    */
+    return new MacOSXPbufferCGLDrawable(this, target);
+  }
+
+  public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) {
+    return true;
+  }
+
+  protected NativeSurface createOffscreenSurfaceImpl(AbstractGraphicsDevice device,GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, int width, int height) {
+    AbstractGraphicsScreen screen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_MACOSX);
+    WrappedSurface ns = new WrappedSurface(MacOSXCGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, screen, true));
+    ns.setSize(width, height);
+    return ns;
+  }
+
+  protected ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice device, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+    AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, 0);    
+    WrappedSurface ns = new WrappedSurface(MacOSXCGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen, true), windowHandle);
+    return ns;    
+  }  
+  
+  protected GLContext createExternalGLContextImpl() {
+    return MacOSXExternalCGLContext.create(this, null);
+  }
+
+  public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+    return false;
+  }
+
+  protected GLDrawable createExternalGLDrawableImpl() {
+    // FIXME
+    throw new GLException("Not yet implemented");
+  }
+
+  public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) {
+    return false;
+  }
+
+  public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+    throws GLException {
+    throw new GLException("not supported in non AWT enviroment");
+  }
+  
+  //------------------------------------------------------
+  // Gamma-related functionality
+  //
+
+  private static final int GAMMA_RAMP_LENGTH = 256;
+
+  /** Returns the length of the computed gamma ramp for this OS and
+      hardware. Returns 0 if gamma changes are not supported. */
+  protected int getGammaRampLength() {
+    return GAMMA_RAMP_LENGTH;
+  }
+
+  protected boolean setGammaRamp(float[] ramp) {
+    return CGL.setGammaRamp(ramp.length,
+                            ramp, 0,
+                            ramp, 0,
+                            ramp, 0);
+  }
+
+  protected Buffer getGammaRamp() {
+    return null;
+  }
+
+  protected void resetGammaRamp(Buffer originalGammaRamp) {
+    CGL.resetGammaRamp();
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
new file mode 100644
index 0000000..94d790c
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
@@ -0,0 +1,72 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl.macosx.cgl;
+
+import jogamp.opengl.*;
+import com.jogamp.common.os.DynamicLookupHelper;
+import com.jogamp.common.os.NativeLibrary;
+import com.jogamp.common.os.Platform;
+import java.util.*;
+import java.security.*;
+import javax.media.opengl.GLException;
+
+public class MacOSXCGLDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo  {
+    protected MacOSXCGLDynamicLibraryBundleInfo() {
+        super();
+    }
+
+    public List getToolLibNames() {
+        List/*<List>*/ libNamesList = new ArrayList();
+
+        List/*<String>*/ glesLibNames = new ArrayList();
+
+        glesLibNames.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib");
+        glesLibNames.add("GL");
+
+        libNamesList.add(glesLibNames);
+
+        return libNamesList;
+    }
+
+    public final List getToolGetProcAddressFuncNameList() {
+        return null; 
+        /** OSX manual says: NSImage use is discouraged
+        List res = new ArrayList();
+        res.add("GetProcAddress"); // dummy
+        return res; */
+    }
+
+    public final long toolDynamicLookupFunction(long toolGetProcAddressHandle, String funcName) {
+        return 0;
+        /** OSX manual says: NSImage use is discouraged
+            return CGL.getProcAddress(glFuncName); // manual implementation 
+         */
+    }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
new file mode 100644
index 0000000..0d73b6b
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+
+public class MacOSXCGLGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
+    long pixelformat;
+
+    MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen, 
+                                   GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
+                                   long pixelformat) {
+        super(screen, capsChosen, capsRequested);
+        this.pixelformat=pixelformat;
+    }
+
+    public Object clone() {
+        return super.clone();
+    }
+
+    void setChosenPixelFormat(long pixelformat) {
+        this.pixelformat=pixelformat;
+    }
+
+    void setChosenCapabilities(GLCapabilitiesImmutable caps) {
+        super.setChosenCapabilities(caps);
+    }
+
+    static final int[] cglInternalAttributeToken = new int[] {
+        CGL.kCGLPFAColorFloat,
+        CGL.NSOpenGLPFAPixelBuffer,
+        CGL.NSOpenGLPFADoubleBuffer,
+        CGL.NSOpenGLPFAStereo,
+        CGL.NSOpenGLPFAColorSize,
+        CGL.NSOpenGLPFAAlphaSize,
+        CGL.NSOpenGLPFADepthSize,
+        CGL.NSOpenGLPFAAccumSize,
+        CGL.NSOpenGLPFAStencilSize,
+        CGL.NSOpenGLPFASampleBuffers,
+        CGL.NSOpenGLPFASamples };
+
+    static int[] GLCapabilities2AttribList(GLCapabilitiesImmutable caps) {
+        int[] ivalues = new int[cglInternalAttributeToken.length];
+
+        for (int idx = 0; idx < cglInternalAttributeToken.length; idx++) {
+          int attr = cglInternalAttributeToken[idx];
+          switch (attr) {
+              case CGL.kCGLPFAColorFloat:
+                ivalues[idx] = caps.getPbufferFloatingPointBuffers() ? 1 : 0;
+                break;
+
+              case CGL.NSOpenGLPFAPixelBuffer:
+                ivalues[idx] = caps.isPBuffer() ? 1 : 0;
+                break;
+
+              case CGL.NSOpenGLPFADoubleBuffer:
+                ivalues[idx] = (caps.getDoubleBuffered() ? 1 : 0);
+                break;
+
+              case CGL.NSOpenGLPFAStereo:
+                ivalues[idx] = (caps.getStereo() ? 1 : 0);
+                break;
+
+              case CGL.NSOpenGLPFAColorSize:
+                ivalues[idx] = (caps.getRedBits() + caps.getGreenBits() + caps.getBlueBits());
+                break;
+
+              case CGL.NSOpenGLPFAAlphaSize:
+                ivalues[idx] = caps.getAlphaBits();
+                break;
+
+              case CGL.NSOpenGLPFADepthSize:
+                ivalues[idx] = caps.getDepthBits();
+                break;
+
+              case CGL.NSOpenGLPFAAccumSize:
+                ivalues[idx] = (caps.getAccumRedBits() + caps.getAccumGreenBits() + caps.getAccumBlueBits() + caps.getAccumAlphaBits());
+                break;
+
+              case CGL.NSOpenGLPFAStencilSize:
+                ivalues[idx] = caps.getStencilBits();
+                break;
+
+              case CGL.NSOpenGLPFASampleBuffers:
+                ivalues[idx] = caps.getSampleBuffers() ? 1 : 0;
+                break;
+
+              case CGL.NSOpenGLPFASamples:
+                ivalues[idx] = caps.getSampleBuffers() ? ivalues[idx] = caps.getNumSamples() : 0;
+                break;
+
+              default:
+                break;
+          }
+        }
+        return ivalues;
+    }
+
+    static long GLCapabilities2NSPixelFormat(GLCapabilitiesImmutable caps) {
+        int[] ivalues = GLCapabilities2AttribList(caps);
+        return CGL.createPixelFormat(cglInternalAttributeToken, 0, cglInternalAttributeToken.length, ivalues, 0);
+    }
+
+    static GLCapabilitiesImmutable NSPixelFormat2GLCapabilities(GLProfile glp, long pixelFormat) {
+        return PixelFormat2GLCapabilities(glp, pixelFormat, true);
+    }
+
+    static GLCapabilitiesImmutable CGLPixelFormat2GLCapabilities(GLProfile glp, long pixelFormat) {
+        return PixelFormat2GLCapabilities(glp, pixelFormat, false);
+    }
+
+    private static GLCapabilitiesImmutable PixelFormat2GLCapabilities(GLProfile glp, long pixelFormat, boolean nsUsage) {
+        int[] ivalues = new int[cglInternalAttributeToken.length];
+
+        // On this platform the pixel format is associated with the
+        // context and not the drawable. However it's a reasonable
+        // approximation to just store the chosen pixel format up in the
+        // NativeSurface's AbstractGraphicsConfiguration, 
+        // since the public API doesn't provide for a different GLCapabilities per context.
+        // Note: These restrictions of the platform's API might be considered as a bug anyways.
+
+        // Figure out what attributes we really got
+        GLCapabilities caps = new GLCapabilities(glp);
+        if(nsUsage) {
+            CGL.queryPixelFormat(pixelFormat, cglInternalAttributeToken, 0, cglInternalAttributeToken.length, ivalues, 0);
+        } else {
+            CGL.CGLQueryPixelFormat(pixelFormat, cglInternalAttributeToken, 0, cglInternalAttributeToken.length, ivalues, 0);
+        }
+        for (int i = 0; i < cglInternalAttributeToken.length; i++) {
+          int attr = cglInternalAttributeToken[i];
+          switch (attr) {
+              case CGL.kCGLPFAColorFloat:
+                caps.setPbufferFloatingPointBuffers(ivalues[i] != 0);
+                break;
+
+              case CGL.NSOpenGLPFAPixelBuffer:
+                caps.setPBuffer(ivalues[i] != 0);
+                break;
+
+              case CGL.NSOpenGLPFADoubleBuffer:
+                caps.setDoubleBuffered(ivalues[i] != 0);
+                break;
+
+              case CGL.NSOpenGLPFAStereo:
+                caps.setStereo(ivalues[i] != 0);
+                break;
+
+              case CGL.NSOpenGLPFAColorSize:
+                {
+                  int bitSize = ivalues[i];
+                  if (bitSize == 32)
+                    bitSize = 24;
+                  bitSize /= 3;
+                  caps.setRedBits(bitSize);
+                  caps.setGreenBits(bitSize);
+                  caps.setBlueBits(bitSize);
+                }
+                break;
+
+              case CGL.NSOpenGLPFAAlphaSize:
+                caps.setAlphaBits(ivalues[i]);
+                break;
+
+              case CGL.NSOpenGLPFADepthSize:
+                caps.setDepthBits(ivalues[i]);
+                break;
+
+              case CGL.NSOpenGLPFAAccumSize:
+                {
+                  int bitSize = ivalues[i] / 4;
+                  caps.setAccumRedBits(bitSize);
+                  caps.setAccumGreenBits(bitSize);
+                  caps.setAccumBlueBits(bitSize);
+                  caps.setAccumAlphaBits(bitSize);
+                }
+                break;
+
+              case CGL.NSOpenGLPFAStencilSize:
+                caps.setStencilBits(ivalues[i]);
+                break;
+
+              case CGL.NSOpenGLPFASampleBuffers:
+                caps.setSampleBuffers(ivalues[i] != 0);
+                break;
+
+              case CGL.NSOpenGLPFASamples:
+                caps.setNumSamples(ivalues[i]);
+                break;
+
+              default:
+                break;
+          }
+        }
+
+        return caps;
+      }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
new file mode 100644
index 0000000..d4526f0
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+import jogamp.opengl.GLGraphicsConfigurationFactory;
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.CapabilitiesChooser;
+import javax.media.nativewindow.CapabilitiesImmutable;
+import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.GLCapabilitiesImmutable;
+
+
+/** Subclass of GraphicsConfigurationFactory used when non-AWT tookits
+    are used on OSX platforms. Toolkits will likely need to delegate
+    to this one to change the accepted and returned types of the
+    GraphicsDevice and GraphicsConfiguration abstractions. */
+
+public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFactory {
+    protected static final boolean DEBUG = jogamp.opengl.Debug.debug("GraphicsConfiguration");
+
+    MacOSXCGLGraphicsConfigurationFactory() {
+        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.macosx.MacOSXGraphicsDevice.class, this);
+    }
+
+    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
+            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
+            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
+        return chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, absScreen, false);
+    }
+
+    static MacOSXCGLGraphicsConfiguration chooseGraphicsConfigurationStatic(CapabilitiesImmutable capsChosen,
+                                                                            CapabilitiesImmutable capsRequested,
+                                                                            CapabilitiesChooser chooser,
+                                                                            AbstractGraphicsScreen absScreen, boolean usePBuffer) {
+        if (absScreen == null) {
+            throw new IllegalArgumentException("AbstractGraphicsScreen is null");
+        }
+
+        if (! (capsChosen instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - chosen");
+        }
+
+        if (! (capsRequested instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - requested");
+        }
+
+        if (chooser != null &&
+            !(chooser instanceof GLCapabilitiesChooser)) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
+        }
+
+        return new MacOSXCGLGraphicsConfiguration(absScreen, (GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested, 0);
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java
new file mode 100644
index 0000000..6303f2e
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+
+import javax.media.nativewindow.*;
+import jogamp.nativewindow.WrappedSurface;
+
+public class MacOSXExternalCGLContext extends MacOSXCGLContext {
+  private GLContext lastContext;
+
+  private MacOSXExternalCGLContext(Drawable drawable, boolean isNSContext, long handle) {
+    super(drawable, null);
+    drawable.setExternalCGLContext(this);
+    this.isNSContext = isNSContext;
+    this.contextHandle = handle;
+    GLContextShareSet.contextCreated(this);
+    setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);
+    getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
+  }
+
+  protected static MacOSXExternalCGLContext create(GLDrawableFactory factory, GLProfile glp) {
+    long pixelFormat = 0;
+    long currentDrawable = 0;
+    long contextHandle = CGL.getCurrentContext(); // Check: MacOSX 10.3 ..
+    boolean isNSContext = 0 != contextHandle;
+    if( isNSContext ) {
+        long ctx = CGL.getCGLContext(contextHandle);
+        if (ctx == 0) {
+          throw new GLException("Error: NULL Context (CGL) of Context (NS) 0x" +Long.toHexString(contextHandle));
+        }
+        pixelFormat = CGL.CGLGetPixelFormat(ctx);
+        currentDrawable = CGL.getNSView(contextHandle);
+        if(DEBUG) {
+            System.err.println("MacOSXExternalCGLContext Create Context (NS) 0x"+Long.toHexString(contextHandle)+
+                               ", Context (CGL) 0x"+Long.toHexString(ctx)+
+                               ", pixelFormat 0x"+Long.toHexString(pixelFormat)+
+                               ", drawable 0x"+Long.toHexString(currentDrawable));
+        }
+    } else {
+        contextHandle = CGL.CGLGetCurrentContext();
+        if (contextHandle == 0) {
+          throw new GLException("Error: current Context (CGL) null, no Context (NS)");
+        }
+        pixelFormat = CGL.CGLGetPixelFormat(contextHandle);
+        if(DEBUG) {
+            System.err.println("MacOSXExternalCGLContext Create Context (CGL) 0x"+Long.toHexString(contextHandle)+
+                               ", pixelFormat 0x"+Long.toHexString(pixelFormat));
+        }
+    }
+
+    if (0 == pixelFormat) {
+      throw new GLException("Error: current pixelformat of current Context 0x"+Long.toHexString(contextHandle)+" is null");
+    }
+    GLCapabilitiesImmutable caps = MacOSXCGLGraphicsConfiguration.CGLPixelFormat2GLCapabilities(glp, pixelFormat);
+    if(DEBUG) {
+        System.err.println("MacOSXExternalCGLContext Create "+caps);
+    }
+
+    AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_MACOSX);
+    MacOSXCGLGraphicsConfiguration cfg = new MacOSXCGLGraphicsConfiguration(aScreen, caps, caps, pixelFormat);
+
+    if(0 == currentDrawable) {
+        // set a fake marker stating a valid drawable
+        currentDrawable = 1; 
+    }
+    WrappedSurface ns = new WrappedSurface(cfg);
+    ns.setSurfaceHandle(currentDrawable);
+    return new MacOSXExternalCGLContext(new Drawable(factory, ns), isNSContext, contextHandle);
+  }
+
+  protected boolean createImpl() throws GLException {
+      return true;
+  }
+
+  public int makeCurrent() throws GLException {
+    // Save last context if necessary to allow external GLContexts to
+    // talk to other GLContexts created by this library
+    GLContext cur = getCurrent();
+    if (cur != null && cur != this) {
+      lastContext = cur;
+      setCurrent(null);
+    }
+    return super.makeCurrent();
+  }  
+
+  public void release() throws GLException {
+    super.release();
+    setCurrent(lastContext);
+    lastContext = null;
+  }
+
+  protected void makeCurrentImpl(boolean newCreated) throws GLException {
+  }
+
+  protected void releaseImpl() throws GLException {
+  }
+
+  protected void destroyImpl() throws GLException {
+  }
+
+  public void setOpenGLMode(int mode) {
+    if (mode != MacOSXCGLDrawable.CGL_MODE)
+      throw new GLException("OpenGL mode switching not supported for external GLContexts");
+  }
+    
+  public int  getOpenGLMode() {
+    return MacOSXCGLDrawable.CGL_MODE;
+  }
+
+  // Need to provide the display connection to extension querying APIs
+  static class Drawable extends MacOSXCGLDrawable {
+    MacOSXExternalCGLContext extCtx;
+
+    Drawable(GLDrawableFactory factory, NativeSurface comp) {
+      super(factory, comp, true);
+    }
+
+    void setExternalCGLContext(MacOSXExternalCGLContext externalContext) {
+      extCtx = externalContext;
+    }
+
+    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");
+    }
+
+    protected void swapBuffersImpl() {
+      if (extCtx != null) {
+        extCtx.swapBuffers();
+      }
+    }
+  
+    public void setOpenGLMode(int mode) {
+        if (mode != CGL_MODE)
+          throw new GLException("OpenGL mode switching not supported for external GLContext's drawables");
+    }
+
+    public int  getOpenGLMode() {
+        return CGL_MODE;
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLContext.java
new file mode 100644
index 0000000..6dba110
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLContext.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+
+public class MacOSXOffscreenCGLContext extends MacOSXPbufferCGLContext
+{  
+  public MacOSXOffscreenCGLContext(MacOSXPbufferCGLDrawable drawable,
+                                  GLContext shareWith) {
+    super(drawable, shareWith);
+  }
+	
+  public int getOffscreenContextPixelDataType() {
+    GL gl = getGL();
+    return gl.isGL2GL3()?GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:GL.GL_UNSIGNED_SHORT_5_5_5_1;
+  }
+
+  public int getOffscreenContextReadBuffer() {
+    return GL.GL_FRONT;
+  }
+
+  public boolean offscreenImageNeedsVerticalFlip() {
+    return true;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
new file mode 100644
index 0000000..bec4cf3
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import jogamp.opengl.*;
+
+public class MacOSXOffscreenCGLDrawable extends MacOSXPbufferCGLDrawable {
+
+  public MacOSXOffscreenCGLDrawable(GLDrawableFactory factory,
+                                    NativeSurface target) {
+    super(factory, target);
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    return new MacOSXOffscreenCGLContext(this, shareWith);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLContext.java
new file mode 100644
index 0000000..55d3a08
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLContext.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+
+import javax.media.opengl.*;
+
+public class MacOSXOnscreenCGLContext extends MacOSXCGLContext {
+
+  public MacOSXOnscreenCGLContext(MacOSXOnscreenCGLDrawable drawable,
+                                 GLContext shareWith) {
+    super(drawable, shareWith);
+  }
+
+    @Override
+  protected void makeCurrentImpl(boolean newCreated) throws GLException {
+      super.makeCurrentImpl(newCreated);
+      CGL.updateContext(contextHandle);
+  }
+    
+    @Override
+  protected void releaseImpl() throws GLException {
+    super.releaseImpl();
+  }
+
+    @Override
+  protected void swapBuffers() {
+    if (!CGL.flushBuffer(contextHandle)) {
+      throw new GLException("Error swapping buffers");
+    }
+  }
+
+    @Override
+  protected void update() throws GLException {
+    if (contextHandle == 0) {
+      throw new GLException("Context not created");
+    }
+    CGL.updateContext(contextHandle);
+  }
+
+  protected boolean createImpl() {
+    return create(false, false);
+  }
+
+  public void setOpenGLMode(int mode) {
+    if (mode != MacOSXCGLDrawable.NSOPENGL_MODE)
+      throw new GLException("OpenGL mode switching not supported for on-screen GLContexts");
+  }
+    
+  public int  getOpenGLMode() {
+    return MacOSXCGLDrawable.NSOPENGL_MODE;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
new file mode 100644
index 0000000..513dc3a
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+import java.lang.ref.WeakReference;
+import java.util.*;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+
+public class MacOSXOnscreenCGLDrawable extends MacOSXCGLDrawable {
+  private List/*<WeakReference<GLContext>>*/ createdContexts =
+    new ArrayList();
+
+  protected MacOSXOnscreenCGLDrawable(GLDrawableFactory factory, NativeSurface component) {
+    super(factory, component, false);
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    MacOSXOnscreenCGLContext context =
+      new MacOSXOnscreenCGLContext(this, shareWith);
+    // NOTE: we need to keep track of the created contexts in order to
+    // implement swapBuffers() because of how Mac OS X implements its
+    // OpenGL window interface
+    synchronized (this) {
+      List newContexts = new ArrayList();
+      newContexts.addAll(createdContexts);
+      newContexts.add(new WeakReference(context));
+      createdContexts = newContexts;
+    }
+    return context;
+  }
+
+  protected void swapBuffersImpl() {
+    for (Iterator iter = createdContexts.iterator(); iter.hasNext(); ) {
+      WeakReference ref = (WeakReference) iter.next();
+      MacOSXOnscreenCGLContext ctx = (MacOSXOnscreenCGLContext) ref.get();
+      // FIXME: clear out unreachable contexts
+      if (ctx != null) {
+        ctx.swapBuffers();
+      }
+    }
+  }
+  
+  public void setOpenGLMode(int mode) {
+    if (mode != NSOPENGL_MODE)
+      throw new GLException("OpenGL mode switching not supported for on-screen GLDrawables");
+  }
+
+  public int  getOpenGLMode() {
+    return NSOPENGL_MODE;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java
new file mode 100644
index 0000000..6eda3f0
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLContext.java
@@ -0,0 +1,366 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+import com.jogamp.common.nio.PointerBuffer;
+import java.security.*;
+import java.util.*;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import jogamp.opengl.*;
+
+public class MacOSXPbufferCGLContext extends MacOSXCGLContext {
+
+  // State for render-to-texture and render-to-texture-rectangle support
+  private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV
+  private int texture;       // actual texture object
+
+  private static boolean isTigerOrLater;
+
+  static {
+    String osVersion = Debug.getProperty("os.version", false, AccessController.getContext());
+    StringTokenizer tok = new StringTokenizer(osVersion, ". ");
+    int major = Integer.parseInt(tok.nextToken());
+    int minor = Integer.parseInt(tok.nextToken());
+    isTigerOrLater = ((major > 10) || (minor > 3));
+  }
+
+  public MacOSXPbufferCGLContext(MacOSXPbufferCGLDrawable drawable,
+                                GLContext shareWith) {
+    super(drawable, shareWith);
+    initOpenGLImpl();
+  }
+
+  public void bindPbufferToTexture() {
+    GL gl = getGL();
+    gl.glBindTexture(textureTarget, texture);
+    // FIXME: not clear whether this is really necessary, but since
+    // the API docs seem to imply it is and since it doesn't seem to
+    // impact performance, leaving it in
+    CGL.setContextTextureImageToPBuffer(contextHandle, drawable.getHandle(), GL.GL_FRONT);
+  }
+
+  public void releasePbufferFromTexture() {
+  }
+
+  protected void makeCurrentImpl(boolean newCreated) throws GLException {
+    if (getOpenGLMode() != ((MacOSXPbufferCGLDrawable)drawable).getOpenGLMode()) {
+      setOpenGLMode(((MacOSXPbufferCGLDrawable)drawable).getOpenGLMode());
+    }
+
+    if (!impl.makeCurrent(contextHandle)) {
+      throw new GLException("Error making Context (NS) current");
+    }
+            
+    if (newCreated) {
+      // Initialize render-to-texture support if requested
+      DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+      GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
+      GL gl = getGL();
+      boolean rect = gl.isGL2GL3() && capabilities.getPbufferRenderToTextureRectangle();
+      if (rect) {
+        if (!gl.isExtensionAvailable("GL_EXT_texture_rectangle")) {
+          System.err.println("MacOSXPbufferCGLContext: WARNING: GL_EXT_texture_rectangle extension not " +
+                             "supported; skipping requested render_to_texture_rectangle support for pbuffer");
+          rect = false;
+        }
+      }
+      textureTarget = (rect ? GL2.GL_TEXTURE_RECTANGLE : GL.GL_TEXTURE_2D);
+      int[] tmp = new int[1];
+      gl.glGenTextures(1, tmp, 0);
+      texture = tmp[0];
+      gl.glBindTexture(textureTarget, texture);
+      gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
+      gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
+      gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP_TO_EDGE);
+      gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP_TO_EDGE);
+      gl.glCopyTexImage2D(textureTarget, 0, GL.GL_RGB, 0, 0, drawable.getWidth(), drawable.getHeight(), 0);
+    }
+  }
+
+  protected void releaseImpl() throws GLException {
+    if (!impl.release(contextHandle)) {
+      throw new GLException("Error releasing OpenGL Context (NS)");
+    }
+  }
+
+  protected void destroyImpl() throws GLException {
+      if (!impl.destroy(contextHandle)) {
+        throw new GLException("Unable to delete OpenGL context");
+      }
+      if (DEBUG) {
+        System.err.println("!!! Destroyed OpenGL context " + contextHandle);
+      }
+  }
+
+  protected void setSwapIntervalImpl(int interval) {
+    impl.setSwapInterval(contextHandle, interval);
+    currentSwapInterval = impl.getSwapInterval() ;
+  }
+
+  public int getFloatingPointMode() {
+    return GLPbuffer.APPLE_FLOAT;
+  }
+
+  protected boolean createImpl() throws GLException {
+    DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
+    if (capabilities.getPbufferFloatingPointBuffers() &&
+	!isTigerOrLater) {
+      throw new GLException("Floating-point pbuffers supported only on OS X 10.4 or later");
+    }
+    // Change our OpenGL mode to match that of any share context before we create ourselves
+    MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(this);
+    if (other != null) {
+      setOpenGLMode(other.getOpenGLMode());
+    }
+    // Will throw exception upon error
+    isNSContext = impl.isNSContext();
+    contextHandle = impl.create();
+
+    if (!impl.makeCurrent(contextHandle)) {
+      throw new GLException("Error making Context (NS:"+isNSContext()+") current");
+    }
+    if(!isNSContext()) { // FIXME: ??
+        throw new GLException("Not a NS Context");
+    }
+    setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);
+    return true;
+  }
+
+  //---------------------------------------------------------------------------
+  // OpenGL "mode switching" functionality
+  //
+  private boolean haveSetOpenGLMode = false;
+  // FIXME: should consider switching the default mode based on
+  // whether the Java2D/JOGL bridge is active -- need to ask ourselves
+  // whether it's more likely that we will share with a GLCanvas or a
+  // GLJPanel when the bridge is turned on
+  private int     openGLMode = MacOSXCGLDrawable.NSOPENGL_MODE;
+  // Implementation object (either NSOpenGL-based or CGL-based)
+  protected Impl impl;
+
+  public void setOpenGLMode(int mode) {
+    if (mode == openGLMode) {
+      return;
+    }
+    if (haveSetOpenGLMode) {
+      throw new GLException("Can't switch between using NSOpenGLPixelBuffer and CGLPBufferObj more than once");
+    }
+    destroyImpl();
+    ((MacOSXPbufferCGLDrawable)drawable).setOpenGLMode(mode);
+    openGLMode = mode;
+    haveSetOpenGLMode = true;
+    if (DEBUG) {
+      System.err.println("Switching PBuffer context mode to " +
+                         ((mode == MacOSXCGLDrawable.NSOPENGL_MODE) ? "NSOPENGL_MODE" : "CGL_MODE"));
+    }
+    initOpenGLImpl();
+  }
+
+  public int  getOpenGLMode() {
+    return openGLMode;
+  }
+
+  private void initOpenGLImpl() {
+    switch (openGLMode) {
+      case MacOSXCGLDrawable.NSOPENGL_MODE:
+        impl = new NSOpenGLImpl();
+        break;
+      case MacOSXCGLDrawable.CGL_MODE:
+        impl = new CGLImpl();
+        break;
+      default:
+        throw new InternalError("Illegal implementation mode " + openGLMode);
+    }
+  }
+
+  // Abstract interface for implementation of this context (either
+  // NSOpenGL-based or CGL-based)
+  interface Impl {
+    public boolean isNSContext();
+    public long    create();
+    public boolean destroy(long ctx);
+    public boolean makeCurrent(long ctx);
+    public boolean release(long ctx);
+    public void    setSwapInterval(long ctx, int interval);
+    public int     getSwapInterval();
+  }
+
+  // NSOpenGLContext-based implementation
+  class NSOpenGLImpl implements Impl {
+    public boolean isNSContext() { return true; }
+    public long create() {
+      DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+      GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
+      if (capabilities.getPbufferFloatingPointBuffers() &&
+          !isTigerOrLater) {
+        throw new GLException("Floating-point pbuffers supported only on OS X 10.4 or later");
+      }
+      if (!MacOSXPbufferCGLContext.this.create(true, capabilities.getPbufferFloatingPointBuffers())) {
+        throw new GLException("Error creating context for pbuffer");
+      }
+      // Must now associate the pbuffer with our newly-created context
+      CGL.setContextPBuffer(contextHandle, drawable.getHandle());
+      return contextHandle;
+    }
+
+    public boolean destroy(long ctx) {
+      return CGL.deleteContext(ctx);
+    }
+
+    public boolean makeCurrent(long ctx) {
+      return CGL.makeCurrentContext(ctx);
+    }
+
+    public boolean release(long ctx) {
+      return CGL.clearCurrentContext(ctx);
+    }
+
+    private int currentSwapInterval = 0 ;
+
+    public void setSwapInterval(long ctx, int interval) {
+      CGL.setSwapInterval(ctx, interval);      
+      currentSwapInterval = interval ;
+    }
+    public int getSwapInterval() {
+        return currentSwapInterval;
+    }
+  }
+
+  class CGLImpl implements Impl {
+    public boolean isNSContext() { return false; }
+    public long create() {
+      // Find and configure share context
+      MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(MacOSXPbufferCGLContext.this);
+      long share = 0;
+      if (other != null) {
+        // Reconfigure pbuffer-based GLContexts
+        if (other instanceof MacOSXPbufferCGLContext) {
+          MacOSXPbufferCGLContext ctx = (MacOSXPbufferCGLContext) other;
+          ctx.setOpenGLMode(MacOSXCGLDrawable.CGL_MODE);
+        } else {
+          if (other.isNSContext()) {
+            throw new GLException("Can't share between NSOpenGLContexts and CGLContextObjs");
+          }
+        }
+        share = other.getHandle();
+        // Note we don't check for a 0 return value, since switching
+        // the context's mode causes it to be destroyed and not
+        // re-initialized until the next makeCurrent
+      }
+
+      // Set up pixel format attributes
+      // FIXME: shall go into MacOSXCGLGraphicsConfiguration
+      int[] attrs = new int[256];
+      int i = 0;
+      attrs[i++] = CGL.kCGLPFAPBuffer;
+      DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+      GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
+      if (capabilities.getPbufferFloatingPointBuffers())
+        attrs[i++] = CGL.kCGLPFAColorFloat;
+      if (capabilities.getDoubleBuffered())
+        attrs[i++] = CGL.kCGLPFADoubleBuffer;
+      if (capabilities.getStereo())
+        attrs[i++] = CGL.kCGLPFAStereo;
+      attrs[i++] = CGL.kCGLPFAColorSize;
+      attrs[i++] = (capabilities.getRedBits() +
+                    capabilities.getGreenBits() +
+                    capabilities.getBlueBits());
+      attrs[i++] = CGL.kCGLPFAAlphaSize;
+      attrs[i++] = capabilities.getAlphaBits();
+      attrs[i++] = CGL.kCGLPFADepthSize;
+      attrs[i++] = capabilities.getDepthBits();
+      // FIXME: should validate stencil size as is done in MacOSXWindowSystemInterface.m
+      attrs[i++] = CGL.kCGLPFAStencilSize;
+      attrs[i++] = capabilities.getStencilBits();
+      attrs[i++] = CGL.kCGLPFAAccumSize;
+      attrs[i++] = (capabilities.getAccumRedBits() +
+                    capabilities.getAccumGreenBits() +
+                    capabilities.getAccumBlueBits() +
+                    capabilities.getAccumAlphaBits());
+      if (capabilities.getSampleBuffers()) {
+        attrs[i++] = CGL.kCGLPFASampleBuffers;
+        attrs[i++] = 1;
+        attrs[i++] = CGL.kCGLPFASamples;
+        attrs[i++] = capabilities.getNumSamples();
+      }
+
+      // Use attribute array to select pixel format
+      PointerBuffer fmt = PointerBuffer.allocateDirect(1);
+      long[] numScreens = new long[1];
+      int res = CGL.CGLChoosePixelFormat(attrs, 0, fmt, numScreens, 0);
+      if (res != CGL.kCGLNoError) {
+        throw new GLException("Error code " + res + " while choosing pixel format");
+      }
+      
+      // Create new context
+      PointerBuffer ctx = PointerBuffer.allocateDirect(1);
+      if (DEBUG) {
+        System.err.println("Share context for CGL-based pbuffer context is " + toHexString(share));
+      }
+      res = CGL.CGLCreateContext(fmt.get(0), share, ctx);
+      CGL.CGLDestroyPixelFormat(fmt.get(0));
+      if (res != CGL.kCGLNoError) {
+        throw new GLException("Error code " + res + " while creating context");
+      }
+      // Attach newly-created context to the pbuffer
+      res = CGL.CGLSetPBuffer(ctx.get(0), drawable.getHandle(), 0, 0, 0);
+      if (res != CGL.kCGLNoError) {
+        throw new GLException("Error code " + res + " while attaching context to pbuffer");
+      }
+      return ctx.get(0);
+    }
+    
+    public boolean destroy(long ctx) {
+      return (CGL.CGLDestroyContext(ctx) == CGL.kCGLNoError);
+    }
+
+    public boolean makeCurrent(long ctx) {
+      return CGL.CGLSetCurrentContext(ctx) == CGL.kCGLNoError;
+    }
+
+    public boolean release(long ctx) {
+      return (CGL.CGLSetCurrentContext(0) == CGL.kCGLNoError);
+    }
+
+    public void setSwapInterval(long ctx, int interval) {
+      // For now not supported (not really relevant for off-screen contexts anyway)
+    }
+    public int getSwapInterval() {
+        return 0;
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
new file mode 100644
index 0000000..ec9ff8d
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -0,0 +1,252 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl;
+
+import com.jogamp.common.nio.PointerBuffer;
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import jogamp.opengl.*;
+
+public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
+  private static final boolean DEBUG = Debug.debug("MacOSXPbufferCGLDrawable");
+  
+  // State for render-to-texture and render-to-texture-rectangle support
+  private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV
+  private int texture;       // actual texture object
+
+  // NSOpenGLPbuffer (for normal mode)
+  // CGLPbufferObj (for CGL_MODE situation, i.e., when Java2D/JOGL bridge is active)
+  // Note that we can not store this in the NativeSurface because the
+  // semantic is that contains an NSView
+  protected long pBuffer;
+
+  public MacOSXPbufferCGLDrawable(GLDrawableFactory factory, NativeSurface target) {
+    super(factory, target, true);
+
+    if (DEBUG) {
+        System.out.println("Pbuffer config: " + getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration());
+    }
+
+    initOpenGLImpl();
+    createPbuffer();
+
+    if (DEBUG) {
+        System.err.println("Created pbuffer " + this);
+    }
+  }
+
+  protected void setRealizedImpl() {
+    if(realized) {
+        createPbuffer();
+    } else {
+        destroyImpl();
+    }
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    return new MacOSXPbufferCGLContext(this, shareWith);
+  }
+
+  protected void destroyImpl() {
+    if (this.pBuffer != 0) {
+      NativeSurface ns = getNativeSurface();
+      impl.destroy(pBuffer);
+      this.pBuffer = 0;
+      ((SurfaceChangeable)ns).setSurfaceHandle(0);
+      if (DEBUG) {
+        System.err.println("Destroyed pbuffer: " + pBuffer);
+      }
+    }
+  }
+
+  public long getHandle() {
+    return pBuffer;
+  }
+  
+  protected void swapBuffersImpl() {
+    if(DEBUG) {
+        System.err.println("unhandled swapBuffersImpl() called for: "+this);
+    }
+  }
+
+  private void createPbuffer() {
+    NativeSurface ns = getNativeSurface();
+    DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
+    GLProfile glProfile = capabilities.getGLProfile();
+    int renderTarget;
+    if (glProfile.isGL2GL3() && capabilities.getPbufferRenderToTextureRectangle()) {
+      renderTarget = GL2.GL_TEXTURE_RECTANGLE;
+    } else {
+      int w = getNextPowerOf2(getWidth());
+      int h = getNextPowerOf2(getHeight());
+      ((SurfaceChangeable)ns).setSize(w, h);
+      renderTarget = GL.GL_TEXTURE_2D;
+    }
+
+    int internalFormat = GL.GL_RGBA;
+    if (capabilities.getPbufferFloatingPointBuffers()) {
+      // FIXME: want to check availability of GL_APPLE_float_pixels
+      // extension, but need valid OpenGL context in order to do so --
+      // in worst case would need to create dummy window / GLCanvas
+      // (undesirable) -- could maybe also do this with pbuffers
+      /*
+        if (!gl.isExtensionAvailable("GL_APPLE_float_pixels")) {
+        throw new GLException("Floating-point support (GL_APPLE_float_pixels) not available");
+        }
+      */
+      if(glProfile.isGL2GL3()) {
+        switch (capabilities.getRedBits()) {
+        case 16: internalFormat = GL2.GL_RGBA_FLOAT16_APPLE; break;
+        case 32: internalFormat = GL2.GL_RGBA_FLOAT32_APPLE; break;
+        default: throw new GLException("Invalid floating-point bit depth (only 16 and 32 supported)");
+        }
+      } else {
+        internalFormat = GL.GL_RGBA;
+      }
+    }
+            
+    pBuffer = impl.create(renderTarget, internalFormat, getWidth(), getHeight());
+    if (pBuffer == 0) {
+      throw new GLException("pbuffer creation error: CGL.createPBuffer() failed");
+    }
+
+    ((SurfaceChangeable)ns).setSurfaceHandle(pBuffer);
+
+  }
+
+  private int getNextPowerOf2(int number) {
+    if (((number-1) & number) == 0) {
+      //ex: 8 -> 0b1000; 8-1=7 -> 0b0111; 0b1000&0b0111 == 0
+      return number;
+    }
+    int power = 0;
+    while (number > 0) {
+      number = number>>1;
+      power++;
+    }
+    return (1<<power);
+  }
+
+  //---------------------------------------------------------------------------
+  // OpenGL "mode switching" functionality
+  //
+  private boolean haveSetOpenGLMode = false;
+  // FIXME: should consider switching the default mode based on
+  // whether the Java2D/JOGL bridge is active -- need to ask ourselves
+  // whether it's more likely that we will share with a GLCanvas or a
+  // GLJPanel when the bridge is turned on
+  private int     openGLMode = NSOPENGL_MODE;
+  // Implementation object (either NSOpenGL-based or CGL-based)
+  protected Impl impl;
+
+  public void setOpenGLMode(int mode) {
+    if (mode == openGLMode) {
+      return;
+    }
+    if (haveSetOpenGLMode) {
+      throw new GLException("Can't switch between using NSOpenGLPixelBuffer and CGLPBufferObj more than once");
+    }
+    destroyImpl();
+    openGLMode = mode;
+    haveSetOpenGLMode = true;
+    if (DEBUG) {
+      System.err.println("Switching PBuffer drawable mode to " +
+                         ((mode == MacOSXCGLDrawable.NSOPENGL_MODE) ? "NSOPENGL_MODE" : "CGL_MODE"));
+    }
+    initOpenGLImpl();
+    createPbuffer();
+  }
+
+  public int getOpenGLMode() {
+    return openGLMode;
+  }
+
+  private void initOpenGLImpl() {
+    switch (openGLMode) {
+      case NSOPENGL_MODE:
+        impl = new NSOpenGLImpl();
+        break;
+      case CGL_MODE:
+        impl = new CGLImpl();
+        break;
+      default:
+        throw new InternalError("Illegal implementation mode " + openGLMode);
+    }
+  }
+
+  // Abstract interface for implementation of this drawable (either
+  // NSOpenGL-based or CGL-based)
+  interface Impl {
+    public long create(int renderTarget, int internalFormat, int width, int height);
+    public void destroy(long pbuffer);
+  }
+
+  // NSOpenGLPixelBuffer implementation
+  class NSOpenGLImpl implements Impl {
+    public long create(int renderTarget, int internalFormat, int width, int height) {
+      return CGL.createPBuffer(renderTarget, internalFormat, width, height);
+    }
+
+    public void destroy(long pbuffer) {
+      CGL.destroyPBuffer(pbuffer);
+    }
+  }
+
+  // CGL implementation
+  class CGLImpl implements Impl {
+    public long create(int renderTarget, int internalFormat, int width, int height) {
+      PointerBuffer pbuffer = PointerBuffer.allocateDirect(1);
+      int res = CGL.CGLCreatePBuffer(width, height, renderTarget, internalFormat, 0, pbuffer);
+      if (res != CGL.kCGLNoError) {
+        throw new GLException("Error creating CGL-based pbuffer: error code " + res);
+      }
+      return pbuffer.get(0);
+    }
+
+    public void destroy(long pbuffer) {
+      int res = CGL.CGLDestroyPBuffer(pbuffer);
+      if (res != CGL.kCGLNoError) {
+        throw new GLException("Error destroying CGL-based pbuffer: error code " + res);
+      }
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java
new file mode 100644
index 0000000..fe60710
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl.awt;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import jogamp.opengl.macosx.cgl.*;
+
+public class MacOSXAWTCGLDrawableFactory extends MacOSXCGLDrawableFactory {
+
+  public MacOSXAWTCGLDrawableFactory() {
+    super();
+  }
+
+  public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) {
+    return true;
+  }
+
+  public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+    throws GLException {
+    return new MacOSXJava2DCGLContext(shareWith);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
new file mode 100644
index 0000000..68e82dc
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.opengl.macosx.cgl.awt;
+
+import jogamp.opengl.GLGraphicsConfigurationFactory;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.CapabilitiesChooser;
+import javax.media.nativewindow.CapabilitiesImmutable;
+import javax.media.nativewindow.DefaultGraphicsScreen;
+import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.nativewindow.awt.AWTGraphicsConfiguration;
+import javax.media.nativewindow.awt.AWTGraphicsDevice;
+import javax.media.nativewindow.awt.AWTGraphicsScreen;
+import javax.media.nativewindow.macosx.MacOSXGraphicsDevice;
+
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLException;
+
+import jogamp.opengl.macosx.cgl.MacOSXCGLGraphicsConfiguration;
+
+public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFactory {
+    protected static final boolean DEBUG = jogamp.opengl.Debug.debug("GraphicsConfiguration");
+
+    public MacOSXAWTCGLGraphicsConfigurationFactory() {
+        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this);
+    }
+
+    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
+            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
+            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
+        GraphicsDevice device = null;
+        if (absScreen != null &&
+            !(absScreen instanceof AWTGraphicsScreen)) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
+        }
+
+        if(null==absScreen) {
+            absScreen = AWTGraphicsScreen.createScreenDevice(-1, AbstractGraphicsDevice.DEFAULT_UNIT);
+        }
+        AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
+        device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
+
+        if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - chosen");
+        }
+
+        if ( !(capsRequested instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - requested");
+        }
+
+        if (chooser != null &&
+            !(chooser instanceof GLCapabilitiesChooser)) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilitiesChooser objects");
+        }
+
+        if(DEBUG) {
+            System.err.println("MacOSXAWTCGLGraphicsConfigurationFactory: got "+absScreen);
+        }
+
+        MacOSXGraphicsDevice macDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+        DefaultGraphicsScreen macScreen = new DefaultGraphicsScreen(macDevice, awtScreen.getIndex());
+        if(DEBUG) {
+            System.err.println("MacOSXAWTCGLGraphicsConfigurationFactory: made "+macScreen);
+        }
+
+        GraphicsConfiguration gc = device.getDefaultConfiguration();
+        MacOSXCGLGraphicsConfiguration macConfig = (MacOSXCGLGraphicsConfiguration)
+            GraphicsConfigurationFactory.getFactory(macDevice).chooseGraphicsConfiguration(capsChosen,
+                                                                                           capsRequested,
+                                                                                           chooser, macScreen);
+
+        if (macConfig == null) {
+            throw new GLException("Unable to choose a GraphicsConfiguration: "+capsChosen+",\n\t"+chooser+"\n\t"+macScreen);
+        }
+
+        // We have nothing to match .. so choose the default
+        return new AWTGraphicsConfiguration(awtScreen, macConfig.getChosenCapabilities(), macConfig.getRequestedCapabilities(),
+                                            gc, macConfig);
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXJava2DCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXJava2DCGLContext.java
new file mode 100644
index 0000000..c5372bb
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXJava2DCGLContext.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.macosx.cgl.awt;
+
+import jogamp.opengl.macosx.cgl.*;
+
+import java.awt.Graphics;
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+import jogamp.opengl.awt.*;
+import jogamp.opengl.macosx.cgl.*;
+
+/** MacOSXCGLContext implementation supporting the Java2D/JOGL bridge
+ * on Mac OS X. The external GLDrawable mechanism does not work on Mac
+ * OS X due to how drawables and contexts are operated upon on this
+ * platform, so it is necessary to supply an alternative means to
+ * create, make current, and destroy contexts on the Java2D "drawable"
+ * on the Mac platform.
+ */
+
+public class MacOSXJava2DCGLContext extends MacOSXCGLContext implements Java2DGLContext {
+  private Graphics graphics;
+
+  // FIXME: ignoring context sharing for the time being; will need to
+  // rethink this in particular if using FBOs to implement the
+  // Java2D/OpenGL pipeline on Mac OS X
+
+  MacOSXJava2DCGLContext(GLContext shareWith) {
+    super(null, shareWith);
+  }
+
+  public void setGraphics(Graphics g) {
+    this.graphics = g;
+  }
+
+  protected void makeCurrentImpl(boolean newCreated) throws GLException {
+    if (!Java2D.makeOGLContextCurrentOnSurface(graphics, contextHandle)) {
+      throw new GLException("Error making context current");
+    }            
+  }
+
+  protected boolean createImpl() {
+    // Find and configure share context
+    MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(this);
+    long share = 0;
+    if (other != null) {
+      // Reconfigure pbuffer-based GLContexts
+      if (other instanceof MacOSXPbufferCGLContext) {
+        MacOSXPbufferCGLContext ctx = (MacOSXPbufferCGLContext) other;
+        ctx.setOpenGLMode(MacOSXCGLDrawable.CGL_MODE);
+      } else {
+        if (other.getOpenGLMode() != MacOSXCGLDrawable.CGL_MODE) {
+          throw new GLException("Can't share between NSOpenGLContexts and CGLContextObjs");
+        }
+      }
+      share = other.getHandle();
+      // Note we don't check for a 0 return value, since switching
+      // the context's mode causes it to be destroyed and not
+      // re-initialized until the next makeCurrent
+    }
+
+    if (DEBUG) {
+      System.err.println("!!! Share context is " + toHexString(share) + " for " + getClass().getName());
+    }
+
+    long ctx = Java2D.createOGLContextOnSurface(graphics, share);
+    if (ctx == 0) {
+      return false;
+    }
+    setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); // use GL_VERSION
+    // FIXME: think about GLContext sharing
+    contextHandle = ctx;
+    isNSContext = true;
+    return true;
+  }
+
+  protected void releaseImpl() throws GLException {
+    // FIXME: would need another primitive in the Java2D class in
+    // order to implement this; hopefully should not matter for
+    // correctness
+  }
+
+  protected void destroyImpl() throws GLException {
+      Java2D.destroyOGLContext(contextHandle);
+      if (DEBUG) {
+        System.err.println("!!! Destroyed OpenGL context " + contextHandle);
+      }
+  }
+
+  public void setOpenGLMode(int mode) {
+    if (mode != MacOSXCGLDrawable.CGL_MODE)
+      throw new GLException("OpenGL mode switching not supported for Java2D GLContexts");
+  }
+
+  public int  getOpenGLMode() {
+    return MacOSXCGLDrawable.CGL_MODE;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
new file mode 100644
index 0000000..4e5afc6
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
@@ -0,0 +1,331 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
+package jogamp.opengl.util.glsl.fixedfunc;
+
+import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.*;
+import javax.media.opengl.glu.*;
+import com.jogamp.common.nio.Buffers;
+import com.jogamp.opengl.util.*;
+import com.jogamp.opengl.util.glsl.*;
+import java.nio.*;
+
+public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFunc {
+    public static final int MAX_TEXTURE_UNITS = 8;
+
+    protected FixedFuncPipeline fixedFunction=null;
+    protected PMVMatrix pmvMatrix=null;
+    protected GL2ES2 gl=null;
+
+    public FixedFuncHook (GL2ES2 gl) {
+        this(gl, null);
+    }
+
+    public FixedFuncHook (GL2ES2 gl, PMVMatrix matrix) {
+        this.gl = gl;
+        pmvMatrix = (null!=matrix)?matrix:new PMVMatrix();
+
+        fixedFunction = new FixedFuncPipeline(gl, pmvMatrix);
+    }
+
+    public FixedFuncHook(GL2ES2 gl, PMVMatrix matrix, 
+                       Class shaderRootClass, String shaderSrcRoot, String shaderBinRoot, 
+                       String vertexColorFile,
+                       String vertexColorLightFile,
+                       String fragmentColorFile,
+                       String fragmentColorTextureFile) {
+        this.gl = gl;
+        pmvMatrix = matrix;
+
+        fixedFunction = new FixedFuncPipeline(gl, pmvMatrix,
+                                              shaderRootClass, shaderSrcRoot, shaderBinRoot, 
+                                              vertexColorFile, vertexColorLightFile, fragmentColorFile, fragmentColorTextureFile);
+    }
+
+    public void destroy() {
+        fixedFunction.destroy(gl);
+        fixedFunction = null;
+    }
+
+    public PMVMatrix getMatrix() { return pmvMatrix; }
+
+    //
+    // FixedFuncHookIf - hooks 
+    //
+    public void glDrawArrays(int mode, int first, int count) {
+        fixedFunction.validate(gl); 
+        gl.glDrawArrays(mode, first, count);
+    }
+    public void glDrawElements(int mode, int count, int type, java.nio.Buffer indices) {
+        fixedFunction.validate(gl); 
+        gl.glDrawElements(mode, count, type, indices);
+    }
+    public void glDrawElements(int mode, int count, int type, long indices_buffer_offset) {
+        fixedFunction.validate(gl); 
+        gl.glDrawElements(mode, count, type, indices_buffer_offset);
+    }
+
+    public void glActiveTexture(int texture) {
+        fixedFunction.glActiveTexture(gl, texture);
+        gl.glActiveTexture(texture);
+    }
+    public void glEnable(int cap) {
+        if(fixedFunction.glEnable(gl, cap, true)) {
+            gl.glEnable(cap);
+        }
+    }
+    public void glDisable(int cap) {
+        if(fixedFunction.glEnable(gl, cap, false)) {
+            gl.glDisable(cap);
+        }
+    }
+    public void glCullFace(int faceName) {
+        fixedFunction.glCullFace(gl, faceName);
+        gl.glCullFace(faceName);
+    }
+
+    public void glGetFloatv(int pname, java.nio.FloatBuffer params) {
+        if(pmvMatrix.isMatrixGetName(pname)) {
+            pmvMatrix.glGetFloatv(pname, params);
+            return;
+        }
+        gl.glGetFloatv(pname, params);
+    }
+    public void glGetFloatv(int pname, float[] params, int params_offset) {
+        if(pmvMatrix.isMatrixGetName(pname)) {
+            pmvMatrix.glGetFloatv(pname, params, params_offset);
+            return;
+        }
+        gl.glGetFloatv(pname, params, params_offset);
+    }
+    public void glGetIntegerv(int pname, IntBuffer params) {
+        if(pmvMatrix.isMatrixGetName(pname)) {
+            pmvMatrix.glGetIntegerv(pname, params);
+            return;
+        }
+        gl.glGetIntegerv(pname, params);
+    }
+    public void glGetIntegerv(int pname, int[] params, int params_offset) {
+        if(pmvMatrix.isMatrixGetName(pname)) {
+            pmvMatrix.glGetIntegerv(pname, params, params_offset);
+            return;
+        }
+        gl.glGetIntegerv(pname, params, params_offset);
+    }
+
+    // 
+    // MatrixIf
+    //
+    public int  glGetMatrixMode() {
+        return pmvMatrix.glGetMatrixMode();
+    }
+    public void glMatrixMode(int mode) {
+        pmvMatrix.glMatrixMode(mode);
+    }
+    public void glLoadMatrixf(java.nio.FloatBuffer m) {
+        pmvMatrix.glLoadMatrixf(m);
+    }
+    public void glLoadMatrixf(float[] m, int m_offset) {
+        glLoadMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset));
+    }
+    public void glPopMatrix() {
+        pmvMatrix.glPopMatrix();
+    }
+    public void glPushMatrix() {
+        pmvMatrix.glPushMatrix();
+    }
+    public void glLoadIdentity() {
+        pmvMatrix.glLoadIdentity();
+    }
+    public void glMultMatrixf(java.nio.FloatBuffer m) {
+        pmvMatrix.glMultMatrixf(m);
+    }
+    public void glMultMatrixf(float[] m, int m_offset) {
+        glMultMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset));
+    }
+    public void glTranslatef(float x, float y, float z) {
+        pmvMatrix.glTranslatef(x, y, z);
+    }
+    public void glRotatef(float angdeg, float x, float y, float z) {
+        pmvMatrix.glRotatef(angdeg, x, y, z);
+    }
+    public void glScalef(float x, float y, float z) {
+        pmvMatrix.glScalef(x, y, z);
+    }
+    public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
+        pmvMatrix.glOrthof(left, right, bottom, top, zNear, zFar);
+    }
+    public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
+        pmvMatrix.glFrustumf(left, right, bottom, top, zNear, zFar);
+    }
+
+    // 
+    // LightingIf
+    //
+    public void glColor4f(float red, float green, float blue, float alpha) {
+      fixedFunction.glColor4fv(gl, GLBuffers.newDirectFloatBuffer(new float[] { red, green, blue, alpha }));
+    }
+
+    public void glLightfv(int light, int pname, java.nio.FloatBuffer params) {
+      fixedFunction.glLightfv(gl, light, pname, params);
+    }
+    public void glLightfv(int light, int pname, float[] params, int params_offset) {
+        glLightfv(light, pname, GLBuffers.newDirectFloatBuffer(params, params_offset));
+    }
+    public void glMaterialfv(int face, int pname, java.nio.FloatBuffer params) {
+      fixedFunction.glMaterialfv(gl, face, pname, params);
+    }
+    public void glMaterialfv(int face, int pname, float[] params, int params_offset) {
+        glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(params, params_offset));
+    }
+    public void glMaterialf(int face, int pname, float param) {
+        glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(new float[] { param }));
+    }
+    public void glShadeModel(int mode) {
+      fixedFunction.glShadeModel(gl, mode);
+    }
+
+    //
+    // PointerIf
+    //
+    public void glEnableClientState(int glArrayIndex) {
+      fixedFunction.glEnableClientState(gl, glArrayIndex);
+    }
+    public void glDisableClientState(int glArrayIndex) {
+      fixedFunction.glDisableClientState(gl, glArrayIndex);
+    }
+
+    public void glVertexPointer(GLArrayData array) {
+      if(array.isVBO()) {
+          if(!gl.glIsVBOArrayEnabled()) {
+            throw new GLException("VBO array is not enabled: "+array);
+          }
+      } else {
+          if(gl.glIsVBOArrayEnabled()) {
+            throw new GLException("VBO array is not disabled: "+array);
+          }
+          Buffers.rangeCheck(array.getBuffer(), 1);
+          if (!Buffers.isDirect(array.getBuffer())) {
+            throw new GLException("Argument \"pointer\" was not a direct buffer"); }
+      }
+      fixedFunction.glVertexPointer(gl, array);
+    }
+
+    public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+      glVertexPointer(GLArrayDataWrapper.createFixed(gl, GL_VERTEX_ARRAY, size, type, false, stride, pointer, 0, 0));
+    }
+    public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) {
+      int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
+      if(vboName==0) {
+        throw new GLException("no GL_ARRAY_BUFFER VBO bound");
+      }
+      glVertexPointer(GLArrayDataWrapper.createFixed(gl, GL_VERTEX_ARRAY, size, type, false, 
+                                                     stride, null, vboName, pointer_buffer_offset));
+    }
+
+    public void glColorPointer(GLArrayData array) {
+      if(array.isVBO()) {
+          if(!gl.glIsVBOArrayEnabled()) {
+            throw new GLException("VBO array is not enabled: "+array);
+          }
+      } else {
+          if(gl.glIsVBOArrayEnabled()) {
+            throw new GLException("VBO array is not disabled: "+array);
+          }
+          Buffers.rangeCheck(array.getBuffer(), 1);
+          if (!Buffers.isDirect(array.getBuffer())) {
+            throw new GLException("Argument \"pointer\" was not a direct buffer"); }
+      }
+      fixedFunction.glColorPointer(gl, array);
+    }
+    public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+      glColorPointer(GLArrayDataWrapper.createFixed(gl, GL_COLOR_ARRAY, size, type, false, 
+                                                    stride, pointer, 0, 0));
+    }
+    public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) {
+      int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
+      if(vboName==0) {
+        throw new GLException("no GL_ARRAY_BUFFER VBO bound");
+      }
+      glColorPointer(GLArrayDataWrapper.createFixed(gl, GL_COLOR_ARRAY, size, type, false, 
+                                                   stride, null, vboName, pointer_buffer_offset));
+    }
+
+    public void glNormalPointer(GLArrayData array) {
+      if(array.getComponentNumber()!=3) {
+        throw new GLException("Only 3 components per normal allowed");
+      }
+      if(array.isVBO()) {
+          if(!gl.glIsVBOArrayEnabled()) {
+            throw new GLException("VBO array is not enabled: "+array);
+          }
+      } else {
+          if(gl.glIsVBOArrayEnabled()) {
+            throw new GLException("VBO array is not disabled: "+array);
+          }
+          Buffers.rangeCheck(array.getBuffer(), 1);
+          if (!Buffers.isDirect(array.getBuffer())) {
+            throw new GLException("Argument \"pointer\" was not a direct buffer"); }
+      }
+      fixedFunction.glNormalPointer(gl, array);
+    }
+    public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) {
+      glNormalPointer(GLArrayDataWrapper.createFixed(gl, GL_NORMAL_ARRAY, 3, type, false, 
+                                                     stride, pointer, 0, 0));
+    }
+    public void glNormalPointer(int type, int stride, long pointer_buffer_offset) {
+      int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
+      if(vboName==0) {
+        throw new GLException("no GL_ARRAY_BUFFER VBO bound");
+      }
+      glNormalPointer(GLArrayDataWrapper.createFixed(gl, GL_NORMAL_ARRAY, 3, type, false, 
+                                                     stride, null, vboName, pointer_buffer_offset));
+    }
+
+    public void glTexCoordPointer(GLArrayData array) {
+      if(array.isVBO()) {
+          if(!gl.glIsVBOArrayEnabled()) {
+            throw new GLException("VBO array is not enabled: "+array);
+          }
+      } else {
+          if(gl.glIsVBOArrayEnabled()) {
+            throw new GLException("VBO array is not disabled: "+array);
+          }
+          Buffers.rangeCheck(array.getBuffer(), 1);
+          if (!Buffers.isDirect(array.getBuffer())) {
+            throw new GLException("Argument \"pointer\" was not a direct buffer"); }
+      }
+      fixedFunction.glTexCoordPointer(gl, array);
+    }
+    public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+      glTexCoordPointer(
+        GLArrayDataWrapper.createFixed(gl, GL_TEXTURE_COORD_ARRAY, size, type, false, stride, pointer, 0,0));
+    }
+    public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) {
+      int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
+      if(vboName==0) {
+        throw new GLException("no GL_ARRAY_BUFFER VBO bound");
+      }
+      glTexCoordPointer(
+        GLArrayDataWrapper.createFixed(gl, GL_TEXTURE_COORD_ARRAY, size, type, false, 
+                                       stride, null, vboName, pointer_buffer_offset) );
+    }
+
+    public final String toString() {
+          StringBuffer buf = new StringBuffer();
+          buf.append(getClass().getName()+" (");
+          if(null!=pmvMatrix) {
+              buf.append(", matrixDirty: "+pmvMatrix.isDirty());
+          }
+          buf.append("\n\t, FixedFunction: "+fixedFunction);
+          buf.append(gl);
+          buf.append(" )");
+
+          return buf.toString();
+    }
+
+}
+
+
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
new file mode 100644
index 0000000..b77cf46
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
@@ -0,0 +1,554 @@
+
+package jogamp.opengl.util.glsl.fixedfunc;
+
+import com.jogamp.common.nio.Buffers;
+import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.*;
+import com.jogamp.opengl.util.*;
+import com.jogamp.opengl.util.glsl.*;
+import java.nio.*;
+
+public class FixedFuncPipeline {
+    public static final int MAX_TEXTURE_UNITS = 8;
+    public static final int MAX_LIGHTS        = 8;
+
+    // We can't have any dependencies on the FixedFuncUtil class for build bootstrapping reasons
+    public static final String mgl_Vertex = "mgl_Vertex";
+    public static final String mgl_Normal = "mgl_Normal";
+    public static final String mgl_Color = "mgl_Color";
+    public static final String mgl_MultiTexCoord = "mgl_MultiTexCoord" ;
+
+    public static String getPredefinedArrayIndexName(int glArrayIndex) {
+        switch(glArrayIndex) {
+            case GLPointerFunc.GL_VERTEX_ARRAY:
+                return mgl_Vertex;
+            case GLPointerFunc.GL_NORMAL_ARRAY:
+                return mgl_Normal;
+            case GLPointerFunc.GL_COLOR_ARRAY:
+                return mgl_Color;
+            case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
+                return mgl_MultiTexCoord;
+        }
+        return null;
+    }
+
+    public FixedFuncPipeline(GL2ES2 gl, PMVMatrix pmvMatrix) {
+        init(gl, pmvMatrix, FixedFuncPipeline.class, shaderSrcRootDef, shaderBinRootDef, 
+             vertexColorFileDef, vertexColorLightFileDef, fragmentColorFileDef, fragmentColorTextureFileDef);
+    }
+    public FixedFuncPipeline(GL2ES2 gl, PMVMatrix pmvMatrix, Class shaderRootClass, String shaderSrcRoot, String shaderBinRoot, 
+                       String vertexColorFile,
+                       String vertexColorLightFile,
+                       String fragmentColorFile,
+                       String fragmentColorTextureFile) {
+        init(gl, pmvMatrix, shaderRootClass, shaderSrcRoot, shaderBinRoot, 
+             vertexColorFile, vertexColorLightFile, fragmentColorFile, fragmentColorTextureFile);
+    }
+
+    public boolean verbose() { return verbose; }
+
+    public void setVerbose(boolean v) { verbose=v; }
+
+    public boolean isValid() {
+        return shaderState.linked();
+    }
+
+    public ShaderState getShaderState() {
+        return shaderState;
+    }
+
+    public int getActiveTextureUnit() {
+        return activeTextureUnit;
+    }
+
+    public String getArrayIndexName(int glArrayIndex) {
+      String name = getPredefinedArrayIndexName(glArrayIndex); 
+      switch(glArrayIndex) {
+          case GLPointerFunc.GL_VERTEX_ARRAY:
+          case GLPointerFunc.GL_NORMAL_ARRAY:
+          case GLPointerFunc.GL_COLOR_ARRAY:
+              break;
+          case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
+              name = name + activeTextureUnit;
+      }
+      return name;
+    }
+
+    public void destroy(GL2ES2 gl) {
+        shaderProgramColor.release(gl, true);
+        shaderProgramColorLight.release(gl, true);
+        shaderProgramColorTexture.release(gl, true);
+        shaderProgramColorTextureLight.release(gl, true);
+        shaderState.destroy(gl);
+    }
+
+    public void glEnableClientState(GL2ES2 gl, int glArrayIndex) {
+        shaderState.glUseProgram(gl, true);
+
+        shaderState.glEnableVertexAttribArray(gl, getArrayIndexName(glArrayIndex));
+        // textureCoordsEnabled |=  (1 << activeTextureUnit);
+        if ( textureCoordsEnabled.get(activeTextureUnit) != 1 ) {
+            textureCoordsEnabled.put(activeTextureUnit, 1);
+            textureCoordsEnabledDirty = true;
+        }
+    }
+
+    public void glDisableClientState(GL2ES2 gl, int glArrayIndex) {
+        shaderState.glUseProgram(gl, true);
+
+        shaderState.glDisableVertexAttribArray(gl, getArrayIndexName(glArrayIndex));
+        // textureCoordsEnabled &= ~(1 << activeTextureUnit);
+        if ( textureCoordsEnabled.get(activeTextureUnit) != 0 ) {
+            textureCoordsEnabled.put(activeTextureUnit, 0);
+            textureCoordsEnabledDirty = true;
+        }
+    }
+
+    public void glVertexPointer(GL2ES2 gl, GLArrayData data) {
+        shaderState.glUseProgram(gl, true);
+        shaderState.glVertexAttribPointer(gl, data);
+    }
+
+    public void glColorPointer(GL2ES2 gl, GLArrayData data) {
+        shaderState.glUseProgram(gl, true);
+        shaderState.glVertexAttribPointer(gl, data);
+    }
+
+    public void glColor4fv(GL2ES2 gl, FloatBuffer data ) {
+        shaderState.glUseProgram(gl, true);
+        GLUniformData ud = shaderState.getUniform(mgl_ColorStatic);
+        if(null!=ud) {
+            ud.setData(data);
+            shaderState.glUniform(gl, ud);
+        }
+    }
+
+    public void glNormalPointer(GL2ES2 gl, GLArrayData data) {
+        shaderState.glUseProgram(gl, true);
+        shaderState.glVertexAttribPointer(gl, data);
+    }
+
+    public void glTexCoordPointer(GL2ES2 gl, GLArrayData data) {
+        shaderState.glUseProgram(gl, true);
+        data.setName( getArrayIndexName(data.getIndex()) );
+        shaderState.glVertexAttribPointer(gl, data);
+    }
+
+    public void glLightfv(GL2ES2 gl, int light, int pname, java.nio.FloatBuffer params) {
+        shaderState.glUseProgram(gl, true);
+        light -=GLLightingFunc.GL_LIGHT0;
+        if(0 <= light && light < MAX_LIGHTS) {
+            GLUniformData ud = null;
+            switch(pname) {
+                case  GLLightingFunc.GL_AMBIENT:
+                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].ambient");
+                    break;
+                case  GLLightingFunc.GL_DIFFUSE:
+                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].diffuse");
+                    break;
+                case  GLLightingFunc.GL_SPECULAR:
+                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].specular");
+                    break;
+                case GLLightingFunc.GL_POSITION:
+                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].position");
+                    break;
+                case GLLightingFunc.GL_SPOT_DIRECTION:
+                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotDirection");
+                    break;
+                case GLLightingFunc.GL_SPOT_EXPONENT:
+                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotExponent");
+                    break;
+                case GLLightingFunc.GL_SPOT_CUTOFF:
+                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotCutoff");
+                    break;
+                case GLLightingFunc.GL_CONSTANT_ATTENUATION:
+                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].constantAttenuation");
+                    break;
+                case GLLightingFunc.GL_LINEAR_ATTENUATION:
+                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].linearAttenuation");
+                    break;
+                case GLLightingFunc.GL_QUADRATIC_ATTENUATION:
+                    ud = shaderState.getUniform(mgl_LightSource+"["+light+"].quadraticAttenuation");
+                    break;
+                default:
+                    if(verbose) {
+                        System.err.println("glLightfv pname not within [GL_AMBIENT GL_DIFFUSE GL_SPECULAR GL_POSITION GL_SPOT_DIRECTION]: "+pname);
+                    }
+                    return;
+            }
+            if(null!=ud) {
+                ud.setData(params);
+                shaderState.glUniform(gl, ud);
+            }
+        } else if(verbose) {
+            System.err.println("glLightfv light not within [0.."+MAX_LIGHTS+"]: "+light);
+        }
+    }
+
+    public void glMaterialfv(GL2ES2 gl, int face, int pname, java.nio.FloatBuffer params) {
+        shaderState.glUseProgram(gl, true);
+
+        switch (face) {
+            case GL.GL_FRONT:
+            case GL.GL_FRONT_AND_BACK:
+                break;
+            case GL.GL_BACK:
+                if(verbose) {
+                    System.err.println("glMaterialfv face GL_BACK currently not supported");
+                }
+                break;
+            default:
+        }
+
+        GLUniformData ud = null;
+        switch(pname) {
+            case  GLLightingFunc.GL_AMBIENT:
+                ud = shaderState.getUniform(mgl_FrontMaterial+".ambient");
+                break;
+            case  GLLightingFunc.GL_AMBIENT_AND_DIFFUSE:
+                glMaterialfv(gl, face, GLLightingFunc.GL_AMBIENT, params);
+                // fall through intended ..
+            case  GLLightingFunc.GL_DIFFUSE:
+                ud = shaderState.getUniform(mgl_FrontMaterial+".diffuse");
+                break;
+            case  GLLightingFunc.GL_SPECULAR:
+                ud = shaderState.getUniform(mgl_FrontMaterial+".specular");
+                break;
+            case  GLLightingFunc.GL_EMISSION:
+                ud = shaderState.getUniform(mgl_FrontMaterial+".emission");
+                break;
+            case  GLLightingFunc.GL_SHININESS:
+                ud = shaderState.getUniform(mgl_FrontMaterial+".shininess");
+                break;
+            default:
+                if(verbose) {
+                    System.err.println("glMaterialfv pname not within [GL_AMBIENT GL_DIFFUSE GL_SPECULAR GL_EMISSION GL_SHININESS]: "+pname);
+                }
+                return;
+        }
+        if(null!=ud) {
+            ud.setData(params);
+            shaderState.glUniform(gl, ud);
+        }
+    }
+
+    public void glShadeModel(GL2ES2 gl, int mode) {
+        shaderState.glUseProgram(gl, true);
+        GLUniformData ud = shaderState.getUniform(mgl_ShadeModel);
+        if(null!=ud) {
+            ud.setData(mode);
+            shaderState.glUniform(gl, ud);
+        }
+    }
+
+    public void glActiveTexture(GL2ES2 gl, int textureUnit) {
+        textureUnit -= GL.GL_TEXTURE0;
+        if(0 <= textureUnit && textureUnit<MAX_TEXTURE_UNITS) {
+            shaderState.glUseProgram(gl, true);
+            GLUniformData ud;
+            ud = shaderState.getUniform(mgl_ActiveTexture);
+            if(null!=ud) {
+                ud.setData(textureUnit);
+                shaderState.glUniform(gl, ud);
+            }
+            ud = shaderState.getUniform(mgl_ActiveTextureIdx);
+            if(null!=ud) {
+                ud.setData(textureUnit);
+                shaderState.glUniform(gl, ud);
+            }
+            activeTextureUnit = textureUnit;
+        } else {
+            throw new GLException("glActivateTexture textureUnit not within GL_TEXTURE0 + [0.."+MAX_TEXTURE_UNITS+"]: "+textureUnit);
+        }
+    }
+
+    /**
+     * @return false if digested in regard to GL2ES2 spec, 
+     *         eg this call must not be passed to an underlying ES2 implementation.
+     *         true if this call shall be passed to an underlying GL2ES2/ES2 implementation as well.
+     */
+    public boolean glEnable(GL2ES2 gl, int cap, boolean enable) {
+        switch(cap) {
+            case GL.GL_TEXTURE_2D:
+                textureEnabled=enable;
+                return true;
+            case GLLightingFunc.GL_LIGHTING:
+                lightingEnabled=enable;
+                return false;
+            case GL.GL_CULL_FACE:
+                cullFace=Math.abs(cullFace);
+                if(!enable) {
+                    cullFace*=-1;
+                }
+                return true;
+        }
+
+        int light = cap - GLLightingFunc.GL_LIGHT0;
+        if(0 <= light && light < MAX_LIGHTS) {
+            if ( (lightsEnabled.get(light)==1) != enable ) {
+                lightsEnabled.put(light, enable?1:0);
+                lightsEnabledDirty = true;
+                return false;
+            }
+        }
+        return true; // pass it on ..
+    }
+
+    public void glCullFace(GL2ES2 gl, int faceName) {
+        switch(faceName) {
+            case GL.GL_FRONT:
+                faceName = 1; break;
+            case GL.GL_BACK:
+                faceName = 2; break;
+            case GL.GL_FRONT_AND_BACK:
+                faceName = 3; break;
+        }
+        if(0>cullFace) {
+            faceName *= -1;
+        }
+        cullFace = faceName;
+    }
+
+    public void validate(GL2ES2 gl) {
+        shaderState.glUseProgram(gl, true);
+        GLUniformData ud;
+        if(pmvMatrix.update()) {
+            ud = shaderState.getUniform(mgl_PMVMatrix);
+            if(null!=ud) {
+                // same data object ..
+                shaderState.glUniform(gl, ud);
+            } else {
+                throw new GLException("Failed to update: mgl_PMVMatrix");
+            }
+            ud = shaderState.getUniform(mgl_NormalMatrix);
+            if(null!=ud) {
+                // same data object ..
+                shaderState.glUniform(gl, ud);
+            }
+        }
+        ud = shaderState.getUniform(mgl_ColorEnabled);
+        if(null!=ud) {
+            int ca = (shaderState.isVertexAttribArrayEnabled(mgl_Color)==true)?1:0;
+            if(ca!=ud.intValue()) {
+                ud.setData(ca);
+                shaderState.glUniform(gl, ud);
+            }
+        }
+        ud = shaderState.getUniform(mgl_CullFace);
+        if(null!=ud) {
+            if(cullFace!=ud.intValue()) {
+                ud.setData(cullFace);
+                shaderState.glUniform(gl, ud);
+            }
+        }
+
+        if(lightsEnabledDirty) {
+            ud = shaderState.getUniform(mgl_LightsEnabled);
+            if(null!=ud) {
+                // same data object 
+                shaderState.glUniform(gl, ud);
+            }
+            lightsEnabledDirty=false;
+        }
+
+        if(textureCoordsEnabledDirty) {
+            ud = shaderState.getUniform(mgl_TexCoordEnabled);
+            if(null!=ud) {
+                // same data object 
+                shaderState.glUniform(gl, ud);
+            }
+            textureCoordsEnabledDirty=false;
+        }
+
+        if(textureEnabled) {
+            if(lightingEnabled) {
+                shaderState.attachShaderProgram(gl, shaderProgramColorTextureLight);
+            } else {
+                shaderState.attachShaderProgram(gl, shaderProgramColorTexture);
+            }
+        } else {
+            if(lightingEnabled) {
+                shaderState.attachShaderProgram(gl, shaderProgramColorLight);
+            } else {
+                shaderState.attachShaderProgram(gl, shaderProgramColor);
+            }
+        }
+        if(DEBUG) {
+            System.err.println("validate: "+this);
+        }
+    }
+
+    public String toString() {
+        return "FixedFuncPipeline[pmv: "+pmvMatrix+
+               ", textureEnabled: "+textureEnabled+
+               ", textureCoordsEnabled: "+textureCoordsEnabled+
+               ", lightingEnabled: "+lightingEnabled+
+               ", lightsEnabled: "+lightsEnabled+
+               "\n\t, shaderProgramColor: "+shaderProgramColor+
+               "\n\t, shaderProgramColorTexture: "+shaderProgramColorTexture+
+               "\n\t, shaderProgramColorLight: "+shaderProgramColorLight+
+               "\n\t, shaderProgramColorTextureLight: "+shaderProgramColorTextureLight+
+               "\n\t, ShaderState: "+shaderState+
+               "]";
+    }
+
+    protected void init(GL2ES2 gl, PMVMatrix pmvMatrix, Class shaderRootClass, String shaderSrcRoot, String shaderBinRoot, 
+                       String vertexColorFile,
+                       String vertexColorLightFile,
+                       String fragmentColorFile,
+                       String fragmentColorTextureFile) 
+   {
+        if(null==pmvMatrix) {
+            throw new GLException("PMVMatrix is null");
+        }
+        this.pmvMatrix=pmvMatrix;
+        this.shaderState=new ShaderState();
+        this.shaderState.setVerbose(verbose);
+        ShaderCode vertexColor, vertexColorLight, fragmentColor, fragmentColorTexture;
+
+        vertexColor = ShaderCode.create( gl, gl.GL_VERTEX_SHADER, 1, shaderRootClass,
+                                         shaderSrcRoot, shaderBinRoot, vertexColorFile);
+
+        vertexColorLight = ShaderCode.create( gl, gl.GL_VERTEX_SHADER, 1, shaderRootClass,
+                                           shaderSrcRoot, shaderBinRoot, vertexColorLightFile);
+
+        fragmentColor = ShaderCode.create( gl, gl.GL_FRAGMENT_SHADER, 1, shaderRootClass,
+                                           shaderSrcRoot, shaderBinRoot, fragmentColorFile);
+
+        fragmentColorTexture = ShaderCode.create( gl, gl.GL_FRAGMENT_SHADER, 1, shaderRootClass,
+                                                  shaderSrcRoot, shaderBinRoot, fragmentColorTextureFile);
+
+        shaderProgramColor = new ShaderProgram();
+        shaderProgramColor.add(vertexColor);
+        shaderProgramColor.add(fragmentColor);
+        if(!shaderProgramColor.link(gl, System.err)) {
+            throw new GLException("Couldn't link VertexColor program: "+shaderProgramColor);
+        }
+
+        shaderProgramColorTexture = new ShaderProgram();
+        shaderProgramColorTexture.add(vertexColor);
+        shaderProgramColorTexture.add(fragmentColorTexture);
+        if(!shaderProgramColorTexture.link(gl, System.err)) {
+            throw new GLException("Couldn't link VertexColorTexture program: "+shaderProgramColorTexture);
+        }
+
+        shaderProgramColorLight = new ShaderProgram();
+        shaderProgramColorLight.add(vertexColorLight);
+        shaderProgramColorLight.add(fragmentColor);
+        if(!shaderProgramColorLight.link(gl, System.err)) {
+            throw new GLException("Couldn't link VertexColorLight program: "+shaderProgramColorLight);
+        }
+
+        shaderProgramColorTextureLight = new ShaderProgram();
+        shaderProgramColorTextureLight.add(vertexColorLight);
+        shaderProgramColorTextureLight.add(fragmentColorTexture);
+        if(!shaderProgramColorTextureLight.link(gl, System.err)) {
+            throw new GLException("Couldn't link VertexColorLight program: "+shaderProgramColorTextureLight);
+        }
+
+        shaderState.attachShaderProgram(gl, shaderProgramColor);
+        shaderState.glUseProgram(gl, true);
+
+        // mandatory ..
+        if(!shaderState.glUniform(gl, new GLUniformData(mgl_PMVMatrix, 4, 4, pmvMatrix.glGetPMvMviMatrixf()))) {
+            throw new GLException("Error setting PMVMatrix in shader: "+this);
+        }
+
+        // optional parameter ..
+        shaderState.glUniform(gl, new GLUniformData(mgl_NormalMatrix, 3, 3, pmvMatrix.glGetNormalMatrixf()));
+
+        shaderState.glUniform(gl, new GLUniformData(mgl_ColorEnabled,  0));
+        shaderState.glUniform(gl, new GLUniformData(mgl_ColorStatic, 4, zero4f));
+        shaderState.glUniform(gl, new GLUniformData(mgl_TexCoordEnabled,  1, textureCoordsEnabled));
+        shaderState.glUniform(gl, new GLUniformData(mgl_ActiveTexture, activeTextureUnit));
+        shaderState.glUniform(gl, new GLUniformData(mgl_ActiveTextureIdx, activeTextureUnit));
+        shaderState.glUniform(gl, new GLUniformData(mgl_ShadeModel, 0));
+        shaderState.glUniform(gl, new GLUniformData(mgl_CullFace, cullFace));
+        for(int i=0; i<MAX_LIGHTS; i++) {
+            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].ambient", 4, defAmbient));
+            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].diffuse", 4, defDiffuse));
+            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].specular", 4, defSpecular));
+            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].position", 4, defPosition));
+            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotDirection", 3, defSpotDir));
+            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotExponent", defSpotExponent));
+            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotCutoff", defSpotCutoff));
+            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].constantAttenuation", defConstantAtten));
+            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].linearAttenuation", defLinearAtten));
+            shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].quadraticAttenuation", defQuadraticAtten));
+        }
+        shaderState.glUniform(gl, new GLUniformData(mgl_LightsEnabled,  1, lightsEnabled));
+        shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".ambient", 4, defMatAmbient));
+        shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".diffuse", 4, defMatDiffuse));
+        shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".specular", 4, defMatSpecular));
+        shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".emission", 4, defMatEmission));
+        shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".shininess", defMatShininess));
+
+        shaderState.glUseProgram(gl, false);
+    }
+
+    protected static final boolean DEBUG=false;
+    protected boolean verbose=false;
+
+    protected boolean textureEnabled=false;
+    protected IntBuffer textureCoordsEnabled = Buffers.newDirectIntBuffer(new int[] { 0, 0, 0, 0, 0, 0, 0, 0 });
+    protected boolean textureCoordsEnabledDirty = false;
+    protected int     activeTextureUnit=0;
+
+    protected int cullFace=-2; // <=0 disabled, 1: front, 2: back (default, but disabled), 3: front & back
+
+    protected boolean lightingEnabled=false;
+    protected IntBuffer lightsEnabled = Buffers.newDirectIntBuffer(new int[] { 0, 0, 0, 0, 0, 0, 0, 0 });
+    protected boolean   lightsEnabledDirty = false;
+
+    protected PMVMatrix pmvMatrix;
+    protected ShaderState shaderState;
+    protected ShaderProgram shaderProgramColor;
+    protected ShaderProgram shaderProgramColorTexture;
+    protected ShaderProgram shaderProgramColorLight;
+    protected ShaderProgram shaderProgramColorTextureLight;
+
+    // uniforms ..
+    protected static final String mgl_PMVMatrix        = "mgl_PMVMatrix";       // m4fv[3]
+    protected static final String mgl_NormalMatrix     = "mgl_NormalMatrix";    // m4fv
+    protected static final String mgl_ColorEnabled     = "mgl_ColorEnabled";    //  1i
+    protected static final String mgl_ColorStatic      = "mgl_ColorStatic";     //  4fv
+
+    protected static final String mgl_LightSource      = "mgl_LightSource";     //  struct mgl_LightSourceParameters[MAX_LIGHTS]
+    protected static final String mgl_FrontMaterial    = "mgl_FrontMaterial";   //  struct mgl_MaterialParameters
+    protected static final String mgl_LightsEnabled    = "mgl_LightsEnabled";   //  int mgl_LightsEnabled[MAX_LIGHTS];
+
+    protected static final String mgl_ShadeModel       = "mgl_ShadeModel";      //  1i
+
+    protected static final String mgl_TexCoordEnabled  = "mgl_TexCoordEnabled"; //  int mgl_TexCoordEnabled[MAX_TEXTURE_UNITS];
+    protected static final String mgl_ActiveTexture    = "mgl_ActiveTexture";   //  1i
+    protected static final String mgl_ActiveTextureIdx = "mgl_ActiveTextureIdx";//  1i
+
+    protected static final String mgl_CullFace         = "mgl_CullFace";   //  1i
+
+    protected static final FloatBuffer zero4f     = Buffers.newDirectFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f, 0.0f });
+
+    public static final FloatBuffer defAmbient = Buffers.newDirectFloatBuffer(new float[] { 0f, 0f, 0f, 1f });
+    public static final FloatBuffer defDiffuse = zero4f;
+    public static final FloatBuffer defSpecular= zero4f;
+    public static final FloatBuffer defPosition= Buffers.newDirectFloatBuffer(new float[] { 0f, 0f, 1f, 0f });
+    public static final FloatBuffer defSpotDir = Buffers.newDirectFloatBuffer(new float[] { 0f, 0f, -1f });
+    public static final float defSpotExponent  = 0f;
+    public static final float defSpotCutoff    = 180f;
+    public static final float defConstantAtten = 1f;
+    public static final float defLinearAtten   = 0f;
+    public static final float defQuadraticAtten= 0f;
+
+    public static final FloatBuffer defMatAmbient = Buffers.newDirectFloatBuffer(new float[] { 0.2f, 0.2f, 0.2f, 1.0f });
+    public static final FloatBuffer defMatDiffuse = Buffers.newDirectFloatBuffer(new float[] { 0.8f, 0.8f, 0.8f, 1.0f });
+    public static final FloatBuffer defMatSpecular= Buffers.newDirectFloatBuffer(new float[] { 0f, 0f, 0f, 1f});
+    public static final FloatBuffer defMatEmission= Buffers.newDirectFloatBuffer(new float[] { 0f, 0f, 0f, 1f});
+    public static final float       defMatShininess = 0f;
+
+    protected static final String vertexColorFileDef          = "FixedFuncColor";
+    protected static final String vertexColorLightFileDef    = "FixedFuncColorLight";
+    protected static final String fragmentColorFileDef        = "FixedFuncColor";
+    protected static final String fragmentColorTextureFileDef = "FixedFuncColorTexture";
+    protected static final String shaderSrcRootDef = "shaders" ;
+    protected static final String shaderBinRootDef = "shaders/bin" ;
+}
+
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColor.fp
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColor.fp
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColor.vp
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColor.vp
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorLight.vp
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorLight.vp
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorTexture.fp
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorTexture.fp
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/bin/nvidia/FixedFuncColor.bfp
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/bin/nvidia/FixedFuncColor.bfp
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/bin/nvidia/FixedFuncColor.bvp
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/bin/nvidia/FixedFuncColor.bvp
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/bin/nvidia/FixedFuncColorLight.bvp
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/bin/nvidia/FixedFuncColorLight.bvp
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/bin/nvidia/FixedFuncColorTexture.bfp
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/bin/nvidia/FixedFuncColorTexture.bfp
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/es_precision.glsl
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/es_precision.glsl
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_attribute.glsl
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_attribute.glsl
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_const.glsl
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_const.glsl
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_lightdef.glsl
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_lightdef.glsl
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_settexcoord.vp
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_settexcoord.vp
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform_light.glsl
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform_light.glsl
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_varying.glsl
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_varying.glsl
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/scripts/nvidia-apx/glslc-ff.bat
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/scripts/nvidia-apx/glslc-ff.bat
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/scripts/nvidia-apx/glslc.bat
similarity index 100%
rename from src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat
rename to src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/scripts/nvidia-apx/glslc.bat
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
new file mode 100644
index 0000000..a23c5a0
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
@@ -0,0 +1,243 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import java.util.Comparator;
+
+import jogamp.nativewindow.windows.GDI;
+import jogamp.nativewindow.windows.PIXELFORMATDESCRIPTOR;
+import javax.media.opengl.GL;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+
+public class WGLGLCapabilities extends GLCapabilities {
+  PIXELFORMATDESCRIPTOR pfd;
+  int pfdID;
+  int arb_pixelformat; // -1 PFD, 0 NOP, 1 ARB
+
+  /** Comparing pfd id only */
+  public static class PfdIDComparator implements Comparator {
+
+      public int compare(Object o1, Object o2) {
+        if ( ! ( o1 instanceof WGLGLCapabilities ) ) {
+            Class c = (null != o1) ? o1.getClass() : null ;
+            throw new ClassCastException("arg1 not a WGLGLCapabilities object: " + c);
+        }
+        if ( ! ( o2 instanceof WGLGLCapabilities ) ) {
+            Class c = (null != o2) ? o2.getClass() : null ;
+            throw new ClassCastException("arg2 not a WGLGLCapabilities object: " + c);
+        }
+
+        final WGLGLCapabilities caps1 = (WGLGLCapabilities) o1;
+        final long id1 = caps1.getPFDID();
+
+        final WGLGLCapabilities caps2 = (WGLGLCapabilities) o2;
+        final long id2 = caps2.getPFDID();
+
+        if(id1 > id2) {
+            return 1;
+        } else if(id1 < id2) {
+            return -1;
+        }
+        return 0;
+      }
+  }
+
+  public WGLGLCapabilities(PIXELFORMATDESCRIPTOR pfd, int pfdID, GLProfile glp) {
+      super(glp);
+      this.pfd = pfd;
+      this.pfdID = pfdID;
+      this.arb_pixelformat = 0;
+  }
+
+  public boolean setValuesByGDI() {
+      arb_pixelformat = -1;
+
+      setRedBits(pfd.getCRedBits());
+      setGreenBits(pfd.getCGreenBits());
+      setBlueBits(pfd.getCBlueBits());
+      setAlphaBits(pfd.getCAlphaBits());
+      setAccumRedBits(pfd.getCAccumRedBits());
+      setAccumGreenBits(pfd.getCAccumGreenBits());
+      setAccumBlueBits(pfd.getCAccumBlueBits());
+      setAccumAlphaBits(pfd.getCAccumAlphaBits());
+      setDepthBits(pfd.getCDepthBits());
+      setStencilBits(pfd.getCStencilBits());
+      setDoubleBuffered((pfd.getDwFlags() & GDI.PFD_DOUBLEBUFFER) != 0);
+      setStereo((pfd.getDwFlags() & GDI.PFD_STEREO) != 0);
+      setHardwareAccelerated((pfd.getDwFlags() & GDI.PFD_GENERIC_FORMAT) == 0
+                          || (pfd.getDwFlags() & GDI.PFD_GENERIC_ACCELERATED) != 0);
+      // n/a with non ARB/GDI method:
+      //       multisample
+      //       opaque
+      //       pbuffer
+
+      return true;
+  }
+
+  public boolean setValuesByARB(final int[] iattribs, final int niattribs, final int[] iresults) {
+      arb_pixelformat = 1;
+
+      for (int i = 0; i < niattribs; i++) {
+          int attr = iattribs[i];
+          switch (attr) {
+              case WGLExt.WGL_DRAW_TO_WINDOW_ARB:
+              case WGLExt.WGL_DRAW_TO_BITMAP_ARB:
+              case WGLExt.WGL_DRAW_TO_PBUFFER_ARB:
+                  break;
+
+              case WGLExt.WGL_ACCELERATION_ARB:
+                  setHardwareAccelerated(iresults[i] == WGLExt.WGL_FULL_ACCELERATION_ARB);
+                  break;
+
+              case WGLExt.WGL_SUPPORT_OPENGL_ARB:
+                  if (iresults[i] != GL.GL_TRUE) {
+                      return false;
+                  }
+                  break;
+
+              case WGLExt.WGL_DEPTH_BITS_ARB:
+                  setDepthBits(iresults[i]);
+                  break;
+
+              case WGLExt.WGL_STENCIL_BITS_ARB:
+                  setStencilBits(iresults[i]);
+                  break;
+
+              case WGLExt.WGL_DOUBLE_BUFFER_ARB:
+                  setDoubleBuffered(iresults[i] == GL.GL_TRUE);
+                  break;
+
+              case WGLExt.WGL_STEREO_ARB:
+                  setStereo(iresults[i] == GL.GL_TRUE);
+                  break;
+
+              case WGLExt.WGL_PIXEL_TYPE_ARB:
+                  // Fail softly with unknown results here
+                  if (iresults[i] == WGLExt.WGL_TYPE_RGBA_ARB ||
+                      iresults[i] == WGLExt.WGL_TYPE_RGBA_FLOAT_ARB) {
+                      setPbufferFloatingPointBuffers(true);
+                  }
+                  break;
+
+              case WGLExt.WGL_FLOAT_COMPONENTS_NV:
+                  if (iresults[i] != 0) {
+                      setPbufferFloatingPointBuffers(true);
+                  }
+                  break;
+
+              case WGLExt.WGL_RED_BITS_ARB:
+                  setRedBits(iresults[i]);
+                  break;
+
+              case WGLExt.WGL_GREEN_BITS_ARB:
+                  setGreenBits(iresults[i]);
+                  break;
+
+              case WGLExt.WGL_BLUE_BITS_ARB:
+                  setBlueBits(iresults[i]);
+                  break;
+
+              case WGLExt.WGL_ALPHA_BITS_ARB:
+                  setAlphaBits(iresults[i]);
+                  break;
+
+              case WGLExt.WGL_ACCUM_RED_BITS_ARB:
+                  setAccumRedBits(iresults[i]);
+                  break;
+
+              case WGLExt.WGL_ACCUM_GREEN_BITS_ARB:
+                  setAccumGreenBits(iresults[i]);
+                  break;
+
+              case WGLExt.WGL_ACCUM_BLUE_BITS_ARB:
+                  setAccumBlueBits(iresults[i]);
+                  break;
+
+              case WGLExt.WGL_ACCUM_ALPHA_BITS_ARB:
+                  setAccumAlphaBits(iresults[i]);
+                  break;
+
+              case WGLExt.WGL_SAMPLE_BUFFERS_ARB:
+                  setSampleBuffers(iresults[i] != 0);
+                  break;
+
+              case WGLExt.WGL_SAMPLES_ARB:
+                  setNumSamples(iresults[i]);
+                  break;
+
+              default:
+                  throw new GLException("Unknown pixel format attribute " + iattribs[i]);
+          }
+      }
+      return true;
+  }
+
+  public Object cloneMutable() {
+    return clone();
+  }
+
+  public Object clone() {
+    try {
+      return super.clone();
+    } catch (RuntimeException e) {
+      throw new GLException(e);
+    }
+  }
+
+  final public PIXELFORMATDESCRIPTOR getPFD() { return pfd; }
+  final public int getPFDID() { return pfdID; }
+  
+  final public boolean isSetByARB() { return 0 < arb_pixelformat; }
+  final public boolean isSetByGDI() { return 0 > arb_pixelformat; }
+  final public boolean isSet()      { return 0 != arb_pixelformat; }
+  
+  public StringBuffer toString(StringBuffer sink) {
+    if(null == sink) {
+        sink = new StringBuffer();
+    }
+    sink.append(pfdID).append(" ");
+    switch (arb_pixelformat) {
+        case -1: 
+            sink.append("gdi");
+            break;
+        case  0:
+            sink.append("nop");
+            break;
+        case  1:
+            sink.append("arb");
+            break;
+        default:
+            throw new InternalError("invalid arb_pixelformat: " + arb_pixelformat);
+    }
+    sink.append(": ");
+    return super.toString(sink);
+  }
+}
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLContext.java
new file mode 100644
index 0000000..68b26b3
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLContext.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import javax.media.opengl.*;
+
+public class WindowsBitmapWGLContext extends WindowsWGLContext {
+  public WindowsBitmapWGLContext(WindowsBitmapWGLDrawable drawable,
+                                   GLContext shareWith) {
+    super(drawable, shareWith);
+  }
+
+  public int getOffscreenContextPixelDataType() {
+      return GL.GL_UNSIGNED_BYTE;
+  }
+  
+  public int getOffscreenContextReadBuffer() {
+    // On Windows these contexts are always single-buffered
+    return GL.GL_FRONT;
+  }
+
+  public boolean offscreenImageNeedsVerticalFlip() {
+    // We can take care of this in the DIB creation (see below)
+    return false;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
new file mode 100644
index 0000000..4df3b7e
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import com.jogamp.common.nio.PointerBuffer;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.SurfaceChangeable;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLException;
+
+import jogamp.nativewindow.windows.BITMAPINFO;
+import jogamp.nativewindow.windows.BITMAPINFOHEADER;
+import jogamp.nativewindow.windows.GDI;
+import javax.media.opengl.GLCapabilitiesImmutable;
+
+public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
+  private long origbitmap;
+  private long hbitmap;
+
+  protected WindowsBitmapWGLDrawable(GLDrawableFactory factory, NativeSurface target) {
+    super(factory, target, true);
+    create();
+  }
+
+  protected void setRealizedImpl() {
+    if(realized) {
+        create();
+    } else {
+        destroyImpl();
+    }
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    return new WindowsBitmapWGLContext(this, shareWith);
+  }
+
+  private void create() {
+    int werr;
+    NativeSurface ns = getNativeSurface();
+    if(DEBUG) {
+        System.err.println("WindowsBitmapWGLDrawable (1): "+ns);
+    }
+    WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getRequestedCapabilities();
+    int width = getWidth();
+    int height = getHeight();
+
+    //
+    // 1. Create DIB Section
+    //
+    BITMAPINFO info = BITMAPINFO.create();
+    BITMAPINFOHEADER header = info.getBmiHeader();
+    int bitsPerPixel = (capabilities.getRedBits() +
+                        capabilities.getGreenBits() +
+                        capabilities.getBlueBits() +
+                        capabilities.getAlphaBits());
+    header.setBiSize(header.size());
+    header.setBiWidth(width);
+    // NOTE: negating the height causes the DIB to be in top-down row
+    // order rather than bottom-up; ends up being correct during pixel
+    // readback
+    header.setBiHeight(-1 * height);
+    header.setBiPlanes((short) 1);
+    header.setBiBitCount((short) bitsPerPixel);
+    header.setBiXPelsPerMeter(0);
+    header.setBiYPelsPerMeter(0);
+    header.setBiClrUsed(0);
+    header.setBiClrImportant(0);
+    header.setBiCompression(GDI.BI_RGB);
+    int byteNum = width * height * ( bitsPerPixel >> 3 ) ;
+    header.setBiSizeImage(byteNum);
+
+    PointerBuffer pb = PointerBuffer.allocateDirect(1);
+    hbitmap = GDI.CreateDIBSection(0, info, GDI.DIB_RGB_COLORS, pb, 0, 0);
+    werr = GDI.GetLastError();
+    if(DEBUG) {
+        long p = ( pb.capacity() > 0 ) ? pb.get(0) : 0;
+        System.err.println("WindowsBitmapWGLDrawable: pb sz/ptr "+pb.capacity() + ", "+toHexString(p));
+        System.err.println("WindowsBitmapWGLDrawable: " + width+"x"+height +
+                            ", bpp " + bitsPerPixel +
+                            ", bytes " + byteNum +
+                            ", header sz " + header.size() +
+                            ", DIB ptr num " + pb.capacity()+
+                            ", "+capabilities+
+                            ", werr "+werr);
+    }
+    if (hbitmap == 0) {
+      throw new GLException("Error creating offscreen bitmap of " + ns + ", werr " + werr);
+    }
+
+    //
+    // 2. Create memory DC (device context) , and associate it with the DIB.
+    //
+    long hdc = GDI.CreateCompatibleDC(0);
+    werr = GDI.GetLastError();
+    if (hdc == 0) {
+        GDI.DeleteObject(hbitmap);
+        hbitmap = 0;
+      throw new GLException("Error creating device context for offscreen OpenGL context, werr "+werr);
+    }
+    ((SurfaceChangeable)ns).setSurfaceHandle(hdc);
+    if(DEBUG) {
+        System.err.println("WindowsBitmapWGLDrawable (2): "+ns);
+    }
+
+    if ((origbitmap = GDI.SelectObject(hdc, hbitmap)) == 0) {
+      GDI.DeleteObject(hbitmap);
+      hbitmap = 0;
+      GDI.DeleteDC(hdc);
+      hdc = 0;
+      throw new GLException("Error selecting bitmap into new device context");
+    }
+    
+    config.updateGraphicsConfiguration(getFactory(), ns, null);
+  }
+  
+  protected void destroyImpl() {
+    NativeSurface ns = getNativeSurface();
+    if (ns.getSurfaceHandle() != 0) {
+      // Must destroy bitmap and device context
+      GDI.SelectObject(ns.getSurfaceHandle(), origbitmap);
+      GDI.DeleteObject(hbitmap);
+      GDI.DeleteDC(ns.getSurfaceHandle());
+      origbitmap = 0;
+      hbitmap = 0;
+      ((SurfaceChangeable)ns).setSurfaceHandle(0);
+    }
+  }
+
+  protected void swapBuffersImpl() {
+    if(DEBUG) {
+        System.err.println("unhandled swapBuffersImpl() called for: "+this);
+    }
+  }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsDummyWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsDummyWGLDrawable.java
new file mode 100644
index 0000000..3d0cce7
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsDummyWGLDrawable.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLProfile;
+
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import jogamp.nativewindow.windows.GDI;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLException;
+import jogamp.nativewindow.windows.GDISurface;
+
+public class WindowsDummyWGLDrawable extends WindowsWGLDrawable {
+  private long hwnd;
+  private boolean handleHwndLifecycle;
+
+  private WindowsDummyWGLDrawable(GLDrawableFactory factory, GDISurface ns, boolean handleHwndLifecycle) {
+    super(factory, ns, true);
+    this.handleHwndLifecycle = handleHwndLifecycle;
+    
+    if(NativeSurface.LOCK_SURFACE_NOT_READY >= ns.lockSurface()) {
+        throw new GLException("WindowsDummyWGLDrawable: surface not ready (lockSurface)");
+    }
+    try {
+        WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+        config.updateGraphicsConfiguration(factory, ns, null);
+        if (DEBUG) {
+          System.err.println("!!! WindowsDummyWGLDrawable: "+config);
+        }
+    } catch (Throwable t) {
+        destroyImpl();
+        throw new GLException(t);
+    } finally {
+        unlockSurface();
+    }
+  }
+
+  public static WindowsDummyWGLDrawable create(GLDrawableFactory factory, GLProfile glp, AbstractGraphicsScreen absScreen,
+                                               long windowHandle, int width, int height, boolean handleWindowLifecycle) {
+    if(0 == windowHandle) {
+        throw new GLException("Error windowHandle 0, werr: "+GDI.GetLastError());
+    }
+    GLCapabilities caps = new GLCapabilities(glp);
+    WindowsWGLGraphicsConfiguration cfg = WindowsWGLGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(caps, absScreen);
+    GDISurface ns = new GDISurface(cfg, windowHandle);
+    ns.setSize(width, height);
+    return new WindowsDummyWGLDrawable(factory, ns, handleWindowLifecycle);
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    // FIXME: figure out how to hook back in the Java 2D / JOGL bridge
+    return new WindowsWGLContext(this, shareWith);
+  }
+
+  protected void destroyImpl() {
+    if (handleHwndLifecycle && hwnd != 0) {
+      GDI.ShowWindow(hwnd, GDI.SW_HIDE);
+      GDI.DestroyDummyWindow(hwnd);
+      hwnd = 0;
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
new file mode 100644
index 0000000..0e2575b
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.DefaultGraphicsScreen;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+
+import jogamp.nativewindow.WrappedSurface;
+import jogamp.nativewindow.windows.GDI;
+import jogamp.opengl.GLContextShareSet;
+
+
+public class WindowsExternalWGLContext extends WindowsWGLContext {
+  private GLContext lastContext;
+
+  private WindowsExternalWGLContext(Drawable drawable, long ctx, WindowsWGLGraphicsConfiguration cfg) {
+    super(drawable, null);
+    this.contextHandle = ctx;
+    if (DEBUG) {
+      System.err.println(getThreadName() + ": !!! Created external OpenGL context " + toHexString(ctx) + " for " + this);
+    }
+    GLContextShareSet.contextCreated(this);
+    setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);  // use GL_VERSION
+    getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
+  }
+
+  protected static WindowsExternalWGLContext create(GLDrawableFactory factory, GLProfile glp) {
+    if(DEBUG) {
+        System.err.println("WindowsExternalWGLContext 0: werr: " + GDI.GetLastError());
+    }
+
+    final long ctx = WGL.wglGetCurrentContext();
+    if (0 == ctx) {
+      throw new GLException("Error: attempted to make an external GLContext without a context current, werr " + GDI.GetLastError());
+    }
+
+    final long hdc = WGL.wglGetCurrentDC();
+    if (0 == hdc) {
+      throw new GLException("Error: attempted to make an external GLDrawable without a drawable current, werr " + GDI.GetLastError());
+    }
+    AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
+    WindowsWGLGraphicsConfiguration cfg;
+    final int pfdID = GDI.GetPixelFormat(hdc);
+    if (0 == pfdID) {
+        // This could have happened if the HDC was released right after the GL ctx made current (SWT),
+        // WinXP-32bit will not be able to use this HDC afterwards.
+        // Workaround: Use a fake default configuration
+        final int werr = GDI.GetLastError();
+        cfg = WindowsWGLGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(new GLCapabilities(GLProfile.getDefault()), aScreen);
+        if(DEBUG) {
+            System.err.println("WindowsExternalWGLContext invalid hdc/pfd werr "+werr+", using default cfg: " + cfg);
+        }
+    } else {
+        cfg = WindowsWGLGraphicsConfiguration.createFromCurrent(factory, hdc, pfdID, glp, aScreen, true);
+        if(DEBUG) {
+            System.err.println("WindowsExternalWGLContext valid hdc/pfd, retrieved cfg: " + cfg);
+        }
+    }
+    return new WindowsExternalWGLContext(new Drawable(factory, new WrappedSurface(cfg, hdc)), ctx, cfg);
+  }
+
+  public int makeCurrent() throws GLException {
+    // Save last context if necessary to allow external GLContexts to
+    // talk to other GLContexts created by this library
+    GLContext cur = getCurrent();
+    if (cur != null && cur != this) {
+      lastContext = cur;
+      setCurrent(null);
+    }
+    return super.makeCurrent();
+  }  
+
+  public void release() throws GLException {
+    super.release();
+    setCurrent(lastContext);
+    lastContext = null;
+  }
+
+  protected void makeCurrentImpl(boolean newCreated) throws GLException {
+  }
+
+  protected void releaseImpl() throws GLException {
+  }
+
+  protected void destroyImpl() throws GLException {
+  }
+
+  // Need to provide the display connection to extension querying APIs
+  static class Drawable extends WindowsWGLDrawable {
+    Drawable(GLDrawableFactory factory, NativeSurface comp) {
+      super(factory, comp, true);
+    }
+
+    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");
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java
new file mode 100644
index 0000000..7666ae3
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.DefaultGraphicsScreen;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+
+import jogamp.nativewindow.WrappedSurface;
+import jogamp.nativewindow.windows.GDI;
+
+public class WindowsExternalWGLDrawable extends WindowsWGLDrawable {
+
+  private WindowsExternalWGLDrawable(GLDrawableFactory factory, NativeSurface component) {
+    super(factory, component, true);
+  }
+
+  protected static WindowsExternalWGLDrawable create(GLDrawableFactory factory, GLProfile glp) {
+    long hdc = WGL.wglGetCurrentDC();
+    if (0==hdc) {
+      throw new GLException("Error: attempted to make an external GLDrawable without a drawable current, werr " + GDI.GetLastError());
+    }
+    int pfdID = GDI.GetPixelFormat(hdc);
+    if (pfdID == 0) {
+      throw new GLException("Error: attempted to make an external GLContext without a valid pixelformat, werr " + GDI.GetLastError());
+    }
+
+    AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
+    WindowsWGLGraphicsConfiguration cfg = WindowsWGLGraphicsConfiguration.createFromCurrent(factory, hdc, pfdID, glp, aScreen, true);
+    return new WindowsExternalWGLDrawable(factory, new WrappedSurface(cfg, hdc));
+  }
+
+
+  public GLContext createContext(GLContext shareWith) {
+    return new WindowsWGLContext(this, shareWith);
+  }
+  
+  public void setSize(int newWidth, int newHeight) {
+    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");
+  }  
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLContext.java
new file mode 100644
index 0000000..a06ab8f
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLContext.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import java.util.*;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+
+public class WindowsOnscreenWGLContext extends WindowsWGLContext {
+  public WindowsOnscreenWGLContext(WindowsOnscreenWGLDrawable drawable,
+                                  GLContext shareWith) {
+    super(drawable, shareWith);
+  }    
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java
new file mode 100644
index 0000000..4f34c94
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+
+public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable {
+  protected WindowsOnscreenWGLDrawable(GLDrawableFactory factory, NativeSurface component) {
+    super(factory, component, false);
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    return new WindowsOnscreenWGLContext(this, shareWith);
+  }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLContext.java
new file mode 100644
index 0000000..97c63ea
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLContext.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import javax.media.opengl.*;
+
+public class WindowsPbufferWGLContext extends WindowsWGLContext {
+  // State for render-to-texture and render-to-texture-rectangle support
+  private boolean rtt;       // render-to-texture?
+  private boolean hasRTT;    // render-to-texture extension available?
+  private boolean rect;      // render-to-texture-rectangle?
+  private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV
+  private int texture;       // actual texture object
+
+  protected WindowsPbufferWGLContext(WindowsPbufferWGLDrawable drawable,
+                                 GLContext shareWith) {
+    super(drawable, shareWith);
+  }
+
+  public void bindPbufferToTexture() {
+    if (!rtt) {
+      throw new GLException("Shouldn't try to bind a pbuffer to a texture if render-to-texture hasn't been " +
+                            "specified in its GLCapabilities");
+    }
+    GL gl = getGL();
+    WGLExt wglExt = getWGLExt();
+    gl.glBindTexture(textureTarget, texture);
+    if (rtt && hasRTT) {
+      if (!wglExt.wglBindTexImageARB(((WindowsPbufferWGLDrawable)drawable).getPbufferHandle(), WGLExt.WGL_FRONT_LEFT_ARB)) {
+        throw new GLException("Binding of pbuffer to texture failed: " + wglGetLastError());
+      }
+    }
+    // FIXME: comment is wrong now
+    // Note that if the render-to-texture extension is not supported,
+    // we perform a glCopyTexImage2D in swapBuffers().
+  }
+
+  public void releasePbufferFromTexture() {
+    if (!rtt) {
+      throw new GLException("Shouldn't try to bind a pbuffer to a texture if render-to-texture hasn't been " +
+                            "specified in its GLCapabilities");
+    }
+    if (rtt && hasRTT) {
+      WGLExt wglExt = getWGLExt();
+      if (!wglExt.wglReleaseTexImageARB(((WindowsPbufferWGLDrawable)drawable).getPbufferHandle(), WGLExt.WGL_FRONT_LEFT_ARB)) {
+        throw new GLException("Releasing of pbuffer from texture failed: " + wglGetLastError());
+      }
+    }
+  }
+
+  protected void makeCurrentImpl(boolean newCreated) throws GLException {
+    super.makeCurrentImpl(newCreated);
+    if (newCreated) {
+      GLCapabilitiesImmutable capabilities = drawable.getChosenGLCapabilities();
+
+      // Initialize render-to-texture support if requested
+      GL gl = getGL();
+      rtt  = capabilities.getPbufferRenderToTexture();
+      rect = gl.isGL2GL3() && capabilities.getPbufferRenderToTextureRectangle();
+
+      if (rtt) {
+        if (DEBUG) {
+          System.err.println("Initializing render-to-texture support");
+        }
+
+        if (!gl.isExtensionAvailable("WGL_ARB_render_texture")) {
+          System.err.println("WindowsPbufferWGLContext: WARNING: WGL_ARB_render_texture extension not " +
+                             "supported; implementing render_to_texture support using slow texture readback");
+        } else {
+          hasRTT = true;
+
+          if (rect && !gl.isExtensionAvailable("GL_NV_texture_rectangle")) {
+            System.err.println("WindowsPbufferWGLContext: WARNING: GL_NV_texture_rectangle extension not " +
+                               "supported; skipping requested render_to_texture_rectangle support for pbuffer");
+            rect = false;
+          }
+          if (rect) {
+            if (DEBUG) {
+              System.err.println("  Using render-to-texture-rectangle");
+            }
+            textureTarget = GL2.GL_TEXTURE_RECTANGLE_ARB;
+          } else {
+            if (DEBUG) {
+              System.err.println("  Using vanilla render-to-texture");
+            }
+            textureTarget = GL.GL_TEXTURE_2D;
+          }
+          int[] tmp = new int[1];
+          gl.glGenTextures(1, tmp, 0);
+          texture = tmp[0];
+          gl.glBindTexture(textureTarget, texture);
+          gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
+          gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
+          gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP_TO_EDGE);
+          gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP_TO_EDGE);
+          gl.glCopyTexImage2D(textureTarget, 0, GL.GL_RGB, 0, 0, drawable.getWidth(), drawable.getHeight(), 0);
+        }
+      }
+    }
+  }
+
+  public int getFloatingPointMode() {
+    return ((WindowsPbufferWGLDrawable)drawable).getFloatingPointMode();
+  }
+
+  private static String wglGetLastError() {
+    return WindowsWGLDrawableFactory.wglGetLastError();
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
new file mode 100644
index 0000000..83354a7
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
@@ -0,0 +1,266 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.SurfaceChangeable;
+import javax.media.opengl.GL;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLPbuffer;
+import javax.media.opengl.GLProfile;
+
+import jogamp.nativewindow.windows.GDI;
+import javax.media.opengl.GLCapabilitiesImmutable;
+
+public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
+  private WGLExt cachedWGLExt; // cached WGLExt instance from parent GLCanvas,
+                               // needed to destroy pbuffer
+  private long buffer; // pbuffer handle
+
+  private int floatMode;
+
+  protected WindowsPbufferWGLDrawable(GLDrawableFactory factory, NativeSurface target,
+                                      WindowsWGLDrawableFactory.SharedResource sharedResource) {
+    super(factory, target, true);
+
+    if (DEBUG) {
+        System.out.println("Pbuffer config: " + getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration());
+    }
+
+    createPbuffer(sharedResource);
+
+    if (DEBUG) {
+        System.err.println("Created pbuffer " + this);
+    }
+  }
+
+  protected void setRealizedImpl() {
+    if(realized) {
+        throw new GLException("Recreation via setRealized not supported.");
+    } else {
+        destroyImpl();
+    }
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    return new WindowsPbufferWGLContext(this, shareWith);
+  }
+
+  protected void destroyImpl() {
+    NativeSurface ns = getNativeSurface();
+    if(0!=buffer) {
+        WGLExt wglExt = cachedWGLExt;
+        if (ns.getSurfaceHandle() != 0) {
+          // Must release DC and pbuffer
+          // NOTE that since the context is not current, glGetError() can
+          // not be called here, so we skip the use of any composable
+          // pipelines (see WindowsOnscreenWGLContext.makeCurrentImpl)
+          if (wglExt.wglReleasePbufferDCARB(buffer, ns.getSurfaceHandle()) == 0) {
+            throw new GLException("Error releasing pbuffer device context: error code " + GDI.GetLastError());
+          }
+          ((SurfaceChangeable)ns).setSurfaceHandle(0);
+        }
+        if (!wglExt.wglDestroyPbufferARB(buffer)) {
+            throw new GLException("Error destroying pbuffer: error code " + GDI.GetLastError());
+        }
+        buffer = 0;
+    }
+  }
+
+  public long getPbufferHandle() {
+    // The actual to-be-used handle for makeCurrent etc,
+    // is the derived DC, set in the NativeSurface surfaceHandle
+    // returned by getHandle().
+    return buffer;
+  }
+
+  public int getFloatingPointMode() {
+    return floatMode;
+  }
+
+  protected void swapBuffersImpl() {
+    if(DEBUG) {
+        System.err.println("unhandled swapBuffersImpl() called for: "+this);
+    }
+  }
+
+  private void createPbuffer(WindowsWGLDrawableFactory.SharedResource sharedResource) {
+    long parentHdc = sharedResource.getDrawable().getNativeSurface().getSurfaceHandle();
+    WGLExt wglExt = sharedResource.getContext().getWGLExt();
+    
+    int[]   iattributes = new int  [2*WindowsWGLGraphicsConfiguration.MAX_ATTRIBS];
+    float[] fattributes = new float[1];
+    int[]   floatModeTmp = new int[1];
+    int     niattribs   = 0;
+    int     width, height;
+
+    WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable)config.getChosenCapabilities();
+    GLProfile glProfile = chosenCaps.getGLProfile();
+
+    if (DEBUG) {
+      System.out.println("Pbuffer parentHdc = " + toHexString(parentHdc));
+      System.out.println("Pbuffer chosenCaps: " + chosenCaps);
+    }
+
+    if(!WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(chosenCaps,
+                                    iattributes, sharedResource, -1, floatModeTmp)){
+      throw new GLException("Pbuffer-related extensions not supported");
+    }
+
+    floatMode = floatModeTmp[0];
+    boolean rtt      = chosenCaps.getPbufferRenderToTexture();
+    boolean rect     = chosenCaps.getPbufferRenderToTextureRectangle();
+    boolean useFloat = chosenCaps.getPbufferFloatingPointBuffers();
+    boolean ati      = false;
+
+    if (useFloat) {
+      ati = (floatMode == GLPbuffer.ATI_FLOAT);
+    }
+
+    int[] pformats = new int[WindowsWGLGraphicsConfiguration.MAX_PFORMATS];
+    int   nformats;
+    int[] nformatsTmp = new int[1];
+    if (!wglExt.wglChoosePixelFormatARB(parentHdc,
+                                        iattributes, 0,
+                                        fattributes, 0,
+                                        WindowsWGLGraphicsConfiguration.MAX_PFORMATS,
+                                        pformats, 0,
+                                        nformatsTmp, 0)) {
+      throw new GLException("pbuffer creation error: wglChoosePixelFormat() failed");
+    }
+    nformats = nformatsTmp[0];
+    if (nformats <= 0) {
+      throw new GLException("pbuffer creation error: Couldn't find a suitable pixel format");
+    }
+
+    if (DEBUG) {
+      System.err.println("" + nformats + " suitable pixel formats found");
+      for (int i = 0; i < nformats; i++) {
+        WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, parentHdc, pformats[i], glProfile, false, true);
+        System.err.println("pixel format " + pformats[i] + " (index " + i + "): " + dbgCaps);
+      }
+    }
+
+    int pfdid = 0;
+    long tmpBuffer = 0;
+    {
+        int whichFormat;
+        // Loop is a workaround for bugs in NVidia's recent drivers
+        for (whichFormat = 0; whichFormat < nformats; whichFormat++) {
+          int format = pformats[whichFormat];
+
+          // Create the p-buffer.
+          niattribs = 0;
+
+          if (rtt) {
+            iattributes[niattribs++]   = WGLExt.WGL_TEXTURE_FORMAT_ARB;
+            if (useFloat) {
+              iattributes[niattribs++] = WGLExt.WGL_TEXTURE_FLOAT_RGB_NV;
+            } else {
+              iattributes[niattribs++] = WGLExt.WGL_TEXTURE_RGBA_ARB;
+            }
+
+            iattributes[niattribs++] = WGLExt.WGL_TEXTURE_TARGET_ARB;
+            iattributes[niattribs++] = rect ? WGLExt.WGL_TEXTURE_RECTANGLE_NV : WGLExt.WGL_TEXTURE_2D_ARB;
+
+            iattributes[niattribs++] = WGLExt.WGL_MIPMAP_TEXTURE_ARB;
+            iattributes[niattribs++] = GL.GL_FALSE;
+
+            iattributes[niattribs++] = WGLExt.WGL_PBUFFER_LARGEST_ARB;
+            iattributes[niattribs++] = GL.GL_FALSE;
+          }
+
+          iattributes[niattribs++] = 0;
+
+          tmpBuffer = wglExt.wglCreatePbufferARB(parentHdc, format, getWidth(), getHeight(), iattributes, 0);
+          if (tmpBuffer != 0) {
+            // Done
+            break;
+          }
+        }
+
+        if (0 == tmpBuffer) {
+          throw new GLException("pbuffer creation error: wglCreatePbuffer() failed: tried " + nformats +
+                                " pixel formats, last error was: " + wglGetLastError());
+        }
+        pfdid = pformats[whichFormat];
+    }
+
+    // Get the device context.
+    long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer);
+    if (tmpHdc == 0) {
+      throw new GLException("pbuffer creation error: wglGetPbufferDC() failed");
+    }
+
+    NativeSurface ns = getNativeSurface();
+    // Set up instance variables
+    buffer = tmpBuffer;
+    ((SurfaceChangeable)ns).setSurfaceHandle(tmpHdc);
+    cachedWGLExt = wglExt;   
+
+    // Re-query chosen pixel format
+    {
+      WGLGLCapabilities newCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, parentHdc, pfdid, glProfile, false, true);
+      if(null == newCaps) {
+        throw new GLException("pbuffer creation error: unable to re-query chosen PFD ID: " + pfdid + ", hdc " + this.toHexString(tmpHdc));
+      }
+      if(newCaps.isOnscreen() || !newCaps.isPBuffer()) {
+        throw new GLException("Error: Selected Onscreen Caps for PBuffer: "+newCaps);
+      }
+      config.setCapsPFD(newCaps);
+    }
+
+    // Determine the actual width and height we were able to create.
+    int[] tmp = new int[1];
+    wglExt.wglQueryPbufferARB( buffer, WGLExt.WGL_PBUFFER_WIDTH_ARB,  tmp, 0 );
+    width = tmp[0];
+    wglExt.wglQueryPbufferARB( buffer, WGLExt.WGL_PBUFFER_HEIGHT_ARB, tmp, 0 );
+    height = tmp[0];
+    ((SurfaceChangeable)ns).setSize(width, height);
+  }
+
+  private static String wglGetLastError() {
+    return WindowsWGLDrawableFactory.wglGetLastError();
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
new file mode 100644
index 0000000..94017e7
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
@@ -0,0 +1,478 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLCapabilitiesImmutable;
+
+import com.jogamp.gluegen.runtime.ProcAddressTable;
+import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
+import jogamp.nativewindow.windows.GDI;
+import jogamp.opengl.GLContextImpl;
+import jogamp.opengl.GLContextShareSet;
+import jogamp.opengl.GLDrawableImpl;
+
+public class WindowsWGLContext extends GLContextImpl {
+  static final Map/*<String, String>*/ functionNameMap;
+  static final Map/*<String, String>*/ extensionNameMap;
+  private boolean wglGetExtensionsStringEXTInitialized;
+  private boolean wglGetExtensionsStringEXTAvailable;
+  private boolean wglGLReadDrawableAvailableSet;
+  private boolean wglGLReadDrawableAvailable;
+  private WGLExt wglExt;
+  // Table that holds the addresses of the native C-language entry points for
+  // WGL extension functions.
+  private WGLExtProcAddressTable wglExtProcAddressTable;
+
+  static {
+    functionNameMap = new HashMap();
+    functionNameMap.put("glAllocateMemoryNV", "wglAllocateMemoryNV");
+    functionNameMap.put("glFreeMemoryNV", "wglFreeMemoryNV");
+
+    extensionNameMap = new HashMap();
+    extensionNameMap.put("GL_ARB_pbuffer", "WGL_ARB_pbuffer");
+    extensionNameMap.put("GL_ARB_pixel_format", "WGL_ARB_pixel_format");
+  }
+
+  // FIXME: figure out how to hook back in the Java 2D / JOGL bridge
+  WindowsWGLContext(GLDrawableImpl drawable,
+                    GLContext shareWith) {
+    super(drawable, shareWith);
+  }
+
+  protected void resetState() {
+    wglGetExtensionsStringEXTInitialized=false;
+    wglGetExtensionsStringEXTAvailable=false;
+    wglGLReadDrawableAvailableSet=false;
+    wglGLReadDrawableAvailable=false;
+    // no inner state _wglExt=null;
+    wglExtProcAddressTable=null;
+  }
+  
+  public Object getPlatformGLExtensions() {
+    return getWGLExt();
+  }
+
+  /* package private */ final WGLExt getWGLExt() {
+    if( null == getWGLExtProcAddressTable()) {
+        throw new InternalError("Null WGLExtProcAddressTable");
+    }
+    if (wglExt == null) {
+      wglExt = new WGLExtImpl(this);
+    }
+    return wglExt;
+  }
+
+  public final boolean isGLReadDrawableAvailable() {
+    if(!wglGLReadDrawableAvailableSet && null != getWGLExtProcAddressTable()) {
+        WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl();
+        AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+        AbstractGraphicsDevice device = config.getScreen().getDevice();
+        switch( factory.isReadDrawableAvailable(device) ) {
+            case  1:
+                wglGLReadDrawableAvailable = true;
+                wglGLReadDrawableAvailableSet=true;
+                break;
+            case  0:
+                wglGLReadDrawableAvailable = false;
+                wglGLReadDrawableAvailableSet=true;
+                break;
+        }
+    }
+    return wglGLReadDrawableAvailable;
+  }
+
+  private final boolean wglMakeContextCurrent(long hDrawDC, long hReadDC, long ctx) {
+    boolean ok = false;
+    if(wglGLReadDrawableAvailable) {
+        // needs initilized WGL ProcAddress table
+        ok = getWGLExt().wglMakeContextCurrent(hDrawDC, hReadDC, ctx);
+    } else if ( hDrawDC == hReadDC ) {
+        ok = WGL.wglMakeCurrent(hDrawDC, ctx);
+    } else {
+        // should not happen due to 'isGLReadDrawableAvailable()' query in GLContextImpl
+        throw new InternalError("Given readDrawable but no driver support");
+    }
+    int werr = ( !ok ) ? GDI.GetLastError() : GDI.ERROR_SUCCESS;
+    if(DEBUG && !ok) {
+        Throwable t = new Throwable ("Info: wglMakeContextCurrent draw "+
+                this.toHexString(hDrawDC) + ", read " + this.toHexString(hReadDC) +
+                ", ctx " + this.toHexString(ctx) + ", werr " + werr);
+        t.printStackTrace();
+    }
+    if(!ok && 0==hDrawDC && 0==hReadDC) {
+        // Some GPU's falsely fails with a zero error code (success),
+        // in case this is a release context request we tolerate this
+        return werr == GDI.ERROR_SUCCESS ;
+    }
+    return ok;
+  }
+
+  public final ProcAddressTable getPlatformExtProcAddressTable() {
+    return getWGLExtProcAddressTable();
+  }
+
+  public final WGLExtProcAddressTable getWGLExtProcAddressTable() {
+    return wglExtProcAddressTable;
+  }
+
+  protected Map/*<String, String>*/ getFunctionNameMap() { return functionNameMap; }
+
+  protected Map/*<String, String>*/ getExtensionNameMap() { return extensionNameMap; }
+
+  protected void destroyContextARBImpl(long context) {
+    WGL.wglMakeCurrent(0, 0);
+    WGL.wglDeleteContext(context);
+  }
+
+  protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+    if( null == getWGLExtProcAddressTable()) {
+        updateGLXProcAddressTable();
+    }
+    WGLExt _wglExt = getWGLExt();
+    if(DEBUG) {
+      System.err.println(getThreadName()+" - WindowWGLContext.createContextARBImpl: "+getGLVersion(major, minor, ctp, "@creation") +
+                         ", handle "+toHexString(drawable.getHandle()) + ", share "+toHexString(share)+", direct "+direct+
+                         ", wglCreateContextAttribsARB: "+toHexString(wglExtProcAddressTable._addressof_wglCreateContextAttribsARB));
+      Thread.dumpStack();
+    }
+
+    boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
+    boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
+    boolean ctDebug     = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
+
+    long ctx=0;
+
+    final int idx_flags = 4;
+    final int idx_profile = 6;
+
+    /*  WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB,   WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB, */
+
+    int attribs[] = {
+        /*  0 */ WGLExt.WGL_CONTEXT_MAJOR_VERSION_ARB, major,
+        /*  2 */ WGLExt.WGL_CONTEXT_MINOR_VERSION_ARB, minor,
+        /*  4 */ WGLExt.WGL_CONTEXT_FLAGS_ARB,         0,
+        /*  6 */ 0,                                    0,
+        /*  8 */ 0
+    };
+
+    if ( major > 3 || major == 3 && minor >= 2  ) {
+        // FIXME: Verify with a None drawable binding (default framebuffer)
+        attribs[idx_profile+0]  = WGLExt.WGL_CONTEXT_PROFILE_MASK_ARB;
+        if( ctBwdCompat ) {
+            attribs[idx_profile+1]  = WGLExt.WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
+        } else {
+            attribs[idx_profile+1]  = WGLExt.WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
+        } 
+    } 
+
+    if ( major >= 3 ) {
+        if( !ctBwdCompat && ctFwdCompat ) {
+            attribs[idx_flags+1] |= WGLExt.WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
+        }
+        if( ctDebug) {
+            attribs[idx_flags+1] |= WGLExt.WGL_CONTEXT_DEBUG_BIT_ARB;
+        }
+    }
+
+    try {
+        ctx = _wglExt.wglCreateContextAttribsARB(drawable.getHandle(), share, attribs, 0);
+    } catch (RuntimeException re) {
+        if(DEBUG) {
+          Throwable t = new Throwable("Info: WindowWGLContext.createContextARBImpl wglCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
+          t.printStackTrace();
+        }
+    }
+
+    if(0!=ctx) {
+        if (!wglMakeContextCurrent(drawable.getHandle(), drawableRead.getHandle(), ctx)) {
+            if(DEBUG) {
+              System.err.println("WindowsWGLContext.createContextARB couldn't make current "+getGLVersion(major, minor, ctp, "@creation"));
+            }
+            WGL.wglMakeCurrent(0, 0);
+            WGL.wglDeleteContext(ctx);
+            ctx = 0;
+        } else {
+            if (DEBUG) {
+                System.err.println(getThreadName() + ": createContextARBImpl: OK "+getGLVersion(major, minor, ctp, "@creation")+", share "+share+", direct "+direct);
+            }
+            // the following is issued by the caller 'GLContextImpl.createContextARB()'
+            // setGLFunctionAvailability(true, major, minor, ctp);
+        }
+    } else if (DEBUG) {
+        System.err.println(getThreadName() + ": createContextARBImpl: NO "+getGLVersion(major, minor, ctp, "@creation"));
+    }
+    return ctx;
+  }
+
+  /**
+   * Creates and initializes an appropriate OpenGL context. Should only be
+   * called by {@link #makeCurrentImpl()}.
+   */
+  protected boolean createImpl() {
+    WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl();
+    AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    AbstractGraphicsDevice device = config.getScreen().getDevice();
+    WindowsWGLContext sharedContext = (WindowsWGLContext) factory.getOrCreateSharedContextImpl(device);
+    GLCapabilitiesImmutable glCaps = drawable.getChosenGLCapabilities();
+
+    isGLReadDrawableAvailable(); // trigger setup wglGLReadDrawableAvailable
+
+    // Windows can set up sharing of display lists after creation time
+    WindowsWGLContext other = (WindowsWGLContext) GLContextShareSet.getShareContext(this);
+    long share = 0;
+    if (other != null) {
+      share = other.getHandle();
+      if (share == 0) {
+        throw new GLException("GLContextShareSet returned an invalid OpenGL context");
+      }
+    }
+
+    int minor[] = new int[1];
+    int major[] = new int[1];
+    int ctp[] = new int[1];
+    boolean createContextARBTried = false;
+
+    // utilize the shared context's GLXExt in case it was using the ARB method and it already exists
+    if( null!=sharedContext && sharedContext.isCreatedWithARBMethod() ) {
+        contextHandle = createContextARB(share, true, major, minor, ctp);
+        createContextARBTried = true;
+        if (DEBUG && 0!=contextHandle) {
+            System.err.println(getThreadName() + ": createImpl: OK (ARB, using sharedContext) share "+share);
+        }
+    }
+
+    long temp_ctx = 0;
+    if(0==contextHandle) {
+        // To use WGL_ARB_create_context, we have to make a temp context current,
+        // so we are able to use GetProcAddress
+        temp_ctx = WGL.wglCreateContext(drawable.getHandle());
+        if (temp_ctx == 0) {
+          throw new GLException("Unable to create temp OpenGL context for device context " + toHexString(drawable.getHandle()));
+        }
+        if (!WGL.wglMakeCurrent(drawable.getHandle(), temp_ctx)) {
+            throw new GLException("Error making temp context current: 0x" + toHexString(temp_ctx) + ", werr: "+GDI.GetLastError());
+        }
+        setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);  // use GL_VERSION
+        boolean isCreateContextAttribsARBAvailable = isFunctionAvailable("wglCreateContextAttribsARB");
+        WGL.wglMakeCurrent(0, 0); // release temp context
+
+        if( !createContextARBTried) {
+            if(isCreateContextAttribsARBAvailable &&
+               isExtensionAvailable("WGL_ARB_create_context") ) {
+                // initial ARB context creation
+                contextHandle = createContextARB(share, true, major, minor, ctp);
+                createContextARBTried=true;
+                if (DEBUG) {
+                    if(0!=contextHandle) {
+                        System.err.println(getThreadName() + ": createContextImpl: OK (ARB, initial) share "+share);
+                    } else {
+                        System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - creation failed - share "+share);
+                    }
+                }
+            } else if (DEBUG) {
+                System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - extension not available - share "+share);
+            }
+        }
+    }
+    
+    if(0!=contextHandle) {
+        share = 0; // mark as shared thx to the ARB create method
+        if(0!=temp_ctx) {
+            WGL.wglMakeCurrent(0, 0);
+            WGL.wglDeleteContext(temp_ctx);
+            if (!wglMakeContextCurrent(drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
+                throw new GLException("Cannot make previous verified context current: 0x" + toHexString(contextHandle) + ", werr: " + GDI.GetLastError());
+            }
+        }
+    } else {
+        if(glCaps.getGLProfile().isGL3()) {
+          WGL.wglMakeCurrent(0, 0);
+          WGL.wglDeleteContext(temp_ctx);
+          throw new GLException("WindowsWGLContext.createContext failed, but context > GL2 requested "+getGLVersion(major[0], minor[0], ctp[0], "@creation")+", ");
+        }
+        if(DEBUG) {
+          System.err.println("WindowsWGLContext.createContext failed, fall back to !ARB context "+getGLVersion(major[0], minor[0], ctp[0], "@creation"));
+        }
+
+        // continue with temp context for GL < 3.0
+        contextHandle = temp_ctx;
+        if (!wglMakeContextCurrent(drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
+            WGL.wglMakeCurrent(0, 0);
+            WGL.wglDeleteContext(contextHandle);
+            throw new GLException("Error making old context current: 0x" + toHexString(contextHandle) + ", werr: " + GDI.GetLastError());
+        }
+        if (DEBUG) {
+            System.err.println(getThreadName() + ": createImpl: OK (old) share "+share);
+        }
+    }
+
+    if(0!=share) {
+        if (!WGL.wglShareLists(share, contextHandle)) {
+            throw new GLException("wglShareLists(" + toHexString(share) +
+                                  ", " + toHexString(contextHandle) + ") failed: werr " + GDI.GetLastError());
+        }
+    }
+    return true;
+  }
+  
+  protected void  makeCurrentImpl(boolean newCreated) throws GLException {
+    if (WGL.wglGetCurrentContext() != contextHandle) {
+      if (!wglMakeContextCurrent(drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
+        throw new GLException("Error making context current: 0x" + toHexString(contextHandle) + ", werr: " + GDI.GetLastError() + ", " + this);
+      } else {
+        if (DEBUG && newCreated) {
+          System.err.println(getThreadName() + ": wglMakeCurrent(hdc " + toHexString(drawable.getHandle()) +
+                             ", contextHandle " + toHexString(contextHandle) + ") succeeded");
+        }
+      }
+    }
+  }
+
+  protected void releaseImpl() throws GLException {
+    if (!wglMakeContextCurrent(0, 0, 0)) {
+        throw new GLException("Error freeing OpenGL context, werr: " + GDI.GetLastError());
+    }
+  }
+
+  protected void destroyImpl() throws GLException {
+      WGL.wglMakeCurrent(0, 0);
+      if (!WGL.wglDeleteContext(contextHandle)) {
+        throw new GLException("Unable to delete OpenGL context");
+      }
+  }
+
+  protected void copyImpl(GLContext source, int mask) throws GLException {
+    if (!WGL.wglCopyContext(source.getHandle(), getHandle(), mask)) {
+      throw new GLException("wglCopyContext failed");
+    }
+  }
+
+  protected final void updateGLXProcAddressTable() {
+    AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice();
+    String key = adevice.getUniqueID();
+    if (DEBUG) {
+      System.err.println(getThreadName() + ": !!! Initializing WGL extension address table: "+key);
+    }
+    wglGetExtensionsStringEXTInitialized=false;
+    wglGetExtensionsStringEXTAvailable=false;
+    wglGLReadDrawableAvailableSet=false;
+    wglGLReadDrawableAvailable=false;
+
+    WGLExtProcAddressTable table = null;
+    synchronized(mappedContextTypeObjectLock) {
+        table = (WGLExtProcAddressTable) mappedGLXProcAddress.get( key );
+    }
+    if(null != table) {
+        wglExtProcAddressTable = table;
+        if(DEBUG) {
+            System.err.println(getThreadName() + ": !!! GLContext WGL ProcAddressTable reusing key("+key+") -> "+table.hashCode());
+        }
+    } else {
+        if (wglExtProcAddressTable == null) {
+          // FIXME: cache ProcAddressTables by OpenGL context type bits so we can
+          // share them among contexts classes (GL4, GL4bc, GL3, GL3bc, ..)
+          wglExtProcAddressTable = new WGLExtProcAddressTable(new GLProcAddressResolver());
+        }
+        resetProcAddressTable(wglExtProcAddressTable);
+        synchronized(mappedContextTypeObjectLock) {
+            mappedGLXProcAddress.put(key, getWGLExtProcAddressTable());
+            if(DEBUG) {
+                System.err.println(getThreadName() + ": !!! GLContext WGL ProcAddressTable mapping key("+key+") -> "+getWGLExtProcAddressTable().hashCode());
+            }
+        }
+    }
+  }
+  
+  public String getPlatformExtensionsString() {
+    if (!wglGetExtensionsStringEXTInitialized) {
+      wglGetExtensionsStringEXTAvailable = (WGL.wglGetProcAddress("wglGetExtensionsStringEXT") != 0);
+      wglGetExtensionsStringEXTInitialized = true;
+    }
+    if (wglGetExtensionsStringEXTAvailable) {
+      return getWGLExt().wglGetExtensionsStringEXT();
+    } else {
+      return "";
+    }
+  }
+
+  protected void setSwapIntervalImpl(int interval) {
+    WGLExt wglExt = getWGLExt();
+    if (wglExt.isExtensionAvailable("WGL_EXT_swap_control")) {
+      if ( wglExt.wglSwapIntervalEXT(interval) ) {
+        currentSwapInterval = interval ;
+      }
+    }
+  }
+
+  public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+    return getWGLExt().wglAllocateMemoryNV(arg0, arg1, arg2, arg3);
+  }
+
+  public int getOffscreenContextPixelDataType() {
+    throw new GLException("Should not call this");
+  }
+
+  public int getOffscreenContextReadBuffer() {
+    throw new GLException("Should not call this");
+  }
+
+  public boolean offscreenImageNeedsVerticalFlip() {
+    throw new GLException("Should not call this");
+  }
+
+  public void bindPbufferToTexture() {
+    throw new GLException("Should not call this");
+  }
+
+  public void releasePbufferFromTexture() {
+    throw new GLException("Should not call this");
+  }
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
new file mode 100644
index 0000000..4ed9a00
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import java.security.AccessController;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLException;
+
+import jogamp.nativewindow.windows.GDI;
+import jogamp.opengl.Debug;
+import jogamp.opengl.GLDrawableImpl;
+import jogamp.opengl.GLDynamicLookupHelper;
+
+
+public abstract class WindowsWGLDrawable extends GLDrawableImpl {
+  private static final boolean PROFILING = Debug.isPropertyDefined("jogl.debug.GLDrawable.profiling", true, AccessController.getContext());
+  private static final int PROFILING_TICKS = 200;
+  private int  profilingSwapBuffersTicks;
+  private long profilingSwapBuffersTime;
+
+  public WindowsWGLDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+    super(factory, comp, realized);
+  }
+
+  protected void setRealizedImpl() {
+    if(!realized) {
+        return; // nothing todo ..
+    }
+
+    NativeSurface ns = getNativeSurface();
+    WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    config.updateGraphicsConfiguration(getFactory(), ns, null);
+    if (DEBUG) {
+      System.err.println("!!! WindowsWGLDrawable.setRealized(true): "+config);
+    }
+  }
+
+  protected void swapBuffersImpl() {
+    long startTime = 0;
+    if (PROFILING) {
+      startTime = System.currentTimeMillis();
+    }
+
+    if (!GDI.SwapBuffers(getHandle()) && (GDI.GetLastError() != GDI.ERROR_SUCCESS)) {
+      throw new GLException("Error swapping buffers");
+    }
+
+    if (PROFILING) {
+      long endTime = System.currentTimeMillis();
+      profilingSwapBuffersTime += (endTime - startTime);
+      int ticks = PROFILING_TICKS;
+      if (++profilingSwapBuffersTicks == ticks) {
+        System.err.println("SwapBuffers calls: " + profilingSwapBuffersTime + " ms / " + ticks + "  calls (" +
+                           ((float) profilingSwapBuffersTime / (float) ticks) + " ms/call)");
+        profilingSwapBuffersTime = 0;
+        profilingSwapBuffersTicks = 0;
+      }
+    }
+  }
+
+  public GLDynamicLookupHelper getGLDynamicLookupHelper() {
+    return getFactoryImpl().getGLDynamicLookupHelper(0);
+  }
+
+  static String getThreadName() {
+    return Thread.currentThread().getName();
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
new file mode 100644
index 0000000..3cbef25
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -0,0 +1,539 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import java.nio.Buffer;
+import java.nio.ShortBuffer;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.DefaultGraphicsScreen;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.ProxySurface;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.nativewindow.windows.WindowsGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawable;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.common.JogampRuntimeException;
+import com.jogamp.common.nio.PointerBuffer;
+import com.jogamp.common.util.ReflectionUtil;
+import javax.media.opengl.GLCapabilities;
+import jogamp.nativewindow.WrappedSurface;
+import jogamp.nativewindow.windows.GDI;
+import jogamp.nativewindow.windows.GDISurface;
+import jogamp.nativewindow.windows.RegisteredClassFactory;
+import jogamp.opengl.DesktopGLDynamicLookupHelper;
+import jogamp.opengl.GLDrawableFactoryImpl;
+import jogamp.opengl.GLDrawableImpl;
+import jogamp.opengl.GLDynamicLookupHelper;
+import jogamp.opengl.SharedResourceRunner;
+
+public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
+  private static final DesktopGLDynamicLookupHelper windowsWGLDynamicLookupHelper;
+
+  static {
+    DesktopGLDynamicLookupHelper tmp = null;
+    try {
+        tmp = new DesktopGLDynamicLookupHelper(new WindowsWGLDynamicLibraryBundleInfo());
+    } catch (GLException gle) {
+        if(DEBUG) {
+            gle.printStackTrace();
+        }
+    }
+    windowsWGLDynamicLookupHelper = tmp;
+    if(null!=windowsWGLDynamicLookupHelper) {
+        WGL.getWGLProcAddressTable().reset(windowsWGLDynamicLookupHelper);
+    }
+  }
+
+  public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
+      return windowsWGLDynamicLookupHelper;
+  }
+
+  public WindowsWGLDrawableFactory() {
+    super();
+
+    // Register our GraphicsConfigurationFactory implementations
+    // The act of constructing them causes them to be registered
+    new WindowsWGLGraphicsConfigurationFactory();
+    if(GLProfile.isAWTAvailable()) {
+        try {
+          ReflectionUtil.createInstance("jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory",
+                                        null, getClass().getClassLoader());
+        } catch (JogampRuntimeException jre) { /* n/a .. */ }
+    }
+
+    defaultDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+
+    // Init shared resources off thread
+    // Will be released via ShutdownHook
+    sharedResourceImpl = new SharedResourceImplementation();
+    sharedResourceRunner = new SharedResourceRunner(sharedResourceImpl);
+    sharedResourceThread = new Thread(sharedResourceRunner, Thread.currentThread().getName()+"-SharedResourceRunner");
+    sharedResourceThread.setDaemon(true); // Allow JVM to exit, even if this one is running
+    sharedResourceThread.start();
+  }
+
+  WindowsGraphicsDevice defaultDevice;
+  SharedResourceImplementation sharedResourceImpl;
+  SharedResourceRunner sharedResourceRunner;
+  Thread sharedResourceThread;
+  HashMap/*<connection, SharedResource>*/ sharedMap = new HashMap();
+
+  long processAffinityChanges = 0;
+  PointerBuffer procMask = PointerBuffer.allocateDirect(1);
+  PointerBuffer sysMask = PointerBuffer.allocateDirect(1);
+
+  protected void enterThreadCriticalZone() {
+    synchronized (sysMask) {
+        if( 0 == processAffinityChanges) {
+            long pid = GDI.GetCurrentProcess();
+            if ( GDI.GetProcessAffinityMask(pid, procMask, sysMask) ) {
+                if(DEBUG) {
+                    System.err.println("WindowsWGLDrawableFactory.enterThreadCriticalZone() - 0x" + Long.toHexString(pid) + " - " + Thread.currentThread().getName());
+                    Thread.dumpStack();
+                }
+                processAffinityChanges = pid;
+                GDI.SetProcessAffinityMask(pid, 1);
+            }
+        }
+    }
+  }
+
+  protected void leaveThreadCriticalZone() {
+    synchronized (sysMask) {
+        if( 0 != processAffinityChanges) {
+            long pid = GDI.GetCurrentProcess();
+            if( pid != processAffinityChanges) {
+                throw new GLException("PID doesn't match: set PID 0x" + Long.toHexString(processAffinityChanges) +
+                                                       " this PID 0x" + Long.toHexString(pid) );
+            }
+            if(DEBUG) {
+                System.err.println("WindowsWGLDrawableFactory.leaveThreadCriticalZone() - 0x" + Long.toHexString(pid) + " - " + Thread.currentThread().getName());
+            }
+            GDI.SetProcessAffinityMask(pid, sysMask.get(0));
+        }
+    }
+  }
+
+  static class SharedResource implements SharedResourceRunner.Resource {
+      private WindowsGraphicsDevice device;
+      private AbstractGraphicsScreen screen;
+      private WindowsDummyWGLDrawable drawable;
+      private WindowsWGLContext context;
+      private boolean hasARBPixelFormat;
+      private boolean hasARBMultisample;
+      private boolean hasARBPBuffer;
+      private boolean hasARBReadDrawable;
+
+      SharedResource(WindowsGraphicsDevice dev, AbstractGraphicsScreen scrn, WindowsDummyWGLDrawable draw, WindowsWGLContext ctx,
+                     boolean arbPixelFormat, boolean arbMultisample, boolean arbPBuffer, boolean arbReadDrawable) {
+          device = dev;
+          screen = scrn;
+          drawable = draw;
+          context = ctx;
+          hasARBPixelFormat = arbPixelFormat;
+          hasARBMultisample = arbMultisample;
+          hasARBPBuffer = arbPBuffer;
+          hasARBReadDrawable = arbReadDrawable;
+      }
+      final public AbstractGraphicsDevice getDevice() { return device; }
+      final public AbstractGraphicsScreen getScreen() { return screen; }
+      final public WindowsWGLDrawable getDrawable() { return drawable; }
+      final public WindowsWGLContext getContext() { return context; }
+
+      final boolean hasARBPixelFormat() { return hasARBPixelFormat; }
+      final boolean hasARBMultisample() { return hasARBMultisample; }
+      final boolean hasARBPBuffer() { return hasARBPBuffer; }
+      final boolean hasReadDrawable() { return hasARBReadDrawable; }
+  }
+
+  class SharedResourceImplementation implements SharedResourceRunner.Implementation {
+        public void clear() {
+            synchronized(sharedMap) {
+                sharedMap.clear();
+            }
+        }
+        public SharedResourceRunner.Resource mapPut(String connection, SharedResourceRunner.Resource resource) {
+            synchronized(sharedMap) {
+                return (SharedResourceRunner.Resource) sharedMap.put(connection, resource);
+            }
+        }
+        public SharedResourceRunner.Resource mapGet(String connection) {
+            synchronized(sharedMap) {
+                return (SharedResourceRunner.Resource) sharedMap.get(connection);
+            }
+        }
+        public Collection/*<Resource>*/ mapValues() {
+            synchronized(sharedMap) {
+                return sharedMap.values();
+            }
+        }
+
+        public SharedResourceRunner.Resource createSharedResource(String connection) {
+            WindowsGraphicsDevice sharedDevice = new WindowsGraphicsDevice(connection, AbstractGraphicsDevice.DEFAULT_UNIT);
+            sharedDevice.lock();
+            try {
+                AbstractGraphicsScreen absScreen = new DefaultGraphicsScreen(sharedDevice, 0);
+                if (null == absScreen) {
+                    throw new GLException("Couldn't create shared screen for device: "+sharedDevice+", idx 0");
+                }
+                GLProfile glp = GLProfile.getMinDesktop(sharedDevice);
+                if (null == glp) {
+                    throw new GLException("Couldn't get default GLProfile for device: "+sharedDevice);
+                }
+                final int f_dim = 64;
+                long hwnd = GDI.CreateDummyWindow(0, 0, f_dim, f_dim);
+                WindowsDummyWGLDrawable sharedDrawable = WindowsDummyWGLDrawable.create(WindowsWGLDrawableFactory.this, glp, absScreen, hwnd, f_dim, f_dim, true);
+                if (null == sharedDrawable) {
+                    throw new GLException("Couldn't create shared drawable for screen: "+absScreen+", "+glp);
+                }
+                WindowsWGLContext sharedContext  = (WindowsWGLContext) sharedDrawable.createContext(null);
+                if (null == sharedContext) {
+                    throw new GLException("Couldn't create shared context for drawable: "+sharedDrawable);
+                }
+                sharedContext.setSynchronized(true);
+                boolean hasARBPixelFormat;
+                boolean hasARBMultisample;
+                boolean hasARBPBuffer;
+                boolean hasARBReadDrawableAvailable;
+                sharedContext.makeCurrent();
+                try {
+                    hasARBPixelFormat = sharedContext.isExtensionAvailable(WGL_ARB_pixel_format);
+                    hasARBMultisample = sharedContext.isExtensionAvailable(WGL_ARB_multisample);
+                    hasARBPBuffer = sharedContext.isExtensionAvailable(GL_ARB_pbuffer);
+                    hasARBReadDrawableAvailable = sharedContext.isExtensionAvailable(WGL_ARB_make_current_read) &&
+                                            sharedContext.isFunctionAvailable(wglMakeContextCurrent);
+                } finally {
+                    sharedContext.release();
+                }
+                if (DEBUG) {
+                    System.err.println("!!! SharedDevice:  " + sharedDevice);
+                    System.err.println("!!! SharedScreen:  " + absScreen);
+                    System.err.println("!!! SharedContext: " + sharedContext);
+                    System.err.println("!!! pixelformat:   " + hasARBPixelFormat);
+                    System.err.println("!!! multisample:   " + hasARBMultisample);
+                    System.err.println("!!! pbuffer:       " + hasARBPBuffer);
+                    System.err.println("!!! readDrawable:  " + hasARBReadDrawableAvailable);
+                }
+                return new SharedResource(sharedDevice, absScreen, sharedDrawable, sharedContext, 
+                                          hasARBPixelFormat, hasARBMultisample,
+                                          hasARBPBuffer, hasARBReadDrawableAvailable);
+            } catch (Throwable t) {
+                throw new GLException("WindowsWGLDrawableFactory - Could not initialize shared resources for "+connection, t);
+            } finally {
+                sharedDevice.unlock();
+            }
+        }
+
+        public void releaseSharedResource(SharedResourceRunner.Resource shared) {
+            SharedResource sr = (SharedResource) shared;
+            if (DEBUG) {
+              System.err.println("!!! Shutdown Shared:");
+              System.err.println("!!!   Device  : " + sr.device);
+              System.err.println("!!!   Screen  : " + sr.screen);
+              System.err.println("!!!   Drawable: " + sr.drawable);
+              System.err.println("!!!   CTX     : " + sr.context);
+            }
+
+            if (null != sr.context) {
+                // may cause JVM SIGSEGV: sharedContext.destroy();
+                sr.context = null;
+            }
+
+            if (null != sr.drawable) {
+                sr.drawable.destroy();
+                sr.drawable = null;
+            }
+
+            if (null != sr.screen) {
+                sr.screen = null;
+            }
+
+            if (null != sr.device) {
+                sr.device.close();
+                sr.device = null;
+            }
+        }
+  }
+
+  public final AbstractGraphicsDevice getDefaultDevice() {
+      return defaultDevice;
+  }
+
+  public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+      if(device instanceof WindowsGraphicsDevice) {
+          return true;
+      }
+      return false;
+  }
+
+  final static String GL_ARB_pbuffer = "GL_ARB_pbuffer";
+  final static String WGL_ARB_pixel_format = "WGL_ARB_pixel_format";
+  final static String WGL_ARB_multisample = "WGL_ARB_multisample";
+  final static String WGL_ARB_make_current_read = "WGL_ARB_make_current_read";
+  final static String wglMakeContextCurrent = "wglMakeContextCurrent";
+
+  protected final GLContext getSharedContextImpl(AbstractGraphicsDevice device) {
+    SharedResourceRunner.Resource sr = sharedResourceRunner.getShared(device);
+    if(null!=sr) {
+      return sr.getContext();
+    }
+    return null;
+  }
+
+  protected final boolean hasSharedContextImpl(AbstractGraphicsDevice device) {
+      return null != getSharedContextImpl(device);
+  }
+
+  protected final GLContext getOrCreateSharedContextImpl(AbstractGraphicsDevice device) {
+    SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device);
+    if(null!=sr) {
+      return sr.getContext();
+    }
+    return null;
+  }
+
+  protected AbstractGraphicsDevice getOrCreateSharedDeviceImpl(AbstractGraphicsDevice device) {
+    SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device);
+    if(null!=sr) {
+        return sr.getDevice();
+    }
+    return null;
+  }
+
+  protected WindowsWGLDrawable getOrCreateSharedDrawable(AbstractGraphicsDevice device) {
+    SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device);
+    if(null!=sr) {
+        return (WindowsWGLDrawable) sr.getDrawable();
+    }
+    return null;
+  }
+
+  SharedResource getOrCreateSharedResource(AbstractGraphicsDevice device) {
+    return (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+  }
+
+  protected final void shutdownInstance() {
+    sharedResourceRunner.releaseAndWait();
+    RegisteredClassFactory.shutdownSharedClasses();
+  }
+
+  protected List/*GLCapabilitiesImmutable*/ getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+    return WindowsWGLGraphicsConfigurationFactory.getAvailableCapabilities(this, device);
+  }
+
+  protected final GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+    if (target == null) {
+      throw new IllegalArgumentException("Null target");
+    }
+    return new WindowsOnscreenWGLDrawable(this, target);
+  }
+
+  protected final GLDrawableImpl createOffscreenDrawableImpl(final NativeSurface target) {
+    if (target == null) {
+      throw new IllegalArgumentException("Null target");
+    }
+    AbstractGraphicsConfiguration config = target.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+    if(!chosenCaps.isPBuffer()) {
+        return new WindowsBitmapWGLDrawable(this, target);
+    }
+
+    // PBuffer GLDrawable Creation
+    final AbstractGraphicsDevice device = config.getScreen().getDevice();
+
+    final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+    if(null==sr) {
+        throw new IllegalArgumentException("No shared resource for "+device);
+    }
+    final List returnList = new ArrayList();
+    Runnable r = new Runnable() {
+        public void run() {
+          GLContext lastContext = GLContext.getCurrent();
+          if (lastContext != null) {
+            lastContext.release();
+          }
+          sr.context.makeCurrent();
+          try {
+            GLDrawableImpl pbufferDrawable = new WindowsPbufferWGLDrawable(WindowsWGLDrawableFactory.this, target, sr);
+            returnList.add(pbufferDrawable);
+          } finally {
+            sr.context.release();
+            if (lastContext != null) {
+              lastContext.makeCurrent();
+            }
+          }
+        }
+      };
+    maybeDoSingleThreadedWorkaround(r);
+    return (GLDrawableImpl) returnList.get(0);
+  }
+
+  /**
+   * @return 1 if read drawable extension is available, 0 if not
+   *           and -1 if undefined yet, ie no shared device exist at this point.
+   */
+  public final int isReadDrawableAvailable(AbstractGraphicsDevice device) {
+    SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared((null!=device)?device:defaultDevice);
+    if(null!=sr) {
+        return sr.hasReadDrawable() ? 1 : 0 ;
+    }
+    return -1; // undefined
+  }
+
+  public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device) {
+    SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared((null!=device)?device:defaultDevice);
+    if(null!=sr) {
+        return sr.hasARBPBuffer();
+    }
+    return false;
+  }
+
+  protected final NativeSurface createOffscreenSurfaceImpl(AbstractGraphicsDevice device, GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, int width, int height) {
+    AbstractGraphicsScreen screen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
+    WrappedSurface ns = new WrappedSurface(WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(
+                                     capsChosen, capsRequested, chooser, screen) );
+    ns.setSize(width, height);
+    return ns;
+  }
+ 
+  protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice adevice, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+    // FIXME device/windowHandle -> screen ?!
+    WindowsGraphicsDevice device = (WindowsGraphicsDevice) adevice;
+    AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, 0);
+    WindowsWGLGraphicsConfiguration cfg = WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen);    
+    GDISurface ns = new GDISurface(cfg, windowHandle);
+    return ns;
+  }
+ 
+  protected final GLContext createExternalGLContextImpl() {
+    return WindowsExternalWGLContext.create(this, null);
+  }
+
+  public final boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+    return true;
+  }
+
+  protected final GLDrawable createExternalGLDrawableImpl() {
+    return WindowsExternalWGLDrawable.create(this, null);
+  }
+
+  static String wglGetLastError() {
+    long err = GDI.GetLastError();
+    String detail = null;
+    switch ((int) err) {
+      case GDI.ERROR_SUCCESS:              detail = "ERROR_SUCCESS";                    break;
+      case GDI.ERROR_INVALID_PIXEL_FORMAT: detail = "ERROR_INVALID_PIXEL_FORMAT";       break;
+      case GDI.ERROR_NO_SYSTEM_RESOURCES:  detail = "ERROR_NO_SYSTEM_RESOURCES";        break;
+      case GDI.ERROR_INVALID_DATA:         detail = "ERROR_INVALID_DATA";               break;
+      case GDI.ERROR_PROC_NOT_FOUND:       detail = "ERROR_PROC_NOT_FOUND";             break;
+      case GDI.ERROR_INVALID_WINDOW_HANDLE:detail = "ERROR_INVALID_WINDOW_HANDLE";      break;
+      default:                             detail = "(Unknown error code " + err + ")"; break;
+    }
+    return detail;
+  }
+
+  public final boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) {
+    return false;
+  }
+
+  public final GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+    throws GLException {
+    throw new GLException("Unimplemented on this platform");
+  }
+
+  //------------------------------------------------------
+  // Gamma-related functionality
+  //
+
+  private static final int GAMMA_RAMP_LENGTH = 256;
+
+  protected final int getGammaRampLength() {
+    return GAMMA_RAMP_LENGTH;
+  }
+
+  protected final boolean setGammaRamp(float[] ramp) {
+    short[] rampData = new short[3 * GAMMA_RAMP_LENGTH];
+    for (int i = 0; i < GAMMA_RAMP_LENGTH; i++) {
+      short scaledValue = (short) (ramp[i] * 65535);
+      rampData[i] = scaledValue;
+      rampData[i +     GAMMA_RAMP_LENGTH] = scaledValue;
+      rampData[i + 2 * GAMMA_RAMP_LENGTH] = scaledValue;
+    }
+
+    long screenDC = GDI.GetDC(0);
+    boolean res = GDI.SetDeviceGammaRamp(screenDC, ShortBuffer.wrap(rampData));
+    GDI.ReleaseDC(0, screenDC);
+    return res;
+  }
+
+  protected final Buffer getGammaRamp() {
+    ShortBuffer rampData = ShortBuffer.wrap(new short[3 * GAMMA_RAMP_LENGTH]);
+    long screenDC = GDI.GetDC(0);
+    boolean res = GDI.GetDeviceGammaRamp(screenDC, rampData);
+    GDI.ReleaseDC(0, screenDC);
+    if (!res) {
+      return null;
+    }
+    return rampData;
+  }
+
+  protected final void resetGammaRamp(Buffer originalGammaRamp) {
+    if (originalGammaRamp == null) {
+      // getGammaRamp failed earlier
+      return;
+    }
+    long screenDC = GDI.GetDC(0);
+    GDI.SetDeviceGammaRamp(screenDC, originalGammaRamp);
+    GDI.ReleaseDC(0, screenDC);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
new file mode 100644
index 0000000..0fb7f45
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl.windows.wgl;
+
+import jogamp.opengl.*;
+import java.util.*;
+
+public class WindowsWGLDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo  {
+    protected WindowsWGLDynamicLibraryBundleInfo() {
+        super();
+    }
+
+    public List getToolLibNames() {
+        List/*<String>*/ libNamesList = new ArrayList();
+
+        libNamesList.add("OpenGL32");
+
+        return libNamesList;
+    }
+
+
+    public final List getToolGetProcAddressFuncNameList() {
+        List res = new ArrayList();
+        res.add("wglGetProcAddress");
+        return res;
+    }
+
+    public final long toolDynamicLookupFunction(long toolGetProcAddressHandle, String funcName) {
+        return WGL.wglGetProcAddress(toolGetProcAddressHandle, funcName);
+    }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
new file mode 100644
index 0000000..ae07646
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -0,0 +1,693 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.DefaultGraphicsConfiguration;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.opengl.GL;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLPbuffer;
+import javax.media.opengl.GLProfile;
+
+import jogamp.nativewindow.windows.GDI;
+import jogamp.nativewindow.windows.PIXELFORMATDESCRIPTOR;
+import jogamp.opengl.GLContextImpl;
+import jogamp.opengl.GLGraphicsConfigurationUtil;
+
+public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
+    // Keep this under the same debug flag as the drawable factory for convenience
+    protected static final boolean DEBUG = jogamp.opengl.Debug.debug("GraphicsConfiguration");
+    
+    protected static final int MAX_PFORMATS = 256;
+    protected static final int MAX_ATTRIBS  = 256;
+
+    private GLCapabilitiesChooser chooser;
+    private boolean isChosen = false;
+
+    WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen, 
+                                    GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
+                                    GLCapabilitiesChooser chooser) {
+        super(screen, capsChosen, capsRequested);
+        this.chooser=chooser;
+        this.isChosen = false;
+    }
+
+    WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen,
+                                    WGLGLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested) {
+        super(screen, capsChosen, capsRequested);
+        setCapsPFD(capsChosen);
+        this.chooser=null;
+    }
+
+
+    static WindowsWGLGraphicsConfiguration createFromCurrent(GLDrawableFactory _factory, long hdc, int pfdID,
+                                                             GLProfile glp, AbstractGraphicsScreen screen, boolean onscreen)
+    {
+        if(_factory==null) {
+            throw new GLException("Null factory");
+        }
+        if(hdc==0) {
+            throw new GLException("Null HDC");
+        }
+        if(pfdID<=0) {
+            throw new GLException("Invalid pixelformat id "+pfdID);
+        }
+        if(null==glp) {
+          glp = GLProfile.getDefault(screen.getDevice());
+        }
+        WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
+        AbstractGraphicsDevice device = screen.getDevice();
+        WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResource(device);
+        boolean hasARB = null != sharedResource && sharedResource.hasARBPixelFormat();
+
+        WGLGLCapabilities caps = null;
+
+        if(hasARB) {
+            caps = wglARBPFID2GLCapabilities(sharedResource, hdc, pfdID, glp, onscreen, true /* pbuffer */);
+        } else {
+            caps = PFD2GLCapabilities(glp, hdc, pfdID, onscreen);
+        }
+        if(null==caps) {
+            throw new GLException("Couldn't choose Capabilities by: HDC 0x"+Long.toHexString(hdc)+
+                                  ", pfdID "+pfdID+", onscreen "+onscreen+", hasARB "+hasARB);
+        }
+
+        return new WindowsWGLGraphicsConfiguration(screen, caps, caps);
+    }
+
+    public Object clone() {
+        return super.clone();
+    }
+
+    /**
+     * Updates the graphics configuration in case it has been determined yet.<br>
+     * Uses the NativeSurface's HDC.<br>
+     * Ensures that a PIXELFORMAT is set.
+     *
+     * @param factory
+     * @param ns
+     * @param pfIDs optional pool of preselected PixelFormat IDs, maybe null for unrestricted selection
+     *
+     * @see #isDetermined()
+     */
+    public final void updateGraphicsConfiguration(GLDrawableFactory factory, NativeSurface ns, int[] pfIDs) {
+        WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfiguration(chooser, factory, ns, pfIDs);
+    }
+
+    /**
+     * Preselect the graphics configuration in case it has been determined yet.<br>
+     * Uses a shared device's HDC and the given pfdIDs to preselect the pfd.
+     * No PIXELFORMAT is set.
+     *
+     * @param factory
+     * @param pfIDs optional pool of preselected PixelFormat IDs, maybe null for unrestricted selection
+     *
+     * @see #isDetermined()
+     */
+    public final void preselectGraphicsConfiguration(GLDrawableFactory factory, int[] pfdIDs) {
+        AbstractGraphicsDevice device = getNativeGraphicsConfiguration().getScreen().getDevice();
+        WindowsWGLGraphicsConfigurationFactory.preselectGraphicsConfiguration(chooser, factory, device, this, pfdIDs);
+    }
+
+    final void setCapsPFD(WGLGLCapabilities caps) {
+        setChosenCapabilities(caps);
+        this.isChosen=true;
+        if (DEBUG) {
+            System.err.println("*** setCapsPFD: "+caps);
+        }
+    }
+
+    public final boolean isDetermined() { return isChosen; }
+    public final PIXELFORMATDESCRIPTOR getPixelFormat()   { return isChosen ? ((WGLGLCapabilities)capabilitiesChosen).getPFD() : null; }
+    public final int getPixelFormatID() { return isChosen ? ((WGLGLCapabilities)capabilitiesChosen).getPFDID() : 0; }
+    public final boolean isChoosenByARB() { return isChosen ? ((WGLGLCapabilities)capabilitiesChosen).isSetByARB() : false; }
+
+    static int fillAttribsForGeneralWGLARBQuery(WindowsWGLDrawableFactory.SharedResource sharedResource, int[] iattributes) {
+        int niattribs = 0;
+        iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_WINDOW_ARB;
+        if(sharedResource.hasARBPBuffer()) {
+            iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB;
+        }
+        iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_BITMAP_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_ACCELERATION_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_SUPPORT_OPENGL_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_STEREO_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_RED_BITS_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB;
+        iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB;
+        if(sharedResource.hasARBMultisample()) {
+            iattributes[niattribs++] = WGLExt.WGL_SAMPLE_BUFFERS_ARB;
+            iattributes[niattribs++] = WGLExt.WGL_SAMPLES_ARB;
+        }
+        if(sharedResource.hasARBPBuffer()) {
+            // pbo float buffer
+            iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;      // ati
+            iattributes[niattribs++] = WGLExt.WGL_FLOAT_COMPONENTS_NV; // nvidia
+        }
+
+        return niattribs;
+    }
+
+    static boolean wglARBPFIDValid(WindowsWGLContext sharedCtx, long hdc, int pfdID) {
+        int[] in = new int[1];
+        int[] out = new int[1];
+        in[0] = WGLExt.WGL_COLOR_BITS_ARB;
+        if (!sharedCtx.getWGLExt().wglGetPixelFormatAttribivARB(hdc, pfdID, 0, 1, in, 0, out, 0)) {
+            // Some GPU's falsely fails with a zero error code (success)
+            return GDI.GetLastError() == GDI.ERROR_SUCCESS ;
+        }
+        return true;
+    }
+
+    static int[] wglAllARBPFIDs(WindowsWGLContext sharedCtx, long hdc) {
+        int[] iattributes = new int[1];
+        int[] iresults = new int[1];
+
+        WGLExt wglExt = sharedCtx.getWGLExt();
+        iattributes[0] = WGLExt.WGL_NUMBER_PIXEL_FORMATS_ARB;
+        if (!wglExt.wglGetPixelFormatAttribivARB(hdc, 0, 0, 1, iattributes, 0, iresults, 0)) {
+            if(DEBUG) {
+                System.err.println("GetPixelFormatAttribivARB: Failed - HDC 0x" + Long.toHexString(hdc) +
+                                  ", LastError: " + GDI.GetLastError());
+                Thread.dumpStack();
+            }
+            return null;
+        }
+        int numFormats = iresults[0];
+        if(0 == numFormats) {
+            if(DEBUG) {
+                System.err.println("GetPixelFormatAttribivARB: No formats - HDC 0x" + Long.toHexString(hdc) +
+                                  ", LastError: " + GDI.GetLastError());
+                Thread.dumpStack();
+            }
+            return null;
+        }
+        int[] pfdIDs = new int[numFormats];
+        for (int i = 0; i < numFormats; i++) {
+            pfdIDs[i] = 1 + i;
+        }
+        return pfdIDs;
+    }
+
+    static WGLGLCapabilities wglARBPFID2GLCapabilities(WindowsWGLDrawableFactory.SharedResource sharedResource,
+                                                       long hdc, int pfdID,
+                                                       GLProfile glp, boolean onscreen, boolean usePBuffer) {
+        if (!sharedResource.hasARBPixelFormat()) {
+            return null;
+        }
+
+        int[] iattributes = new int  [2*MAX_ATTRIBS];
+        int[] iresults    = new int  [2*MAX_ATTRIBS];
+
+        int niattribs = fillAttribsForGeneralWGLARBQuery(sharedResource, iattributes);
+
+        if (!sharedResource.getContext().getWGLExt().wglGetPixelFormatAttribivARB(hdc, pfdID, 0, niattribs, iattributes, 0, iresults, 0)) {
+            throw new GLException("wglARBPFID2GLCapabilities: Error getting pixel format attributes for pixel format " + pfdID + 
+                                  " of device context " + toHexString(hdc) + ", werr " + GDI.GetLastError());
+        }
+        ArrayList bucket = new ArrayList(1);
+        final int winattrbits = GLGraphicsConfigurationUtil.getWinAttributeBits(onscreen, usePBuffer);
+        if(AttribList2GLCapabilities(bucket, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits)) {
+            return (WGLGLCapabilities) bucket.get(0);
+        }
+        return null;
+    }
+
+    static int[] wglChoosePixelFormatARB(long hdc, WindowsWGLDrawableFactory.SharedResource sharedResource,
+                                         GLCapabilitiesImmutable capabilities,
+                                         int[] iattributes, int accelerationMode, float[] fattributes)
+    {
+
+        if ( !WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(capabilities,
+                iattributes, sharedResource, accelerationMode, null))
+        {
+            if (DEBUG) {
+                System.err.println("wglChoosePixelFormatARB: GLCapabilities2AttribList failed: " + GDI.GetLastError());
+                Thread.dumpStack();
+            }
+            return null;
+        }
+
+        int[] pformatsTmp = new int[WindowsWGLGraphicsConfiguration.MAX_PFORMATS];
+        int[] numFormatsTmp = new int[1];
+        if ( !sharedResource.getContext().getWGLExt().wglChoosePixelFormatARB(hdc, iattributes, 0,
+                                                                fattributes, 0,
+                                                                WindowsWGLGraphicsConfiguration.MAX_PFORMATS,
+                                                                pformatsTmp, 0, numFormatsTmp, 0))
+        {
+            if (DEBUG) {
+                System.err.println("wglChoosePixelFormatARB: wglChoosePixelFormatARB failed: " + GDI.GetLastError());
+                Thread.dumpStack();
+            }
+            return null;
+        }
+        int numFormats = numFormatsTmp[0];
+        int[] pformats = null;
+        if( 0 < numFormats ) {
+            pformats = new int[numFormats];
+            System.arraycopy(pformatsTmp, 0, pformats, 0, numFormats);
+        }
+        if (DEBUG) {
+            System.err.println("wglChoosePixelFormatARB: NumFormats (wglChoosePixelFormatARB) accelMode 0x"
+                    + Integer.toHexString(accelerationMode) + ": " + numFormats);
+            for (int i = 0; i < numFormats; i++) {
+                WGLGLCapabilities dbgCaps0 = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(
+                                                sharedResource, hdc, pformats[i],
+                                                capabilities.getGLProfile(), capabilities.isOnscreen(), capabilities.isPBuffer());
+                System.err.println("pixel format " + pformats[i] + " (index " + i + "): " + dbgCaps0);
+            }
+        }
+        return pformats;
+    }
+
+    static List /*<GLCapabilitiesImmutable>*/ wglARBPFIDs2GLCapabilities(WindowsWGLDrawableFactory.SharedResource sharedResource,
+                                                                         long hdc, int[] pfdIDs, GLProfile glp, boolean onscreen, boolean usePBuffer) {
+        final int winattrbits = GLGraphicsConfigurationUtil.getWinAttributeBits(onscreen, usePBuffer);
+        return wglARBPFIDs2GLCapabilitiesImpl(sharedResource, hdc, pfdIDs, glp, winattrbits);
+    }
+
+    static List /*<GLCapabilitiesImmutable>*/ wglARBPFIDs2AllGLCapabilities(WindowsWGLDrawableFactory.SharedResource sharedResource,
+                                                                            long hdc, int[] pfdIDs, GLProfile glp) {
+        return wglARBPFIDs2GLCapabilitiesImpl(sharedResource, hdc, pfdIDs, glp, GLGraphicsConfigurationUtil.ALL_BITS);
+    }
+    
+    private static List /*<GLCapabilitiesImmutable>*/ wglARBPFIDs2GLCapabilitiesImpl(WindowsWGLDrawableFactory.SharedResource sharedResource,
+                                                                                     long hdc, int[] pfdIDs, GLProfile glp, int winattrbits) {
+        if (!sharedResource.hasARBPixelFormat()) {
+            return null;
+        }
+        final int numFormats = pfdIDs.length;
+
+        int[] iattributes = new int [2*MAX_ATTRIBS];
+        int[] iresults    = new int [2*MAX_ATTRIBS];
+        int niattribs = fillAttribsForGeneralWGLARBQuery(sharedResource, iattributes);
+
+        ArrayList bucket = new ArrayList();
+
+        for(int i = 0; i<numFormats; i++) {
+            if ( pfdIDs[i] >= 1 &&
+                 sharedResource.getContext().getWGLExt().wglGetPixelFormatAttribivARB(hdc, pfdIDs[i], 0, niattribs, iattributes, 0, iresults, 0) ) {
+                AttribList2GLCapabilities(bucket, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, winattrbits);
+            } else if (DEBUG) {
+                System.err.println("wglARBPFIDs2GLCapabilities: Cannot get pixel format attributes for pixel format " +
+                                   i + "/" + numFormats + ": " + pfdIDs[i] + ", " +
+                                   GLGraphicsConfigurationUtil.winAttributeBits2String(null, winattrbits).toString());
+            }
+        }
+        return bucket;
+    }
+
+    static boolean GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
+                                             int[] iattributes,
+                                             WindowsWGLDrawableFactory.SharedResource sharedResource,
+                                             int accelerationValue,
+                                             int[] floatMode) throws GLException {
+        if (!sharedResource.hasARBPixelFormat()) {
+          return false;
+        }
+
+        boolean onscreen = caps.isOnscreen();
+        boolean pbuffer = caps.isPBuffer();
+
+        int niattribs = 0;
+
+        iattributes[niattribs++] = WGLExt.WGL_SUPPORT_OPENGL_ARB;
+        iattributes[niattribs++] = GL.GL_TRUE;
+        if(accelerationValue>0) {
+            iattributes[niattribs++] = WGLExt.WGL_ACCELERATION_ARB;
+            iattributes[niattribs++] = accelerationValue;
+        }
+        if (onscreen) {
+          iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_WINDOW_ARB;
+          iattributes[niattribs++] = GL.GL_TRUE;
+        } else if (pbuffer && sharedResource.hasARBPBuffer()) {
+          iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB;
+          iattributes[niattribs++] = GL.GL_TRUE;
+        } else {
+          iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_BITMAP_ARB;
+          iattributes[niattribs++] = GL.GL_TRUE;
+        }
+
+        iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER_ARB;
+        if (caps.getDoubleBuffered()) {
+          iattributes[niattribs++] = GL.GL_TRUE;
+        } else {
+          iattributes[niattribs++] = GL.GL_FALSE;
+        }
+
+        iattributes[niattribs++] = WGLExt.WGL_STEREO_ARB;
+        if (caps.getStereo()) {
+          iattributes[niattribs++] = GL.GL_TRUE;
+        } else {
+          iattributes[niattribs++] = GL.GL_FALSE;
+        }
+        
+        iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS_ARB;
+        iattributes[niattribs++] = caps.getDepthBits();
+        iattributes[niattribs++] = WGLExt.WGL_RED_BITS_ARB;
+        iattributes[niattribs++] = caps.getRedBits();
+        iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS_ARB;
+        iattributes[niattribs++] = caps.getGreenBits();
+        iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS_ARB;
+        iattributes[niattribs++] = caps.getBlueBits();
+        iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS_ARB;
+        iattributes[niattribs++] = caps.getAlphaBits();
+        iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS_ARB;
+        iattributes[niattribs++] = caps.getStencilBits();
+        if (caps.getAccumRedBits()   > 0 ||
+            caps.getAccumGreenBits() > 0 ||
+            caps.getAccumBlueBits()  > 0 ||
+            caps.getAccumAlphaBits() > 0) {
+          iattributes[niattribs++] = WGLExt.WGL_ACCUM_BITS_ARB;
+          iattributes[niattribs++] = (caps.getAccumRedBits() +
+                                      caps.getAccumGreenBits() +
+                                      caps.getAccumBlueBits() +
+                                      caps.getAccumAlphaBits());
+          iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS_ARB;
+          iattributes[niattribs++] = caps.getAccumRedBits();
+          iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS_ARB;
+          iattributes[niattribs++] = caps.getAccumGreenBits();
+          iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB;
+          iattributes[niattribs++] = caps.getAccumBlueBits();
+          iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB;
+          iattributes[niattribs++] = caps.getAccumAlphaBits();
+        }
+
+        if (caps.getSampleBuffers() && sharedResource.hasARBMultisample()) {
+            iattributes[niattribs++] = WGLExt.WGL_SAMPLE_BUFFERS_ARB;
+            iattributes[niattribs++] = GL.GL_TRUE;
+            iattributes[niattribs++] = WGLExt.WGL_SAMPLES_ARB;
+            iattributes[niattribs++] = caps.getNumSamples();
+        }
+
+        boolean rtt      = caps.getPbufferRenderToTexture();
+        boolean rect     = caps.getPbufferRenderToTextureRectangle();
+        boolean useFloat = caps.getPbufferFloatingPointBuffers();
+        boolean ati      = false;
+        if (pbuffer && sharedResource.hasARBPBuffer()) {
+          // Check some invariants and set up some state
+          if (rect && !rtt) {
+            throw new GLException("Render-to-texture-rectangle requires render-to-texture to be specified");
+          }
+
+          WindowsWGLContext sharedCtx = sharedResource.getContext();
+          if (rect) {
+            if (!sharedCtx.isExtensionAvailable("GL_NV_texture_rectangle")) {
+              throw new GLException("Render-to-texture-rectangle requires GL_NV_texture_rectangle extension");
+            }
+          }
+
+          if (useFloat) {
+            if (!sharedCtx.isExtensionAvailable("WGL_ATI_pixel_format_float") &&
+                !sharedCtx.isExtensionAvailable("WGL_NV_float_buffer")) {
+              throw new GLException("Floating-point pbuffers not supported by this hardware");
+            }
+
+            // Prefer NVidia extension over ATI
+            if (sharedCtx.isExtensionAvailable("WGL_NV_float_buffer")) {
+              ati = false;
+              floatMode[0] = GLPbuffer.NV_FLOAT;
+            } else {
+              ati = true;
+              floatMode[0] = GLPbuffer.ATI_FLOAT;
+            }
+            if (DEBUG) {
+              System.err.println("Using " + (ati ? "ATI" : "NVidia") + " floating-point extension");
+            }
+          }
+
+          // See whether we need to change the pixel type to support ATI's
+          // floating-point pbuffers
+          if (useFloat && ati) {
+            if (rtt) {
+              throw new GLException("Render-to-floating-point-texture not supported on ATI hardware");
+            } else {
+              iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
+              iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_FLOAT_ARB;
+            }
+          } else {
+            if (!rtt) {
+              // Currently we don't support non-truecolor visuals in the
+              // GLCapabilities, so we don't offer the option of making
+              // color-index pbuffers.
+              iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
+              iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_ARB;
+            }
+          }
+
+          if (useFloat && !ati) {
+            iattributes[niattribs++] = WGLExt.WGL_FLOAT_COMPONENTS_NV;
+            iattributes[niattribs++] = GL.GL_TRUE;
+          }
+
+          if (rtt) {
+            if (useFloat) {
+              assert(!ati);
+              if (!rect) {
+                throw new GLException("Render-to-floating-point-texture only supported on NVidia hardware with render-to-texture-rectangle");
+              }
+              iattributes[niattribs++] = WGLExt.WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV;
+              iattributes[niattribs++] = GL.GL_TRUE;
+            } else {
+              iattributes[niattribs++] = rect ? WGLExt.WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV : WGLExt.WGL_BIND_TO_TEXTURE_RGB_ARB;
+              iattributes[niattribs++] = GL.GL_TRUE;
+            }
+          }
+        } else {
+          iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
+          iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_ARB;
+        }
+        iattributes[niattribs++] = 0;
+
+        return true;
+    }
+
+    static int AttribList2DrawableTypeBits(final int[] iattribs, final int niattribs, final int[] iresults) {
+        int val = 0;
+
+        for (int i = 0; i < niattribs; i++) {
+          int attr = iattribs[i];
+          switch (attr) {
+            case WGLExt.WGL_DRAW_TO_WINDOW_ARB:
+                if(iresults[i] == GL.GL_TRUE) val |= GLGraphicsConfigurationUtil.WINDOW_BIT;
+                break;
+            case WGLExt.WGL_DRAW_TO_BITMAP_ARB:
+                if(iresults[i] == GL.GL_TRUE) val |= GLGraphicsConfigurationUtil.BITMAP_BIT;
+                break;
+            case WGLExt.WGL_DRAW_TO_PBUFFER_ARB:
+                if(iresults[i] == GL.GL_TRUE) val |= GLGraphicsConfigurationUtil.PBUFFER_BIT;
+                break;
+            }
+        }
+        return val;
+    }
+
+    static boolean AttribList2GLCapabilities( ArrayList capsBucket,
+                                              final GLProfile glp, final long hdc, final int pfdID, final int[] iattribs,
+                                              final int niattribs,
+                                              final int[] iresults, final int winattrmask) {
+        final int allDrawableTypeBits = AttribList2DrawableTypeBits(iattribs, niattribs, iresults);
+        int drawableTypeBits = winattrmask & allDrawableTypeBits;
+
+        if( 0 == drawableTypeBits ) {
+            return false;
+        }
+        PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
+
+        if (GDI.DescribePixelFormat(hdc, pfdID, pfd.size(), pfd) == 0) {
+            // remove displayable bits, since pfdID is non displayable
+            drawableTypeBits = drawableTypeBits & ~(GLGraphicsConfigurationUtil.WINDOW_BIT | GLGraphicsConfigurationUtil.BITMAP_BIT);
+            if( 0 == drawableTypeBits ) {
+                return false;
+            }
+            // non displayable requested (pbuffer)
+        }
+        WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
+        res.setValuesByARB(iattribs, niattribs, iresults);
+
+        return GLGraphicsConfigurationUtil.addGLCapabilitiesPermutations(capsBucket, res, drawableTypeBits );
+    }
+
+    //
+    // GDI PIXELFORMAT
+    //
+
+    static int[] wglAllGDIPFIDs(long hdc) {
+        int numFormats = GDI.DescribePixelFormat(hdc, 1, 0, null);
+        if (numFormats == 0) {
+            throw new GLException("DescribePixelFormat: No formats - HDC 0x" + Long.toHexString(hdc) +
+                                  ", LastError: " + GDI.GetLastError());
+        }
+        int[] pfdIDs = new int[numFormats];
+        for (int i = 0; i < numFormats; i++) {
+            pfdIDs[i] = 1 + i;
+        }
+        return pfdIDs;
+    }
+
+    static int PFD2DrawableTypeBits(PIXELFORMATDESCRIPTOR pfd) {
+        int val = 0;
+
+        int dwFlags = pfd.getDwFlags();
+
+        if( 0 != (GDI.PFD_DRAW_TO_WINDOW & dwFlags ) ) {
+            val |= GLGraphicsConfigurationUtil.WINDOW_BIT;
+        }
+        if( 0 != (GDI.PFD_DRAW_TO_BITMAP & dwFlags ) ) {
+            val |= GLGraphicsConfigurationUtil.BITMAP_BIT;
+        }
+        return val;
+    }
+
+    static WGLGLCapabilities PFD2GLCapabilities(GLProfile glp, long hdc, int pfdID, boolean onscreen) {
+        final int winattrmask = GLGraphicsConfigurationUtil.getWinAttributeBits(onscreen, false);
+        ArrayList capsBucket = new ArrayList(1);
+        if( PFD2GLCapabilities(capsBucket, glp, hdc, pfdID, winattrmask) ) {
+            return (WGLGLCapabilities) capsBucket.get(0);
+        }
+        return null;
+    }
+
+    static boolean  PFD2GLCapabilities(ArrayList capsBucket, final GLProfile glp, final long hdc, final int pfdID, final int winattrmask) {
+        PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
+        if(null == pfd) {
+            return false;
+        }
+        if ((pfd.getDwFlags() & GDI.PFD_SUPPORT_OPENGL) == 0) {
+          return false;
+        }
+        final int allDrawableTypeBits = PFD2DrawableTypeBits(pfd);
+        final int drawableTypeBits = winattrmask & allDrawableTypeBits;
+
+        if( 0 == drawableTypeBits ) {
+            return false;
+        }
+
+        WGLGLCapabilities res = new WGLGLCapabilities(pfd, pfdID, glp);
+        res.setValuesByGDI();
+
+        return GLGraphicsConfigurationUtil.addGLCapabilitiesPermutations(capsBucket, res, drawableTypeBits );
+  }
+
+  static PIXELFORMATDESCRIPTOR GLCapabilities2PFD(GLCapabilitiesImmutable caps, PIXELFORMATDESCRIPTOR pfd) {
+    int colorDepth = (caps.getRedBits() +
+                      caps.getGreenBits() +
+                      caps.getBlueBits());
+    if (colorDepth < 15) {
+      throw new GLException("Bit depths < 15 (i.e., non-true-color) not supported");
+    }
+    int pfdFlags = (GDI.PFD_SUPPORT_OPENGL |
+                    GDI.PFD_GENERIC_ACCELERATED);
+    if (caps.getDoubleBuffered()) {
+      pfdFlags |= GDI.PFD_DOUBLEBUFFER;
+    }
+    if (caps.isOnscreen()) {
+      pfdFlags |= GDI.PFD_DRAW_TO_WINDOW;
+    } else {
+      pfdFlags |= GDI.PFD_DRAW_TO_BITMAP;
+    }
+    if (caps.getStereo()) {
+      pfdFlags |= GDI.PFD_STEREO;
+    }
+    pfd.setDwFlags(pfdFlags);
+    pfd.setIPixelType((byte) GDI.PFD_TYPE_RGBA);
+    pfd.setCColorBits((byte) colorDepth);
+    pfd.setCRedBits  ((byte) caps.getRedBits());
+    pfd.setCGreenBits((byte) caps.getGreenBits());
+    pfd.setCBlueBits ((byte) caps.getBlueBits());
+    pfd.setCAlphaBits((byte) caps.getAlphaBits());
+    int accumDepth = (caps.getAccumRedBits() +
+                      caps.getAccumGreenBits() +
+                      caps.getAccumBlueBits());
+    pfd.setCAccumBits     ((byte) accumDepth);
+    pfd.setCAccumRedBits  ((byte) caps.getAccumRedBits());
+    pfd.setCAccumGreenBits((byte) caps.getAccumGreenBits());
+    pfd.setCAccumBlueBits ((byte) caps.getAccumBlueBits());
+    pfd.setCAccumAlphaBits((byte) caps.getAccumAlphaBits());
+    pfd.setCDepthBits((byte) caps.getDepthBits());
+    pfd.setCStencilBits((byte) caps.getStencilBits());
+    pfd.setILayerType((byte) GDI.PFD_MAIN_PLANE);
+
+    // n/a with non ARB/GDI method:
+    //       multisample
+    //       opaque
+    //       pbuffer
+    return pfd;
+  }
+
+  static PIXELFORMATDESCRIPTOR createPixelFormatDescriptor(long hdc, int pfdID) {
+    PIXELFORMATDESCRIPTOR pfd = PIXELFORMATDESCRIPTOR.create();
+    pfd.setNSize((short) pfd.size());
+    pfd.setNVersion((short) 1);
+    if(0 != hdc && 1 <= pfdID) {
+        if (GDI.DescribePixelFormat(hdc, pfdID, pfd.size(), pfd) == 0) {
+            // Accelerated pixel formats that are non displayable
+            if(DEBUG) {
+                System.err.println("Info: Non displayable pixel format " + pfdID + " of device context: error code " + GDI.GetLastError());
+            }
+            return null;
+        }
+    }
+    return pfd;
+  }
+
+  static PIXELFORMATDESCRIPTOR createPixelFormatDescriptor() {
+    return createPixelFormatDescriptor(0, 0);
+  }
+  
+  public String toString() {
+    return "WindowsWGLGraphicsConfiguration["+getScreen()+", pfdID " + getPixelFormatID() + ", ARB-Choosen " + isChoosenByARB() +
+                                            ",\n\trequested " + getRequestedCapabilities() +
+                                            ",\n\tchosen    " + getChosenCapabilities() +
+                                            "]";
+  }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
new file mode 100644
index 0000000..fdf10a5
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -0,0 +1,471 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.opengl.windows.wgl;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.CapabilitiesChooser;
+import javax.media.nativewindow.DefaultGraphicsScreen;
+import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.nativewindow.CapabilitiesImmutable;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+
+import jogamp.nativewindow.windows.GDI;
+import jogamp.nativewindow.windows.PIXELFORMATDESCRIPTOR;
+import jogamp.opengl.GLGraphicsConfigurationFactory;
+import jogamp.opengl.GLGraphicsConfigurationUtil;
+import jogamp.opengl.SharedResourceRunner;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/** Subclass of GraphicsConfigurationFactory used when non-AWT tookits
+    are used on Windows platforms. Toolkits will likely need to delegate
+    to this one to change the accepted and returned types of the
+    GraphicsDevice and GraphicsConfiguration abstractions. */
+
+public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFactory {
+    protected static final boolean DEBUG = jogamp.opengl.Debug.debug("GraphicsConfiguration");
+    static WGLGLCapabilities.PfdIDComparator PfdIDComparator = new WGLGLCapabilities.PfdIDComparator();
+
+    WindowsWGLGraphicsConfigurationFactory() {
+        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.windows.WindowsGraphicsDevice.class, this);
+    }
+
+    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
+            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
+
+        if (! (capsChosen instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - chosen");
+        }
+
+        if (! (capsRequested instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - requested");
+        }
+
+        return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested, chooser, absScreen);
+    }
+
+    static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(GLCapabilitiesImmutable caps,
+                                                                              AbstractGraphicsScreen absScreen) {
+        return chooseGraphicsConfigurationStatic(caps, caps, null, absScreen);
+    }
+
+    static WindowsWGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
+                                                                             GLCapabilitiesImmutable capsReq,
+                                                                             CapabilitiesChooser chooser,
+                                                                             AbstractGraphicsScreen absScreen) {
+        if(null==absScreen) {
+            absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
+        }
+        AbstractGraphicsDevice absDevice = absScreen.getDevice();
+
+        capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities(
+                capsChosen, GLDrawableFactory.getDesktopFactory().canCreateGLPbuffer(absDevice) );
+
+        return new WindowsWGLGraphicsConfiguration( absScreen, capsChosen, capsReq, (GLCapabilitiesChooser)chooser );
+    }
+
+    protected static List/*<WGLGLCapabilities>*/ getAvailableCapabilities(WindowsWGLDrawableFactory factory, AbstractGraphicsDevice device) {
+        WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResource(device);
+        if(null == sharedResource) {
+            throw new GLException("Shared resource for device n/a: "+device);
+        }
+        WindowsWGLDrawable sharedDrawable = sharedResource.getDrawable();
+        GLCapabilitiesImmutable capsChosen = sharedDrawable.getChosenGLCapabilities();
+        List availableCaps = null;
+
+        sharedDrawable.lockSurface();
+        try {
+            long hdc = sharedDrawable.getHandle();
+            if (0 == hdc) {
+                throw new GLException("Error: HDC is null");
+            }
+            if (sharedResource.hasARBPixelFormat()) {
+                availableCaps = getAvailableGLCapabilitiesARB(hdc, sharedResource, capsChosen.getGLProfile());
+            }
+            if( null == availableCaps || 0 == availableCaps.size() ) {
+                availableCaps = getAvailableGLCapabilitiesGDI(hdc, capsChosen.getGLProfile());
+            }
+        } finally {
+            sharedDrawable.unlockSurface();
+        }
+
+        if( null != availableCaps ) {
+            Collections.sort(availableCaps, PfdIDComparator);
+        }
+        return availableCaps;
+    }
+
+    static List/*<WGLGLCapabilities>*/ getAvailableGLCapabilitiesARB(long hdc, WindowsWGLDrawableFactory.SharedResource sharedResource, GLProfile glProfile) {
+        int[] pformats = WindowsWGLGraphicsConfiguration.wglAllARBPFIDs(sharedResource.getContext(), hdc);
+        return WindowsWGLGraphicsConfiguration.wglARBPFIDs2AllGLCapabilities(sharedResource, hdc, pformats, glProfile);
+    }
+
+    static List/*<WGLGLCapabilities>*/ getAvailableGLCapabilitiesGDI(long hdc, GLProfile glProfile) {
+        int[] pformats = WindowsWGLGraphicsConfiguration.wglAllGDIPFIDs(hdc);
+        int numFormats = pformats.length;
+        ArrayList bucket = new ArrayList(numFormats);
+        for (int i = 0; i < numFormats; i++) {
+            WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(bucket, glProfile, hdc, pformats[i], GLGraphicsConfigurationUtil.ALL_BITS);
+        }
+        return bucket;
+    }
+
+    /**
+     *
+     * @param chooser
+     * @param _factory
+     * @param ns
+     * @param pfIDs optional pool of preselected PixelFormat IDs, maybe null for unrestricted selection
+     */
+    static void updateGraphicsConfiguration(CapabilitiesChooser chooser,
+                                            GLDrawableFactory factory, NativeSurface ns, int[] pfdIDs) {
+        if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
+        }
+        if (factory == null) {
+            throw new IllegalArgumentException("GLDrawableFactory is null");
+        }
+        if (ns == null) {
+            throw new IllegalArgumentException("NativeSurface is null");
+        }
+
+        if(NativeSurface.LOCK_SURFACE_NOT_READY >= ns.lockSurface()) {
+            throw new GLException("Surface not ready (lockSurface)");
+        }
+        try {
+            long hdc = ns.getSurfaceHandle();
+            if (0 == hdc) {
+                throw new GLException("Error: HDC is null");
+            }
+            WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+
+            if(!config.isDetermined()) {
+                updateGraphicsConfiguration(config, chooser, factory, hdc, false, pfdIDs);
+            } else {
+                // set PFD if not set yet
+                int pfdID = -1;
+                boolean set = false;
+                if ( 1 > ( pfdID = GDI.GetPixelFormat(hdc) ) ) {
+                    if (!GDI.SetPixelFormat(hdc, config.getPixelFormatID(), config.getPixelFormat())) {
+                        throw new GLException("Unable to set pixel format " + config.getPixelFormatID() +
+                                              " for device context " + toHexString(hdc) +
+                                              ": error code " + GDI.GetLastError());
+                    }
+                    set = true;
+                    pfdID = config.getPixelFormatID();
+                }
+                if (DEBUG) {
+                    System.err.println("!!! setPixelFormat (post): hdc "+toHexString(hdc) +", "+config.getPixelFormatID()+" -> "+pfdID+", set: "+set);
+                    Thread.dumpStack();
+                }
+            }
+        } finally {
+            ns.unlockSurface();
+        }
+    }
+
+    static void preselectGraphicsConfiguration(CapabilitiesChooser chooser,
+                                               GLDrawableFactory _factory, AbstractGraphicsDevice device,
+                                               WindowsWGLGraphicsConfiguration config, int[] pfdIDs) {
+        if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
+        }
+        if (_factory == null) {
+            throw new IllegalArgumentException("GLDrawableFactory is null");
+        }
+        if (config == null) {
+            throw new IllegalArgumentException("WindowsWGLGraphicsConfiguration is null");
+        }
+        WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
+        WindowsWGLDrawable sharedDrawable = factory.getOrCreateSharedDrawable(device);
+        if(null == sharedDrawable) {
+            throw new IllegalArgumentException("Shared Drawable is null");
+        }
+
+        if(NativeSurface.LOCK_SURFACE_NOT_READY >= sharedDrawable.lockSurface()) {
+            throw new GLException("Surface not ready (lockSurface)");
+        }
+        try {
+            long hdc = sharedDrawable.getHandle();
+            if (0 == hdc) {
+                throw new GLException("Error: HDC is null");
+            }
+            updateGraphicsConfiguration(config, chooser, factory, hdc, true, pfdIDs);
+        } finally {
+            sharedDrawable.unlockSurface();
+        }
+    }
+
+    private static void updateGraphicsConfiguration(WindowsWGLGraphicsConfiguration config, CapabilitiesChooser chooser,
+                                                    GLDrawableFactory factory, long hdc, boolean extHDC, int[] pfdIDs) {
+        if (DEBUG) {
+            if(extHDC) {
+                System.err.println("updateGraphicsConfiguration(using shared): hdc "+toHexString(hdc));
+            } else {
+                System.err.println("updateGraphicsConfiguration(using target): hdc "+toHexString(hdc));
+            }
+            System.err.println("!!! user chosen caps " + config.getChosenCapabilities());
+        }
+        if( !updateGraphicsConfigurationARB(hdc, extHDC, config, chooser, (WindowsWGLDrawableFactory)factory, pfdIDs) ) {
+            updateGraphicsConfigurationGDI(hdc, extHDC, config, chooser, pfdIDs);
+        }
+    }
+
+    private static boolean updateGraphicsConfigurationARB(long hdc, boolean extHDC, WindowsWGLGraphicsConfiguration config,
+                                                          CapabilitiesChooser chooser, WindowsWGLDrawableFactory factory, int[] pformats) {
+        AbstractGraphicsDevice device = config.getScreen().getDevice();
+        WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResource(device);
+
+        if (null == sharedResource) {
+            if (DEBUG) {
+                System.err.println("updateGraphicsConfigurationARB: SharedResource is null: "+device);
+            }
+            return false;
+        }
+        if (!sharedResource.hasARBPixelFormat()) {
+            if (DEBUG) {
+                System.err.println("updateGraphicsConfigurationARB: "+WindowsWGLDrawableFactory.WGL_ARB_pixel_format+" not available");
+            }
+            return false;
+        }
+
+        GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+        boolean onscreen = capsChosen.isOnscreen();
+        boolean usePBuffer = capsChosen.isPBuffer();
+        GLProfile glProfile = capsChosen.getGLProfile();
+
+        WGLGLCapabilities pixelFormatCaps = null; // chosen or preset PFD ID's caps
+        boolean pixelFormatSet = false; // indicates a preset PFD ID [caps]
+        final int presetPFDID = extHDC ? -1 : GDI.GetPixelFormat(hdc) ;
+        if ( 1 <= presetPFDID ) {
+            // Pixelformat already set by either
+            //  - a previous preselectGraphicsConfiguration() call on the same HDC,
+            //  - the graphics driver, copying the HDC's pixelformat to the new one,
+            //  - or the Java2D/OpenGL pipeline's configuration
+            if (DEBUG) {
+                System.err.println("updateGraphicsConfigurationARB: Pixel format already chosen for HDC: " + toHexString(hdc)
+                        + ", pixelformat " + presetPFDID);
+            }
+            pixelFormatSet = true;
+            pixelFormatCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, hdc, presetPFDID, glProfile, onscreen, usePBuffer);
+        } else {
+            int recommendedIndex = -1; // recommended index
+
+            if(null == pformats) {
+                // No given PFD IDs
+                //
+                // 1st choice: get GLCapabilities based on users GLCapabilities setting recommendedIndex as preferred choice
+                int[] iattributes = new int[2 * WindowsWGLGraphicsConfiguration.MAX_ATTRIBS];
+                float[] fattributes = new float[1];
+                int accelerationMode = WGLExt.WGL_FULL_ACCELERATION_ARB;
+                pformats = WindowsWGLGraphicsConfiguration.wglChoosePixelFormatARB(hdc, sharedResource, capsChosen,
+                                                                                   iattributes, accelerationMode, fattributes);
+                if (null == pformats) {
+                    accelerationMode = WGLExt.WGL_GENERIC_ACCELERATION_ARB;
+                    pformats = WindowsWGLGraphicsConfiguration.wglChoosePixelFormatARB(hdc, sharedResource, capsChosen,
+                                                                                       iattributes, accelerationMode, fattributes);
+                }
+                if (null == pformats) {
+                    accelerationMode = -1; // use what we are offered ..
+                    pformats = WindowsWGLGraphicsConfiguration.wglChoosePixelFormatARB(hdc, sharedResource, capsChosen,
+                                                                                       iattributes, accelerationMode, fattributes);
+                }
+                if (null != pformats) {
+                    recommendedIndex = 0;
+                } else {
+                    if(DEBUG) {
+                        System.err.println("updateGraphicsConfigurationARB: wglChoosePixelFormatARB failed with: "+capsChosen);
+                    }
+                    // 2nd choice: get all GLCapabilities available, no preferred recommendedIndex available
+                    pformats = WindowsWGLGraphicsConfiguration.wglAllARBPFIDs(sharedResource.getContext(), hdc);
+                    if (DEBUG) {
+                        final int len = ( null != pformats ) ? pformats.length : 0;
+                        System.err.println("updateGraphicsConfigurationARB: NumFormats (wglAllARBPFIDs) " + len);
+                    }
+                }
+                if (null == pformats) {
+                    if (DEBUG) {
+                        Thread.dumpStack();
+                    }
+                    return false;
+                }
+            }
+
+            List /*<WGLGLCapabilities>*/ availableCaps =
+                WindowsWGLGraphicsConfiguration.wglARBPFIDs2GLCapabilities(sharedResource, hdc, pformats,
+                                                                           glProfile, onscreen, usePBuffer);
+            if( null == availableCaps || 0 == availableCaps.size() ) {
+                if (DEBUG) {
+                    System.err.println("updateGraphicsConfigurationARB: wglARBPFIDs2GLCapabilities failed with " + pformats.length +
+                                       " pfd ids, onscreen " + onscreen + ", pbuffer " + usePBuffer);
+                    Thread.dumpStack();
+                }
+                return false;
+            }
+
+            if (DEBUG) {
+                System.err.println("updateGraphicsConfigurationARB: " + pformats.length +
+                                   " pfd ids, onscreen " + onscreen + ", pbuffer " + usePBuffer + ", " + availableCaps.size() + " glcaps");
+                if(0 <= recommendedIndex) {
+                    System.err.println("updateGraphicsConfigurationARB: Used wglChoosePixelFormatARB to recommend pixel format " +
+                                       pformats[recommendedIndex] + ", idx " + recommendedIndex +", "+availableCaps.get(recommendedIndex));
+                }
+            }
+
+            int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex);
+            if ( 0 > chosenIndex ) {
+                if (DEBUG) {
+                    Thread.dumpStack();
+                }
+                return false;
+            }
+            pixelFormatCaps = (WGLGLCapabilities) availableCaps.get(chosenIndex);
+            if( null == pixelFormatCaps) {
+                throw new GLException("Null Capabilities with "+
+                                      " chosen pfdID: native recommended "+ (recommendedIndex+1) +
+                                      " chosen "+pixelFormatCaps.getPFDID());
+            }
+            if (DEBUG) {
+                System.err.println("!!! chosen pfdID (ARB): native recommended "+ (recommendedIndex+1) +
+                                   " chosen "+pixelFormatCaps);
+            }
+        }
+
+        if ( !extHDC && !pixelFormatSet ) {
+            if (!GDI.SetPixelFormat(hdc, pixelFormatCaps.getPFDID(), pixelFormatCaps.getPFD())) {
+                throw new GLException("Unable to set pixel format " + pixelFormatCaps.getPFDID() +
+                                      " for device context " + toHexString(hdc) +
+                                      ": error code " + GDI.GetLastError());
+            }
+            if (DEBUG) {
+                System.err.println("!!! setPixelFormat (ARB): hdc "+toHexString(hdc) +", "+config.getPixelFormatID()+" -> "+pixelFormatCaps.getPFDID());
+            }
+        }
+        config.setCapsPFD(pixelFormatCaps);
+        return true;
+    }
+
+    private static boolean updateGraphicsConfigurationGDI(long hdc, boolean extHDC, WindowsWGLGraphicsConfiguration config,
+                                                          CapabilitiesChooser chooser, int[] pformats) {
+        GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+        if(capsChosen.isPBuffer()) {
+            if (DEBUG) {
+                System.err.println("updateGraphicsConfigurationGDI: no pbuffer supported on GDI: " + capsChosen);
+            }
+            return false;
+        }
+        boolean onscreen = capsChosen.isOnscreen();
+        GLProfile glProfile = capsChosen.getGLProfile();
+
+        ArrayList/*<WGLGLCapabilities>*/ availableCaps = new ArrayList();
+        int pfdID; // chosen or preset PFD ID
+        WGLGLCapabilities pixelFormatCaps = null; // chosen or preset PFD ID's caps
+        boolean pixelFormatSet = false; // indicates a preset PFD ID [caps]
+
+        if ( !extHDC && 1 <= ( pfdID = GDI.GetPixelFormat(hdc) ) ) {
+            // Pixelformat already set by either
+            //  - a previous preselectGraphicsConfiguration() call on the same HDC,
+            //  - the graphics driver, copying the HDC's pixelformat to the new one,
+            //  - or the Java2D/OpenGL pipeline's configuration
+            if (DEBUG) {
+                System.err.println("updateGraphicsConfigurationGDI: NOTE: pixel format already chosen for HDC: " + toHexString(hdc)
+                        + ", pixelformat " + pfdID);
+            }
+            pixelFormatSet = true;
+            pixelFormatCaps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(glProfile, hdc, pfdID, onscreen);
+        } else {
+            if(null == pformats) {
+                pformats = WindowsWGLGraphicsConfiguration.wglAllGDIPFIDs(hdc);
+            }
+            final int winattrmask = GLGraphicsConfigurationUtil.getWinAttributeBits(onscreen, false);
+
+            for (int i = 0; i < pformats.length; i++) {
+                WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(availableCaps, glProfile, hdc, pformats[i], winattrmask);
+            }
+
+            // 1st choice: get GLCapabilities based on users GLCapabilities setting recommendedIndex as preferred choice
+            PIXELFORMATDESCRIPTOR pfd = WindowsWGLGraphicsConfiguration.createPixelFormatDescriptor();
+            pfd = WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(capsChosen, pfd);
+            pfdID = GDI.ChoosePixelFormat(hdc, pfd);
+            int recommendedIndex = -1 ;
+            if( 1 <= pfdID ) {
+                // seek index ..
+                for (recommendedIndex = availableCaps.size() - 1 ;
+                     0 <= recommendedIndex && pfdID != ((WGLGLCapabilities) availableCaps.get(recommendedIndex)).getPFDID();
+                     recommendedIndex--)
+                { /* nop */ }
+            }
+            // 2nd choice: if no preferred recommendedIndex available
+            if (DEBUG) {
+                System.err.println("updateGraphicsConfigurationGDI: ChoosePixelFormat(HDC " + toHexString(hdc) + ") = " + pfdID + ", idx " + recommendedIndex + " (LastError: " + GDI.GetLastError() + ")");
+            }
+            int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex);
+            if ( 0 > chosenIndex ) {
+                if (DEBUG) {
+                    Thread.dumpStack();
+                }
+                return false;
+            }
+            pixelFormatCaps = (WGLGLCapabilities) availableCaps.get(chosenIndex);
+            if (DEBUG) {
+                System.err.println("!!! chosen pfdID (GDI): native recommended "+ (recommendedIndex+1) +
+                                   ", caps " + pixelFormatCaps);
+            }
+        }
+
+        if ( !extHDC && !pixelFormatSet ) {
+            if (!GDI.SetPixelFormat(hdc, pixelFormatCaps.getPFDID(), pixelFormatCaps.getPFD())) {
+                throw new GLException("Unable to set pixel format " + pixelFormatCaps.getPFDID() +
+                                      " for device context " + toHexString(hdc) +
+                                      ": error code " + GDI.GetLastError());
+            }
+            if (DEBUG) {
+                System.err.println("!!! setPixelFormat (GDI): hdc "+toHexString(hdc) +", "+config.getPixelFormatID()+" -> " + pixelFormatCaps.getPFDID());
+            }
+        }
+        config.setCapsPFD(pixelFormatCaps);
+        return true;
+    }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
new file mode 100644
index 0000000..1f09180
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.opengl.windows.wgl.awt;
+
+
+import com.jogamp.common.util.ArrayHashSet;
+import jogamp.nativewindow.jawt.windows.Win32SunJDKReflection;
+import jogamp.opengl.GLGraphicsConfigurationFactory;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.CapabilitiesChooser;
+import javax.media.nativewindow.CapabilitiesImmutable;
+import javax.media.nativewindow.DefaultGraphicsScreen;
+import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.nativewindow.awt.AWTGraphicsConfiguration;
+import javax.media.nativewindow.awt.AWTGraphicsDevice;
+import javax.media.nativewindow.awt.AWTGraphicsScreen;
+import javax.media.nativewindow.windows.WindowsGraphicsDevice;
+
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLException;
+
+import jogamp.opengl.windows.wgl.WindowsWGLGraphicsConfiguration;
+import javax.media.opengl.GLDrawableFactory;
+
+public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFactory {
+    protected static final boolean DEBUG = jogamp.opengl.Debug.debug("GraphicsConfiguration");
+
+    public WindowsAWTWGLGraphicsConfigurationFactory() {
+        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this);
+    }
+
+    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
+            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
+            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
+        GraphicsDevice device = null;
+        if (absScreen != null &&
+            !(absScreen instanceof AWTGraphicsScreen)) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
+        }
+
+        if(null==absScreen) {
+            absScreen = AWTGraphicsScreen.createScreenDevice(-1, AbstractGraphicsDevice.DEFAULT_UNIT);
+            if(DEBUG) {
+                System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: creating default device: "+absScreen);
+            }
+        }
+        AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
+        device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
+
+        if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - chosen");
+        }
+
+        if ( !(capsRequested instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - requested");
+        }
+
+        if (chooser != null &&
+            !(chooser instanceof GLCapabilitiesChooser)) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilitiesChooser objects");
+        }
+
+        if(DEBUG) {
+            System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: got "+absScreen);
+        }
+
+        WindowsGraphicsDevice winDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+        DefaultGraphicsScreen winScreen = new DefaultGraphicsScreen(winDevice, awtScreen.getIndex());
+        GraphicsConfigurationFactory configFactory = GraphicsConfigurationFactory.getFactory(winDevice);
+        GLDrawableFactory drawableFactory = GLDrawableFactory.getFactory( ((GLCapabilitiesImmutable)capsChosen).getGLProfile() );
+
+        WindowsWGLGraphicsConfiguration winConfig = (WindowsWGLGraphicsConfiguration)
+                                                       configFactory.chooseGraphicsConfiguration(capsChosen,
+                                                                                                 capsRequested,
+                                                                                                 chooser, winScreen);
+        if (winConfig == null) {
+            throw new GLException("Unable to choose a GraphicsConfiguration: "+capsChosen+",\n\t"+chooser+"\n\t"+winScreen);
+        }
+
+        GraphicsConfiguration chosenGC = null;
+
+        // 1st Choice: Create an AWT GraphicsConfiguration with the desired PFD
+        // This gc will probably not be able to support GDI (WGL_SUPPORT_GDI_ARB, PFD_SUPPORT_GDI)
+        // however on most GPUs this is the current situation for Windows,
+        // otherwise no hardware accelerated PFD could be achieved.
+        //   - preselect with no constrains
+        //   - try to create dedicated GC
+        winConfig.preselectGraphicsConfiguration(drawableFactory, null);
+        if ( 1 <= winConfig.getPixelFormatID() ) {
+            chosenGC = Win32SunJDKReflection.graphicsConfigurationGet(device, winConfig.getPixelFormatID());
+            if(DEBUG) {
+                System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: Found new AWT PFD ID "+winConfig.getPixelFormatID()+" -> "+winConfig);
+            }
+        }
+
+        if( null == chosenGC ) {
+            // 2nd Choice: Choose and match the GL Visual with AWT:
+            //   - collect all AWT PFDs
+            //   - choose a GL config from the pool of AWT PFDs
+            //
+            // The resulting GraphicsConfiguration has to be 'forced' on the AWT native peer,
+            // ie. returned by GLCanvas's getGraphicsConfiguration() befor call by super.addNotify().
+            //
+
+            // collect all available PFD IDs
+            GraphicsConfiguration[] configs = device.getConfigurations();
+            int[] pfdIDs = new int[configs.length];
+            ArrayHashSet pfdIDOSet = new ArrayHashSet();
+            for (int i = 0; i < configs.length; i++) {
+                GraphicsConfiguration gc = configs[i];
+                pfdIDs[i] = Win32SunJDKReflection.graphicsConfigurationGetPixelFormatID(gc);
+                pfdIDOSet.add(new Integer(pfdIDs[i]));
+                if(DEBUG) {
+                    System.err.println("AWT pfd["+i+"] "+pfdIDs[i]);
+                }
+            }
+            if(DEBUG) {
+                System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: PFD IDs: "+pfdIDs.length+", unique: "+pfdIDOSet.size());
+            }
+            winConfig.preselectGraphicsConfiguration(drawableFactory, pfdIDs);
+            int gcIdx = pfdIDOSet.indexOf(new Integer(winConfig.getPixelFormatID()));
+            if( 0 > gcIdx ) {
+                chosenGC = configs[gcIdx];
+                if(DEBUG) {
+                    System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: Found matching AWT PFD ID "+winConfig.getPixelFormatID()+" -> "+winConfig);
+                }
+            }
+        }
+
+        if ( null == chosenGC ) {
+            throw new GLException("Unable to determine GraphicsConfiguration: "+winConfig);
+        }
+        return new AWTGraphicsConfiguration(awtScreen, winConfig.getChosenCapabilities(), winConfig.getRequestedCapabilities(),
+                                            chosenGC, winConfig);
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
new file mode 100644
index 0000000..e95c802
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import javax.media.opengl.*;
+
+
+public class GLXUtil {
+    public static String getExtension(long display) {
+        return GLX.glXGetClientString(display, GLX.GLX_EXTENSIONS);
+    }
+
+    public static boolean isMultisampleAvailable(String extensions) {
+        if (extensions != null) {
+            return (extensions.indexOf("GLX_ARB_multisample") >= 0);
+        }
+        return false;
+    }
+
+    public static boolean isMultisampleAvailable(long display) {
+        return isMultisampleAvailable(getExtension(display));
+    }
+
+    /** Workaround for apparent issue with ATI's proprietary drivers
+        where direct contexts still send GLX tokens for GL calls */
+    public static String getVendorName(long display) {
+        return GLX.glXGetClientString(display, GLX.GLX_VENDOR);
+    }
+
+    public static boolean isVendorNVIDIA(String vendor) {
+        return vendor != null && vendor.startsWith("NVIDIA") ;
+    }
+
+    public static boolean isVendorATI(String vendor) {
+        return vendor != null && vendor.startsWith("ATI") ;
+    }
+
+    public static boolean isVendorATI(long display) {
+        return isVendorATI(getVendorName(display));
+    }
+
+    public static boolean isVendorNVIDIA(long display) {
+        return isVendorNVIDIA(getVendorName(display));
+    }
+
+    public static void getGLXVersion(long display, int major[], int minor[]) { 
+        if(0 == display) {
+            throw new GLException("null display handle");
+        }
+        if(major.length<1||minor.length<1) {
+            throw new GLException("passed int arrays size is not >= 1");
+        }
+
+        if (!GLX.glXQueryVersion(display, major, 0, minor, 0)) {
+          throw new GLException("glXQueryVersion failed");
+        }
+
+        // Work around bugs in ATI's Linux drivers where they report they
+        // only implement GLX version 1.2 on the server side
+        if (major[0] == 1 && minor[0] == 2) {
+          String str = GLX.glXGetClientString(display, GLX.GLX_VERSION);
+          try {
+              // e.g. "1.3"
+              major[0] = Integer.valueOf(str.substring(0, 1)).intValue();
+              minor[0] = Integer.valueOf(str.substring(2, 3)).intValue();
+          } catch (Exception e) {
+              major[0] = 1;
+              minor[0] = 2;
+          }
+        }
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java
new file mode 100644
index 0000000..68bdb4a
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java
@@ -0,0 +1,90 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl.x11.glx;
+
+import javax.media.opengl.*;
+
+import javax.media.nativewindow.x11.*;
+import jogamp.nativewindow.*;
+import jogamp.nativewindow.x11.*;
+
+public class X11DummyGLXDrawable extends X11OnscreenGLXDrawable {
+  private static final int f_dim = 64;
+  private long dummyWindow = 0;
+
+  /** 
+   * Due to the ATI Bug https://bugzilla.mozilla.org/show_bug.cgi?id=486277,
+   * we cannot switch the Display as we please, 
+   * hence we reuse the target's screen configuration. 
+   */
+  public X11DummyGLXDrawable(X11GraphicsScreen screen, GLDrawableFactory factory, GLCapabilitiesImmutable caps) {
+    super(factory, 
+          new WrappedSurface(X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(
+            caps, caps, null, screen)));
+    this.realized = true;
+
+    WrappedSurface ns = (WrappedSurface) getNativeSurface();
+    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+
+    X11GraphicsDevice device = (X11GraphicsDevice) screen.getDevice();
+    long dpy = device.getHandle();
+    int scrn = screen.getIndex();
+    long visualID = config.getVisualID();
+
+    dummyWindow = X11Util.CreateDummyWindow(dpy, scrn, visualID, f_dim, f_dim);
+    ns.setSurfaceHandle( dummyWindow );
+    ns.setSize(f_dim, f_dim);
+
+    updateHandle();
+  }
+
+  public static X11DummyGLXDrawable create(X11GraphicsScreen screen, GLDrawableFactory factory, GLProfile glp) {
+      GLCapabilities caps = new GLCapabilities(glp);
+      return new X11DummyGLXDrawable(screen, factory, caps);
+  }
+
+  public void setSize(int width, int height) {
+  }
+
+  public int getWidth() {
+    return 1;
+  }
+
+  public int getHeight() {
+    return 1;
+  }
+
+  protected void destroyImpl() {
+    if(0!=dummyWindow) {
+        destroyHandle();
+        X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+        X11Util.DestroyDummyWindow(config.getScreen().getDevice().getHandle(), dummyWindow);
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
new file mode 100644
index 0000000..c488fe5
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+import jogamp.nativewindow.WrappedSurface;
+
+public class X11ExternalGLXContext extends X11GLXContext {
+  private GLContext lastContext;
+
+  private X11ExternalGLXContext(Drawable drawable, long ctx) {
+    super(drawable, null);
+    this.contextHandle = ctx;
+    GLContextShareSet.contextCreated(this);
+    setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);
+    getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
+  }
+
+  protected static X11ExternalGLXContext create(GLDrawableFactory factory, GLProfile glp) {
+    long ctx = GLX.glXGetCurrentContext();
+    if (ctx == 0) {
+      throw new GLException("Error: current context null");
+    }
+    long display = GLX.glXGetCurrentDisplay();
+    if (display == 0) {
+      throw new GLException("Error: current display null");
+    }
+    long drawable = GLX.glXGetCurrentDrawable();
+    if (drawable == 0) {
+      throw new GLException("Error: attempted to make an external GLDrawable without a drawable/context current");
+    }
+    int[] val = new int[1];
+    GLX.glXQueryContext(display, ctx, GLX.GLX_SCREEN, val, 0);
+    X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val[0]);
+
+    GLX.glXQueryContext(display, ctx, GLX.GLX_FBCONFIG_ID, val, 0);
+    X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val[0]);
+
+    WrappedSurface ns = new WrappedSurface(cfg);
+    ns.setSurfaceHandle(drawable);
+    return new X11ExternalGLXContext(new Drawable(factory, ns), ctx);
+  }
+
+  protected boolean createImpl() {
+      return true;
+  }
+
+  public int makeCurrent() throws GLException {
+    // Save last context if necessary to allow external GLContexts to
+    // talk to other GLContexts created by this library
+    GLContext cur = getCurrent();
+    if (cur != null && cur != this) {
+      lastContext = cur;
+      setCurrent(null);
+    }
+    return super.makeCurrent();
+  }  
+
+  public void release() throws GLException {
+    super.release();
+    setCurrent(lastContext);
+    lastContext = null;
+  }
+
+  protected void makeCurrentImpl(boolean newCreated) throws GLException {
+  }
+
+  protected void releaseImpl() throws GLException {
+  }
+
+  protected void destroyImpl() throws GLException {
+  }
+
+  // Need to provide the display connection to extension querying APIs
+  static class Drawable extends X11GLXDrawable {
+    Drawable(GLDrawableFactory factory, NativeSurface comp) {
+      super(factory, comp, true);
+    }
+
+    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");
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
new file mode 100644
index 0000000..eb286cd
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+import javax.media.opengl.*;
+import jogamp.nativewindow.WrappedSurface;
+
+
+public class X11ExternalGLXDrawable extends X11GLXDrawable {
+
+  private X11ExternalGLXDrawable(GLDrawableFactory factory, NativeSurface surface) {
+    super(factory, surface, true);
+  }
+
+  protected static X11ExternalGLXDrawable create(GLDrawableFactory factory, GLProfile glp) {
+    long context = GLX.glXGetCurrentContext();
+    if (context == 0) {
+      throw new GLException("Error: current context null");
+    }
+    long display = GLX.glXGetCurrentDisplay();
+    if (display == 0) {
+      throw new GLException("Error: current display null");
+    }
+    long drawable = GLX.glXGetCurrentDrawable();
+    if (drawable == 0) {
+      throw new GLException("Error: attempted to make an external GLDrawable without a drawable current");
+    }
+    int[] val = new int[1];
+    GLX.glXQueryContext(display, context, GLX.GLX_SCREEN, val, 0);
+    X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val[0]);
+
+    GLX.glXQueryContext(display, context, GLX.GLX_FBCONFIG_ID, val, 0);
+    X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val[0]);
+
+    int w, h;
+    GLX.glXQueryDrawable(display, drawable, GLX.GLX_WIDTH, val, 0);
+    w=val[0];
+    GLX.glXQueryDrawable(display, drawable, GLX.GLX_HEIGHT, val, 0);
+    h=val[0];
+
+    GLX.glXQueryContext(display, context, GLX.GLX_RENDER_TYPE, val, 0);
+    if ((val[0] & GLX.GLX_RGBA_TYPE) == 0) {
+      if (DEBUG) {
+        System.err.println("X11ExternalGLXDrawable: WARNING: forcing GLX_RGBA_TYPE for newly created contexts (current 0x"+Integer.toHexString(val[0])+")");
+      }
+    }
+    WrappedSurface ns = new WrappedSurface(cfg);
+    ns.setSurfaceHandle(drawable);
+    ns.setSize(w, h);
+    return new X11ExternalGLXDrawable(factory, ns);
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    return new Context(this, shareWith);
+  }
+
+  public void setSize(int newWidth, int newHeight) {
+    throw new GLException("Should not call this");
+  }
+
+  class Context extends X11GLXContext {
+    Context(X11GLXDrawable drawable, GLContext shareWith) {
+      super(drawable, shareWith);
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java
new file mode 100644
index 0000000..5455976
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java
@@ -0,0 +1,124 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import jogamp.nativewindow.x11.XVisualInfo;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+import java.util.Comparator;
+
+public class X11GLCapabilities extends GLCapabilities {
+  XVisualInfo xVisualInfo; // maybe null if !onscreen
+  long fbcfg;
+  int  fbcfgid;
+
+  /** Comparing xvisual id only */
+  public static class XVisualIDComparator implements Comparator {
+
+      public int compare(Object o1, Object o2) {
+        if ( ! ( o1 instanceof X11GLCapabilities ) ) {
+            Class c = (null != o1) ? o1.getClass() : null ;
+            throw new ClassCastException("arg1 not a X11GLCapabilities object: " + c);
+        }
+        if ( ! ( o2 instanceof X11GLCapabilities ) ) {
+            Class c = (null != o2) ? o2.getClass() : null ;
+            throw new ClassCastException("arg2 not a X11GLCapabilities object: " + c);
+        }
+
+        final X11GLCapabilities caps1 = (X11GLCapabilities) o1;
+        final long id1 = caps1.getXVisualID();
+
+        final X11GLCapabilities caps2 = (X11GLCapabilities) o2;
+        final long id2 = caps2.getXVisualID();
+
+        if(id1 > id2) {
+            return 1;
+        } else if(id1 < id2) {
+            return -1;
+        }
+        return 0;
+      }
+  }
+
+  public X11GLCapabilities(XVisualInfo xVisualInfo, long fbcfg, int fbcfgid, GLProfile glp) {
+      super(glp);
+      this.xVisualInfo = xVisualInfo;
+      this.fbcfg = fbcfg;
+      this.fbcfgid = fbcfgid;
+  }
+
+  public X11GLCapabilities(XVisualInfo xVisualInfo, GLProfile glp) {
+      super(glp);
+      this.xVisualInfo = xVisualInfo;
+      this.fbcfg = 0;
+      this.fbcfgid = -1;
+  }
+
+  public Object cloneMutable() {
+    return clone();
+  }
+
+  public Object clone() {
+    try {
+      return super.clone();
+    } catch (RuntimeException e) {
+      throw new GLException(e);
+    }
+  }
+
+  final public XVisualInfo getXVisualInfo() { return xVisualInfo; }
+  final public long getXVisualID() { return (null!=xVisualInfo) ? xVisualInfo.getVisualid() : 0; }
+  final public boolean hasXVisualInfo() { return null!=xVisualInfo; }
+
+  final public long getFBConfig() { return fbcfg; }
+  final public int getFBConfigID() { return fbcfgid; }
+  final public boolean hasFBConfig() { return 0!=fbcfg && fbcfgid>0; }
+
+  final static String na_str = "----" ;
+
+  public StringBuffer toString(StringBuffer sink) {
+    if(null == sink) {
+        sink = new StringBuffer();
+    }
+    if(hasXVisualInfo()) {
+        sink.append("0x").append(Long.toHexString(xVisualInfo.getVisualid()));
+    } else {
+        sink.append(na_str);
+    }
+    sink.append(" ");
+    if(hasFBConfig()) {
+        sink.append("0x").append(Integer.toHexString(fbcfgid));
+    } else {
+        sink.append(na_str);
+    }
+    sink.append(": ");
+    return super.toString(sink);
+  }
+}
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
new file mode 100644
index 0000000..7d7614c
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
@@ -0,0 +1,587 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import java.nio.*;
+import java.util.*;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.X11GraphicsDevice;
+
+import com.jogamp.common.util.VersionNumber;
+import jogamp.opengl.*;
+import com.jogamp.gluegen.runtime.ProcAddressTable;
+import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver;
+import jogamp.nativewindow.x11.X11Util;
+
+public abstract class X11GLXContext extends GLContextImpl {
+  protected static final boolean TRACE_CONTEXT_CURRENT = false; // true;
+
+  private static final Map/*<String, String>*/ functionNameMap;
+  private static final Map/*<String, String>*/ extensionNameMap;
+  private VersionNumber glXVersion;
+  private boolean glXVersionOneThreeCapable;
+  private boolean glXQueryExtensionsStringInitialized;
+  private boolean glXQueryExtensionsStringAvailable;
+  private GLXExt glXExt;
+  // Table that holds the addresses of the native C-language entry points for
+  // GLX extension functions.
+  private GLXExtProcAddressTable glXExtProcAddressTable;
+  private int hasSwapIntervalSGI = 0;
+
+  // This indicates whether the context we have created is indirect
+  // and therefore requires the toolkit to be locked around all GL
+  // calls rather than just all GLX calls
+  protected boolean isDirect;
+
+  static {
+    functionNameMap = new HashMap();
+    functionNameMap.put("glAllocateMemoryNV", "glXAllocateMemoryNV");
+    functionNameMap.put("glFreeMemoryNV", "glXFreeMemoryNV");
+
+    extensionNameMap = new HashMap();
+    extensionNameMap.put("GL_ARB_pbuffer",      "GLX_SGIX_pbuffer");
+    extensionNameMap.put("GL_ARB_pixel_format", "GLX_SGIX_pbuffer"); // good enough
+  }
+
+  X11GLXContext(GLDrawableImpl drawable,
+                GLContext shareWith) {
+    super(drawable, shareWith);
+  }
+  
+  protected void resetState() {
+    glXVersion = null;
+    glXVersionOneThreeCapable = false;
+    glXQueryExtensionsStringInitialized=false;
+    glXQueryExtensionsStringAvailable=false;
+    // no inner state glXExt=null;
+    glXExtProcAddressTable = null;
+    hasSwapIntervalSGI = 0;
+    isDirect = false;
+  }
+
+  public final ProcAddressTable getPlatformExtProcAddressTable() {
+    return getGLXExtProcAddressTable();
+  }
+
+  public final GLXExtProcAddressTable getGLXExtProcAddressTable() {
+    return glXExtProcAddressTable;
+  }
+
+  public Object getPlatformGLExtensions() {
+    return getGLXExt();
+  }
+
+  public GLXExt getGLXExt() {
+    if (glXExt == null) {
+      glXExt = new GLXExtImpl(this);
+    }
+    return glXExt;
+  }
+
+  protected Map/*<String, String>*/ getFunctionNameMap() { return functionNameMap; }
+
+  protected Map/*<String, String>*/ getExtensionNameMap() { return extensionNameMap; }
+
+  public final boolean isGLXVersionGreaterEqualOneThree() {
+    if(null == glXVersion) {
+        X11GLXDrawableFactory factory = (X11GLXDrawableFactory)drawable.getFactoryImpl();
+
+        X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+        X11GraphicsDevice device = (X11GraphicsDevice) config.getScreen().getDevice();
+
+        glXVersion = factory.getGLXVersion(device);
+        glXVersionOneThreeCapable = ( null != glXVersion ) ? glXVersion.compareTo(X11GLXDrawableFactory.versionOneThree) >= 0 : false ;
+    }
+    return glXVersionOneThreeCapable;
+  }
+
+  public final boolean isGLReadDrawableAvailable() {
+    return isGLXVersionGreaterEqualOneThree();
+  }
+
+  private final boolean glXMakeContextCurrent(long dpy, long writeDrawable, long readDrawable, long ctx) {
+    boolean res = false;
+
+    try {
+        if(TRACE_CONTEXT_CURRENT) {
+            Throwable t = new Throwable(Thread.currentThread()+" - glXMakeContextCurrent("+toHexString(dpy)+", "+
+                    toHexString(writeDrawable)+", "+toHexString(readDrawable)+", "+toHexString(ctx)+") - GLX >= 1.3 "+ glXVersionOneThreeCapable);
+            t.printStackTrace();
+        }
+        if ( glXVersionOneThreeCapable ) {
+            res = GLX.glXMakeContextCurrent(dpy, writeDrawable, readDrawable, ctx);
+        } else if ( writeDrawable == readDrawable ) {
+            res = GLX.glXMakeCurrent(dpy, writeDrawable, ctx);
+        } else {
+            // should not happen due to 'isGLReadDrawableAvailable()' query in GLContextImpl
+            throw new InternalError("Given readDrawable but no driver support");
+        }
+    } catch (RuntimeException re) {
+        if(DEBUG) {
+          System.err.println("Warning: X11GLXContext.glXMakeContextCurrent failed: "+re+", with "+
+            "dpy "+toHexString(dpy)+
+            ", write "+toHexString(writeDrawable)+
+            ", read "+toHexString(readDrawable)+
+            ", ctx "+toHexString(ctx));
+          re.printStackTrace();
+        }
+    }
+    return res;
+  }
+
+  protected void destroyContextARBImpl(long ctx) {
+    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    long display = config.getScreen().getDevice().getHandle();
+
+    glXMakeContextCurrent(display, 0, 0, 0);
+    GLX.glXDestroyContext(display, ctx);
+  }
+
+  protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+    updateGLXProcAddressTable();
+    GLXExt _glXExt = getGLXExt();
+    if(DEBUG) {
+      System.err.println("X11GLXContext.createContextARBImpl: "+getGLVersion(major, minor, ctp, "@creation") +
+                         ", handle "+toHexString(drawable.getHandle()) + ", share "+toHexString(share)+", direct "+direct+
+                         ", glXCreateContextAttribsARB: "+toHexString(glXExtProcAddressTable._addressof_glXCreateContextAttribsARB));
+      Thread.dumpStack();
+    }
+
+    boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
+    boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
+    boolean ctDebug     = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
+
+    long ctx=0;
+
+    final int idx_flags = 6;
+    final int idx_profile = 8;
+
+    int attribs[] = {
+        /*  0 */ GLX.GLX_CONTEXT_MAJOR_VERSION_ARB, major,
+        /*  2 */ GLX.GLX_CONTEXT_MINOR_VERSION_ARB, minor,
+        /*  4 */ GLX.GLX_RENDER_TYPE,               GLX.GLX_RGBA_TYPE, // default
+        /*  6 */ GLX.GLX_CONTEXT_FLAGS_ARB,         0,
+        /*  8 */ 0,                                 0,
+        /* 10 */ 0
+    };
+
+    if ( major > 3 || major == 3 && minor >= 2  ) {
+        // FIXME: Verify with a None drawable binding (default framebuffer)
+        attribs[idx_profile+0]  = GLX.GLX_CONTEXT_PROFILE_MASK_ARB;
+        if( ctBwdCompat ) {
+            attribs[idx_profile+1]  = GLX.GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
+        } else {
+            attribs[idx_profile+1]  = GLX.GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
+        } 
+    } 
+
+    if ( major >= 3 ) {
+        if( !ctBwdCompat && ctFwdCompat ) {
+            attribs[idx_flags+1] |= GLX.GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
+        }
+        if( ctDebug) {
+            attribs[idx_flags+1] |= GLX.GLX_CONTEXT_DEBUG_BIT_ARB;
+        }
+    }
+
+    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    AbstractGraphicsDevice device = config.getScreen().getDevice();
+    long display = device.getHandle();
+
+    try {
+        // critical path, a remote display might not support this command,
+        // hence we need to catch the X11 Error within this block.
+        X11Util.XSync(display, false);
+        ctx = _glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs, 0);
+        X11Util.XSync(display, false);
+    } catch (RuntimeException re) {
+        if(DEBUG) {
+          Throwable t = new Throwable("Info: X11GLXContext.createContextARBImpl glXCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
+          t.printStackTrace();
+        }
+    }
+    if(0!=ctx) {
+        if (!glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), ctx)) {
+            if(DEBUG) {
+              System.err.println("X11GLXContext.createContextARBImpl couldn't make current "+getGLVersion(major, minor, ctp, "@creation"));
+            }
+            // release & destroy
+            glXMakeContextCurrent(display, 0, 0, 0);
+            GLX.glXDestroyContext(display, ctx);
+            ctx = 0;
+        } else {
+            if (DEBUG) {
+                System.err.println(getThreadName() + ": createContextARBImpl: OK "+getGLVersion(major, minor, ctp, "@creation")+", share "+share+", direct "+direct);
+            }
+            // the following is issued by the caller 'GLContextImpl.createContextARB()'
+            // setGLFunctionAvailability(true, major, minor, ctp);
+        }
+    } else if (DEBUG) {
+        System.err.println(getThreadName() + ": createContextARBImpl: NO "+getGLVersion(major, minor, ctp, "@creation"));
+    }
+
+    return ctx;
+  }
+
+  protected boolean createImpl() {
+      // covers the whole context creation loop incl createContextARBImpl and destroyContextARBImpl
+      X11Util.setX11ErrorHandler(true, true);
+      try {
+          return createImplRaw();
+      } finally {
+          X11Util.setX11ErrorHandler(false, false);
+      }
+  }
+
+  private boolean createImplRaw() {
+    boolean direct = true; // try direct always
+    isDirect = false; // fall back
+
+    X11GLXDrawableFactory factory = (X11GLXDrawableFactory)drawable.getFactoryImpl();
+    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    AbstractGraphicsDevice device = config.getScreen().getDevice();
+    X11GLXContext sharedContext = (X11GLXContext) factory.getOrCreateSharedContextImpl(device);
+    long display = device.getHandle();
+
+    isGLReadDrawableAvailable(); // trigger setup glXVersionOneThreeCapable
+
+    X11GLXContext other = (X11GLXContext) GLContextShareSet.getShareContext(this);
+    long share = 0;
+    if (other != null) {
+      share = other.getHandle();
+      if (share == 0) {
+        throw new GLException("GLContextShareSet returned an invalid OpenGL context");
+      }
+      direct = GLX.glXIsDirect(display, share);
+    }
+
+    GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+    GLProfile glp = glCaps.getGLProfile();
+    isVendorATI = factory.isGLXVendorATI(device);
+
+    if(config.getFBConfigID()<0) {
+        // not able to use FBConfig
+        if(glp.isGL3()) {
+          throw new GLException("Unable to create OpenGL >= 3.1 context");
+        }
+        contextHandle = GLX.glXCreateContext(display, config.getXVisualInfo(), share, direct);
+        if (contextHandle == 0) {
+          throw new GLException("Unable to create context(0)");
+        }
+        if (!glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
+          throw new GLException("Error making temp context(0) current: display "+toHexString(display)+", context "+toHexString(contextHandle)+", drawable "+drawable);
+        }
+        setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); // use GL_VERSION
+        isDirect = GLX.glXIsDirect(display, contextHandle);
+        if (DEBUG) {
+            System.err.println(getThreadName() + ": createContextImpl: OK (old-1) share "+share+", direct "+isDirect+"/"+direct);
+        }
+        return true;
+    }
+
+    int minor[] = new int[1];
+    int major[] = new int[1];
+    int ctp[] = new int[1];
+    boolean createContextARBTried = false;
+
+    // utilize the shared context's GLXExt in case it was using the ARB method and it already exists
+    if(null!=sharedContext && sharedContext.isCreatedWithARBMethod()) {
+        contextHandle = createContextARB(share, direct, major, minor, ctp);
+        createContextARBTried = true;
+        if (DEBUG && 0!=contextHandle) {
+            System.err.println(getThreadName() + ": createContextImpl: OK (ARB, using sharedContext) share "+share);
+        }
+    }
+
+    long temp_ctx = 0;
+    if(0==contextHandle) {
+        // To use GLX_ARB_create_context, we have to make a temp context current,
+        // so we are able to use GetProcAddress
+        temp_ctx = GLX.glXCreateNewContext(display, config.getFBConfig(), GLX.GLX_RGBA_TYPE, share, direct);
+        if (temp_ctx == 0) {
+            throw new GLException("Unable to create temp OpenGL context(1)");
+        }
+        if (!glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), temp_ctx)) {
+          throw new GLException("Error making temp context(1) current: display "+toHexString(display)+", context "+toHexString(temp_ctx)+", drawable "+drawable);
+        }
+        setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); // use GL_VERSION
+        boolean isCreateContextAttribsARBAvailable = isFunctionAvailable("glXCreateContextAttribsARB");
+        glXMakeContextCurrent(display, 0, 0, 0); // release temp context
+
+        if( !createContextARBTried ) {
+            if ( isCreateContextAttribsARBAvailable &&
+                 isExtensionAvailable("GLX_ARB_create_context") ) {
+                // initial ARB context creation
+                contextHandle = createContextARB(share, direct, major, minor, ctp);
+                createContextARBTried=true;
+                if (DEBUG) {
+                    if(0!=contextHandle) {
+                        System.err.println(getThreadName() + ": createContextImpl: OK (ARB, initial) share "+share);                        
+                    } else {
+                        System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - creation failed - share "+share);
+                    }
+                }
+            } else if (DEBUG) {
+                System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - extension not available - share "+share);
+            }
+        }
+    }
+
+    if(0!=contextHandle) {
+        if(0!=temp_ctx) {
+            glXMakeContextCurrent(display, 0, 0, 0);
+            GLX.glXDestroyContext(display, temp_ctx);
+            if (!glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
+                throw new GLException("Cannot make previous verified context current");
+            }
+        }
+    } else {
+        if(glp.isGL3()) {
+          glXMakeContextCurrent(display, 0, 0, 0);
+          GLX.glXDestroyContext(display, temp_ctx);
+          throw new GLException("X11GLXContext.createContextImpl failed, but context > GL2 requested "+getGLVersion(major[0], minor[0], ctp[0], "@creation")+", ");
+        }
+        if(DEBUG) {
+          System.err.println("X11GLXContext.createContextImpl failed, fall back to !ARB context "+getGLVersion(major[0], minor[0], ctp[0], "@creation"));
+        }
+
+        // continue with temp context for GL <= 3.0
+        contextHandle = temp_ctx;
+        if (!glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
+          glXMakeContextCurrent(display, 0, 0, 0);
+          GLX.glXDestroyContext(display, temp_ctx);
+          throw new GLException("Error making context(1) current: display "+toHexString(display)+", context "+toHexString(contextHandle)+", drawable "+drawable);
+        }
+        if (DEBUG) {
+            System.err.println(getThreadName() + ": createContextImpl: OK (old-2) share "+share);
+        }
+    }
+    isDirect = GLX.glXIsDirect(display, contextHandle);
+    if (DEBUG) {
+        System.err.println(getThreadName() + ": createContextImpl: OK direct "+isDirect+"/"+direct);
+    }
+    return true;
+  }
+
+  protected void makeCurrentImpl(boolean newCreated) throws GLException {
+    long dpy = drawable.getNativeSurface().getDisplayHandle();
+
+    if (GLX.glXGetCurrentContext() != contextHandle) {
+        X11Util.setX11ErrorHandler(true, true);
+        try {
+            if (!glXMakeContextCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
+                throw new GLException("Error making context current: "+this);
+            }
+        } finally {
+            X11Util.setX11ErrorHandler(false, false);
+        }
+        if (DEBUG && newCreated) {
+            System.err.println(getThreadName() + ": glXMakeCurrent(display " + 
+                               toHexString(dpy)+
+                               ", drawable " + toHexString(drawable.getHandle()) +
+                               ", drawableRead " + toHexString(drawableRead.getHandle()) +
+                               ", context " + toHexString(contextHandle) + ") succeeded");
+        }
+    }
+  }
+
+  protected void releaseImpl() throws GLException {
+    long display = drawable.getNativeSurface().getDisplayHandle();
+    X11Util.setX11ErrorHandler(true, true);
+    try {
+        if (!glXMakeContextCurrent(display, 0, 0, 0)) {
+            throw new GLException("Error freeing OpenGL context");
+        }
+    } finally {
+        X11Util.setX11ErrorHandler(false, false);
+    }
+  }
+
+  protected void destroyImpl() throws GLException {
+    long display = drawable.getNativeSurface().getDisplayHandle();
+    if (DEBUG) {
+      System.err.println("glXDestroyContext(dpy " +
+                         toHexString(display)+
+                         ", ctx " +
+                         toHexString(contextHandle) + ")");
+    }
+    GLX.glXDestroyContext(display, contextHandle);
+    if (DEBUG) {
+      System.err.println("!!! Destroyed OpenGL context " + contextHandle);
+    }
+  }
+
+  protected void copyImpl(GLContext source, int mask) throws GLException {
+    long dst = getHandle();
+    long src = source.getHandle();
+    long display = drawable.getNativeSurface().getDisplayHandle();
+    if (0 == display) {
+      throw new GLException("Connection to X display not yet set up");
+    }
+    GLX.glXCopyContext(display, src, dst, mask);
+    // Should check for X errors and raise GLException
+  }
+
+  protected final void updateGLXProcAddressTable() {
+    AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice();
+    String key = adevice.getUniqueID();
+    if (DEBUG) {
+      System.err.println(getThreadName() + ": !!! Initializing GLX extension address table: "+key);
+    }
+    glXQueryExtensionsStringInitialized = false;
+    glXQueryExtensionsStringAvailable = false;
+
+    GLXExtProcAddressTable table = null;
+    synchronized(mappedContextTypeObjectLock) {
+        table = (GLXExtProcAddressTable) mappedGLXProcAddress.get( key );
+    }
+    if(null != table) {
+        glXExtProcAddressTable = table;
+        if(DEBUG) {
+            System.err.println(getThreadName() + ": !!! GLContext GLX ProcAddressTable reusing key("+key+") -> "+table.hashCode());
+        }
+    } else {
+        if (glXExtProcAddressTable == null) {
+          glXExtProcAddressTable = new GLXExtProcAddressTable(new GLProcAddressResolver());
+        }
+        resetProcAddressTable(getGLXExtProcAddressTable());
+        synchronized(mappedContextTypeObjectLock) {
+            mappedGLXProcAddress.put(key, getGLXExtProcAddressTable());
+            if(DEBUG) {
+                System.err.println(getThreadName() + ": !!! GLContext GLX ProcAddressTable mapping key("+key+") -> "+getGLXExtProcAddressTable().hashCode());
+                Thread.dumpStack();
+            }
+        }
+    }
+  }
+
+  public synchronized String getPlatformExtensionsString() {
+    if (!glXQueryExtensionsStringInitialized) {
+      glXQueryExtensionsStringAvailable =
+        getDrawableImpl().getGLDynamicLookupHelper().dynamicLookupFunction("glXQueryExtensionsString") != 0;
+      glXQueryExtensionsStringInitialized = true;
+    }
+    if (glXQueryExtensionsStringAvailable) {
+        NativeSurface ns = drawable.getNativeSurface();
+        String ret = GLX.glXQueryExtensionsString(ns.getDisplayHandle(), ns.getScreenIndex());
+        if (DEBUG) {
+          System.err.println("!!! GLX extensions: " + ret);
+        }
+        return ret;
+    } else {
+      return "";
+    }
+  }
+
+  public boolean isExtensionAvailable(String glExtensionName) {
+    if (glExtensionName.equals("GL_ARB_pbuffer") ||
+        glExtensionName.equals("GL_ARB_pixel_format")) {
+      return getGLDrawable().getFactory().canCreateGLPbuffer(
+          drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice() );
+    }
+    return super.isExtensionAvailable(glExtensionName);
+  }
+
+  protected void setSwapIntervalImpl(int interval) {
+    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+    if(!glCaps.isOnscreen()) return;
+
+    GLXExt glXExt = getGLXExt();
+    if(0==hasSwapIntervalSGI) {
+        try {
+            hasSwapIntervalSGI = glXExt.isExtensionAvailable("GLX_SGI_swap_control")?1:-1;
+        } catch (Throwable t) { hasSwapIntervalSGI=1; }
+    }
+    if (hasSwapIntervalSGI>0) {
+        try {
+            if( 0 == glXExt.glXSwapIntervalSGI(interval) ) {
+                currentSwapInterval = interval;
+            }
+        } catch (Throwable t) { hasSwapIntervalSGI=-1; }
+    }
+  }
+
+  public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+    return getGLXExt().glXAllocateMemoryNV(arg0, arg1, arg2, arg3);
+  }
+
+  public int getOffscreenContextPixelDataType() {
+    throw new GLException("Should not call this");
+  }
+
+  public int getOffscreenContextReadBuffer() {
+    throw new GLException("Should not call this");
+  }
+
+  public boolean offscreenImageNeedsVerticalFlip() {
+    throw new GLException("Should not call this");
+  }
+
+  public void bindPbufferToTexture() {
+    throw new GLException("Should not call this");
+  }
+
+  public void releasePbufferFromTexture() {
+    throw new GLException("Should not call this");
+  }
+
+  public String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.append(getClass().getName());
+    sb.append(" [");
+    super.append(sb);
+    sb.append(", direct ");
+    sb.append(isDirect);
+    sb.append("] ");
+    return sb.toString();
+  }
+
+  //----------------------------------------------------------------------
+  // Internals only below this point
+  //
+
+  private boolean isVendorATI = false;
+
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java
new file mode 100644
index 0000000..d2ce629
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import jogamp.opengl.*;
+
+public abstract class X11GLXDrawable extends GLDrawableImpl {
+  protected X11GLXDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+    super(factory, comp, realized);
+  }
+
+  public GLDynamicLookupHelper getGLDynamicLookupHelper() {
+    return getFactoryImpl().getGLDynamicLookupHelper(0);
+  }
+
+  protected void setRealizedImpl() {
+    if(realized) {
+        X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+        config.updateGraphicsConfiguration();
+
+        if (DEBUG) {
+          System.err.println("!!! X11GLXDrawable.setRealized(true): "+config);
+        }
+    }
+  }
+
+    protected void swapBuffersImpl() {
+        GLX.glXSwapBuffers(getNativeSurface().getDisplayHandle(), getHandle());
+    }
+
+  //---------------------------------------------------------------------------
+  // Internals only below this point
+  //
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
new file mode 100644
index 0000000..8203a44
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -0,0 +1,552 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.nio.*;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+import javax.media.opengl.*;
+
+import jogamp.opengl.*;
+import com.jogamp.common.JogampRuntimeException;
+import com.jogamp.common.util.*;
+import jogamp.nativewindow.WrappedSurface;
+import jogamp.nativewindow.x11.*;
+
+public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
+  
+  private static final DesktopGLDynamicLookupHelper x11GLXDynamicLookupHelper;
+  static final VersionNumber versionOneThree = new VersionNumber(1, 3, 0);
+
+  static {
+    DesktopGLDynamicLookupHelper tmp = null;
+    try {
+        tmp = new DesktopGLDynamicLookupHelper(new X11GLXDynamicLibraryBundleInfo());
+    } catch (GLException gle) {
+        if(DEBUG) {
+            gle.printStackTrace();
+        }
+    }
+    x11GLXDynamicLookupHelper = tmp;
+    if(null!=x11GLXDynamicLookupHelper) {
+        GLX.getGLXProcAddressTable().reset(x11GLXDynamicLookupHelper);
+    }
+  }
+
+  public static VersionNumber getGLXVersion(X11GraphicsDevice device) {
+    int[] major = new int[1];
+    int[] minor = new int[1];
+    GLXUtil.getGLXVersion(device.getHandle(), major, minor);
+    return new VersionNumber(major[0], minor[0], 0);
+  }
+
+  public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
+      return x11GLXDynamicLookupHelper;
+  }
+
+  public X11GLXDrawableFactory() {
+    super();
+    // Register our GraphicsConfigurationFactory implementations
+    // The act of constructing them causes them to be registered
+    new X11GLXGraphicsConfigurationFactory();
+    if(GLProfile.isAWTAvailable()) {
+        try {
+          ReflectionUtil.createInstance("jogamp.opengl.x11.glx.awt.X11AWTGLXGraphicsConfigurationFactory",
+                                        null, getClass().getClassLoader());
+        } catch (JogampRuntimeException jre) { /* n/a .. */ }
+    }
+
+    defaultDevice = new X11GraphicsDevice(X11Util.getNullDisplayName(), AbstractGraphicsDevice.DEFAULT_UNIT);
+
+    // Init shared resources off thread
+    // Will be released via ShutdownHook
+    sharedResourceImpl = new SharedResourceImplementation();
+    sharedResourceRunner = new SharedResourceRunner(sharedResourceImpl);
+    sharedResourceThread = new Thread(sharedResourceRunner, Thread.currentThread().getName()+"-SharedResourceRunner");
+    sharedResourceThread.setDaemon(true); // Allow JVM to exit, even if this one is running
+    sharedResourceThread.start();
+  }
+
+  X11GraphicsDevice defaultDevice;
+  SharedResourceImplementation sharedResourceImpl;
+  SharedResourceRunner sharedResourceRunner;
+  Thread sharedResourceThread;
+  HashMap/*<connection, SharedResource>*/ sharedMap = new HashMap();
+
+  static class SharedResource implements SharedResourceRunner.Resource {
+      X11GraphicsDevice device;
+      X11GraphicsScreen screen;
+      X11DummyGLXDrawable drawable;
+      X11GLXContext context;
+      String glXVendorName;
+      boolean isGLXVendorATI;
+      boolean isGLXVendorNVIDIA;
+      VersionNumber glXVersion;
+
+      SharedResource(X11GraphicsDevice dev, X11GraphicsScreen scrn,
+                     X11DummyGLXDrawable draw, X11GLXContext ctx,
+                     VersionNumber glXVer, String glXVendor) {
+          device = dev;
+          screen = scrn;
+          drawable = draw;
+          context = ctx;
+          glXVersion = glXVer;
+          glXVendorName = glXVendor;
+          isGLXVendorATI = GLXUtil.isVendorATI(glXVendorName);
+          isGLXVendorNVIDIA = GLXUtil.isVendorNVIDIA(glXVendorName);
+      }
+      final public AbstractGraphicsDevice getDevice() { return device; }
+      final public AbstractGraphicsScreen getScreen() { return screen; }
+      final public GLDrawableImpl getDrawable() { return drawable; }
+      final public GLContextImpl getContext() { return context; }
+
+      final String getGLXVendorName() { return glXVendorName; }
+      final boolean isGLXVendorATI() { return isGLXVendorATI; }
+      final boolean isGLXVendorNVIDIA() { return isGLXVendorNVIDIA; }
+      final VersionNumber getGLXVersion() { return glXVersion; }
+      final boolean isGLXVersionGreaterEqualOneThree() {
+        return ( null != glXVersion ) ? glXVersion.compareTo(versionOneThree) >= 0 : false ;
+      }
+  }
+
+  class SharedResourceImplementation implements SharedResourceRunner.Implementation {
+        public void clear() {
+            synchronized(sharedMap) {
+                sharedMap.clear();
+            }
+        }
+        public SharedResourceRunner.Resource mapPut(String connection, SharedResourceRunner.Resource resource) {
+            synchronized(sharedMap) {
+                return (SharedResourceRunner.Resource) sharedMap.put(connection, resource);
+            }
+        }
+        public SharedResourceRunner.Resource mapGet(String connection) {
+            synchronized(sharedMap) {
+                return (SharedResourceRunner.Resource) sharedMap.get(connection);
+            }
+        }
+        public Collection/*<Resource>*/ mapValues() {
+            synchronized(sharedMap) {
+                return sharedMap.values();
+            }
+        }
+
+        public SharedResourceRunner.Resource createSharedResource(String connection) {
+            X11GraphicsDevice sharedDevice = new X11GraphicsDevice(X11Util.createDisplay(connection), AbstractGraphicsDevice.DEFAULT_UNIT);
+            sharedDevice.setCloseDisplay(true);
+            sharedDevice.lock();
+            try {
+                String glXVendorName = GLXUtil.getVendorName(sharedDevice.getHandle());
+                X11GraphicsScreen sharedScreen = new X11GraphicsScreen(sharedDevice, 0);
+
+                if (null == sharedScreen) {
+                    throw new GLException("Couldn't create shared screen for device: "+sharedDevice+", idx 0");
+                }
+                GLProfile glp = GLProfile.getMinDesktop(sharedDevice);
+                if (null == glp) {
+                    throw new GLException("Couldn't get default GLProfile for device: "+sharedDevice);
+                }
+                X11DummyGLXDrawable sharedDrawable = X11DummyGLXDrawable.create(sharedScreen, X11GLXDrawableFactory.this, glp);
+                if (null == sharedDrawable) {
+                    throw new GLException("Couldn't create shared drawable for screen: "+sharedScreen+", "+glp);
+                }
+                X11GLXContext sharedContext = (X11GLXContext) sharedDrawable.createContext(null);
+                if (null == sharedContext) {
+                    throw new GLException("Couldn't create shared context for drawable: "+sharedDrawable);
+                }
+                sharedContext.setSynchronized(true);
+                VersionNumber glXVersion = getGLXVersion(sharedDevice);
+                boolean madeCurrent = false;
+                sharedContext.makeCurrent();
+                try {
+                    madeCurrent = sharedContext.isCurrent();
+                } finally {
+                    sharedContext.release();
+                }
+                if (DEBUG) {
+                    System.err.println("!!! SharedDevice:  " + sharedDevice);
+                    System.err.println("!!! SharedScreen:  " + sharedScreen);
+                    System.err.println("!!! SharedContext: " + sharedContext + ", madeCurrent " + madeCurrent);
+                    System.err.println("!!! GLX Vendor:    " + glXVendorName);
+                    System.err.println("!!! GLX Version:   " + glXVersion
+                            + " >= 1.3: " + (glXVersion.compareTo(versionOneThree) >= 0));
+                }
+                return new SharedResource(sharedDevice, sharedScreen, sharedDrawable, sharedContext, glXVersion, glXVendorName);
+            } catch (Throwable t) {
+                throw new GLException("WindowsWGLDrawableFactory - Could not initialize shared resources for "+connection, t);
+            } finally {
+                sharedDevice.unlock();
+            }
+        }
+
+        public void releaseSharedResource(SharedResourceRunner.Resource shared) {
+            SharedResource sr = (SharedResource) shared;
+            if (DEBUG) {
+                System.err.println("!!! Shutdown Shared:");
+                System.err.println("!!!   Device  : " + sr.device);
+                System.err.println("!!!   Screen  : " + sr.screen);
+                System.err.println("!!!   Drawable: " + sr.drawable);
+                System.err.println("!!!   CTX     : " + sr.context);
+            }
+
+            if (null != sr.context) {
+                // may cause JVM SIGSEGV: sharedContext.destroy();
+                sr.context = null;
+            }
+
+            if (null != sr.drawable) {
+                // may cause JVM SIGSEGV: sharedDrawable.destroy();
+                sr.drawable = null;
+            }
+
+            if (null != sr.screen) {
+                sr.screen = null;
+            }
+
+            if (null != sr.device) {
+                sr.device.close();
+                sr.device = null;
+            }
+        }
+  }
+
+  public final AbstractGraphicsDevice getDefaultDevice() {
+      return defaultDevice;
+  }
+
+  public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+      if(device instanceof X11GraphicsDevice) {
+          return true;
+      }
+      return false;
+  }
+
+  protected final GLContext getOrCreateSharedContextImpl(AbstractGraphicsDevice device) {
+    SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device);
+    if(null!=sr) {
+      return sr.getContext();
+    }
+    return null;
+  }
+
+  protected AbstractGraphicsDevice getOrCreateSharedDeviceImpl(AbstractGraphicsDevice device) {
+    SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device);
+    if(null!=sr) {
+        return sr.getDevice();
+    }
+    return null;
+  }
+
+  protected final long getOrCreateSharedDpy(AbstractGraphicsDevice device) {
+    SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device);
+    if(null!=sr) {
+        return sr.getDevice().getHandle();
+    }
+    return 0;
+  }
+
+  SharedResource getOrCreateSharedResource(AbstractGraphicsDevice device) {
+    return (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+  }
+
+  public final String getGLXVendorName(AbstractGraphicsDevice device) {
+    SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device);
+    if(null!=sr) {
+      return ((SharedResource)sr).getGLXVendorName();
+    }
+    return GLXUtil.getVendorName(device.getHandle());
+  }
+
+  public final boolean isGLXVendorATI(AbstractGraphicsDevice device) {
+    SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device);
+    if(null!=sr) {
+      return ((SharedResource)sr).isGLXVendorATI();
+    }
+    return GLXUtil.isVendorATI(device.getHandle());
+  }
+
+  public final boolean isGLXVendorNVIDIA(AbstractGraphicsDevice device) {
+    SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device);
+    if(null!=sr) {
+      return ((SharedResource)sr).isGLXVendorNVIDIA();
+    }
+    return GLXUtil.isVendorNVIDIA(device.getHandle());
+  }
+
+  protected final void shutdownInstance() {
+    sharedResourceRunner.releaseAndWait();
+
+    // Don't really close pending Display connections,
+    // since this may trigger a JVM exception
+    X11Util.shutdown( false, DEBUG );
+  }
+
+  protected List/*GLCapabilitiesImmutable*/ getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+    return X11GLXGraphicsConfigurationFactory.getAvailableCapabilities(this, device);
+  }
+
+  protected final GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+    if (target == null) {
+      throw new IllegalArgumentException("Null target");
+    }
+    return new X11OnscreenGLXDrawable(this, target);
+  }
+
+  protected final GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
+    if (target == null) {
+      throw new IllegalArgumentException("Null target");
+    }
+    AbstractGraphicsConfiguration config = target.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+    if(!caps.isPBuffer()) {
+        return new X11PixmapGLXDrawable(this, target);
+    }
+
+    // PBuffer GLDrawable Creation
+    GLDrawableImpl pbufferDrawable;
+    AbstractGraphicsDevice device = config.getScreen().getDevice();
+
+    /**
+     * Due to the ATI Bug https://bugzilla.mozilla.org/show_bug.cgi?id=486277,
+     * we need to have a context current on the same Display to create a PBuffer.
+     * The dummy context shall also use the same Display,
+     * since switching Display in this regard is another ATI bug.
+     */
+    SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+    if( null!=sr && sr.isGLXVendorATI() && null == GLContext.getCurrent() ) {
+        sr.getContext().makeCurrent();
+        try {
+            pbufferDrawable = new X11PbufferGLXDrawable(this, target);
+        } finally {
+            sr.getContext().release();
+        }
+    } else {
+        pbufferDrawable = new X11PbufferGLXDrawable(this, target);
+    }
+    return pbufferDrawable;
+  }
+
+  public final boolean isGLXVersionGreaterEqualOneThree(AbstractGraphicsDevice device) {
+    SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+    if(null!=sr) {
+      return sr.isGLXVersionGreaterEqualOneThree();
+    }
+    if( device instanceof X11GraphicsDevice ) {
+      VersionNumber v = getGLXVersion( (X11GraphicsDevice) device);
+      return ( null != v ) ? v.compareTo(versionOneThree) >= 0 : false ;
+    }
+    return false;
+  }
+
+  public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device) {
+      if(null == device) {
+        SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(defaultDevice);
+        if(null!=sr) {
+            device = sr.getDevice();
+        }
+      }
+      return isGLXVersionGreaterEqualOneThree(device);
+  }
+
+  protected final NativeSurface createOffscreenSurfaceImpl(AbstractGraphicsDevice device,
+                                                           GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
+                                                           GLCapabilitiesChooser chooser,
+                                                           int width, int height) {
+    X11GraphicsScreen screen = null;
+    SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(device);
+    if(null!=sr) {
+        screen = (X11GraphicsScreen) sr.getScreen();
+    }
+    if(null==screen) {
+        return null;
+    }
+
+    WrappedSurface ns = new WrappedSurface(
+               X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, screen) );
+    if(ns != null) {
+        ns.setSize(width, height);
+    }
+    return ns;
+  }
+
+  protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice adevice, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+    // FIXME device/windowHandle -> screen ?!
+    X11GraphicsDevice device = (X11GraphicsDevice) adevice;
+    X11GraphicsScreen screen = new X11GraphicsScreen(device, 0);
+    X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen);
+    WrappedSurface ns = new WrappedSurface(cfg, windowHandle);
+    return ns;
+  }
+ 
+  protected final GLContext createExternalGLContextImpl() {
+    return X11ExternalGLXContext.create(this, null);
+  }
+
+  public final boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+    return canCreateGLPbuffer(device);
+  }
+
+  protected final GLDrawable createExternalGLDrawableImpl() {
+    return X11ExternalGLXDrawable.create(this, null);
+  }
+
+  public final boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) {
+    return false;
+  }
+
+  public final GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+    throws GLException {
+    throw new GLException("Unimplemented on this platform");
+  }
+
+  //----------------------------------------------------------------------
+  // Gamma-related functionality
+  //
+
+  private boolean gotGammaRampLength;
+  private int gammaRampLength;
+  protected final synchronized int getGammaRampLength() {
+    if (gotGammaRampLength) {
+      return gammaRampLength;
+    }
+
+    long display = getOrCreateSharedDpy(defaultDevice);
+    if(0 == display) {
+        return 0;
+    }
+
+    int[] size = new int[1];
+    boolean res = X11Util.XF86VidModeGetGammaRampSize(display,
+                                                      X11Util.DefaultScreen(display),
+                                                      size, 0);
+    if (!res) {
+      return 0;
+    }
+    gotGammaRampLength = true;
+    gammaRampLength = size[0];
+    return gammaRampLength;
+  }
+
+  protected final boolean setGammaRamp(float[] ramp) {
+    long display = getOrCreateSharedDpy(defaultDevice);
+    if(0 == display) {
+        return false;
+    }
+
+    int len = ramp.length;
+    short[] rampData = new short[len];
+    for (int i = 0; i < len; i++) {
+      rampData[i] = (short) (ramp[i] * 65535);
+    }
+
+    boolean res = X11Util.XF86VidModeSetGammaRamp(display,
+                                              X11Util.DefaultScreen(display),
+                                              rampData.length,
+                                              rampData, 0,
+                                              rampData, 0,
+                                              rampData, 0);
+    return res;
+  }
+
+  protected final Buffer getGammaRamp() {
+    long display = getOrCreateSharedDpy(defaultDevice);
+    if(0 == display) {
+        return null;
+    }
+
+    int size = getGammaRampLength();
+    ShortBuffer rampData = ShortBuffer.wrap(new short[3 * size]);
+    rampData.position(0);
+    rampData.limit(size);
+    ShortBuffer redRampData = rampData.slice();
+    rampData.position(size);
+    rampData.limit(2 * size);
+    ShortBuffer greenRampData = rampData.slice();
+    rampData.position(2 * size);
+    rampData.limit(3 * size);
+    ShortBuffer blueRampData = rampData.slice();
+
+    boolean res = X11Util.XF86VidModeGetGammaRamp(display,
+                                              X11Util.DefaultScreen(display),
+                                              size,
+                                              redRampData,
+                                              greenRampData,
+                                              blueRampData);
+    if (!res) {
+      return null;
+    }
+    return rampData;
+  }
+
+  protected final void resetGammaRamp(Buffer originalGammaRamp) {
+    if (originalGammaRamp == null) {
+        return; // getGammaRamp failed originally
+    }
+    long display = getOrCreateSharedDpy(defaultDevice);
+    if(0 == display) {
+        return;
+    }
+
+    ShortBuffer rampData = (ShortBuffer) originalGammaRamp;
+    int capacity = rampData.capacity();
+    if ((capacity % 3) != 0) {
+      throw new IllegalArgumentException("Must not be the original gamma ramp");
+    }
+    int size = capacity / 3;
+    rampData.position(0);
+    rampData.limit(size);
+    ShortBuffer redRampData = rampData.slice();
+    rampData.position(size);
+    rampData.limit(2 * size);
+    ShortBuffer greenRampData = rampData.slice();
+    rampData.position(2 * size);
+    rampData.limit(3 * size);
+    ShortBuffer blueRampData = rampData.slice();
+
+    X11Util.XF86VidModeSetGammaRamp(display,
+                                X11Util.DefaultScreen(display),
+                                size,
+                                redRampData,
+                                greenRampData,
+                                blueRampData);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
new file mode 100644
index 0000000..51b6144
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
@@ -0,0 +1,84 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.opengl.x11.glx;
+
+import jogamp.opengl.*;
+import java.util.*;
+
+public class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo  {
+    protected X11GLXDynamicLibraryBundleInfo() {
+        super();
+    }
+
+    public List getToolLibNames() {
+        List/*<List>*/ libNamesList = new ArrayList();
+
+        List/*<String>*/ glesLibNames = new ArrayList();
+
+        // Be aware that on DRI systems, eg ATI fglrx, etc, 
+        // you have to set LIBGL_DRIVERS_PATH env variable.
+        // Eg on Ubuntu 64bit systems this is:
+        //    export LIBGL_DRIVERS_PATH=/usr/lib/fglrx/dri:/usr/lib32/fglrx/dri
+        //
+
+        // this is the default GL lib name, according to the spec
+        glesLibNames.add("libGL.so.1");
+
+        // try this one as well, if spec fails
+        glesLibNames.add("libGL.so");
+
+        // last but not least .. the generic one
+        glesLibNames.add("GL");
+
+        libNamesList.add(glesLibNames);
+
+        return libNamesList;
+    }
+
+    /** 
+     * This respects old DRI requirements:<br>
+     * <pre>
+     * http://dri.sourceforge.net/doc/DRIuserguide.html
+     * </pre>
+     */
+    public boolean shallLinkGlobal() { return true; }
+
+    public final List getToolGetProcAddressFuncNameList() {
+        List res = new ArrayList();
+        res.add("glXGetProcAddressARB");
+        res.add("glXGetProcAddress");
+        return res;
+    }
+
+    public final long toolDynamicLookupFunction(long toolGetProcAddressHandle, String funcName) {
+        return GLX.glXGetProcAddress(toolGetProcAddressHandle, funcName);
+    }
+}
+
+
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
new file mode 100644
index 0000000..c3d4563
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
@@ -0,0 +1,447 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import java.util.ArrayList;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+import javax.media.opengl.*;
+
+import com.jogamp.common.nio.PointerBuffer;
+import jogamp.opengl.*;
+import jogamp.nativewindow.x11.*;
+
+public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implements Cloneable {
+    protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
+    
+    public static final int MAX_ATTRIBS = 128;
+    private GLCapabilitiesChooser chooser; 
+
+    X11GLXGraphicsConfiguration(X11GraphicsScreen screen, 
+                                X11GLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+        super(screen, capsChosen, capsRequested, capsChosen.getXVisualInfo());
+        this.chooser=chooser;
+    }
+
+    static X11GLXGraphicsConfiguration create(GLProfile glp, X11GraphicsScreen x11Screen, int fbcfgID) {
+      long display = x11Screen.getDevice().getHandle();
+      if(0==display) {
+          throw new GLException("Display null of "+x11Screen);
+      }
+      int screen = x11Screen.getIndex();
+      long fbcfg = glXFBConfigID2FBConfig(display, screen, fbcfgID);
+      if(0==fbcfg) {
+          throw new GLException("FBConfig null of "+toHexString(fbcfgID));
+      }
+      if(null==glp) {
+        glp = GLProfile.getDefault(x11Screen.getDevice());
+      }
+      X11GLCapabilities caps = GLXFBConfig2GLCapabilities(glp, display, fbcfg, true, true, true, GLXUtil.isMultisampleAvailable(display));
+      if(null==caps) {
+          throw new GLException("GLCapabilities null of "+toHexString(fbcfg));
+      }
+      return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser());
+    }
+
+    public Object clone() {
+        return super.clone();
+    }
+
+    public final long getFBConfig()   {
+        return ((X11GLCapabilities)capabilitiesChosen).getFBConfig();
+    }
+    public final int  getFBConfigID() {
+        return ((X11GLCapabilities)capabilitiesChosen).getFBConfigID();
+    }
+
+    void updateGraphicsConfiguration() {
+        X11GLXGraphicsConfiguration newConfig = (X11GLXGraphicsConfiguration)
+            GraphicsConfigurationFactory.getFactory(getScreen().getDevice()).chooseGraphicsConfiguration(
+                getChosenCapabilities(), getRequestedCapabilities(), chooser, getScreen());
+        if(null!=newConfig) {
+            // FIXME: setScreen( ... );
+            setXVisualInfo(newConfig.getXVisualInfo());
+            setChosenCapabilities(newConfig.getChosenCapabilities());
+            if(DEBUG) {
+                System.err.println("!!! updateGraphicsConfiguration: "+this);
+            }
+        }
+    }
+
+    private static int nonZeroOrDontCare(int value) {
+        return value != 0 ? value : (int)GLX.GLX_DONT_CARE ;
+    }
+
+    static int[] GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
+                                           boolean forFBAttr,
+                                           boolean isMultisampleAvailable,
+                                           long display,
+                                           int screen) 
+    {
+        int colorDepth = (caps.getRedBits() +
+                          caps.getGreenBits() +
+                          caps.getBlueBits());
+        if (colorDepth < 15) {
+          throw new GLException("Bit depths < 15 (i.e., non-true-color) not supported");
+        }
+        int[] res = new int[MAX_ATTRIBS];
+        int idx = 0;
+
+        if (forFBAttr) {
+          res[idx++] = GLX.GLX_DRAWABLE_TYPE;
+          res[idx++] = caps.isOnscreen() ? ( GLX.GLX_WINDOW_BIT ) : ( caps.isPBuffer() ? GLX.GLX_PBUFFER_BIT : GLX.GLX_PIXMAP_BIT ) ;
+        }
+
+        if (forFBAttr) {
+          res[idx++] = GLX.GLX_RENDER_TYPE;
+          res[idx++] = GLX.GLX_RGBA_BIT;
+        } else {
+          res[idx++] = GLX.GLX_RGBA;
+        }
+
+        // FIXME: Still a bug is Mesa: PBUFFER && GLX_STEREO==GL_FALSE ?
+        if (forFBAttr) {
+            res[idx++] = GLX.GLX_DOUBLEBUFFER;
+            res[idx++] = caps.getDoubleBuffered()?GL.GL_TRUE:GL.GL_FALSE;
+            res[idx++] = GLX.GLX_STEREO;
+            res[idx++] = caps.getStereo()?GL.GL_TRUE:GL.GL_FALSE;
+            res[idx++] = GLX.GLX_TRANSPARENT_TYPE;
+            res[idx++] = caps.isBackgroundOpaque()?GLX.GLX_NONE:GLX.GLX_TRANSPARENT_RGB;
+            if(!caps.isBackgroundOpaque()) {
+                res[idx++] = GLX.GLX_TRANSPARENT_RED_VALUE;
+                res[idx++] = caps.getTransparentRedValue()>=0?caps.getTransparentRedValue():(int)GLX.GLX_DONT_CARE;
+                res[idx++] = GLX.GLX_TRANSPARENT_GREEN_VALUE;
+                res[idx++] = caps.getTransparentGreenValue()>=0?caps.getTransparentGreenValue():(int)GLX.GLX_DONT_CARE;
+                res[idx++] = GLX.GLX_TRANSPARENT_BLUE_VALUE;
+                res[idx++] = caps.getTransparentBlueValue()>=0?caps.getTransparentBlueValue():(int)GLX.GLX_DONT_CARE;
+                res[idx++] = GLX.GLX_TRANSPARENT_ALPHA_VALUE;
+                res[idx++] = caps.getTransparentAlphaValue()>=0?caps.getTransparentAlphaValue():(int)GLX.GLX_DONT_CARE;
+            }
+        } else {
+            if (caps.getDoubleBuffered()) {
+              res[idx++] = GLX.GLX_DOUBLEBUFFER;
+            }
+            if (caps.getStereo()) {
+              res[idx++] = GLX.GLX_STEREO;
+            }
+        }
+
+        res[idx++] = GLX.GLX_RED_SIZE;
+        res[idx++] = caps.getRedBits();
+        res[idx++] = GLX.GLX_GREEN_SIZE;
+        res[idx++] = caps.getGreenBits();
+        res[idx++] = GLX.GLX_BLUE_SIZE;
+        res[idx++] = caps.getBlueBits();
+        res[idx++] = GLX.GLX_ALPHA_SIZE;
+        res[idx++] = caps.getAlphaBits();
+        res[idx++] = GLX.GLX_DEPTH_SIZE;
+        res[idx++] = caps.getDepthBits();
+        if (caps.getStencilBits() > 0) {
+          res[idx++] = GLX.GLX_STENCIL_SIZE;
+          res[idx++] = caps.getStencilBits();
+        }
+        if (caps.getAccumRedBits()   > 0 ||
+            caps.getAccumGreenBits() > 0 ||
+            caps.getAccumBlueBits()  > 0 ||
+            caps.getAccumAlphaBits() > 0) {
+          res[idx++] = GLX.GLX_ACCUM_RED_SIZE;
+          res[idx++] = caps.getAccumRedBits();
+          res[idx++] = GLX.GLX_ACCUM_GREEN_SIZE;
+          res[idx++] = caps.getAccumGreenBits();
+          res[idx++] = GLX.GLX_ACCUM_BLUE_SIZE;
+          res[idx++] = caps.getAccumBlueBits();
+          res[idx++] = GLX.GLX_ACCUM_ALPHA_SIZE;
+          res[idx++] = caps.getAccumAlphaBits();
+        }
+        if (isMultisampleAvailable && caps.getSampleBuffers()) {
+          res[idx++] = GLX.GLX_SAMPLE_BUFFERS;
+          res[idx++] = GL.GL_TRUE;
+          res[idx++] = GLX.GLX_SAMPLES;
+          res[idx++] = caps.getNumSamples();
+        }
+        if (caps.isPBuffer()) {
+          if (caps.getPbufferFloatingPointBuffers()) {
+            String glXExtensions = GLX.glXQueryExtensionsString(display, screen);
+            if (glXExtensions == null ||
+                glXExtensions.indexOf("GLX_NV_float_buffer") < 0) {
+              throw new GLException("Floating-point pbuffers on X11 currently require NVidia hardware: "+glXExtensions);
+            }
+            res[idx++] = GLXExt.GLX_FLOAT_COMPONENTS_NV;
+            res[idx++] = GL.GL_TRUE;
+          }
+        }
+        res[idx++] = 0;
+        return res;
+  }
+
+  // FBConfig
+
+  static boolean GLXFBConfigValid(long display, long fbcfg) {
+    int[] tmp = new int[1];
+    if(GLX.GLX_BAD_ATTRIBUTE == GLX.glXGetFBConfigAttrib(display, fbcfg, GLX.GLX_RENDER_TYPE, tmp, 0)) {
+      return false;
+    }
+    return true;
+  }
+
+  static int FBCfgDrawableTypeBits(final long display, final long fbcfg) {
+    int val = 0;
+
+    int[] tmp = new int[1];
+    int fbtype = glXGetFBConfig(display, fbcfg, GLX.GLX_DRAWABLE_TYPE, tmp, 0);
+
+    if ( 0 != ( fbtype & GLX.GLX_WINDOW_BIT ) ) {
+        val |= GLGraphicsConfigurationUtil.WINDOW_BIT;
+    }
+    if ( 0 != ( fbtype & GLX.GLX_PIXMAP_BIT ) ) {
+        val |= GLGraphicsConfigurationUtil.BITMAP_BIT;
+    }
+    if ( 0 != ( fbtype & GLX.GLX_PBUFFER_BIT ) ) {
+        val |= GLGraphicsConfigurationUtil.PBUFFER_BIT;
+    }
+    return val;
+  }
+
+  static X11GLCapabilities GLXFBConfig2GLCapabilities(GLProfile glp, long display, long fbcfg,
+                                                            boolean relaxed, boolean onscreen, boolean usePBuffer,
+                                                            boolean isMultisampleAvailable) {
+    ArrayList bucket = new ArrayList();
+    final int winattrmask = GLGraphicsConfigurationUtil.getWinAttributeBits(onscreen, usePBuffer);
+    if( GLXFBConfig2GLCapabilities(bucket, glp, display, fbcfg, winattrmask, isMultisampleAvailable) ) {
+        return (X11GLCapabilities) bucket.get(0);
+    } else if ( relaxed && GLXFBConfig2GLCapabilities(bucket, glp, display, fbcfg, GLGraphicsConfigurationUtil.ALL_BITS, isMultisampleAvailable) ) {
+        return (X11GLCapabilities) bucket.get(0);
+    }
+    return null;
+  }
+
+  static boolean GLXFBConfig2GLCapabilities(ArrayList capsBucket,
+                                            GLProfile glp, long display, long fbcfg,
+                                            int winattrmask, boolean isMultisampleAvailable) {
+    final int allDrawableTypeBits = FBCfgDrawableTypeBits(display, fbcfg);
+    int drawableTypeBits = winattrmask & allDrawableTypeBits;
+
+    int fbcfgid = X11GLXGraphicsConfiguration.glXFBConfig2FBConfigID(display, fbcfg);
+    XVisualInfo visualInfo = GLX.glXGetVisualFromFBConfig(display, fbcfg);
+    if(null == visualInfo) {
+        if(DEBUG) {
+            System.err.println("X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities: Null XVisualInfo for FBConfigID 0x" + Integer.toHexString(fbcfgid));
+        }
+        // onscreen must have an XVisualInfo
+        drawableTypeBits = drawableTypeBits & ~GLGraphicsConfigurationUtil.WINDOW_BIT;
+    }
+
+    if( 0 == drawableTypeBits ) {
+        return false;
+    }
+
+    int[] tmp = new int[1];
+    if(GLX.GLX_BAD_ATTRIBUTE == GLX.glXGetFBConfigAttrib(display, fbcfg, GLX.GLX_RENDER_TYPE, tmp, 0)) {
+      return false;
+    }
+
+    GLCapabilities res = new X11GLCapabilities(visualInfo, fbcfg, fbcfgid, glp);
+    res.setDoubleBuffered(glXGetFBConfig(display, fbcfg, GLX.GLX_DOUBLEBUFFER,     tmp, 0) != 0);
+    res.setStereo        (glXGetFBConfig(display, fbcfg, GLX.GLX_STEREO,           tmp, 0) != 0);
+    res.setHardwareAccelerated(glXGetFBConfig(display, fbcfg, GLX.GLX_CONFIG_CAVEAT, tmp, 0) != GLX.GLX_SLOW_CONFIG);
+    res.setDepthBits     (glXGetFBConfig(display, fbcfg, GLX.GLX_DEPTH_SIZE,       tmp, 0));
+    res.setStencilBits   (glXGetFBConfig(display, fbcfg, GLX.GLX_STENCIL_SIZE,     tmp, 0));
+    res.setRedBits       (glXGetFBConfig(display, fbcfg, GLX.GLX_RED_SIZE,         tmp, 0));
+    res.setGreenBits     (glXGetFBConfig(display, fbcfg, GLX.GLX_GREEN_SIZE,       tmp, 0));
+    res.setBlueBits      (glXGetFBConfig(display, fbcfg, GLX.GLX_BLUE_SIZE,        tmp, 0));
+    res.setAlphaBits     (glXGetFBConfig(display, fbcfg, GLX.GLX_ALPHA_SIZE,       tmp, 0));
+    res.setAccumRedBits  (glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_RED_SIZE,   tmp, 0));
+    res.setAccumGreenBits(glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_GREEN_SIZE, tmp, 0));
+    res.setAccumBlueBits (glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_BLUE_SIZE,  tmp, 0));
+    res.setAccumAlphaBits(glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_ALPHA_SIZE, tmp, 0));
+    if (isMultisampleAvailable) {
+      res.setSampleBuffers(glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLE_BUFFERS, tmp, 0) != 0);
+      res.setNumSamples   (glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLES,        tmp, 0));
+    }
+    res.setBackgroundOpaque(glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_TYPE, tmp, 0) == GLX.GLX_NONE);
+    if(!res.isBackgroundOpaque()) {
+        glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_RED_VALUE,  tmp, 0);
+        res.setTransparentRedValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
+
+        glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_GREEN_VALUE,  tmp, 0);
+        res.setTransparentGreenValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
+
+        glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_BLUE_VALUE,  tmp, 0);
+        res.setTransparentBlueValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
+
+        glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_ALPHA_VALUE,  tmp, 0);
+        res.setTransparentAlphaValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
+    }
+    try { 
+        res.setPbufferFloatingPointBuffers(glXGetFBConfig(display, fbcfg, GLXExt.GLX_FLOAT_COMPONENTS_NV, tmp, 0) != GL.GL_FALSE);
+    } catch (Exception e) {}
+
+    return GLGraphicsConfigurationUtil.addGLCapabilitiesPermutations(capsBucket, res, drawableTypeBits );
+  }
+
+  private static String glXGetFBConfigErrorCode(int err) {
+    switch (err) {
+      case GLX.GLX_NO_EXTENSION:  return "GLX_NO_EXTENSION";
+      case GLX.GLX_BAD_ATTRIBUTE: return "GLX_BAD_ATTRIBUTE";
+      default:                return "Unknown error code " + err;
+    }
+  }
+
+  static int glXGetFBConfig(long display, long cfg, int attrib, int[] tmp, int tmp_offset) {
+    if (display == 0) {
+      throw new GLException("No display connection");
+    }
+    int res = GLX.glXGetFBConfigAttrib(display, cfg, attrib, tmp, tmp_offset);
+    if (res != 0) {
+      throw new GLException("glXGetFBConfig("+toHexString(attrib)+") failed: error code " + glXGetFBConfigErrorCode(res));
+    }
+    return tmp[tmp_offset];
+  }
+
+  static int glXFBConfig2FBConfigID(long display, long cfg) {
+      int[] tmpID = new int[1];
+      return glXGetFBConfig(display, cfg, GLX.GLX_FBCONFIG_ID, tmpID, 0);
+  }
+
+  static long glXFBConfigID2FBConfig(long display, int screen, int id) {
+      int[] attribs = new int[] { GLX.GLX_FBCONFIG_ID, id, 0 };
+      int[] count = { -1 };
+      PointerBuffer fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, 0, count, 0);
+      if (fbcfgsL == null || fbcfgsL.limit()<1) {
+          return 0;
+      }
+      return fbcfgsL.get(0);
+  }
+
+  // Visual Info
+
+  static XVisualInfo XVisualID2XVisualInfo(long display, long visualID) {
+      int[] count = new int[1];
+      XVisualInfo template = XVisualInfo.create();
+      template.setVisualid(visualID);
+      XVisualInfo[] infos = X11Util.XGetVisualInfo(display, X11Lib.VisualIDMask, template, count, 0);
+      if (infos == null || infos.length == 0) {
+            return null;
+      }  
+      XVisualInfo res = XVisualInfo.create(infos[0]);
+      if (DEBUG) {
+        System.err.println("!!! Fetched XVisualInfo for visual ID " + toHexString(visualID));
+        System.err.println("!!! Resulting XVisualInfo: visualid = " + toHexString(res.getVisualid()));
+      }
+      return res;
+  }
+
+  static boolean XVisualInfo2GLCapabilities(ArrayList capsBucket,
+                                            GLProfile glp, long display, XVisualInfo info,
+                                            final int winattrmask, boolean isMultisampleEnabled) {
+    final int allDrawableTypeBits = GLGraphicsConfigurationUtil.WINDOW_BIT | GLGraphicsConfigurationUtil.BITMAP_BIT ;
+    final int drawableTypeBits = winattrmask & allDrawableTypeBits;
+
+    if( 0 == drawableTypeBits ) {
+        return false;
+    }
+
+    int[] tmp = new int[1];
+    int val = glXGetConfig(display, info, GLX.GLX_USE_GL, tmp, 0);
+    if (val == 0) {
+      if(DEBUG) {
+        System.err.println("Visual ("+toHexString(info.getVisualid())+") does not support OpenGL");
+      }
+      return false;
+    }
+    val = glXGetConfig(display, info, GLX.GLX_RGBA, tmp, 0);
+    if (val == 0) {
+      if(DEBUG) {
+        System.err.println("Visual ("+toHexString(info.getVisualid())+") does not support RGBA");
+      }
+      return false;
+    }
+
+    GLCapabilities res = new X11GLCapabilities(info, glp);
+
+    res.setDoubleBuffered(glXGetConfig(display, info, GLX.GLX_DOUBLEBUFFER,     tmp, 0) != 0);
+    res.setStereo        (glXGetConfig(display, info, GLX.GLX_STEREO,           tmp, 0) != 0);
+    // Note: use of hardware acceleration is determined by
+    // glXCreateContext, not by the XVisualInfo. Optimistically claim
+    // that all GLCapabilities have the capability to be hardware
+    // accelerated.
+    res.setHardwareAccelerated(true);
+    res.setDepthBits     (glXGetConfig(display, info, GLX.GLX_DEPTH_SIZE,       tmp, 0));
+    res.setStencilBits   (glXGetConfig(display, info, GLX.GLX_STENCIL_SIZE,     tmp, 0));
+    res.setRedBits       (glXGetConfig(display, info, GLX.GLX_RED_SIZE,         tmp, 0));
+    res.setGreenBits     (glXGetConfig(display, info, GLX.GLX_GREEN_SIZE,       tmp, 0));
+    res.setBlueBits      (glXGetConfig(display, info, GLX.GLX_BLUE_SIZE,        tmp, 0));
+    res.setAlphaBits     (glXGetConfig(display, info, GLX.GLX_ALPHA_SIZE,       tmp, 0));
+    res.setAccumRedBits  (glXGetConfig(display, info, GLX.GLX_ACCUM_RED_SIZE,   tmp, 0));
+    res.setAccumGreenBits(glXGetConfig(display, info, GLX.GLX_ACCUM_GREEN_SIZE, tmp, 0));
+    res.setAccumBlueBits (glXGetConfig(display, info, GLX.GLX_ACCUM_BLUE_SIZE,  tmp, 0));
+    res.setAccumAlphaBits(glXGetConfig(display, info, GLX.GLX_ACCUM_ALPHA_SIZE, tmp, 0));
+    if (isMultisampleEnabled) {
+      res.setSampleBuffers(glXGetConfig(display, info, GLX.GLX_SAMPLE_BUFFERS, tmp, 0) != 0);
+      res.setNumSamples   (glXGetConfig(display, info, GLX.GLX_SAMPLES,        tmp, 0));
+    }
+
+    return GLGraphicsConfigurationUtil.addGLCapabilitiesPermutations(capsBucket, res, drawableTypeBits);
+  }
+
+  private static String glXGetConfigErrorCode(int err) {
+    switch (err) {
+      case GLX.GLX_NO_EXTENSION:  return "GLX_NO_EXTENSION";
+      case GLX.GLX_BAD_SCREEN:    return "GLX_BAD_SCREEN";
+      case GLX.GLX_BAD_ATTRIBUTE: return "GLX_BAD_ATTRIBUTE";
+      case GLX.GLX_BAD_VISUAL:    return "GLX_BAD_VISUAL";
+      default:                return "Unknown error code " + err;
+    }
+  }
+
+  static int glXGetConfig(long display, XVisualInfo info, int attrib, int[] tmp, int tmp_offset) {
+    if (display == 0) {
+      throw new GLException("No display connection");
+    }
+    int res = GLX.glXGetConfig(display, info, attrib, tmp, tmp_offset);
+    if (res != 0) {
+      throw new GLException("glXGetConfig("+toHexString(attrib)+") failed: error code " + glXGetConfigErrorCode(res));
+    }
+    return tmp[tmp_offset];
+  }
+
+  public String toString() {
+    return "X11GLXGraphicsConfiguration["+getScreen()+", visualID " + toHexString(getVisualID()) + ", fbConfigID " + toHexString(getFBConfigID()) +
+                                        ",\n\trequested " + getRequestedCapabilities()+
+                                        ",\n\tchosen    " + getChosenCapabilities()+
+                                        "]";
+  }
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
new file mode 100644
index 0000000..319a52c
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
@@ -0,0 +1,378 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.CapabilitiesChooser;
+import javax.media.nativewindow.CapabilitiesImmutable;
+import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.nativewindow.x11.X11GraphicsScreen;
+import javax.media.nativewindow.x11.X11GraphicsDevice;
+import javax.media.opengl.DefaultGLCapabilitiesChooser;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.common.nio.PointerBuffer;
+import jogamp.nativewindow.x11.X11Lib;
+import jogamp.nativewindow.x11.X11Util;
+import jogamp.nativewindow.x11.XVisualInfo;
+import jogamp.opengl.Debug;
+import jogamp.opengl.GLGraphicsConfigurationFactory;
+import jogamp.opengl.GLGraphicsConfigurationUtil;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+
+/** Subclass of GraphicsConfigurationFactory used when non-AWT toolkits
+    are used on X11 platforms. Toolkits will likely need to delegate
+    to this one to change the accepted and returned types of the
+    GraphicsDevice and GraphicsConfiguration abstractions. */
+
+public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationFactory {
+    protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
+    static X11GLCapabilities.XVisualIDComparator XVisualIDComparator = new X11GLCapabilities.XVisualIDComparator();
+
+    X11GLXGraphicsConfigurationFactory() {
+        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.x11.X11GraphicsDevice.class, this);
+    }
+
+    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
+            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
+        if (!(absScreen instanceof X11GraphicsScreen)) {
+            throw new IllegalArgumentException("Only X11GraphicsScreen are allowed here");
+        }
+
+        if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - chosen");
+        }
+
+        if ( !(capsRequested instanceof GLCapabilitiesImmutable)) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - requested");
+        }
+
+        if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
+            throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
+        }
+        return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested,
+                                                 (GLCapabilitiesChooser)chooser, (X11GraphicsScreen)absScreen);
+    }
+
+    protected static List/*<X11GLCapabilities>*/ getAvailableCapabilities(X11GLXDrawableFactory factory, AbstractGraphicsDevice device) {
+        X11GLXDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResource(device);
+        if(null == sharedResource) {
+            throw new GLException("Shared resource for device n/a: "+device);
+        }
+        X11GraphicsScreen sharedScreen = (X11GraphicsScreen) sharedResource.getScreen();
+        X11GLXDrawable sharedDrawable = (X11GLXDrawable) sharedResource.getDrawable();
+        GLCapabilitiesImmutable capsChosen = sharedDrawable.getChosenGLCapabilities();
+        GLProfile glp = capsChosen.getGLProfile();
+
+        List/*GLCapabilitiesImmutable*/ availableCaps = null;
+
+        if( sharedResource.isGLXVersionGreaterEqualOneThree() ) {
+            availableCaps = getAvailableGLCapabilitiesFBConfig(sharedScreen, glp);
+        }
+        if( null == availableCaps || 0 == availableCaps.size() ) {
+            availableCaps = getAvailableGLCapabilitiesXVisual(sharedScreen, glp);
+        }
+        if( null != availableCaps ) {
+            Collections.sort(availableCaps, XVisualIDComparator);
+        }
+        return availableCaps;
+    }
+
+    static List/*<X11GLCapabilities>*/ getAvailableGLCapabilitiesFBConfig(X11GraphicsScreen x11Screen, GLProfile glProfile) {
+        PointerBuffer fbcfgsL = null;
+
+        // Utilizing FBConfig
+        //
+        AbstractGraphicsDevice absDevice = x11Screen.getDevice();
+        long display = absDevice.getHandle();
+
+        int screen = x11Screen.getIndex();
+        boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display);
+        int[] count = { -1 };
+        ArrayList availableCaps = new ArrayList();
+
+        fbcfgsL = GLX.glXChooseFBConfig(display, screen, null, 0, count, 0);
+        if (fbcfgsL == null || fbcfgsL.limit()<=0) {
+            if(DEBUG) {
+                System.err.println("X11GLXGraphicsConfiguration.getAvailableGLCapabilitiesFBConfig: Failed glXChooseFBConfig ("+x11Screen+"): "+fbcfgsL+", "+count[0]);
+            }
+            return null;
+        }
+        for (int i = 0; i < fbcfgsL.limit(); i++) {
+            if( !X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(availableCaps, glProfile, display, fbcfgsL.get(i), GLGraphicsConfigurationUtil.ALL_BITS, isMultisampleAvailable) ) {
+                if(DEBUG) {
+                    System.err.println("X11GLXGraphicsConfiguration.getAvailableGLCapabilitiesFBConfig: FBConfig invalid (2): ("+x11Screen+"): fbcfg: "+toHexString(fbcfgsL.get(i)));
+                }
+            }
+        }
+        return availableCaps;
+    }
+
+    static List/*<X11GLCapabilities>*/ getAvailableGLCapabilitiesXVisual(X11GraphicsScreen x11Screen, GLProfile glProfile) {
+        AbstractGraphicsDevice absDevice = x11Screen.getDevice();
+        long display = absDevice.getHandle();
+
+        int screen = x11Screen.getIndex();
+        boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display);
+
+        int[] count = new int[1];
+        XVisualInfo template = XVisualInfo.create();
+        template.setScreen(screen);
+        XVisualInfo[] infos = X11Util.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
+        if (infos == null || infos.length<1) {
+            throw new GLException("Error while enumerating available XVisualInfos");
+        }
+        ArrayList availableCaps = new ArrayList();
+        for (int i = 0; i < infos.length; i++) {
+            if( !X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(availableCaps, glProfile, display, infos[i], GLGraphicsConfigurationUtil.ALL_BITS, isMultisampleAvailable) ) {
+                if(DEBUG) {
+                    System.err.println("X11GLXGraphicsConfiguration.getAvailableGLCapabilitiesXVisual: XVisual invalid: ("+x11Screen+"): fbcfg: "+toHexString(infos[i].getVisualid()));
+                }
+            }
+        }
+        return availableCaps;
+    }
+
+
+    static X11GLXGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
+                                                                         GLCapabilitiesImmutable capsReq,
+                                                                         GLCapabilitiesChooser chooser,
+                                                                         X11GraphicsScreen x11Screen) {
+        if (x11Screen == null) {
+            throw new IllegalArgumentException("AbstractGraphicsScreen is null");
+        }
+
+        if (capsChosen == null) {
+            capsChosen = new GLCapabilities(null);
+        }
+        X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
+        X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
+
+        capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities( capsChosen, factory.canCreateGLPbuffer(x11Device) );
+        boolean usePBuffer = capsChosen.isPBuffer();
+    
+        X11GLXGraphicsConfiguration res = null;
+        if( factory.isGLXVersionGreaterEqualOneThree(x11Device) ) {
+            res = chooseGraphicsConfigurationFBConfig(capsChosen, capsReq, chooser, x11Screen);
+        }
+        if(null==res) {
+            if(usePBuffer) {
+                throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig for "+capsChosen);
+            }
+            res = chooseGraphicsConfigurationXVisual(capsChosen, capsReq, chooser, x11Screen);
+        }
+        if(null==res) {
+            throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig and XVisual for "+capsChosen);
+        }
+        if(DEBUG) {
+            System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationStatic("+x11Screen+","+capsChosen+"): "+res);
+        }
+        return res;
+    }
+
+    static X11GLXGraphicsConfiguration fetchGraphicsConfigurationFBConfig(X11GraphicsScreen x11Screen, int fbID, GLProfile glp) {
+        AbstractGraphicsDevice absDevice = x11Screen.getDevice();
+        long display = absDevice.getHandle();
+        int screen = x11Screen.getIndex();
+
+        long fbcfg = X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, screen, fbID);
+        if( !X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfg ) ) {
+            if(DEBUG) {
+                System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed - GLX FBConfig invalid: ("+x11Screen+","+toHexString(fbID)+"): fbcfg: "+toHexString(fbcfg));
+            }
+            return null;
+        }
+        X11GLCapabilities caps = X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(glp, display, fbcfg, true, true, true, GLXUtil.isMultisampleAvailable(display));
+        return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser());
+    }
+
+    private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(GLCapabilitiesImmutable capsChosen,
+                                                                                   GLCapabilitiesImmutable capsReq,
+                                                                                   GLCapabilitiesChooser chooser,
+                                                                                   X11GraphicsScreen x11Screen) {
+        long recommendedFBConfig = -1;
+        int recommendedIndex = -1;
+        PointerBuffer fbcfgsL = null;
+        GLProfile glProfile = capsChosen.getGLProfile();
+        boolean onscreen = capsChosen.isOnscreen();
+        boolean usePBuffer = capsChosen.isPBuffer();
+
+        // Utilizing FBConfig
+        //
+        AbstractGraphicsDevice absDevice = x11Screen.getDevice();
+        long display = absDevice.getHandle();
+
+        int screen = x11Screen.getIndex();
+        boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display);
+        int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capsChosen, true, isMultisampleAvailable, display, screen);
+        int[] count = { -1 };
+        ArrayList/*<X11GLCapabilities>*/ availableCaps = new ArrayList();
+        final int winattrmask = GLGraphicsConfigurationUtil.getWinAttributeBits(onscreen, usePBuffer);
+
+        // 1st choice: get GLCapabilities based on users GLCapabilities setting recommendedIndex as preferred choice
+        fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, 0, count, 0);
+        if (fbcfgsL != null && fbcfgsL.limit()>0) {
+            for (int i = 0; i < fbcfgsL.limit(); i++) {
+                if( !X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(availableCaps, glProfile, display, fbcfgsL.get(i), winattrmask, isMultisampleAvailable) ) {
+                    if(DEBUG) {
+                        System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: FBConfig invalid (1): ("+x11Screen+","+capsChosen+"): fbcfg: "+toHexString(fbcfgsL.get(i)));
+                    }
+                }
+            }
+            if(availableCaps.size() > 0) {
+                recommendedFBConfig = fbcfgsL.get(0);
+                recommendedIndex=0;
+                if (DEBUG) {
+                    System.err.println("!!! glXChooseFBConfig recommended fbcfg " + toHexString(recommendedFBConfig) + ", idx " + recommendedIndex);
+                    System.err.println("!!! user  caps " + capsChosen);
+                    System.err.println("!!! fbcfg caps " + availableCaps.get(recommendedIndex));
+                }
+            } else if (DEBUG) {
+                System.err.println("!!! glXChooseFBConfig no caps for recommended fbcfg " + toHexString(fbcfgsL.get(0)));
+                System.err.println("!!! user  caps " + capsChosen);
+            }
+        }
+
+        // 2nd choice: get all GLCapabilities available, no preferred recommendedIndex available
+        if( 0 == availableCaps.size() ) {
+            // reset ..
+            recommendedFBConfig = -1;
+            recommendedIndex = -1;
+
+            fbcfgsL = GLX.glXChooseFBConfig(display, screen, null, 0, count, 0);
+            if (fbcfgsL == null || fbcfgsL.limit()<=0) {
+                if(DEBUG) {
+                    System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed glXChooseFBConfig ("+x11Screen+","+capsChosen+"): "+fbcfgsL+", "+count[0]);
+                }
+                return null;
+            }
+
+            for (int i = 0; i < fbcfgsL.limit(); i++) {
+                if( !X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(availableCaps, glProfile, display, fbcfgsL.get(i), winattrmask, isMultisampleAvailable) ) {
+                    if(DEBUG) {
+                        System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: FBConfig invalid (2): ("+x11Screen+"): fbcfg: "+toHexString(fbcfgsL.get(i)));
+                    }
+                }
+            }
+        }
+        int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex);
+        if ( 0 > chosenIndex ) {
+            if (DEBUG) {
+                Thread.dumpStack();
+            }
+            return null;
+        }
+        X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
+
+        return new X11GLXGraphicsConfiguration(x11Screen, chosenCaps, capsReq, chooser);
+    }
+
+    private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationXVisual(GLCapabilitiesImmutable capsChosen,
+                                                                                  GLCapabilitiesImmutable capsReq,
+                                                                                  GLCapabilitiesChooser chooser,
+                                                                                  X11GraphicsScreen x11Screen) {
+        if (chooser == null) {
+            chooser = new DefaultGLCapabilitiesChooser();
+        }
+
+        GLProfile glProfile = capsChosen.getGLProfile();
+        final int winattrmask = GLGraphicsConfigurationUtil.getWinAttributeBits(capsChosen.isOnscreen(), false /* pbuffer */);
+        ArrayList availableCaps = new ArrayList();
+        int recommendedIndex = -1;
+
+        AbstractGraphicsDevice absDevice = x11Screen.getDevice();
+        long display = absDevice.getHandle();
+
+        int screen = x11Screen.getIndex();
+        boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display);
+        int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capsChosen, false, isMultisampleAvailable, display, screen);
+
+        // 1st choice: get GLCapabilities based on users GLCapabilities setting recommendedIndex as preferred choice
+        XVisualInfo recommendedVis = GLX.glXChooseVisual(display, screen, attribs, 0);
+        if (DEBUG) {
+            System.err.print("!!! glXChooseVisual recommended ");
+            if (recommendedVis == null) {
+                System.err.println("null visual");
+            } else {
+                System.err.println("visual id " + toHexString(recommendedVis.getVisualid()));
+            }
+        }
+
+        // 2nd choice: get all GLCapabilities available, preferred recommendedIndex might be available if 1st choice was successful
+        int[] count = new int[1];
+        XVisualInfo template = XVisualInfo.create();
+        template.setScreen(screen);
+        XVisualInfo[] infos = X11Util.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
+        if (infos == null || infos.length<1) {
+            throw new GLException("Error while enumerating available XVisualInfos");
+        }
+
+        for (int i = 0; i < infos.length; i++) {
+            if( !X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(availableCaps, glProfile, display, infos[i], winattrmask, isMultisampleAvailable) ) {
+                if(DEBUG) {
+                    System.err.println("X11GLXGraphicsConfiguration.getAvailableGLCapabilitiesXVisual: XVisual invalid: ("+x11Screen+"): fbcfg: "+toHexString(infos[i].getVisualid()));
+                }
+            } else {
+                // Attempt to find the visual chosenIndex by glXChooseVisual
+                if (recommendedVis != null && recommendedVis.getVisualid() == infos[i].getVisualid()) {
+                    recommendedIndex = availableCaps.size() - 1;
+                }
+            }
+        }
+
+        int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex);
+        if ( 0 > chosenIndex ) {
+            if (DEBUG) {
+                Thread.dumpStack();
+            }
+            return null;
+        }
+        X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
+
+        return new X11GLXGraphicsConfiguration(x11Screen, chosenCaps, capsReq, chooser);
+    }
+
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXContext.java
new file mode 100644
index 0000000..ce5d466
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXContext.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+package jogamp.opengl.x11.glx;
+
+import javax.media.opengl.*;
+
+public class X11OnscreenGLXContext extends X11GLXContext {
+
+    public X11OnscreenGLXContext(X11OnscreenGLXDrawable drawable, GLContext shareWith) {
+        super(drawable, shareWith);
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java
new file mode 100644
index 0000000..9e6ef91
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+
+public class X11OnscreenGLXDrawable extends X11GLXDrawable {
+  /** GLXWindow can't be made current on AWT with NVidia driver, hence disabled for now */
+  public static final boolean USE_GLXWINDOW = false;
+  long glXWindow; // GLXWindow, a GLXDrawable representation
+  boolean useGLXWindow;
+
+  protected X11OnscreenGLXDrawable(GLDrawableFactory factory, NativeSurface component) {
+    super(factory, component, false);
+    glXWindow=0;
+    useGLXWindow=false;
+  }
+
+  public long getHandle() {
+    if(useGLXWindow) {
+        return glXWindow; 
+    } 
+    return getNativeSurface().getSurfaceHandle();
+  }
+
+  protected void destroyHandle() {
+    if(0!=glXWindow) {
+        GLX.glXDestroyWindow(getNativeSurface().getDisplayHandle(), glXWindow);
+        glXWindow = 0;
+        useGLXWindow=false;
+    }
+  }
+
+  /** must be locked already */
+  protected void updateHandle() {
+    if(USE_GLXWINDOW) {
+        X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+        if(config.getFBConfig()>=0) {
+            useGLXWindow=true;
+            long dpy = getNativeSurface().getDisplayHandle();
+            if(0!=glXWindow) {
+                GLX.glXDestroyWindow(dpy, glXWindow);
+            }
+            glXWindow = GLX.glXCreateWindow(dpy, config.getFBConfig(), getNativeSurface().getSurfaceHandle(), null, 0);
+            if (DEBUG) {
+              System.err.println("!!! X11OnscreenGLXDrawable.setRealized(true): glXWindow: "+toHexString(getNativeSurface().getSurfaceHandle())+" -> "+toHexString(glXWindow));
+            }
+            if(0==glXWindow) {
+                throw new GLException("X11OnscreenGLXDrawable.setRealized(true): GLX.glXCreateWindow() failed: "+this);
+            }
+        }
+    }
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    return new X11OnscreenGLXContext(this, shareWith);
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXContext.java
new file mode 100644
index 0000000..765a820
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXContext.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import javax.media.opengl.*;
+
+public class X11PbufferGLXContext extends X11GLXContext {
+
+  public X11PbufferGLXContext(X11PbufferGLXDrawable drawable, GLContext shareWith) {
+    super(drawable, shareWith);
+  }
+
+  public void bindPbufferToTexture() {
+    // FIXME: figure out how to implement this
+    throw new GLException("Not yet implemented");
+  }
+
+  public void releasePbufferFromTexture() {
+    // FIXME: figure out how to implement this
+    throw new GLException("Not yet implemented");
+  }
+
+
+  public int getFloatingPointMode() {
+    return ((X11PbufferGLXDrawable)drawable).getFloatingPointMode();
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
new file mode 100644
index 0000000..8ea9892
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+
+public class X11PbufferGLXDrawable extends X11GLXDrawable {
+  protected X11PbufferGLXDrawable(GLDrawableFactory factory, NativeSurface target) {
+                                  /* GLCapabilities caps, 
+                                  GLCapabilitiesChooser chooser,
+                                  int width, int height */
+    super(factory, target, true);
+
+    if (DEBUG) {
+        System.out.println("Pbuffer config: " + getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration());
+    }
+
+    createPbuffer();
+
+    if (DEBUG) {
+        System.err.println("Created pbuffer " + this);
+    }
+  }
+
+  protected void setRealizedImpl() {
+    if(realized) {
+        createPbuffer();
+    } else {
+        destroyImpl();
+    }
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    return new X11PbufferGLXContext(this, shareWith);
+  }
+
+  protected void destroyImpl() {
+    NativeSurface ns = getNativeSurface();
+    if (ns.getSurfaceHandle() != 0) {
+      GLX.glXDestroyPbuffer(ns.getDisplayHandle(), ns.getSurfaceHandle());
+    }
+    ((SurfaceChangeable)ns).setSurfaceHandle(0);
+  }
+
+  private void createPbuffer() {
+      X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+      AbstractGraphicsScreen aScreen = config.getScreen();
+      AbstractGraphicsDevice aDevice = aScreen.getDevice();
+      long display = aDevice.getHandle();
+      int screen = aScreen.getIndex();
+
+      if (display==0) {
+        throw new GLException("Null display");
+      }
+
+      NativeSurface ns = getNativeSurface();
+    
+      GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable)config.getChosenCapabilities();
+
+      if (chosenCaps.getPbufferRenderToTexture()) {
+        throw new GLException("Render-to-texture pbuffers not supported yet on X11");
+      }
+
+      if (chosenCaps.getPbufferRenderToTextureRectangle()) {
+        throw new GLException("Render-to-texture-rectangle pbuffers not supported yet on X11");
+      }
+
+      // Create the p-buffer.
+      int niattribs = 0;
+      int[] iattributes = new int[5];
+
+      iattributes[niattribs++] = GLX.GLX_PBUFFER_WIDTH;
+      iattributes[niattribs++] = ns.getWidth();
+      iattributes[niattribs++] = GLX.GLX_PBUFFER_HEIGHT;
+      iattributes[niattribs++] = ns.getHeight();
+      iattributes[niattribs++] = 0;
+
+      long pbuffer = GLX.glXCreatePbuffer(display, config.getFBConfig(), iattributes, 0);
+      if (pbuffer == 0) {
+        // FIXME: query X error code for detail error message
+        throw new GLException("pbuffer creation error: glXCreatePbuffer() failed");
+      }
+
+      // Set up instance variables
+      ((SurfaceChangeable)ns).setSurfaceHandle(pbuffer);
+      
+      // Determine the actual width and height we were able to create.
+      int[] tmp = new int[1];
+      GLX.glXQueryDrawable(display, pbuffer, GLX.GLX_WIDTH, tmp, 0);
+      int width = tmp[0];
+      GLX.glXQueryDrawable(display, pbuffer, GLX.GLX_HEIGHT, tmp, 0);
+      int height = tmp[0];
+      ((SurfaceChangeable)ns).setSize(width, height);
+  }
+
+  public int getFloatingPointMode() {
+    // Floating-point pbuffers currently require NVidia hardware on X11
+    return GLPbuffer.NV_FLOAT;
+  }
+
+  protected void swapBuffersImpl() {
+    if(DEBUG) {
+        System.err.println("unhandled swapBuffersImpl() called for: "+this);
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXContext.java
new file mode 100644
index 0000000..ef8007d
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXContext.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import javax.media.opengl.*;
+
+public class X11PixmapGLXContext extends X11GLXContext {
+
+  public X11PixmapGLXContext(X11PixmapGLXDrawable drawable,
+                               GLContext shareWith) {
+    super(drawable, shareWith);
+  }
+
+  public int getOffscreenContextPixelDataType() {
+    GL gl = getGL();
+    return gl.isGL2GL3()?GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:GL.GL_UNSIGNED_SHORT_5_5_5_1;
+  }
+  
+  public int getOffscreenContextReadBuffer() {
+    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+    if (caps.getDoubleBuffered()) {
+      return GL.GL_BACK;
+    }
+    return GL.GL_FRONT;
+  }
+
+  public boolean offscreenImageNeedsVerticalFlip() {
+    // There doesn't seem to be a way to do this in the construction
+    // of the Pixmap or GLXPixmap
+    return true;
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
new file mode 100644
index 0000000..f5d3215
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.opengl.x11.glx;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import jogamp.nativewindow.x11.*;
+
+public class X11PixmapGLXDrawable extends X11GLXDrawable {
+  private long pixmap;
+
+  protected X11PixmapGLXDrawable(GLDrawableFactory factory, NativeSurface target) {
+    super(factory, target, true);
+    create();
+  }
+
+  protected void setRealizedImpl() {
+    if(realized) {
+        create();
+    } else {
+        destroyImpl();
+    }
+  }
+
+  public GLContext createContext(GLContext shareWith) {
+    return new X11PixmapGLXContext(this, shareWith);
+  }
+  
+  private void create() {
+    NativeSurface ns = getNativeSurface();
+    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+    XVisualInfo vis = config.getXVisualInfo();
+    int bitsPerPixel = vis.getDepth();
+    AbstractGraphicsScreen aScreen = config.getScreen();
+    AbstractGraphicsDevice aDevice = aScreen.getDevice();
+    long dpy = aDevice.getHandle();
+    int screen = aScreen.getIndex();
+
+    pixmap = X11Util.XCreatePixmap(dpy, X11Util.RootWindow(dpy, screen),
+                                  surface.getWidth(), surface.getHeight(), bitsPerPixel);
+    if (pixmap == 0) {
+        throw new GLException("XCreatePixmap failed");
+    }
+    long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap);
+    if (drawable == 0) {
+        X11Util.XFreePixmap(dpy, pixmap);
+        pixmap = 0;
+        throw new GLException("glXCreateGLXPixmap failed");
+    }
+    ((SurfaceChangeable)ns).setSurfaceHandle(drawable);
+    if (DEBUG) {
+        System.err.println("Created pixmap " + toHexString(pixmap) +
+                           ", GLXPixmap " + toHexString(drawable) +
+                           ", display " + toHexString(dpy));
+    }
+  }
+
+  protected void destroyImpl() {
+    if (pixmap == 0) return;
+
+    NativeSurface ns = getNativeSurface();
+    long display = ns.getDisplayHandle();
+
+    long drawable = ns.getSurfaceHandle();
+    if (DEBUG) {
+        System.err.println("Destroying pixmap " + toHexString(pixmap) +
+                           ", GLXPixmap " + toHexString(drawable) +
+                           ", display " + toHexString(display));
+    }
+
+    // Must destroy pixmap and GLXPixmap
+
+    if (DEBUG) {
+        long cur = GLX.glXGetCurrentContext();
+        if (cur != 0) {
+          System.err.println("WARNING: found context " + toHexString(cur) + " current during pixmap destruction");
+        }
+    }
+
+    // FIXME: workaround for crashes on NVidia hardware when
+    // destroying pixmap (no context is current at the point of the
+    // crash, at least from the point of view of
+    // glXGetCurrentContext)
+    GLX.glXMakeCurrent(display, 0, 0);
+
+    GLX.glXDestroyGLXPixmap(display, drawable);
+    X11Util.XFreePixmap(display, pixmap);
+    drawable = 0;
+    pixmap = 0;
+    ((SurfaceChangeable)ns).setSurfaceHandle(0);
+    display = 0;
+  }
+
+  protected void swapBuffersImpl() {
+    if(DEBUG) {
+        System.err.println("unhandled swapBuffersImpl() called for: "+this);
+    }
+  }
+}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java
new file mode 100644
index 0000000..ee7dd28
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.opengl.x11.glx.awt;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+import javax.media.nativewindow.awt.*;
+import javax.media.opengl.*;
+
+import jogamp.opengl.*;
+import jogamp.nativewindow.jawt.x11.*;
+import jogamp.nativewindow.x11.*;
+
+public class X11AWTGLXGraphicsConfigurationFactory extends GLGraphicsConfigurationFactory {
+    protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
+
+    public X11AWTGLXGraphicsConfigurationFactory() {
+        GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this);
+    }
+
+    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
+            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
+            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) {
+        GraphicsDevice device = null;
+        if (absScreen != null &&
+            !(absScreen instanceof AWTGraphicsScreen)) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
+        }
+
+        if(null==absScreen) {
+            absScreen = AWTGraphicsScreen.createScreenDevice(-1, AbstractGraphicsDevice.DEFAULT_UNIT);
+        }
+        AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
+        device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
+
+        if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - chosen");
+        }
+
+        if ( !(capsRequested instanceof GLCapabilitiesImmutable) ) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects - requested");
+        }
+
+        if (chooser != null &&
+            !(chooser instanceof GLCapabilitiesChooser)) {
+            throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilitiesChooser objects");
+        }
+
+        if(DEBUG) {
+            System.err.println("X11AWTGLXGraphicsConfigurationFactory: got "+absScreen);
+        }
+        
+        long displayHandle = X11SunJDKReflection.graphicsDeviceGetDisplay(device);
+        boolean owner = false;
+        if(0==displayHandle) {
+            displayHandle = X11Util.createDisplay(null);
+            owner = true;
+            if(DEBUG) {
+                System.err.println(Thread.currentThread().getName() + " - X11AWTGLXGraphicsConfigurationFactory: using a thread local X11 display");
+            }
+        } else {
+            if(DEBUG) {
+                System.err.println(Thread.currentThread().getName() + " - X11AWTGLXGraphicsConfigurationFactory: using AWT X11 display 0x"+Long.toHexString(displayHandle));
+            }
+            /**
+             * Using the AWT display handle works fine with NVidia and AMD drivers today 2011-02-22,
+             * hence no need for our own display instance anymore.
+               String name = X11Util.XDisplayString(displayHandle);
+               displayHandle = X11Util.createDisplay(name);
+               owner = true;
+             */
+        }
+        ((AWTGraphicsDevice)awtScreen.getDevice()).setSubType(NativeWindowFactory.TYPE_X11, displayHandle);
+        X11GraphicsDevice x11Device = new X11GraphicsDevice(displayHandle, AbstractGraphicsDevice.DEFAULT_UNIT);
+        x11Device.setCloseDisplay(owner);
+        X11GraphicsScreen x11Screen = new X11GraphicsScreen(x11Device, awtScreen.getIndex());
+        if(DEBUG) {
+            System.err.println("X11AWTGLXGraphicsConfigurationFactory: made "+x11Screen);
+        }
+        GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(x11Device);
+        GraphicsConfiguration[] configs = device.getConfigurations();
+
+        //
+        // Match the X11/GL Visual with AWT:
+        //   - choose a config AWT agnostic and then
+        //   - try to find the visual within the GraphicsConfiguration
+        //
+        // The resulting GraphicsConfiguration has to be 'forced' on the AWT native peer,
+        // ie. returned by GLCanvas's getGraphicsConfiguration() befor call by super.addNotify().
+        //
+        X11GraphicsConfiguration x11Config = (X11GraphicsConfiguration) factory.chooseGraphicsConfiguration(capsChosen, capsRequested, chooser, x11Screen);
+        if (x11Config == null) {
+            throw new GLException("Unable to choose a GraphicsConfiguration (1): "+capsChosen+",\n\t"+chooser+"\n\t"+x11Screen);
+        }
+        long visualID = x11Config.getVisualID();
+        for (int i = 0; i < configs.length; i++) {
+            GraphicsConfiguration gc = configs[i];
+            if (gc != null) {
+                if (X11SunJDKReflection.graphicsConfigurationGetVisualID(gc) == visualID) {
+                    if(DEBUG) {
+                        System.err.println("Found matching AWT visual: 0x"+Long.toHexString(visualID) +" -> "+x11Config);
+                    }
+                    return new AWTGraphicsConfiguration(awtScreen,
+                                                        x11Config.getChosenCapabilities(), x11Config.getRequestedCapabilities(),
+                                                        gc, x11Config);
+                }
+            }
+        }
+
+        // try again using an AWT Colormodel compatible configuration
+        GraphicsConfiguration gc = device.getDefaultConfiguration();
+        capsChosen = AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capsChosen, gc);
+        x11Config = (X11GraphicsConfiguration) factory.chooseGraphicsConfiguration(capsChosen, capsRequested, chooser, x11Screen);
+        if (x11Config == null) {
+            throw new GLException("Unable to choose a GraphicsConfiguration (2): "+capsChosen+",\n\t"+chooser+"\n\t"+x11Screen);
+        }
+        visualID = x11Config.getVisualID();
+        for (int i = 0; i < configs.length; i++) {
+            gc = configs[i];
+            if (X11SunJDKReflection.graphicsConfigurationGetVisualID(gc) == visualID) {
+                if(DEBUG) {
+                    System.err.println("Found matching default AWT visual: 0x"+Long.toHexString(visualID) +" -> "+x11Config);
+                }
+                return new AWTGraphicsConfiguration(awtScreen,
+                                                    x11Config.getChosenCapabilities(), x11Config.getRequestedCapabilities(),
+                                                    gc, x11Config);
+            }
+        }
+
+        // Either we weren't able to reflectively introspect on the
+        // X11GraphicsConfig or something went wrong in the steps above;
+        // Let's take the default configuration as used on Windows and MacOSX then ..
+        if(DEBUG) {
+            System.err.println("!!! Using default configuration");
+        }
+
+        gc = device.getDefaultConfiguration();
+        return new AWTGraphicsConfiguration(awtScreen, x11Config.getChosenCapabilities(), x11Config.getRequestedCapabilities(), gc, x11Config);
+    }
+}
diff --git a/src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01NEWT.java b/src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01NEWT.java
deleted file mode 100644
index 860a181..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01NEWT.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.acore;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.util.DumpVersion;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import javax.media.opengl.*;
-import com.jogamp.newt.*;
-import com.jogamp.newt.opengl.*;
-
-import com.jogamp.newt.*;
-import java.io.IOException;
-
-public class TestGLProfile01NEWT extends UITestCase {
-    static GLProfile glp;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        glp = GLProfile.getDefault();
-        Assert.assertNotNull(glp);
-    }
-
-    @AfterClass
-    public static void releaseClass() {
-    }
-
-    @Test
-    public void test01GLProfileDefault() {
-        System.out.println("GLProfile <static> "+GLProfile.glAvailabilityToString());
-        GLProfile glp = GLProfile.getDefault();
-        dumpVersion(glp);
-    }
-
-    @Test
-    public void test02GLProfileMaxFixedFunc() {
-        // Assuming at least one fixed profile is available
-        GLProfile glp = GLProfile.getMaxFixedFunc();
-        System.out.println("GLProfile <static> getMaxFixedFunc(): "+glp);
-        if(glp.getName().equals(GLProfile.GL4bc)) {
-            Assert.assertTrue(GLProfile.isGL4bcAvailable());
-            Assert.assertTrue(GLProfile.isGL3bcAvailable());
-            Assert.assertTrue(GLProfile.isGL2Available());
-            Assert.assertTrue(GLProfile.isGL2ES1Available());
-            Assert.assertTrue(GLProfile.isGL2ES2Available());
-        } else if(glp.getName().equals(GLProfile.GL3bc)) {
-            Assert.assertTrue(GLProfile.isGL3bcAvailable());
-            Assert.assertTrue(GLProfile.isGL2Available());
-            Assert.assertTrue(GLProfile.isGL2ES1Available());
-            Assert.assertTrue(GLProfile.isGL2ES2Available());
-        } else if(glp.getName().equals(GLProfile.GL2)) {
-            Assert.assertTrue(GLProfile.isGL2Available());
-            Assert.assertTrue(GLProfile.isGL2ES1Available());
-            Assert.assertTrue(GLProfile.isGL2ES2Available());
-        } else if(glp.getName().equals(GLProfile.GL2ES1)) {
-            Assert.assertTrue(GLProfile.isGL2ES1Available());
-        }
-        dumpVersion(glp);
-    }
-
-    @Test
-    public void test03GLProfileMaxProgrammable() {
-        // Assuming at least one programmable profile is available
-        GLProfile glp = GLProfile.getMaxProgrammable();
-        System.out.println("GLProfile <static> getMaxProgrammable(): "+glp);
-        if(glp.getName().equals(GLProfile.GL4)) {
-            Assert.assertTrue(GLProfile.isGL4Available());
-            Assert.assertTrue(GLProfile.isGL3Available());
-            Assert.assertTrue(GLProfile.isGL2Available());
-            Assert.assertTrue(GLProfile.isGL2ES1Available());
-            Assert.assertTrue(GLProfile.isGL2ES2Available());
-        } else if(glp.getName().equals(GLProfile.GL3)) {
-            Assert.assertTrue(GLProfile.isGL3Available());
-            Assert.assertTrue(GLProfile.isGL2Available());
-            Assert.assertTrue(GLProfile.isGL2ES1Available());
-            Assert.assertTrue(GLProfile.isGL2ES2Available());
-        } else if(glp.getName().equals(GLProfile.GL2)) {
-            Assert.assertTrue(GLProfile.isGL2Available());
-            Assert.assertTrue(GLProfile.isGL2ES1Available());
-            Assert.assertTrue(GLProfile.isGL2ES2Available());
-        } else if(glp.getName().equals(GLProfile.GL2ES2)) {
-            Assert.assertTrue(GLProfile.isGL2ES2Available());
-        }
-        dumpVersion(glp);
-    }
-
-    @Test
-    public void test04GLProfileGL2ES1() {
-        if(!GLProfile.isGL2ES1Available()) {
-            System.out.println("GLProfile GL2ES1 n/a");
-            return;
-        }
-        GLProfile glp = GLProfile.getGL2ES1();
-        System.out.println("GLProfile <static> GL2ES1: "+glp);
-        dumpVersion(glp);
-    }
-
-    @Test
-    public void test05GLProfileGL2ES2() {
-        if(!GLProfile.isGL2ES2Available()) {
-            System.out.println("GLProfile GL2ES2 n/a");
-            return;
-        }
-        GLProfile glp = GLProfile.getGL2ES2();
-        System.out.println("GLProfile <static> GL2ES2: "+glp);
-        dumpVersion(glp);
-    }
-
-    protected void dumpVersion(GLProfile glp) {
-        GLCapabilities caps = new GLCapabilities(glp);
-        GLWindow glWindow = GLWindow.create(caps);
-        Assert.assertNotNull(glWindow);
-        glWindow.setTitle("TestGLProfile01NEWT");
-
-        glWindow.addGLEventListener(new DumpVersion());
-
-        glWindow.setSize(128, 128);
-        glWindow.setVisible(true);
-        glWindow.display();
-        glWindow.invalidate();
-    }
-
-    public static void main(String args[]) throws IOException {
-        String tstname = TestGLProfile01NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/awt/TestAWT01GLn.java b/src/junit/com/jogamp/test/junit/jogl/awt/TestAWT01GLn.java
deleted file mode 100644
index 09dfc85..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/awt/TestAWT01GLn.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.awt;
-
-import javax.media.opengl.GLProfile;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.awt.GLCanvas;
-import com.jogamp.opengl.util.Animator;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-import java.awt.Frame;
-
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.Test;
-
-
-public class TestAWT01GLn extends UITestCase {
-    Frame frame=null;
-    GLCanvas glCanvas=null;
-
-    @BeforeClass
-    public static void startup() {
-        GLProfile.initSingleton(true);
-        System.out.println("GLProfile <static> "+GLProfile.glAvailabilityToString());
-    }
-
-    @Before
-    public void init() {
-        frame = new Frame("Texture Test");
-        Assert.assertNotNull(frame);
-    }
-
-    @After
-    public void release() {
-        Assert.assertNotNull(frame);
-        Assert.assertNotNull(glCanvas);
-        try {
-            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    frame.setVisible(false);
-                    frame.remove(glCanvas);
-                    frame.dispose();
-                }});
-        } catch (Throwable t) {
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-        frame=null;
-        glCanvas=null;
-    }
-
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
-        glCanvas = new GLCanvas(caps);
-        Assert.assertNotNull(glCanvas);
-        frame.add(glCanvas);
-        frame.setSize(512, 512);
-
-        glCanvas.addGLEventListener(new Gears());
-
-        try {
-            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    frame.setVisible(true);
-                }});
-        } catch (Throwable t) {
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-
-        glCanvas.display(); // one in process display
-
-        Animator animator = new Animator(glCanvas);
-        animator.start();
-
-        Thread.sleep(500); // 500 ms
-
-        animator.stop();
-    }
-
-    @Test
-    public void test01GLDefault() throws InterruptedException {
-        GLProfile glp = GLProfile.getDefault();
-        System.out.println("GLProfile Default: "+glp);
-        GLCapabilities caps = new GLCapabilities(glp);
-        runTestGL(caps);
-    }
-
-    @Test
-    public void test03GLMaxFixed() throws InterruptedException {
-        GLProfile maxFixed = GLProfile.getMaxFixedFunc();
-        System.out.println("GLProfile MaxFixed: "+maxFixed);
-        GLCapabilities caps = new GLCapabilities(maxFixed);
-        try {
-            runTestGL(caps);
-        } catch (Throwable t) {
-             // FIXME: 
-             // Stop test and ignore if GL3bc and GL4bc
-             // currently this won't work on ATI!
-             if(maxFixed.equals(GLProfile.GL3bc) ||
-                maxFixed.equals(GLProfile.GL4bc)) {
-                t.printStackTrace();
-                Assume.assumeNoException(t);
-             }
-             // else .. serious unexpected exception
-        }
-    }
-
-    public static void main(String args[]) {
-        org.junit.runner.JUnitCore.main(TestAWT01GLn.class.getName());
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/awt/TestAWT02WindowClosing.java b/src/junit/com/jogamp/test/junit/jogl/awt/TestAWT02WindowClosing.java
deleted file mode 100644
index 6132f82..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/awt/TestAWT02WindowClosing.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.awt;
-
-import com.jogamp.test.junit.util.UITestCase;
-import javax.media.opengl.GLProfile;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.Test;
-
-public class TestAWT02WindowClosing extends UITestCase {
-
-    static long durationPerTest = 200; // ms
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-    }
-
-    @Test
-    public void test01WindowClosing() throws InterruptedException {
-        Frame frame = new Frame();
-        frame.setSize(500, 500);
-        ClosingWindowAdapter closingWindowAdapter = new ClosingWindowAdapter(frame);
-        frame.addWindowListener(closingWindowAdapter);
-        final Frame _frame = frame;
-        try {
-            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    _frame.setVisible(true);
-                }});
-        } catch (Throwable t) {
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-
-        Thread.sleep(durationPerTest);
-        if(!closingWindowAdapter.closingCalled) {
-            // programatically issue windowClosing
-            Toolkit tk = Toolkit.getDefaultToolkit();
-            EventQueue evtQ = tk.getSystemEventQueue();
-            evtQ.postEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));
-            Thread.sleep(200);
-        }
-        Assert.assertEquals(true, closingWindowAdapter.closingCalled);
-    }
-
-    static class ClosingWindowAdapter extends WindowAdapter {
-        boolean closingCalled = false;
-        Frame frame;
-        public ClosingWindowAdapter(Frame frame) {
-            this.frame = frame;
-        }
-        public void windowClosing(WindowEvent ev) {
-                System.out.println("windowClosing() called ..");
-                closingCalled = true;
-                frame.dispose();
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        System.out.println("durationPerTest: "+durationPerTest);
-        org.junit.runner.JUnitCore.main(TestAWT02WindowClosing.class.getName());
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWT01GLn.java b/src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWT01GLn.java
deleted file mode 100644
index a32dc90..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWT01GLn.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.awt;
-
-import java.lang.reflect.InvocationTargetException;
-import javax.media.opengl.GLProfile;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.awt.GLCanvas;
-import com.jogamp.opengl.util.Animator;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-import java.awt.Frame;
-import java.awt.Window;
-import javax.swing.JFrame;
-
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import static org.junit.Assume.*;
-import static org.junit.Assert.*;
-import static javax.swing.SwingUtilities.*;
-
-/**
- * Tests context creation + display on various kinds of Window implementations.
- * @author Michael Bien
- */
-public class TestSwingAWT01GLn extends UITestCase {
-    private Window[] windows;
-
-
-    @BeforeClass
-    public static void startup() {
-        GLProfile.initSingleton(true);
-        System.out.println("GLProfile <static> "+GLProfile.glAvailabilityToString());
-    }
-
-    @Before
-    public void init() {
-        windows = new Window[]{
-            new Window(null),
-            new Frame("Frame GL test"),
-            new JFrame("JFrame GL test")
-        };
-    }
-
-    protected void runTestGL(final GLCapabilities caps) throws InterruptedException, InvocationTargetException {
-
-        for (final Window window : windows) {
-
-            System.out.println("testing with "+window.getClass().getName());
-
-            // final array as mutable container hack
-            final GLCanvas[] glCanvas = new GLCanvas[1];
-
-            Runnable test = new Runnable() {
-                public void run() {
-                    glCanvas[0] = new GLCanvas(caps);
-                    glCanvas[0].addGLEventListener(new Gears());
-                    window.add(glCanvas[0]);
-                    window.setSize(512, 512);
-                    window.setVisible(true);
-                    glCanvas[0].display();
-                }
-            };
-
-            Runnable cleanup = new Runnable() {
-                public void run() {
-                    System.out.println("cleaning up...");
-                    window.setVisible(false);
-                    try {
-                        window.removeAll();
-                    } catch (Throwable t) {
-                        assumeNoException(t);
-                        t.printStackTrace();
-                    }
-                    window.dispose();
-                }
-
-            };
-
-            // AWT / Swing on EDT..
-            invokeAndWait(test);
-
-            Animator animator = new Animator(glCanvas[0]);
-            animator.start();
-            Thread.sleep(1000);
-            animator.stop();
-
-            // AWT / Swing on EDT..
-            invokeAndWait(cleanup);
-        }
-    }
-
-    @Test
-    public void test01GLDefault() throws InterruptedException, InvocationTargetException {
-        GLProfile glp = GLProfile.getDefault();
-        System.out.println("GLProfile Default: "+glp);
-        GLCapabilities caps = new GLCapabilities(glp);
-        runTestGL(caps);
-    }
-
-    @Test
-    public void test03GLMaxFixed() throws InterruptedException, InvocationTargetException {
-        GLProfile maxFixed = GLProfile.getMaxFixedFunc();
-        System.out.println("GLProfile MaxFixed: "+maxFixed);
-        GLCapabilities caps = new GLCapabilities(maxFixed);
-        try {
-            runTestGL(caps);
-        } catch (Throwable t) {
-             // FIXME: 
-             // Stop test and ignore if GL3bc and GL4bc
-             // currently this won't work on ATI!
-             if(maxFixed.getName().equals(GLProfile.GL3bc) ||
-                maxFixed.getName().equals(GLProfile.GL4bc)) {
-                t.printStackTrace();
-                assumeNoException(t);
-             }
-             // else .. serious unexpected exception
-        }
-    }
-
-    public static void main(String args[]) {
-        org.junit.runner.JUnitCore.main(TestSwingAWT01GLn.class.getName());
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/caps/MultisampleChooser01.java b/src/junit/com/jogamp/test/junit/jogl/caps/MultisampleChooser01.java
deleted file mode 100644
index 7dcde18..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/caps/MultisampleChooser01.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- *
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-package com.jogamp.test.junit.jogl.caps;
-
-import javax.media.opengl.DefaultGLCapabilitiesChooser;
-import javax.media.opengl.GLCapabilitiesImmutable;
-
-class MultisampleChooser01 extends DefaultGLCapabilitiesChooser {
-
-    public int chooseCapabilities(GLCapabilitiesImmutable desired, GLCapabilitiesImmutable[] available, int windowSystemRecommendedChoice) {
-        boolean anyHaveSampleBuffers = false;
-        for (int i = 0; i < available.length; i++) {
-            GLCapabilitiesImmutable caps = available[i];
-            if (caps != null && caps.getSampleBuffers()) {
-                anyHaveSampleBuffers = true;
-                break;
-            }
-        }
-        int selection = super.chooseCapabilities(desired, available, windowSystemRecommendedChoice);
-        if (!anyHaveSampleBuffers) {
-            System.err.println("WARNING: antialiasing will be disabled because none of the available pixel formats had it to offer");
-        } else {
-            if (!available[selection].getSampleBuffers()) {
-                System.err.println("WARNING: antialiasing will be disabled because the DefaultGLCapabilitiesChooser didn't supply it");
-            }
-        }
-        return selection;
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/caps/MultisampleDemo01.java b/src/junit/com/jogamp/test/junit/jogl/caps/MultisampleDemo01.java
deleted file mode 100644
index e399de0..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/caps/MultisampleDemo01.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- *
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.test.junit.jogl.caps;
-
-import com.jogamp.opengl.impl.x11.glx.GLX;
-import com.jogamp.opengl.impl.x11.glx.X11GLXGraphicsConfiguration;
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import javax.media.opengl.GL2ES1;
-import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLEventListener;
-import javax.media.opengl.GLPipelineFactory;
-
-class MultisampleDemo01 implements GLEventListener {
-
-    static boolean glDebug = false;
-    static boolean glTrace = false;
-
-    boolean multisample;
-
-    public MultisampleDemo01(boolean multisample) {
-        this.multisample = multisample;
-    }
-
-    public void init(GLAutoDrawable drawable) {
-        AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
-        System.err.println();
-        System.err.println("Info: " + config);
-        System.err.println();
-        if (NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(false))) {
-            X11GLXGraphicsConfiguration x11config = (X11GLXGraphicsConfiguration) config;
-            long display = drawable.getNativeSurface().getDisplayHandle();
-            int[] foo = new int[1];
-            GLX.glXGetFBConfigAttrib(display, x11config.getFBConfig(), GLX.GLX_SAMPLES, foo, 0);
-            System.out.println("GLX_SAMPLES " + foo[0]);
-            GLX.glXGetFBConfigAttrib(display, x11config.getFBConfig(), GLX.GLX_SAMPLE_BUFFERS, foo, 0);
-            System.out.println("GLX_SAMPLE_BUFFERS " + foo[0]);
-        }
-        GL _gl = drawable.getGL();
-        if (glDebug) {
-            try {
-                // Debug ..
-                _gl = _gl.getContext().setGL(GLPipelineFactory.create("javax.media.opengl.Debug", GL2.class, _gl, null));
-                if (glTrace) {
-                    // Trace ..
-                    _gl = _gl.getContext().setGL(GLPipelineFactory.create("javax.media.opengl.Trace", GL2.class, _gl, new Object[]{System.err}));
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-        GL2 gl = _gl.getGL2();
-        if (multisample) {
-            gl.glEnable(GL.GL_MULTISAMPLE);
-        }
-        gl.glClearColor(0, 0, 0, 0);
-        //      gl.glEnable(GL.GL_DEPTH_TEST);
-        //      gl.glDepthFunc(GL.GL_LESS);
-        gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
-        gl.glLoadIdentity();
-        gl.glMatrixMode(GL2ES1.GL_PROJECTION);
-        gl.glLoadIdentity();
-        gl.glOrtho(-1, 1, -1, 1, -1, 1);
-        if (multisample) {
-            gl.glDisable(GL.GL_MULTISAMPLE);
-        }
-    }
-
-    public void dispose(GLAutoDrawable drawable) {
-    }
-
-    public void display(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
-        if (multisample) {
-            gl.glEnable(GL.GL_MULTISAMPLE);
-        }
-        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-        int numSteps = 20;
-        double increment = Math.PI / numSteps;
-        double radius = 1;
-        gl.glBegin(GL.GL_LINES);
-        for (int i = numSteps - 1; i >= 0; i--) {
-            gl.glVertex3d(radius * Math.cos(i * increment), radius * Math.sin(i * increment), 0);
-            gl.glVertex3d(-1.0 * radius * Math.cos(i * increment), -1.0 * radius * Math.sin(i * increment), 0);
-        }
-        gl.glEnd();
-        if (multisample) {
-            gl.glDisable(GL.GL_MULTISAMPLE);
-        }
-    }
-
-    // Unused routines
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-    }
-
-    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/caps/TestMultisampleAWT.java b/src/junit/com/jogamp/test/junit/jogl/caps/TestMultisampleAWT.java
deleted file mode 100755
index c6e7f08..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/caps/TestMultisampleAWT.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.test.junit.jogl.caps;
-
-import com.jogamp.test.junit.util.MiscUtils;
-import java.awt.*;
-import javax.media.opengl.*;
-import javax.media.opengl.awt.GLCanvas;
-import com.jogamp.test.junit.util.UITestCase;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.GraphicsConfigurationFactory;
-import javax.media.nativewindow.awt.AWTGraphicsConfiguration;
-import javax.media.nativewindow.awt.AWTGraphicsDevice;
-import javax.media.nativewindow.awt.AWTGraphicsScreen;
-import org.junit.Test;
-
-
-public class TestMultisampleAWT extends UITestCase {
-  static long durationPerTest = 500; // ms
-  private GLCanvas canvas;
-
-  public static void main(String[] args) {
-     for(int i=0; i<args.length; i++) {
-        if(args[i].equals("-time")) {
-            durationPerTest = MiscUtils.atoi(args[++i], 500);
-        }
-     }
-     System.out.println("durationPerTest: "+durationPerTest);
-     String tstname = TestMultisampleAWT.class.getName();
-     org.junit.runner.JUnitCore.main(tstname);
-  }
-
-  @Test
-  public void testMultiSampleAA4() throws InterruptedException {
-    testMultiSampleAAImpl(4);
-  }
-
-  // @Test
-  public void testMultiSampleNone() throws InterruptedException {
-    testMultiSampleAAImpl(0);
-  }
-
-  private void testMultiSampleAAImpl(int samples) throws InterruptedException {
-    GLCapabilities caps = new GLCapabilities(null);
-    GLCapabilitiesChooser chooser = new MultisampleChooser01();
-
-    if(samples>0) {
-        caps.setSampleBuffers(true);
-        caps.setNumSamples(samples);
-    }
-    // turns out we need to have alpha, 
-    // otherwise no AA will be visible.
-    caps.setAlphaBits(1); 
-
-    /**
-     * whatever I tried here (passing and preconfig GraphicsConfiguration)
-     * either it just didn't picked up .. or the context couldn't be made current.
-     *
-    GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
-    GraphicsConfiguration gc = AWTGraphicsConfiguration.getAWTGraphicsConfiguration(caps, gd);
-
-    AbstractGraphicsScreen aScreen = AWTGraphicsScreen.createScreenDevice(gd, AbstractGraphicsDevice.DEFAULT_UNIT);
-    AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
-      GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(caps, caps,
-                                                                                                   chooser, aScreen);
-    canvas = new GLCanvas(caps, chooser, null, gd, config.getGraphicsConfiguration(), config); */
-    canvas = new GLCanvas(caps, chooser, null, null);
-    canvas.addGLEventListener(new MultisampleDemo01(samples>0?true:false));
-    
-    Frame frame = new Frame("Multi Samples "+samples);
-    frame.setLayout(new BorderLayout());
-    canvas.setSize(512, 512);
-    frame.add(canvas, BorderLayout.CENTER);
-    frame.pack();
-    frame.setVisible(true);
-    frame.setLocation(0, 0);
-    canvas.requestFocus();
-
-    Thread.sleep(durationPerTest);
-
-    frame.dispose();
-  }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/caps/TestMultisampleNEWT.java b/src/junit/com/jogamp/test/junit/jogl/caps/TestMultisampleNEWT.java
deleted file mode 100755
index c060828..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/caps/TestMultisampleNEWT.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.test.junit.jogl.caps;
-
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.test.junit.util.MiscUtils;
-import javax.media.opengl.*;
-import org.junit.Test;
-
-public class TestMultisampleNEWT {
-  static long durationPerTest = 500; // ms
-  private GLWindow window;
-
-  public static void main(String[] args) {
-     for(int i=0; i<args.length; i++) {
-        if(args[i].equals("-time")) {
-            durationPerTest = MiscUtils.atoi(args[++i], 500);
-        }
-     }
-     System.out.println("durationPerTest: "+durationPerTest);
-     String tstname = TestMultisampleNEWT.class.getName();
-     org.junit.runner.JUnitCore.main(tstname);
-  }
-
-  @Test
-  public void testMultiSampleAA4() throws InterruptedException {
-    testMultiSampleAAImpl(4);
-  }
-
-  // @Test
-  public void testMultiSampleNone() throws InterruptedException {
-    testMultiSampleAAImpl(0);
-  }
-
-  private void testMultiSampleAAImpl(int samples) throws InterruptedException {
-    GLCapabilities caps = new GLCapabilities(null);
-    GLCapabilitiesChooser chooser = new MultisampleChooser01();
-
-    if(samples>0) {
-        caps.setSampleBuffers(true);
-        caps.setNumSamples(4);
-    }
-    // turns out we need to have alpha, 
-    // otherwise no AA will be visible.
-    caps.setAlphaBits(1); 
-
-    window = GLWindow.create(caps);
-    window.setCapabilitiesChooser(chooser);
-    window.addGLEventListener(new MultisampleDemo01(samples>0?true:false));
-    window.setSize(512, 512);
-    window.setVisible(true);
-    window.setPosition(0, 0);
-    window.requestFocus();
-
-    GLCapabilitiesImmutable capsChosen0 = window.getChosenGLCapabilities();
-
-    Thread.sleep(durationPerTest);
-
-    window.destroy();
-  }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/es1/RedSquare.java b/src/junit/com/jogamp/test/junit/jogl/demos/es1/RedSquare.java
deleted file mode 100644
index be416f0..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/demos/es1/RedSquare.java
+++ /dev/null
@@ -1,169 +0,0 @@
-package com.jogamp.test.junit.jogl.demos.es1;
-
-import com.jogamp.common.nio.Buffers;
-import java.nio.*;
-import java.util.*;
-import javax.media.opengl.*;
-import javax.media.opengl.glu.*;
-import javax.media.nativewindow.*;
-
-import com.jogamp.opengl.util.*;
-import com.jogamp.opengl.util.glsl.fixedfunc.*;
-
-public class RedSquare implements GLEventListener {
-
-    public static boolean glDebugEmu = false;
-    public static boolean glDebug = false ;
-    public static boolean glTrace = false ;
-    public static boolean oneThread = false;
-    public static boolean useAnimator = false;
-    public static int swapInterval = -1;
-
-    boolean debug = false;
-    long startTime = 0;
-    long curTime = 0;
-
-    GLU glu = null;
-
-    public RedSquare() {
-        this(false);
-    }
-
-    public RedSquare(boolean debug) {
-        this.debug = debug;
-    }
-
-    // FIXME: we must add storage of the pointers in the GL state to
-    // the GLImpl classes. The need for this can be seen by making
-    // these variables method local instead of instance members. The
-    // square will disappear after a second or so due to garbage
-    // collection. On desktop OpenGL this implies a stack of
-    // references due to the existence of glPush/PopClientAttrib. On
-    // OpenGL ES 1/2 it can simply be one set of references.
-    private FloatBuffer colors;
-    private FloatBuffer vertices;
-
-    public void init(GLAutoDrawable drawable) {
-        System.out.println("RedSquare: Init");
-        GL _gl = drawable.getGL();
-
-        if(glDebugEmu) {
-            try {
-                // Debug ..
-                _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES2.class, _gl, null) );
-
-                if(glTrace) {
-                    // Trace ..
-                    _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES2.class, _gl, new Object[] { System.err } ) );
-                }
-            } catch (Exception e) {e.printStackTrace();} 
-            glDebug = false;
-            glTrace = false;
-        }
-
-        GL2ES1 gl = FixedFuncUtil.getFixedFuncImpl(_gl);
-        if(swapInterval>=0) {
-            gl.setSwapInterval(swapInterval);
-        }
-
-        if(glDebug) {
-            try {
-                // Debug ..
-                gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES1.class, gl, null) );
-            } catch (Exception e) {e.printStackTrace();} 
-        }
-
-        if(glTrace) {
-            try {
-                // Trace ..
-                gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES1.class, gl, new Object[] { System.err } ) );
-            } catch (Exception e) {e.printStackTrace();}
-        }
-
-        glu = GLU.createGLU(gl);
-
-        if(debug) {
-            System.err.println(Thread.currentThread()+" Entering initialization");
-            System.err.println(Thread.currentThread()+" GL Profile: "+gl.getGLProfile());
-            System.err.println(Thread.currentThread()+" GL:" + gl);
-            System.err.println(Thread.currentThread()+" GL_VERSION=" + gl.glGetString(gl.GL_VERSION));
-            System.err.println(Thread.currentThread()+" GL_EXTENSIONS:");
-            System.err.println(Thread.currentThread()+"   " + gl.glGetString(gl.GL_EXTENSIONS));
-            System.err.println(Thread.currentThread()+" swapInterval: " + swapInterval + " (GL: "+gl.getSwapInterval()+")");
-            System.err.println(Thread.currentThread()+" GLU: " + glu);
-        }
-
-        // Allocate vertex arrays
-        colors   = Buffers.newDirectFloatBuffer(16);
-        vertices = Buffers.newDirectFloatBuffer(12);
-        // Fill them up
-        colors.put( 0, 1);    colors.put( 1, 0);     colors.put( 2, 0);    colors.put( 3, 1);
-        colors.put( 4, 0);    colors.put( 5, 0);     colors.put( 6, 1);    colors.put( 7, 1);
-        colors.put( 8, 1);    colors.put( 9, 0);     colors.put(10, 0);    colors.put(11, 1);
-        colors.put(12, 1);    colors.put(13, 0);     colors.put(14, 0);    colors.put(15, 1);
-        vertices.put(0, -2);  vertices.put( 1,  2);  vertices.put( 2,  0);
-        vertices.put(3,  2);  vertices.put( 4,  2);  vertices.put( 5,  0);
-        vertices.put(6, -2);  vertices.put( 7, -2);  vertices.put( 8,  0);
-        vertices.put(9,  2);  vertices.put(10, -2);  vertices.put(11,  0);
-
-        gl.glEnableClientState(gl.GL_VERTEX_ARRAY);
-        gl.glEnableClientState(gl.GL_COLOR_ARRAY);
-        gl.glVertexPointer(3, GL.GL_FLOAT, 0, vertices);
-        gl.glColorPointer(4, GL.GL_FLOAT, 0, colors);
-
-        // OpenGL Render Settings
-        gl.glClearColor(0, 0, 0, 1);
-        gl.glEnable(GL.GL_DEPTH_TEST);
-
-        startTime = System.currentTimeMillis();
-        curTime = startTime;
-    }
-
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        System.out.println("RedSquare: Reshape");
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
-        // Set location in front of camera
-        gl.glMatrixMode(gl.GL_PROJECTION);
-        gl.glLoadIdentity();
-        glu.gluPerspective(45.0f, (float)width / (float)height, 1.0f, 100.0f);
-        //gl.glOrthof(-4.0f, 4.0f, -4.0f, 4.0f, 1.0f, 100.0f);
-        //glu.gluLookAt(0, 0, -20, 0, 0, 0, 0, 1, 0);
-    }
-
-    public void display(GLAutoDrawable drawable) {
-        curTime = System.currentTimeMillis();
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
-        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-
-        // One rotation every four seconds
-        gl.glMatrixMode(gl.GL_MODELVIEW);
-        gl.glLoadIdentity();
-        gl.glTranslatef(0, 0, -10);
-        float ang = ((float) (curTime - startTime) * 360.0f) / 4000.0f;
-        gl.glRotatef(ang, 0, 0, 1);
-        gl.glRotatef(ang, 0, 1, 0);
-
-
-        // Draw a square
-        gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
-    }
-
-    public void dispose(GLAutoDrawable drawable) {
-        System.out.println("RedSquare: Dispose");
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
-        if(debug) {
-            System.out.println(Thread.currentThread()+" RedSquare.dispose: "+gl.getContext());
-        }
-        gl.glDisableClientState(gl.GL_VERTEX_ARRAY);
-        gl.glDisableClientState(gl.GL_COLOR_ARRAY);
-        glu.destroy();
-        glu = null;
-        colors.clear();
-        colors   = null;
-        vertices.clear();
-        vertices = null;
-        if(debug) {
-            System.out.println(Thread.currentThread()+" RedSquare.dispose: FIN");
-        }
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/es2/RedSquare0.java b/src/junit/com/jogamp/test/junit/jogl/demos/es2/RedSquare0.java
deleted file mode 100644
index 229635a..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/demos/es2/RedSquare0.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.test.junit.jogl.demos.es2;
-
-import com.jogamp.common.nio.Buffers;
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.GLArrayDataWrapper;
-import com.jogamp.opengl.util.PMVMatrix;
-import com.jogamp.test.junit.jogl.demos.es2.shader.RedSquareShader;
-import com.jogamp.test.junit.util.GLSLSimpleProgram;
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.nio.FloatBuffer;
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2ES2;
-import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLEventListener;
-import javax.media.opengl.GLUniformData;
-import org.junit.Assert;
-
-public class RedSquare0 implements GLEventListener {
-    ByteArrayOutputStream baos = new ByteArrayOutputStream();
-    PrintStream pbaos = new PrintStream(baos);
-    GLSLSimpleProgram myShader;
-    PMVMatrix pmvMatrix;
-    int mgl_PMVMatrix;
-    GLUniformData pmvMatrixUniform;
-    int mgl_Vertex;
-    int mgl_Color;
-    long t0;
-
-    public void init(GLAutoDrawable glad) {
-        GLContext context = glad.getContext();
-        context.makeCurrent();
-        GL2ES2 gl = context.getGL().getGL2ES2();
-        myShader = GLSLSimpleProgram.create(gl, RedSquareShader.VERTEX_SHADER_TEXT, RedSquareShader.FRAGMENT_SHADER_TEXT, true);
-        gl.glUseProgram(myShader.getShaderProgram());
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        // setup mgl_PMVMatrix
-        pmvMatrix = new PMVMatrix();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
-        pmvMatrix.glLoadIdentity();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
-        pmvMatrix.glLoadIdentity();
-        mgl_PMVMatrix = gl.glGetUniformLocation(myShader.getShaderProgram(), "mgl_PMVMatrix");
-        Assert.assertTrue(0 <= mgl_PMVMatrix);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
-        pmvMatrixUniform.setLocation(mgl_PMVMatrix);
-        gl.glUniform(pmvMatrixUniform);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        // Allocate Vertex Array
-        int components = 3;
-        int numElements = 4;
-        mgl_Vertex = gl.glGetAttribLocation(myShader.getShaderProgram(), "mgl_Vertex");
-        Assert.assertTrue(0 <= mgl_Vertex);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        FloatBuffer buffer = Buffers.newDirectFloatBuffer(numElements * components);
-        GLArrayDataWrapper vertices = GLArrayDataWrapper.createGLSL(gl, "mgl_Vertex", 3, gl.GL_FLOAT, false, 0, buffer, -1, 0);
-        {
-            // Fill them up
-            FloatBuffer verticeb = (FloatBuffer) vertices.getBuffer();
-            verticeb.put(-2);
-            verticeb.put(2);
-            verticeb.put(0);
-            verticeb.put(2);
-            verticeb.put(2);
-            verticeb.put(0);
-            verticeb.put(-2);
-            verticeb.put(-2);
-            verticeb.put(0);
-            verticeb.put(2);
-            verticeb.put(-2);
-            verticeb.put(0);
-        }
-        buffer.flip();
-        vertices.setLocation(mgl_Vertex);
-        gl.glEnableVertexAttribArray(mgl_Vertex);
-        gl.glVertexAttribPointer(vertices);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        // Allocate Color Array
-        components = 4;
-        numElements = 4;
-        mgl_Color = gl.glGetAttribLocation(myShader.getShaderProgram(), "mgl_Color");
-        Assert.assertTrue(0 <= mgl_Color);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        buffer = Buffers.newDirectFloatBuffer(numElements * components);
-        GLArrayDataWrapper colors = GLArrayDataWrapper.createGLSL(gl, "mgl_Color", 4, gl.GL_FLOAT, false, 0, buffer, -1, 0);
-        {
-            // Fill them up
-            FloatBuffer colorb = (FloatBuffer) colors.getBuffer();
-            colorb.put(1);
-            colorb.put(0);
-            colorb.put(0);
-            colorb.put(1);
-            colorb.put(0);
-            colorb.put(0);
-            colorb.put(1);
-            colorb.put(1);
-            colorb.put(1);
-            colorb.put(0);
-            colorb.put(0);
-            colorb.put(1);
-            colorb.put(1);
-            colorb.put(0);
-            colorb.put(0);
-            colorb.put(1);
-        }
-        buffer.flip();
-        colors.setLocation(mgl_Color);
-        gl.glEnableVertexAttribArray(mgl_Color);
-        gl.glVertexAttribPointer(colors);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        // OpenGL Render Settings
-        gl.glClearColor(0, 0, 0, 1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-        gl.glUseProgram(0);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
-        t0 = System.currentTimeMillis();
-    }
-
-    public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
-        GL2ES2 gl = glad.getGL().getGL2ES2();
-        gl.glUseProgram(myShader.getShaderProgram());
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        // Set location in front of camera
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
-        pmvMatrix.glLoadIdentity();
-        pmvMatrix.gluPerspective(45.0F, (float) width / (float) height, 1.0F, 100.0F);
-        //pmvMatrix.glOrthof(-4.0f, 4.0f, -4.0f, 4.0f, 1.0f, 100.0f);
-        gl.glUniform(pmvMatrixUniform);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        gl.glUseProgram(0);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-    }
-
-    public void display(GLAutoDrawable glad) {
-        long t1 = System.currentTimeMillis();
-
-        GL2ES2 gl = glad.getGL().getGL2ES2();
-        gl.glUseProgram(myShader.getShaderProgram());
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        // One rotation every four seconds
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
-        pmvMatrix.glLoadIdentity();
-        pmvMatrix.glTranslatef(0, 0, -10);
-        float ang = ((float) (t1 - t0) * 360.0F) / 4000.0F;
-        pmvMatrix.glRotatef(ang, 0, 0, 1);
-        pmvMatrix.glRotatef(ang, 0, 1, 0);
-        gl.glUniform(pmvMatrixUniform);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        // Draw a square
-        gl.glDrawArrays(gl.GL_TRIANGLE_STRIP, 0, 4);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        gl.glUseProgram(0);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-    }
-
-    public void dispose(GLAutoDrawable glad) {
-        GL2ES2 gl = glad.getGL().getGL2ES2();
-        gl.glDisableVertexAttribArray(mgl_Vertex);
-        gl.glDisableVertexAttribArray(mgl_Color);
-        myShader.release(gl);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        pmvMatrix.destroy();
-        pmvMatrix = null;
-        System.err.println("dispose done");
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/es2/shader/RedSquareShader.java b/src/junit/com/jogamp/test/junit/jogl/demos/es2/shader/RedSquareShader.java
deleted file mode 100644
index 5a365be..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/demos/es2/shader/RedSquareShader.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.test.junit.jogl.demos.es2.shader;
-
-public class RedSquareShader {
-    public static String VERTEX_SHADER_TEXT =
-                " #ifdef GL_ES\n" +
-                "  #define MEDIUMP mediump\n" +
-                "  #define HIGHP highp\n" +
-                "#else\n" +
-                "  #define MEDIUMP\n" +
-                "  #define HIGHP\n" +
-                "#endif\n" +
-                "\n" +
-                "uniform MEDIUMP mat4    mgl_PMVMatrix[2];\n" +
-                "attribute HIGHP vec4    mgl_Vertex;\n" +
-                "attribute HIGHP vec4    mgl_Color;\n" +
-                "varying   HIGHP vec4    frontColor;\n" +
-                "\n" +
-                "void main(void)\n" +
-                "{\n" +
-                "  frontColor=mgl_Color;\n" +
-                "  gl_Position = mgl_PMVMatrix[0] * mgl_PMVMatrix[1] * mgl_Vertex;\n" +
-                "}\n" ;
-
-    public static String FRAGMENT_SHADER_TEXT =
-                "#ifdef GL_ES\n" +
-                "  #define MEDIUMP mediump\n" +
-                "  #define HIGHP highp\n" +
-                "#else\n" +
-                "  #define MEDIUMP\n" +
-                "  #define HIGHP\n" +
-                "#endif\n" +
-                "\n" +
-                "varying   HIGHP vec4    frontColor;\n" +
-                "\n" +
-                "void main (void)\n" +
-                "{\n" +
-                "    gl_FragColor = frontColor;\n" +
-                "}\n" ;
-
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java
deleted file mode 100644
index d9194c2..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java
+++ /dev/null
@@ -1,316 +0,0 @@
-
-package com.jogamp.test.junit.jogl.demos.gl2.gears;
-
-import javax.media.opengl.*;
-
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.event.awt.*;
-import com.jogamp.newt.Window;
-
-/**
- * Gears.java <BR>
- * author: Brian Paul (converted to Java by Ron Cemer and Sven Gothel) <P>
- *
- * This version is equal to Brian Paul's version 1.2 1999/10/21
- */
-
-public class Gears implements GLEventListener {
-  private float view_rotx = 20.0f, view_roty = 30.0f, view_rotz = 0.0f;
-  private int gear1, gear2, gear3;
-  private float angle = 0.0f;
-  private int swapInterval;
-
-  private boolean mouseRButtonDown = false;
-  private int prevMouseX, prevMouseY;
-
-  public Gears(int swapInterval) {
-    this.swapInterval = swapInterval;
-  }
-
-  public Gears() {
-    this.swapInterval = 1;
-  }
-
-  public void init(GLAutoDrawable drawable) {
-    System.err.println("Gears: Init");
-    // Use debug pipeline
-    // drawable.setGL(new DebugGL(drawable.getGL()));
-
-    GL2 gl = drawable.getGL().getGL2();
-
-    float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f };
-    float red[] = { 0.8f, 0.1f, 0.0f, 0.7f };
-    float green[] = { 0.0f, 0.8f, 0.2f, 0.7f };
-    float blue[] = { 0.2f, 0.2f, 1.0f, 0.7f };
-
-    gl.glLightfv(GL2.GL_LIGHT0, GL2.GL_POSITION, pos, 0);
-    gl.glEnable(GL2.GL_CULL_FACE);
-    gl.glEnable(GL2.GL_LIGHTING);
-    gl.glEnable(GL2.GL_LIGHT0);
-    gl.glEnable(GL2.GL_DEPTH_TEST);
-            
-    /* make the gears */
-    gear1 = gl.glGenLists(1);
-    gl.glNewList(gear1, GL2.GL_COMPILE);
-    gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, red, 0);
-    gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
-    gl.glEndList();
-            
-    gear2 = gl.glGenLists(1);
-    gl.glNewList(gear2, GL2.GL_COMPILE);
-    gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, green, 0);
-    gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f);
-    gl.glEndList();
-            
-    gear3 = gl.glGenLists(1);
-    gl.glNewList(gear3, GL2.GL_COMPILE);
-    gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, blue, 0);
-    gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f);
-    gl.glEndList();
-            
-    gl.glEnable(GL2.GL_NORMALIZE);
-                
-    // MouseListener gearsMouse = new TraceMouseAdapter(new GearsMouseAdapter());
-    MouseListener gearsMouse = new GearsMouseAdapter();
-
-    if (drawable instanceof Window) {
-        Window window = (Window) drawable;
-        window.addMouseListener(gearsMouse);
-    } else if (GLProfile.isAWTAvailable() && drawable instanceof java.awt.Component) {
-        java.awt.Component comp = (java.awt.Component) drawable;
-        new AWTMouseAdapter(gearsMouse).addTo(comp);
-    }
-  }
-    
-  public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-    System.err.println("Gears: Reshape "+x+"/"+y+" "+width+"x"+height);
-    GL2 gl = drawable.getGL().getGL2();
-
-    gl.setSwapInterval(swapInterval);
-
-    float h = (float)height / (float)width;
-            
-    gl.glMatrixMode(GL2.GL_PROJECTION);
-
-    gl.glLoadIdentity();
-    gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
-    gl.glMatrixMode(GL2.GL_MODELVIEW);
-    gl.glLoadIdentity();
-    gl.glTranslatef(0.0f, 0.0f, -40.0f);
-  }
-
-  public void dispose(GLAutoDrawable drawable) {
-    System.err.println("Gears: Dispose");
-  }
-
-  public void display(GLAutoDrawable drawable) {
-    // Turn the gears' teeth
-    angle += 2.0f;
-
-    // Get the GL corresponding to the drawable we are animating
-    GL2 gl = drawable.getGL().getGL2();
-
-    gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
-
-    // Special handling for the case where the GLJPanel is translucent
-    // and wants to be composited with other Java 2D content
-    if (GLProfile.isAWTAvailable() && 
-        (drawable instanceof javax.media.opengl.awt.GLJPanel) &&
-        !((javax.media.opengl.awt.GLJPanel) drawable).isOpaque() &&
-        ((javax.media.opengl.awt.GLJPanel) drawable).shouldPreserveColorBufferIfTranslucent()) {
-      gl.glClear(GL2.GL_DEPTH_BUFFER_BIT);
-    } else {
-      gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
-    }
-            
-    // Rotate the entire assembly of gears based on how the user
-    // dragged the mouse around
-    gl.glPushMatrix();
-    gl.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
-    gl.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
-    gl.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
-            
-    // Place the first gear and call its display list
-    gl.glPushMatrix();
-    gl.glTranslatef(-3.0f, -2.0f, 0.0f);
-    gl.glRotatef(angle, 0.0f, 0.0f, 1.0f);
-    gl.glCallList(gear1);
-    gl.glPopMatrix();
-            
-    // Place the second gear and call its display list
-    gl.glPushMatrix();
-    gl.glTranslatef(3.1f, -2.0f, 0.0f);
-    gl.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
-    gl.glCallList(gear2);
-    gl.glPopMatrix();
-            
-    // Place the third gear and call its display list
-    gl.glPushMatrix();
-    gl.glTranslatef(-3.1f, 4.2f, 0.0f);
-    gl.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
-    gl.glCallList(gear3);
-    gl.glPopMatrix();
-            
-    // Remember that every push needs a pop; this one is paired with
-    // rotating the entire gear assembly
-    gl.glPopMatrix();
-  }
-
-  public static void gear(GL2 gl,
-                          float inner_radius,
-                          float outer_radius,
-                          float width,
-                          int teeth,
-                          float tooth_depth)
-  {
-    int i;
-    float r0, r1, r2;
-    float angle, da;
-    float u, v, len;
-
-    r0 = inner_radius;
-    r1 = outer_radius - tooth_depth / 2.0f;
-    r2 = outer_radius + tooth_depth / 2.0f;
-            
-    da = 2.0f * (float) Math.PI / teeth / 4.0f;
-            
-    gl.glShadeModel(GL2.GL_FLAT);
-
-    gl.glNormal3f(0.0f, 0.0f, 1.0f);
-
-    /* draw front face */
-    gl.glBegin(GL2.GL_QUAD_STRIP);
-    for (i = 0; i <= teeth; i++)
-      {
-        angle = i * 2.0f * (float) Math.PI / teeth;
-        gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
-        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
-        if(i < teeth)
-          {
-            gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
-            gl.glVertex3f(r1 * (float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f);
-          }
-      }
-    gl.glEnd();
-
-    /* draw front sides of teeth */
-    gl.glBegin(GL2.GL_QUADS);
-    for (i = 0; i < teeth; i++)
-      {
-        angle = i * 2.0f * (float) Math.PI / teeth;
-        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
-        gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f);
-        gl.glVertex3f(r2 * (float)Math.cos(angle + 2.0f * da), r2 * (float)Math.sin(angle + 2.0f * da), width * 0.5f);
-        gl.glVertex3f(r1 * (float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f);
-      }
-    gl.glEnd();
-    
-    /* draw back face */
-    gl.glBegin(GL2.GL_QUAD_STRIP);
-    for (i = 0; i <= teeth; i++)
-      {
-        angle = i * 2.0f * (float) Math.PI / teeth;
-        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
-        gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
-        gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
-        gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
-      }
-    gl.glEnd();
-    
-    /* draw back sides of teeth */
-    gl.glBegin(GL2.GL_QUADS);
-    for (i = 0; i < teeth; i++)
-      {
-        angle = i * 2.0f * (float) Math.PI / teeth;
-        gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
-        gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f);
-        gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f);
-        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
-      }
-    gl.glEnd();
-    
-    /* draw outward faces of teeth */
-    gl.glBegin(GL2.GL_QUAD_STRIP);
-    for (i = 0; i < teeth; i++)
-      {
-        angle = i * 2.0f * (float) Math.PI / teeth;
-        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
-        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
-        u = r2 * (float)Math.cos(angle + da) - r1 * (float)Math.cos(angle);
-        v = r2 * (float)Math.sin(angle + da) - r1 * (float)Math.sin(angle);
-        len = (float)Math.sqrt(u * u + v * v);
-        u /= len;
-        v /= len;
-        gl.glNormal3f(v, -u, 0.0f);
-        gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f);
-        gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f);
-        gl.glNormal3f((float)Math.cos(angle), (float)Math.sin(angle), 0.0f);
-        gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), width * 0.5f);
-        gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f);
-        u = r1 * (float)Math.cos(angle + 3 * da) - r2 * (float)Math.cos(angle + 2 * da);
-        v = r1 * (float)Math.sin(angle + 3 * da) - r2 * (float)Math.sin(angle + 2 * da);
-        gl.glNormal3f(v, -u, 0.0f);
-        gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), width * 0.5f);
-        gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
-        gl.glNormal3f((float)Math.cos(angle), (float)Math.sin(angle), 0.0f);
-      }
-    gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), width * 0.5f);
-    gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), -width * 0.5f);
-    gl.glEnd();
-    
-    gl.glShadeModel(GL2.GL_SMOOTH);
-    
-    /* draw inside radius cylinder */
-    gl.glBegin(GL2.GL_QUAD_STRIP);
-    for (i = 0; i <= teeth; i++)
-      {
-        angle = i * 2.0f * (float) Math.PI / teeth;
-        gl.glNormal3f(-(float)Math.cos(angle), -(float)Math.sin(angle), 0.0f);
-        gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
-        gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
-      }
-    gl.glEnd();
-  }
-
-  class GearsMouseAdapter extends MouseAdapter {
-      public void mousePressed(MouseEvent e) {
-        prevMouseX = e.getX();
-        prevMouseY = e.getY();
-        if ((e.getModifiers() & e.BUTTON3_MASK) != 0) {
-          mouseRButtonDown = true;
-        }
-      }
-        
-      public void mouseReleased(MouseEvent e) {
-        if ((e.getModifiers() & e.BUTTON3_MASK) != 0) {
-          mouseRButtonDown = false;
-        }
-      }
-        
-      public void mouseDragged(MouseEvent e) {
-        int x = e.getX();
-        int y = e.getY();
-        int width=0, height=0;
-        Object source = e.getSource();
-        if(source instanceof Window) {
-            Window window = (Window) source;
-            width=window.getWidth();
-            height=window.getHeight();
-        } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) {
-            java.awt.Component comp = (java.awt.Component) source;
-            width=comp.getWidth();
-            height=comp.getHeight();
-        } else {
-            throw new RuntimeException("Event source neither Window nor Component: "+source);
-        }
-        float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
-        float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
-        
-        prevMouseX = x;
-        prevMouseY = y;
-
-        view_rotx += thetaX;
-        view_roty += thetaY;
-      }
-  }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java
deleted file mode 100644
index 3e7e598..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.demos.gl2.gears;
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.util.Animator;
-import javax.media.opengl.awt.GLCanvas;
-import com.jogamp.newt.event.awt.AWTKeyAdapter;
-import com.jogamp.newt.event.awt.AWTWindowAdapter;
-import com.jogamp.newt.event.TraceKeyAdapter;
-import com.jogamp.newt.event.TraceWindowAdapter;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.util.QuitAdapter;
-import java.awt.Frame;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-public class TestGearsAWT extends UITestCase {
-    static GLProfile glp;
-    static int width, height;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        glp = GLProfile.getDefault();
-        Assert.assertNotNull(glp);
-        width  = 512;
-        height = 512;
-    }
-
-    @AfterClass
-    public static void releaseClass() {
-    }
-
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
-        Frame frame = new Frame("Gears AWT Test");
-        Assert.assertNotNull(frame);
-
-        GLCanvas glCanvas = new GLCanvas(caps);
-        Assert.assertNotNull(glCanvas);
-        frame.add(glCanvas);
-        frame.setSize(512, 512);
-
-        glCanvas.addGLEventListener(new Gears());
-
-        Animator animator = new Animator(glCanvas);
-        QuitAdapter quitAdapter = new QuitAdapter();
-
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glCanvas);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
-
-        frame.setVisible(true);
-        animator.start();
-
-        while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getDuration()<duration) {
-            Thread.sleep(100);
-        }
-
-        Assert.assertNotNull(frame);
-        Assert.assertNotNull(glCanvas);
-        Assert.assertNotNull(animator);
-
-        animator.stop();
-        Assert.assertEquals(false, animator.isAnimating());
-        frame.setVisible(false);
-        Assert.assertEquals(false, frame.isVisible());
-        frame.remove(glCanvas);
-        frame.dispose();
-        frame=null;
-        glCanvas=null;
-    }
-
-    @Test
-    public void test01() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
-        runTestGL(caps);
-    }
-
-    static long duration = 500; // ms
-
-    public static void main(String args[]) {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                i++;
-                try {
-                    duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
-            }
-        }
-        org.junit.runner.JUnitCore.main(TestGearsAWT.class.getName());
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java
deleted file mode 100644
index 8b3273a..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.demos.gl2.gears;
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.util.FPSAnimator;
-import javax.media.opengl.awt.GLJPanel;
-
-import com.jogamp.test.junit.util.UITestCase;
-import java.awt.AWTException;
-import java.awt.BorderLayout;
-import java.lang.reflect.InvocationTargetException;
-import javax.swing.JFrame;
-import javax.swing.SwingUtilities;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class TestGearsGLJPanelAWT extends UITestCase {
-    static GLProfile glp;
-    static int width, height;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(false);
-        glp = GLProfile.getDefault();
-        Assert.assertNotNull(glp);
-        width  = 512;
-        height = 512;
-    }
-
-    @AfterClass
-    public static void releaseClass() {
-    }
-
-    protected void runTestGL(GLCapabilities caps)
-            throws AWTException, InterruptedException, InvocationTargetException
-    {
-        JFrame frame = new JFrame("Swing GLJPanel");
-        Assert.assertNotNull(frame);
-
-        GLJPanel glJPanel = new GLJPanel(caps);
-        Assert.assertNotNull(glJPanel);
-        glJPanel.addGLEventListener(new Gears());
-
-        FPSAnimator animator = new FPSAnimator(glJPanel, 60);
-
-        final JFrame _frame = frame;
-        final GLJPanel _glJPanel = glJPanel;
-        SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    _frame.getContentPane().add(_glJPanel, BorderLayout.CENTER);
-                    _frame.setSize(512, 512);
-                    _frame.setVisible(true);
-                } } ) ;
-
-        animator.start();
-        Assert.assertEquals(true, animator.isAnimating());
-
-        while(animator.isAnimating() && animator.getDuration()<duration) {
-            Thread.sleep(100);
-        }
-
-        Assert.assertNotNull(frame);
-        Assert.assertNotNull(glJPanel);
-        Assert.assertNotNull(animator);
-
-        animator.stop();
-        Assert.assertEquals(false, animator.isAnimating());
-        SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    _frame.setVisible(false);
-                    _frame.getContentPane().remove(_glJPanel);
-                    _frame.remove(_glJPanel);
-                    _glJPanel.destroy();
-                    _frame.dispose();
-                } } );
-    }
-
-    @Ignore("not ready yet") @Test
-    public void test01()
-            throws AWTException, InterruptedException, InvocationTargetException
-    {
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
-        runTestGL(caps);
-    }
-
-    static long duration = 500; // ms
-
-    public static void main(String args[]) {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                i++;
-                try {
-                    duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
-            }
-        }
-        org.junit.runner.JUnitCore.main(TestGearsGLJPanelAWT.class.getName());
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/newt/TestGearsNEWT.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/newt/TestGearsNEWT.java
deleted file mode 100644
index d83deea..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/newt/TestGearsNEWT.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.demos.gl2.gears.newt;
-
-import com.jogamp.newt.event.KeyAdapter;
-import com.jogamp.newt.event.KeyEvent;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.util.QuitAdapter;
-
-import com.jogamp.opengl.util.Animator;
-
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-import javax.media.opengl.GLRunnable;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-public class TestGearsNEWT extends UITestCase {
-    static GLProfile glp;
-    static int width, height;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        glp = GLProfile.getDefault();
-        Assert.assertNotNull(glp);
-        width  = 512;
-        height = 512;
-    }
-
-    @AfterClass
-    public static void releaseClass() {
-    }
-
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
-        Assert.assertNotNull(glWindow);
-        glWindow.setTitle("Gears NEWT Test");
-
-        glWindow.addGLEventListener(new Gears());
-
-        Animator animator = new Animator(glWindow);
-        QuitAdapter quitAdapter = new QuitAdapter();
-
-        //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
-        //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
-        glWindow.addKeyListener(quitAdapter);
-        glWindow.addWindowListener(quitAdapter);
-
-        final GLWindow f_glWindow = glWindow;
-        glWindow.addKeyListener(new KeyAdapter() {
-            public void keyTyped(KeyEvent e) {
-                if(e.getKeyChar()=='f') {
-                    f_glWindow.invoke(false, new GLRunnable() {
-                        public void run(GLAutoDrawable drawable) {
-                            GLWindow win = (GLWindow)drawable;
-                            win.setFullscreen(!win.isFullscreen());
-                        } });
-                }
-            }
-        });
-
-        glWindow.setSize(width, height);
-        glWindow.setVisible(true);
-        animator.start();
-
-        while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getDuration()<duration) {
-            Thread.sleep(100);
-        }
-
-        animator.stop();
-        glWindow.invalidate();
-    }
-
-    @Test
-    public void test01() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
-        runTestGL(caps);
-    }
-
-    static long duration = 500; // ms
-
-    public static void main(String args[]) {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                i++;
-                try {
-                    duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
-            }
-        }
-        org.junit.runner.JUnitCore.main(TestGearsNEWT.class.getName());
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/newt/TestGearsNewtAWTWrapper.java b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/newt/TestGearsNewtAWTWrapper.java
deleted file mode 100644
index d0b8cc7..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/newt/TestGearsNewtAWTWrapper.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.demos.gl2.gears.newt;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.util.Animator;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.util.QuitAdapter;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import org.junit.After;
-import org.junit.Test;
-
-public class TestGearsNewtAWTWrapper extends UITestCase {
-    static GLProfile glp;
-    static int width, height;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        glp = GLProfile.getDefault();
-        Assert.assertNotNull(glp);
-        width  = 512;
-        height = 512;
-    }
-
-    @AfterClass
-    public static void releaseClass() {
-    }
-
-    protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException {
-        Display nDisplay = NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null, false); // local display
-        Screen nScreen  = NewtFactory.createScreen(nDisplay, 0); // screen 0
-        Window nWindow = NewtFactory.createWindow(nScreen, caps);
-
-        GLWindow glWindow = GLWindow.create(nWindow);
-        Assert.assertNotNull(glWindow);
-        glWindow.setTitle("Gears NewtAWTWrapper Test");
-
-        glWindow.addGLEventListener(new Gears());
-
-        Animator animator = new Animator(glWindow);
-        QuitAdapter quitAdapter = new QuitAdapter();
-
-        glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
-        glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
-
-        glWindow.setSize(width, height);
-        glWindow.setVisible(true);
-        animator.start();
-
-        while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getDuration()<duration) {
-            Thread.sleep(100);
-        }
-
-        animator.stop();
-        glWindow.invalidate();
-    }
-
-    @Test
-    public void test01() throws InterruptedException {
-        GLCapabilitiesImmutable caps = new GLCapabilities(GLProfile.getDefault());
-        runTestGL(caps);
-    }
-
-    static long duration = 500; // ms
-
-    public static void main(String args[]) {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                i++;
-                try {
-                    duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
-            }
-        }
-        org.junit.runner.JUnitCore.main(TestGearsNewtAWTWrapper.class.getName());
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/drawable/TestDrawable01NEWT.java b/src/junit/com/jogamp/test/junit/jogl/drawable/TestDrawable01NEWT.java
deleted file mode 100644
index 9b6194c..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/drawable/TestDrawable01NEWT.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.drawable;
-
-import com.jogamp.test.junit.util.UITestCase;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import javax.media.opengl.*;
-
-import com.jogamp.newt.*;
-import java.io.IOException;
-
-public class TestDrawable01NEWT extends UITestCase {
-    static GLProfile glp;
-    static GLDrawableFactory factory;
-    static int width, height;
-    GLCapabilities caps;
-    Window window;
-    GLDrawable drawable;
-    GLContext context;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        glp = GLProfile.getDefault();
-        Assert.assertNotNull(glp);
-        factory = GLDrawableFactory.getFactory(glp);
-        Assert.assertNotNull(factory);
-        width  = 640;
-        height = 480;
-    }
-
-    @AfterClass
-    public static void releaseClass() {
-        Assert.assertNotNull(factory);
-        factory=null;
-    }
-
-    @Before
-    public void initTest() {
-        caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-    }
-
-    void createWindow(boolean onscreen, boolean pbuffer, boolean undecorated) {
-        caps.setOnscreen(onscreen);
-        caps.setPBuffer(!onscreen && pbuffer);
-        caps.setDoubleBuffered(onscreen);
-        // System.out.println("Requested: "+caps);
-
-        //
-        // Create native windowing resources .. X11/Win/OSX
-        // 
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-
-        window = NewtFactory.createWindow(screen, caps);
-        Assert.assertNotNull(window);
-        window.setUndecorated(onscreen && undecorated);
-        window.setSize(width, height);
-        window.setVisible(true);
-        // System.out.println("Created: "+window);
-
-        //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
-        // equivalent to GLAutoDrawable methods: setVisible(true)
-        // 
-        GLCapabilities glCaps = (GLCapabilities) window.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
-        Assert.assertNotNull(glCaps);
-        Assert.assertTrue(glCaps.getGreenBits()>5);
-        Assert.assertTrue(glCaps.getBlueBits()>5);
-        Assert.assertTrue(glCaps.getRedBits()>5);
-        Assert.assertEquals(glCaps.isOnscreen(),onscreen);
-        Assert.assertTrue(onscreen || !pbuffer || glCaps.isPBuffer()); // pass if onscreen, or !pbuffer req. or have pbuffer
-        Assert.assertEquals(glCaps.getDoubleBuffered(),onscreen);
-        Assert.assertTrue(glCaps.getDepthBits()>4);
-
-        drawable = factory.createGLDrawable(window);
-        Assert.assertNotNull(drawable);
-        // System.out.println("Pre: "+drawable);
-        //
-        drawable.setRealized(true);
-        // Assert.assertEquals(width,drawable.getWidth());
-        // Assert.assertEquals(height,drawable.getHeight());
-        // Assert.assertEquals(glCaps,drawable.getChosenGLCapabilities());
-        Assert.assertEquals(window,drawable.getNativeSurface());
-        // System.out.println("Post: "+drawable);
-
-        context = drawable.createContext(null);
-        Assert.assertNotNull(context);
-        // System.out.println(context);
-        
-        int res = context.makeCurrent();
-        Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
-
-        // draw something ..
-
-        drawable.swapBuffers();
-        context.release();
-
-        // System.out.println("Final: "+window);
-    }
-
-    void destroyWindow() {
-        // GLWindow.dispose(..) sequence
-        Assert.assertNotNull(context);
-        context.destroy();
-
-        Assert.assertNotNull(drawable);
-        drawable.setRealized(false);
-
-        // GLWindow.destroy(..) sequence cont..
-        Assert.assertNotNull(window);
-        window.invalidate();
-
-        drawable = null;
-        context = null;
-        window = null;
-    }
-
-    @Test
-    public void testOnScreenDecorated() throws InterruptedException {
-        createWindow(true, false, false);
-        Thread.sleep(1000); // 1000 ms
-        destroyWindow();
-    }
-
-    @Test
-    public void testOnScreenUndecorated() throws InterruptedException {
-        createWindow(true, false, true);
-        Thread.sleep(1000); // 1000 ms
-        destroyWindow();
-    }
-
-    public static void main(String args[]) throws IOException {
-        String tstname = TestDrawable01NEWT.class.getName();
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java b/src/junit/com/jogamp/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java
deleted file mode 100644
index f1b4297..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.test.junit.jogl.glsl;
-
-import com.jogamp.test.junit.jogl.demos.es2.RedSquare0;
-import com.jogamp.test.junit.util.GLSLSimpleProgram;
-import com.jogamp.test.junit.util.UITestCase;
-
-
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLProfile;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.test.junit.jogl.demos.es2.shader.RedSquareShader;
-import com.jogamp.test.junit.util.MiscUtils;
-
-import java.io.IOException;
-import javax.media.opengl.GL2ES2;
-import org.junit.AfterClass;
-
-public class TestGLSLSimple01NEWT extends UITestCase {
-    static long durationPerTest = 100; // ms
-
-    @BeforeClass
-    public static void initClass() {
-        System.err.println("class init");
-        GLProfile.initSingleton(true);
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        System.err.println("class tear down ..");
-        GLProfile.shutdown();
-        System.err.println("class tear down end");
-    }
-
-    @Test(timeout=60000)
-    public void testGLSLCompilation01() {
-        GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
-        Assert.assertNotNull(glp);
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-
-        GLWindow window = GLWindow.create(caps);
-        Assert.assertNotNull(window);
-        window.setSize(800, 600);
-        window.setVisible(true);
-        Assert.assertTrue(window.isNativeValid());
-
-        GLContext context = window.getContext();
-        context.setSynchronized(true);
-        
-        // trigger native creation of drawable/context
-        window.display();
-        Assert.assertTrue(window.isRealized());
-        Assert.assertTrue(window.getContext().isCreated());
-
-        context.makeCurrent();
-
-        // given
-
-        GL2ES2 gl = context.getGL().getGL2ES2();
-        GLSLSimpleProgram myShader = GLSLSimpleProgram.create(gl,
-                RedSquareShader.VERTEX_SHADER_TEXT,
-                RedSquareShader.FRAGMENT_SHADER_TEXT,
-                true);
-
-        myShader.release(gl);
-        context.release();
-        window.destroy();
-    }
-
-    @Test(timeout=60000)
-    public void testGLSLUse01() throws InterruptedException {
-        GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
-        Assert.assertNotNull(glp);
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-
-        GLWindow window = GLWindow.create(caps);
-        Assert.assertNotNull(window);
-        window.setSize(800, 600);
-        window.setVisible(true);
-        Assert.assertTrue(window.isNativeValid());
-        window.addGLEventListener(new RedSquare0());
-        
-        Animator animator = new Animator(window);
-        animator.start();
-        Assert.assertEquals(true, animator.isAnimating());
-        while(animator.isAnimating() && animator.getDuration()<durationPerTest) {
-            Thread.sleep(100);
-        }
-        Assert.assertEquals(true, animator.isAnimating());
-
-        window.destroy();
-        animator.stop();
-    }
-
-    public static void main(String args[]) throws IOException {
-        System.err.println("main - start");
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
-            }
-        }
-        String tstname = TestGLSLSimple01NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-        System.err.println("main - end");
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java b/src/junit/com/jogamp/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java
deleted file mode 100644
index 8da48dc..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java
+++ /dev/null
@@ -1,231 +0,0 @@
-package com.jogamp.test.junit.jogl.glsl;
-
-import com.jogamp.test.junit.util.UITestCase;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-
-import javax.media.opengl.GL3;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLProfile;
-
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.util.glsl.ShaderUtil;
-
-import java.io.IOException;
-import org.junit.AfterClass;
-
-/**
- * Bug 'Function glTransformFeedbackVaryings incorrectly passes argument'
- * http://jogamp.org/bugzilla/show_bug.cgi?id=407
- */
-public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
-
-    private String VERTEX_SHADER_TEXT;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-    }
-
-    @AfterClass
-    public static void tearDownClass() {
-        GLProfile.shutdown();
-    }
-
-    class MyShader {
-        int shaderProgram;
-        int vertShader;
-
-        MyShader(int shaderProgram, int vertShader) {
-            this.shaderProgram = shaderProgram;
-            this.vertShader = vertShader;
-        }
-    }
-
-    private MyShader getShader(GL3 gl, String text, int type) {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        PrintStream pbaos = new PrintStream(baos);
-
-        int shaderProgram = gl.glCreateProgram();
-
-        int vertShader = gl.glCreateShader(type);
-
-        String[] lines = new String[]{text};
-        int[] lengths = new int[]{lines[0].length()};
-        gl.glShaderSource(vertShader, lines.length, lines, lengths, 0);
-        gl.glCompileShader(vertShader);
-
-        if(!ShaderUtil.isShaderStatusValid(gl, vertShader, gl.GL_COMPILE_STATUS, pbaos)) {
-            System.out.println("getShader:postCompile: "+baos.toString());
-            Assert.assertTrue(false);
-        }
-        pbaos.flush(); baos.reset();
-
-        gl.glAttachShader(shaderProgram, vertShader);
-
-        return new MyShader(shaderProgram, vertShader);
-    }
-
-    private void releaseShader(GL3 gl, MyShader myShader) {
-        if(null!=myShader) {
-            gl.glDetachShader(myShader.shaderProgram, myShader.vertShader);
-            gl.glDeleteShader(myShader.vertShader);
-            gl.glDeleteProgram(myShader.shaderProgram);
-        }
-    }
-
-
-    private GLWindow prepareTest() {
-        if(!GLProfile.isGL3Available()) {
-            System.err.println("GL3 not available");
-            System.err.println(GLProfile.glAvailabilityToString());
-            return null;
-        }
-        VERTEX_SHADER_TEXT =
-                  "#version 150                           \n"
-                + "                                       \n"
-                + "out vec4 Position;                     \n"
-                + "                                       \n"
-                + "void main() {                          \n"
-                + "  Position = vec4(1.0, 1.0, 1.0, 1.0); \n"
-                + "}                                      \n";
-
-        GLCapabilities caps;        
-
-        GLProfile glp = null;
-        try {
-            glp = GLProfile.get(GLProfile.GL3);
-        } catch (Throwable t) {
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-        caps = new GLCapabilities(glp);
-
-        caps.setOnscreen(true);
-        caps.setDoubleBuffered(true);
-
-        GLWindow window = GLWindow.create(caps);
-        Assert.assertNotNull(window);
-        window.setUndecorated(true);
-        window.setSize(800, 600);
-        window.setVisible(true);
-        Assert.assertTrue(window.isNativeValid());
-
-        window.getContext().setSynchronized(true);
-
-        // trigger native creation of drawable/context
-        window.display();
-        Assert.assertTrue(window.isRealized());
-        Assert.assertTrue(window.getContext().isCreated());
-
-        return window;
-    }
-
-    private void cleanupTest(GLWindow window) {
-        if(null!=window) {
-            window.destroy();
-        }
-    }
-
-    @Test(timeout=60000)
-    public void testGlTransformFeedbackVaryings_WhenVarNameOK() {
-        if(!GLProfile.isGL3Available()) {
-            return;
-        }
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        PrintStream pbaos = new PrintStream(baos);
-
-        GLWindow window = prepareTest();
-        GLContext context = window.getContext();
-        context.makeCurrent();
-
-        // given
-
-        GL3 gl = context.getGL().getGL3();
-        MyShader myShader = getShader(gl, VERTEX_SHADER_TEXT, GL3.GL_VERTEX_SHADER);
-        String[] vars = new String[]{"Position"};
-
-        // when
-
-        gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL3.GL_SEPARATE_ATTRIBS);
-        gl.glLinkProgram(myShader.shaderProgram);
-
-        // then
-
-        boolean error = false;
-
-        if(!ShaderUtil.isProgramValid(gl, myShader.shaderProgram, pbaos)) {
-            System.out.println("Error (unexpected link error) - testGlTransformFeedbackVaryings_WhenVarNameOK:postLink: "+baos.toString());
-            error = true;
-        }
-        pbaos.flush(); baos.reset();
-
-        Assert.assertEquals(GL3.GL_NO_ERROR, gl.glGetError());
-
-        releaseShader(gl, myShader);
-        context.release();
-        cleanupTest(window);
-
-        Assert.assertFalse(error);
-    }
-
-    @Test(timeout=60000)
-    public void testGlTransformFeedbackVaryings_WhenVarNameWrong() {
-        if(!GLProfile.isGL3Available()) {
-            return;
-        }
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        PrintStream pbaos = new PrintStream(baos);
-
-        GLWindow window = prepareTest();
-        GLContext context = window.getContext();
-        context.makeCurrent();
-
-        // given
-
-        GL3 gl = context.getGL().getGL3();
-        MyShader myShader = getShader(gl, VERTEX_SHADER_TEXT, GL3.GL_VERTEX_SHADER);
-        String[] vars = new String[]{"PPPosition"};
-
-        // when
-
-        gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL3.GL_SEPARATE_ATTRIBS);
-        gl.glLinkProgram(myShader.shaderProgram);
-
-        // then
-
-        boolean error = false;
-
-        if(!ShaderUtil.isProgramValid(gl, myShader.shaderProgram, pbaos)) {
-            System.out.println("GOOD (expected link error) - testGlTransformFeedbackVaryings_WhenVarNameWrong:postLink: "+baos.toString());
-            // should be invalid, due to wrong var name
-        } else {
-            // oops 
-            System.out.println("Error (unexpected link success) - testGlTransformFeedbackVaryings_WhenVarNameWrong link worked, but it should not");
-            error = true;
-        }
-        pbaos.flush(); baos.reset();
-
-        Assert.assertEquals(GL3.GL_NO_ERROR, gl.glGetError());
-        // You cannot assume this error message - Assert.assertTrue(baos.toString().contains("(named PPPosition)"));
-
-        releaseShader(gl, myShader);
-        context.release();
-        cleanupTest(window);
-
-        Assert.assertFalse(error);
-    }
-
-    public static void main(String args[]) throws IOException {
-        String tstname = TestTransformFeedbackVaryingsBug407NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java b/src/junit/com/jogamp/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
deleted file mode 100644
index fef0e5a..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.newt;
-
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-import com.jogamp.test.junit.util.*;
-
-import java.lang.reflect.InvocationTargetException;
-import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLProfile;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.awt.GLCanvas;
-import com.jogamp.opengl.util.Animator;
-
-import com.jogamp.newt.Screen;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.AWTException;
-import java.awt.Robot;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.InputEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import javax.media.opengl.GLEventListener;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.BorderFactory;
-import javax.swing.border.Border;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
-    static long durationPerTest = 500; // ms
-    static Robot robot;
-    static Border border;
-    static JFrame frame;
-    static JButton button;
-    static JPanel panel;
-    static JPanel colorPanel;
-    static boolean windowClosing;
-
-    boolean modLightBrighter = true;
-
-    Color modLight(Color c) {
-        Color c2;
-        if(modLightBrighter) {
-            c2 = c.brighter();
-        } else {
-            c2 = c.darker();
-        }
-        if(c2.equals(c)) {
-            modLightBrighter = !modLightBrighter;
-        }
-        return c2;
-    }
-
-    class SwingGLAction implements GLEventListener {
-        public void init(GLAutoDrawable glad) {
-        }
-
-        public void dispose(GLAutoDrawable glad) {
-        }
-
-        public void display(GLAutoDrawable glad) {
-            colorPanel.setBackground(modLight(colorPanel.getBackground()));
-            colorPanel.repaint();
-        }
-
-        public void reshape(GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
-        }
-    }
-
-    @BeforeClass
-    public static void setup() throws InterruptedException, InvocationTargetException, AWTException {
-        int count;
-
-        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.setup(): Start Pre-JOGL-Swing");
-
-        // GLProfile.initSingleton(false);
-        // GLProfile.initSingleton(true);
-
-        // simulate AWT usage before JOGL's initialization of X11 threading
-        windowClosing=false;
-        border = BorderFactory.createLineBorder (Color.yellow, 2);
-
-        panel = new JPanel();
-        panel.setLayout(new BorderLayout());
-
-        button = new JButton("Click me");
-        button.addMouseListener(new MouseAdapter() {
-            public void mouseClicked(MouseEvent e) {
-                System.err.println("Test: "+e);
-            }
-        });
-        panel.add(button, BorderLayout.NORTH);
-
-        colorPanel = new JPanel();
-        Dimension size = new Dimension(400,100);
-        colorPanel.setPreferredSize(size);
-        colorPanel.setBorder(border);
-        panel.add(colorPanel, BorderLayout.SOUTH);
-
-        frame = new JFrame("PRE JOGL");
-        frame.addWindowListener( new WindowAdapter() {
-            public void windowClosing(WindowEvent ev) {
-                windowClosing=true;
-            }
-        });
-        frame.setContentPane(panel);
-        frame.setSize(512, 512);
-        frame.setLocation(0, 0);
-        frame.pack();
-
-        // AWT/Swing: From here on (post setVisible(true)
-        //            you need to use AWT/Swing's invokeAndWait()
-
-        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                frame.setVisible(true);
-                colorPanel.setBackground(Color.white);
-                colorPanel.repaint();
-            }});
-
-        robot = new Robot();
-        robot.setAutoWaitForIdle(true);
-
-        AWTRobotUtil.toFront(robot, frame);
-        AWTRobotUtil.requestFocus(robot, button);
-
-        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.setup(): Before JOGL init");
-
-        GLProfile.initSingleton(false);
-
-        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.setup(): End Pre-JOGL-Swing");
-    }
-
-    @AfterClass
-    public static void release() throws InterruptedException, InvocationTargetException {
-        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.release(): Start");
-        robot = null;
-        Assert.assertNotNull(frame);
-        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                frame.dispose();
-            }
-        });
-        frame=null;
-        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.release(): End");
-    }
-
-    protected void runTestGL(final Canvas canvas, GLAutoDrawable drawable) 
-        throws AWTException, InterruptedException, InvocationTargetException {
-
-        Dimension size = new Dimension(400,400);
-        canvas.setPreferredSize(size);
-
-        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                panel.add(canvas, BorderLayout.CENTER);
-                frame.pack();
-            }
-        });
-
-        AWTRobotUtil.toFront(robot, frame);
-
-        drawable.addGLEventListener(new Gears());
-
-        for(int i=0; i<100; i++) {
-            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    colorPanel.setBackground(modLight(colorPanel.getBackground()));
-                    colorPanel.repaint();
-                }
-            });
-            drawable.display(); // one in process display
-            Thread.sleep(10);
-        }
-
-        colorPanel.setBackground(Color.blue);
-        drawable.addGLEventListener(new SwingGLAction());
-
-        Point p0 = canvas.getLocationOnScreen();
-        Rectangle r0 = canvas.getBounds();
-        robot.mouseMove( (int) ( p0.getX() + .5 ) ,
-                         (int) ( p0.getY() + .5 ) );
-        robot.mousePress(InputEvent.BUTTON1_MASK);
-        for(int i=0; !windowClosing && i<durationPerTest/10; i++) {
-            p0.translate(1,1);
-            robot.mouseMove( (int) ( p0.getX() + .5 ) ,
-                             (int) ( p0.getY() + .5 ) );
-            Thread.sleep(10);
-        }
-        robot.mouseRelease(InputEvent.BUTTON1_MASK);
-
-        for(int i=0; !windowClosing && i<durationPerTest/100; i++) {
-            Thread.sleep(100);
-        }
-
-        Assert.assertNotNull(canvas);
-        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                panel.remove(canvas);
-                frame.pack();
-            }
-        });
-    }
-
-    @Test
-    public void test01NewtCanvasAWT() throws AWTException, InterruptedException, InvocationTargetException {
-        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test01NewtCanvasAWT(): Start");
-
-        GLProfile glp = GLProfile.getDefault();
-        GLCapabilities caps = new GLCapabilities(glp);
-
-        GLWindow win0 = GLWindow.create(caps);
-        win0.setSize(100,100);
-        win0.setVisible(true);
-        Screen screen = win0.getScreen();
-        win0.setPosition(screen.getWidth()-150, 0);
-        win0.addGLEventListener(new Gears());
-        Animator anim = new Animator(win0);
-        anim.start();
-
-        GLWindow win1 = GLWindow.create(caps);
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(win1);
-        anim.add(win1);
-        runTestGL(newtCanvasAWT, win1);
-
-        win0.destroy();
-        Assert.assertEquals(true, anim.isAnimating());
-
-        newtCanvasAWT.destroy();
-
-        win0.invalidate();
-        Assert.assertEquals(true, anim.isAnimating());
-        win1.invalidate();
-        Assert.assertEquals(false, anim.isAnimating());
-
-        anim.stop();
-
-        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test01NewtCanvasAWT(): End");
-    }
-
-    @Test
-    public void test02GLCanvas() throws AWTException, InterruptedException, InvocationTargetException {
-        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test02GLCanvas(): Start");
-        GLProfile glp = GLProfile.getDefault();
-        GLCapabilities caps = new GLCapabilities(glp);
-
-        Animator anim = new Animator();
-        anim.start();
-
-        /**
-         * Using GLCanvas _and_ NEWT side by side currently causes a deadlock
-         * in AWT with AMD drivers !
-         *
-        GLWindow win0 = GLWindow.create(caps);
-        win0.setSize(100,100);
-        win0.setVisible(true);
-        Screen screen = win0.getScreen();
-        win0.setPosition(screen.getWidth()-150, 0);
-        win0.addGLEventListener(new Gears());
-        anim.add(win0);
-         */
-
-        GLCanvas glCanvas = new GLCanvas(caps);
-        anim.add(glCanvas);
-        runTestGL(glCanvas, glCanvas);
-
-        /**
-        win0.destroy();
-        Assert.assertEquals(true, anim.isAnimating());
-         */
-        anim.stop();
-        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test02GLCanvas(): End");
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        System.out.println("durationPerTest: "+durationPerTest);
-        org.junit.runner.JUnitCore.main(TestSwingAWTRobotUsageBeforeJOGLInitBug411.class.getName());
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBuffer2File.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBuffer2File.java
deleted file mode 100644
index b09d277..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBuffer2File.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.offscreen;
-
-import java.io.IOException;
-import javax.media.opengl.*;
-
-import com.jogamp.opengl.util.texture.TextureIO;
-import java.io.File;
-
-public class ReadBuffer2File extends ReadBufferBase {
-
-    public ReadBuffer2File(GLDrawable externalRead) {
-        super(externalRead);
-    }
-
-    @Override
-    public void dispose(GLAutoDrawable drawable) {
-        super.dispose(drawable);
-    }
-    int shotNum = 0;
-
-    void copyTextureData2File() throws IOException {
-        if (!readBufferUtil.isValid()) {
-            return;
-        }
-
-        File file = File.createTempFile("shot" + shotNum + "-", ".ppm");
-        TextureIO.write(readBufferUtil.getTextureData(), file);
-        System.out.println("Wrote: " + file.getAbsolutePath() + ", ...");
-        shotNum++;
-        readBufferUtil.rewindPixelBuffer();
-    }
-
-    @Override
-    public void display(GLAutoDrawable drawable) {
-        super.display(drawable);
-        try {
-            copyTextureData2File();
-        } catch (IOException ex) {
-            throw new RuntimeException("can not read buffer to file", ex);
-        }
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBuffer2Screen.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBuffer2Screen.java
deleted file mode 100644
index 5d414c7..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBuffer2Screen.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.offscreen;
-
-import java.nio.*;
-import javax.media.opengl.*;
-import javax.media.opengl.fixedfunc.*;
-
-import com.jogamp.opengl.util.*;
-
-import javax.media.opengl.fixedfunc.GLPointerFunc;
-import com.jogamp.opengl.util.texture.TextureCoords;
-import com.jogamp.opengl.util.GLArrayDataClient;
-import com.jogamp.opengl.util.GLArrayDataServer;
-
-public class ReadBuffer2Screen extends ReadBufferBase {
-    PMVMatrix pmvMatrix;
-    GLArrayDataClient readTextureVertices = null;
-    GLArrayDataClient readTextureCoords = null;
-    boolean enableBufferAlways = false; // FIXME
-    boolean enableBufferVBO    = true; // FIXME
-
-    public ReadBuffer2Screen (GLDrawable externalRead) {
-        super(externalRead);
-    }
-
-    @Override
-    public void init(GLAutoDrawable drawable) {
-        super.init(drawable);
-
-        GL gl = drawable.getGL();
-
-        pmvMatrix = new PMVMatrix();
-
-        float f_edge = 1f;
-        if(null==readTextureVertices) {
-            //readTextureVertices = GLArrayDataClient.createFixed(gl, GLPointerFunc.GL_VERTEX_ARRAY, "mgl_Vertex", 
-            //                                                    2, GL.GL_FLOAT, true, 4);
-            readTextureVertices = GLArrayDataServer.createFixed(gl, GLPointerFunc.GL_VERTEX_ARRAY, "mgl_Vertex", 
-                                                                2, GL.GL_FLOAT, true, 4, GL.GL_STATIC_DRAW);
-            readTextureVertices.setEnableAlways(enableBufferAlways);
-            readTextureVertices.setVBOUsage(enableBufferVBO);
-            {
-                FloatBuffer vb = (FloatBuffer)readTextureVertices.getBuffer();
-                vb.put(-f_edge); vb.put(-f_edge);
-                vb.put( f_edge); vb.put(-f_edge);
-                vb.put(-f_edge); vb.put( f_edge);
-                vb.put( f_edge); vb.put( f_edge);
-            }
-            readTextureVertices.seal(gl, true);
-            System.out.println(readTextureVertices);
-        }
-
-        // Clear background to gray
-        gl.glClearColor(0.5f, 0.5f, 0.5f, 0.4f);
-    }
-
-    @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        super.reshape(drawable, x, y, width, height);
-
-        GL gl = drawable.getGL();
-
-        gl.glViewport(0, 0, width, height);
-
-        if(gl instanceof GLLightingFunc) {
-            ((GLLightingFunc)gl).glShadeModel(GLLightingFunc.GL_SMOOTH);
-        }
-
-        GLMatrixFunc glM;
-        if(gl instanceof GLMatrixFunc) {
-            glM = (GLMatrixFunc)gl;
-        } else {
-            throw new GLException("ES2 currently unhandled .. ");
-        }
-
-        // Identity ..
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
-        pmvMatrix.glLoadIdentity();
-        pmvMatrix.glTranslatef(0, 0, -2.5f);
-        if(null!=glM) {
-            glM.glMatrixMode(PMVMatrix.GL_MODELVIEW);
-            glM.glLoadMatrixf(pmvMatrix.glGetMvMatrixf());
-        }
-
-        // Set location in front of camera
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
-        pmvMatrix.glLoadIdentity();
-        pmvMatrix.gluPerspective(45.0f, (float)width / (float)height, 1.0f, 100.0f);
-        if(null!=glM) {
-            glM.glMatrixMode(PMVMatrix.GL_PROJECTION);
-            glM.glLoadMatrixf(pmvMatrix.glGetPMatrixf());
-        }
-    }
-
-    @Override
-    public void dispose(GLAutoDrawable drawable) {
-        super.dispose(drawable);
-    }
-
-    void renderOffscreenTexture(GL gl) {
-      if(!readBufferUtil.isValid()) return;
-
-      // Now draw one quad with the texture
-      readBufferUtil.getTexture().enable();
-      readBufferUtil.getTexture().bind();
-
-      if(gl.isGL2ES1()) {
-          // gl.getGL2ES1().glTexEnvi(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_MODE, GL2ES1.GL_REPLACE);
-          gl.getGL2ES1().glTexEnvi(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_MODE, GL2ES1.GL_MODULATE);
-      }
-
-      updateTextureCoords(gl, false);
-
-      readTextureVertices.enableBuffer(gl, true);
-      if(null!=readTextureCoords) {
-          readTextureCoords.enableBuffer(gl, true);
-      }
-      gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, readTextureVertices.getElementNumber());
-      /**
-      if(null!=readTextureCoords) {
-          readTextureCoords.enableBuffer(gl, false);
-      }
-      readTextureVertices.enableBuffer(gl, false); */
-
-      readBufferUtil.getTexture().disable();
-    }
-
-    void updateTextureCoords(GL gl, boolean force) {
-        if(force || null==readTextureCoords) {
-            readTextureCoords = GLArrayDataServer.createFixed(gl, GLPointerFunc.GL_TEXTURE_COORD_ARRAY, "mgl_MultiTexCoord0", 
-                                                              2, GL.GL_FLOAT, true, 4, GL.GL_STATIC_DRAW);
-            readTextureCoords.setEnableAlways(enableBufferAlways);
-            readTextureCoords.setVBOUsage(enableBufferVBO);
-            {
-                TextureCoords coords = readBufferUtil.getTexture().getImageTexCoords();
-                FloatBuffer cb = (FloatBuffer)readTextureCoords.getBuffer();
-                cb.put(coords.left());  cb.put(coords.bottom());
-                cb.put(coords.right()); cb.put(coords.bottom());
-                cb.put(coords.left());  cb.put(coords.top());
-                cb.put(coords.right()); cb.put(coords.top());
-            }
-            readTextureCoords.seal(gl, true);
-            System.out.println(readTextureCoords);
-        }
-    }
-
-    @Override
-    public void display(GLAutoDrawable drawable) {
-        super.display(drawable);
-
-        GL gl = drawable.getGL();
-
-        gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT);
-        if(gl instanceof GLLightingFunc) {
-            ((GLLightingFunc)gl).glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
-        }
-
-        renderOffscreenTexture(gl);
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBufferBase.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBufferBase.java
deleted file mode 100644
index bd85dd8..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBufferBase.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.offscreen;
-
-import javax.media.opengl.*;
-
-public class ReadBufferBase implements GLEventListener {
-    public boolean glDebug = false ;
-    public boolean glTrace = false ;
-
-    protected GLDrawable externalRead;
-
-    ReadBufferUtil readBufferUtil = new ReadBufferUtil();
-
-    public ReadBufferBase (GLDrawable externalRead) {
-        this.externalRead = externalRead ;
-    }
-
-    public void init(GLAutoDrawable drawable) {
-        GL _gl = drawable.getGL();
-
-        _gl.glGetError(); // flush error ..
-
-        if(glDebug) {
-            try {
-                _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, _gl, null) );
-            } catch (Exception e) {
-                throw new RuntimeException("can not set debug pipeline", e);
-            }
-        }
-
-        if(glTrace) {
-            try {
-                _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, _gl, new Object[] { System.err } ) );
-            } catch (Exception e) {
-                throw new RuntimeException("can not set trace pipeline", e);
-            }
-        }
-
-        System.out.println(_gl);
-
-        _gl.getContext().setGLDrawableRead(externalRead);
-        if(_gl.isGL2GL3()) {
-            _gl.getGL2GL3().glReadBuffer(GL2GL3.GL_FRONT);
-        }
-        System.out.println("---------------------------");
-        System.out.println(_gl.getContext());
-        System.out.println("---------------------------");
-    }
-
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-    }
-
-    public void dispose(GLAutoDrawable drawable) {
-        readBufferUtil.dispose();
-    }
-
-    public void display(GLAutoDrawable drawable) {
-        GL gl = drawable.getGL();
-
-        readBufferUtil.fetchOffscreenTexture(drawable, gl);
-    }
-
-}
-
diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBufferUtil.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBufferUtil.java
deleted file mode 100644
index f10a60a..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBufferUtil.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.offscreen;
-
-import com.jogamp.opengl.util.GLBuffers;
-import java.nio.*;
-import javax.media.opengl.*;
-
-import com.jogamp.opengl.util.texture.Texture;
-import com.jogamp.opengl.util.texture.TextureData;
-
-public class ReadBufferUtil {
-    protected int readPixelSizeLast = 0;
-    protected Buffer readPixelBuffer = null;
-    protected TextureData readTextureData = null;
-    protected Texture readTexture = new Texture(GL.GL_TEXTURE_2D);
-
-    public Buffer getPixelBuffer() { return readPixelBuffer; }
-    public void rewindPixelBuffer() { readPixelBuffer.rewind(); }
-
-    public TextureData getTextureData() { return readTextureData; }
-    public Texture getTexture() { return readTexture; }
-
-    public boolean isValid() {
-      return null!=readTexture && null!=readTextureData && null!=readPixelBuffer ;
-    }
-
-    public void fetchOffscreenTexture(GLDrawable drawable, GL gl) {
-        int readPixelSize = drawable.getWidth() * drawable.getHeight() * 3 ; // RGB
-        boolean newData = false;
-        if(readPixelSize>readPixelSizeLast) {
-            readPixelBuffer = GLBuffers.newDirectGLBuffer(GL.GL_UNSIGNED_BYTE, readPixelSize);
-            readPixelSizeLast = readPixelSize ;
-            try {
-                readTextureData = new TextureData(
-                           gl.getGLProfile(),
-                           // gl.isGL2GL3()?gl.GL_RGBA:gl.GL_RGB,
-                           gl.GL_RGB,
-                           drawable.getWidth(), drawable.getHeight(),
-                           0, 
-                           gl.GL_RGB,
-                           gl.GL_UNSIGNED_BYTE,
-                           false, false, 
-                           false /* flip */,
-                           readPixelBuffer,
-                           null /* Flusher */);
-                newData = true;
-            } catch (Exception e) {
-                readTextureData = null;
-                readPixelBuffer = null;
-                readPixelSizeLast = 0;
-                throw new RuntimeException("can not fetch offscreen texture", e);
-            }
-        }
-        if(null!=readPixelBuffer) {
-            readPixelBuffer.clear();
-            gl.glReadPixels(0, 0, drawable.getWidth(), drawable.getHeight(), GL.GL_RGB, GL.GL_UNSIGNED_BYTE, readPixelBuffer);
-            readPixelBuffer.rewind();
-            if(newData) {
-                readTexture.updateImage(readTextureData);
-            } else {
-                readTexture.updateSubImage(readTextureData, 0, 
-                                           0, 0, // src offset
-                                           0, 0, // dst offset
-                                           drawable.getWidth(), drawable.getHeight());
-            }
-            readPixelBuffer.rewind();
-        }
-    }
-
-    @SuppressWarnings("deprecation")
-    public void dispose() {
-        readTexture.dispose();
-        readTextureData = null;
-        readPixelBuffer.clear();
-        readPixelBuffer = null;
-        readPixelSizeLast = 0;
-    }
-
-}
-
diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/Surface2File.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/Surface2File.java
deleted file mode 100644
index c5d770b..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/offscreen/Surface2File.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.offscreen;
-
-import javax.media.opengl.*;
-
-import com.jogamp.opengl.util.texture.TextureIO;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.media.nativewindow.*;
-
-public class Surface2File implements SurfaceUpdatedListener {
-
-    ReadBufferUtil readBufferUtil = new ReadBufferUtil();
-    int shotNum = 0;
-
-    public void dispose() {
-        readBufferUtil.dispose();
-    }
-
-    public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
-        if (updater instanceof GLDrawable) {
-            GLDrawable drawable = (GLDrawable) updater;
-            GLContext ctx = GLContext.getCurrent();
-            if (null != ctx && ctx.getGLDrawable() == drawable) {
-                GL gl = ctx.getGL();
-                // FIXME glFinish() is an expensive paranoia sync, should not be necessary due to spec
-                gl.glFinish();
-                readBufferUtil.fetchOffscreenTexture(drawable, gl);
-                gl.glFinish();
-                try {
-                    surface2File("shot");
-                } catch (IOException ex) {
-                    throw new RuntimeException("can not write survace to file", ex);
-                }
-            }
-        }
-    }
-
-    public void surface2File(String basename) throws IOException {
-        if (!readBufferUtil.isValid()) {
-            return;
-        }
-
-        File file = File.createTempFile(basename + shotNum + "-", ".ppm");
-        TextureIO.write(readBufferUtil.getTextureData(), file);
-        System.out.println("Wrote: " + file.getAbsolutePath() + ", ...");
-        shotNum++;
-        readBufferUtil.rewindPixelBuffer();
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java
deleted file mode 100644
index a57ea57..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java
+++ /dev/null
@@ -1,489 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.offscreen;
-
-
-import com.jogamp.newt.Display;
-import com.jogamp.newt.NewtFactory;
-import com.jogamp.newt.Screen;
-import com.jogamp.newt.Window;
-import com.jogamp.newt.event.MouseListener;
-import com.jogamp.newt.event.WindowListener;
-import com.jogamp.newt.opengl.GLWindow;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.jogl.demos.es1.RedSquare;
-import java.io.IOException;
-
-public class TestOffscreen01NEWT extends UITestCase {
-    static GLProfile glpDefault;
-    static GLDrawableFactory glDrawableFactory;
-    static int width, height;
-    GLCapabilities capsDefault;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        glpDefault = GLProfile.getDefault();
-        Assert.assertNotNull(glpDefault);
-        glDrawableFactory = GLDrawableFactory.getFactory(glpDefault);
-        System.out.println("INFO: PBuffer supported: "+ glDrawableFactory.canCreateGLPbuffer(null));
-        width  = 640;
-        height = 480;
-    }
-
-    @AfterClass
-    public static void releaseClass() {
-    }
-
-    @Before
-    public void init() {
-        capsDefault = new GLCapabilities(glpDefault);
-        Assert.assertNotNull(capsDefault);
-    }
-
-    private void do01OffscreenWindowPBuffer(GLCapabilities caps) {
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-        Window window = NewtFactory.createWindow(screen, caps);
-        Assert.assertNotNull(window);
-        window.setSize(width, height);
-        GLWindow glWindow = GLWindow.create(window);
-        Assert.assertNotNull(glWindow);
-        try {
-            glWindow.setVisible(true);
-        } catch (Throwable t) {
-             // stop test and ignore if pixmap cannot be used
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-        GLEventListener demo = new RedSquare();
-        WindowUtilNEWT.setDemoFields(demo, window, glWindow, false);
-        glWindow.addGLEventListener(demo);
-
-        while ( glWindow.getTotalFrames() < 2) {
-            try {
-                glWindow.display();
-            } catch (Throwable t) {
-                 // stop test and ignore if pbuffer cannot be used
-                t.printStackTrace();
-                Assume.assumeNoException(t);
-            }
-        }
-
-        if(null!=glWindow) {
-            glWindow.destroy();
-        }
-        if(null!=window) {
-            window.destroy();
-        }
-        if(null!=screen) {
-            screen.destroy();
-        }
-        if(null!=display) {
-            display.destroy();
-        }
-    }
-
-    @Test
-    public void test01aOffscreenWindowPBuffer() {
-        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
-            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
-            return;
-        }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
-        do01OffscreenWindowPBuffer(caps2);
-    }
-
-    @Test
-    public void test01bOffscreenWindowPBufferStencil() {
-        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
-            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
-            return;
-        }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
-        caps2.setStencilBits(8);
-        do01OffscreenWindowPBuffer(caps2);
-    }
-
-    @Test
-    public void test01cOffscreenWindowPBufferStencilAlpha() {
-        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
-            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
-            return;
-        }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
-        caps2.setStencilBits(8);
-        caps2.setAlphaBits(8);
-        do01OffscreenWindowPBuffer(caps2);
-    }
-
-    @Test
-    public void test01cOffscreenWindowPBuffer555() {
-        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
-            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
-            return;
-        }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
-        caps2.setRedBits(5);
-        caps2.setGreenBits(5);
-        caps2.setBlueBits(5);
-        do01OffscreenWindowPBuffer(caps2);
-    }
-
-    @Test
-    public void test02Offscreen3Windows1DisplayPBuffer() {
-        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
-            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
-            return;
-        }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
-        int winnum = 3, i;
-        Window windows[] = new Window[winnum];
-        GLWindow glWindows[] = new GLWindow[winnum];
-        GLEventListener demos[] = new GLEventListener[winnum];
-
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-
-        for(i=0; i<winnum; i++) {
-            System.out.println("Create Window "+i);
-            windows[i] = NewtFactory.createWindow(screen, caps2);
-            Assert.assertNotNull(windows[i]);
-            windows[i].setSize(width, height);
-            glWindows[i] = GLWindow.create(windows[i]);
-            Assert.assertNotNull(glWindows[i]);
-            try {
-                glWindows[i].setVisible(true);
-            } catch (Throwable t) {
-                 // stop test and ignore if pixmap cannot be used
-                t.printStackTrace();
-                Assume.assumeNoException(t);
-            }
-            demos[i] = new RedSquare();
-            WindowUtilNEWT.setDemoFields(demos[i], windows[i], glWindows[i], false);
-            glWindows[i].addGLEventListener(demos[i]);
-        }
-
-        try {
-            while ( glWindows[0].getTotalFrames() < 2) {
-                for(i=0; i<winnum; i++) {
-                    glWindows[i].display();
-                }
-            }
-        } catch (Throwable t) {
-             // stop test and ignore if pbuffer cannot be used
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-
-        for(i=0; i<winnum; i++) {
-            if(null!=glWindows[i]) {
-                glWindows[i].destroy();
-            }
-            if(null!=windows[i]) {
-                windows[i].destroy();
-            }
-        }
-        if(null!=screen) {
-            screen.destroy();
-        }
-        if(null!=display) {
-            display.destroy();
-        }
-    }
-
-    @Test
-    public void test03Offscreen3Windows3DisplaysPBuffer() {
-        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
-            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
-            return;
-        }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
-        int winnum = 3, i;
-        Display displays[] = new Display[winnum];
-        Screen screens[] = new Screen[winnum];
-        Window windows[] = new Window[winnum];
-        GLWindow glWindows[] = new GLWindow[winnum];
-        GLEventListener demos[] = new GLEventListener[winnum];
-
-        for(i=0; i<winnum; i++) {
-            System.out.println("Create Window "+i);
-            displays[i] = NewtFactory.createDisplay(null, false); // local display
-            Assert.assertNotNull(displays[i]);
-            screens[i]  = NewtFactory.createScreen(displays[i], 0); // screen 0
-            Assert.assertNotNull(screens[i]);
-            windows[i] = NewtFactory.createWindow(screens[i], caps2);
-            Assert.assertNotNull(windows[i]);
-            windows[i].setSize(width, height);
-            glWindows[i] = GLWindow.create(windows[i]);
-            Assert.assertNotNull(glWindows[i]);
-            try {
-                glWindows[i].setVisible(true);
-            } catch (Throwable t) {
-                 // stop test and ignore if pixmap cannot be used
-                t.printStackTrace();
-                Assume.assumeNoException(t);
-            }
-            demos[i] = new RedSquare();
-            WindowUtilNEWT.setDemoFields(demos[i], windows[i], glWindows[i], false);
-            glWindows[i].addGLEventListener(demos[i]);
-        }
-
-        try {
-            while ( glWindows[0].getTotalFrames() < 2) {
-                for(i=0; i<winnum; i++) {
-                    glWindows[i].display();
-                }
-            }
-        } catch (Throwable t) {
-             // stop test and ignore if pbuffer cannot be used
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-
-
-        for(i=0; i<winnum; i++) {
-            if(null!=glWindows[i]) {
-                glWindows[i].destroy();
-            }
-            if(null!=windows[i]) {
-                windows[i].destroy();
-            }
-            if(null!=screens[i]) {
-                screens[i].destroy();
-            }
-            if(null!=displays[i]) {
-                displays[i].destroy();
-            }
-        }
-    }
-
-    @Test
-    public void test04OffscreenSnapshotWithDemoPBuffer() {
-        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
-            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
-            return;
-        }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
-
-        System.out.println("Create Window 1");
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-        Window window = NewtFactory.createWindow(screen, caps2);
-        Assert.assertNotNull(window);
-        window.setSize(width, height);
-        GLWindow glWindow = GLWindow.create(window);
-        Assert.assertNotNull(glWindow);
-        try {
-            glWindow.setVisible(true);
-        } catch (Throwable t) {
-             // stop test and ignore if pixmap cannot be used
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-
-        GLWindow windowOnScreen = null;
-        WindowListener wl=null;
-        MouseListener ml=null;
-        SurfaceUpdatedListener ul=null;
-
-        GLEventListener demo = new RedSquare();
-        Assert.assertNotNull(demo);
-
-        try {
-            WindowUtilNEWT.run(glWindow, demo, windowOnScreen, wl, ml, ul, 2, true /*snapshot*/, false /*debug*/);
-        } catch (Throwable t) {
-             // stop test and ignore if pbuffer cannot be used
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-
-        if(null!=windowOnScreen) {
-            windowOnScreen.destroy();
-        }
-        if(null!=glWindow) {
-            glWindow.destroy();
-        }
-        if(null!=window) {
-            window.destroy();
-        }
-        if(null!=screen) {
-            screen.destroy();
-        }
-        if(null!=display) {
-            display.destroy();
-        }
-    }
-
-    @Test
-    public void test11OffscreenWindowPixmap() {
-        // Offscreen doesn't work on >= GL3 (ATI)
-        GLProfile glp = GLProfile.get(GLProfile.GL2);
-        Assert.assertNotNull(glp);
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
-
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-        Window window = NewtFactory.createWindow(screen, caps2);
-        Assert.assertNotNull(window);
-        window.setSize(width, height);
-        GLWindow glWindow = GLWindow.create(window);
-        Assert.assertNotNull(glWindow);
-        try {
-            glWindow.setVisible(true);
-        } catch (Throwable t) {
-             // stop test and ignore if pixmap cannot be used
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-        GLEventListener demo = new RedSquare();
-        WindowUtilNEWT.setDemoFields(demo, window, glWindow, false);
-        glWindow.addGLEventListener(demo);
-
-        while ( glWindow.getTotalFrames() < 2) {
-            try {
-                glWindow.display();
-            } catch (Throwable t) {
-                 // stop test and ignore if pixmap cannot be used
-                t.printStackTrace();
-                Assume.assumeNoException(t);
-            }
-        }
-
-        if(null!=glWindow) {
-            glWindow.destroy();
-        }
-        if(null!=window) {
-            window.destroy();
-        }
-        if(null!=screen) {
-            screen.destroy();
-        }
-        if(null!=display) {
-            display.destroy();
-        }
-    }
-
-    @Test
-    public void test14OffscreenSnapshotWithDemoPixmap() {
-        // Offscreen doesn't work on >= GL3 (ATI)
-        GLProfile glp = GLProfile.get(GLProfile.GL2);
-        Assert.assertNotNull(glp);
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
-
-        System.out.println("Create Window 1");
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-        Window window = NewtFactory.createWindow(screen, caps2);
-        Assert.assertNotNull(window);
-        window.setSize(width, height);
-        GLWindow glWindow = GLWindow.create(window);
-        Assert.assertNotNull(glWindow);
-        try {
-            glWindow.setVisible(true);
-        } catch (Throwable t) {
-             // stop test and ignore if pixmap cannot be used
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-
-        GLWindow windowOnScreen = null;
-        WindowListener wl=null;
-        MouseListener ml=null;
-        SurfaceUpdatedListener ul=null;
-
-        GLEventListener demo = new RedSquare();
-        Assert.assertNotNull(demo);
-
-        try {
-            WindowUtilNEWT.run(glWindow, demo, windowOnScreen, wl, ml, ul, 2, true /*snapshot*/, false /*debug*/);
-        } catch (Throwable t) {
-             // stop test and ignore if pixmap cannot be used
-            t.printStackTrace();
-            Assume.assumeNoException(t);
-        }
-
-        if(null!=windowOnScreen) {
-            windowOnScreen.destroy();
-        }
-        if(null!=glWindow) {
-            glWindow.destroy();
-        }
-        if(null!=window) {
-            window.destroy();
-        }
-        if(null!=screen) {
-            screen.destroy();
-        }
-        if(null!=display) {
-            display.destroy();
-        }
-    }
-    public static void main(String args[]) throws IOException {
-        String tstname = TestOffscreen01NEWT.class.getName();
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java
deleted file mode 100644
index cfe956c..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.offscreen;
-
-import com.jogamp.test.junit.util.*;
-
-import org.junit.Assert;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-
-public class WindowUtilNEWT {
-
-    public static GLCapabilities fixCaps(GLCapabilities caps, boolean onscreen, boolean pbuffer, boolean undecorated) {
-        GLCapabilities caps2 = (GLCapabilities) caps.cloneMutable();
-        caps2.setOnscreen(onscreen);
-        caps2.setPBuffer(!onscreen && pbuffer);
-        caps2.setDoubleBuffered(!onscreen);
-        return caps2;
-    }
-
-    public static void setDemoFields(GLEventListener demo, Window window, GLWindow glWindow, boolean debug) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(window);
-        if(debug) {
-            MiscUtils.setFieldIfExists(demo, "glDebug", true);
-            MiscUtils.setFieldIfExists(demo, "glTrace", true);
-        }
-        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    public static void run(GLWindow windowOffScreen, GLEventListener demo, 
-                           GLWindow windowOnScreen, WindowListener wl, MouseListener ml, 
-                           SurfaceUpdatedListener ul, int frames, boolean snapshot, boolean debug) {
-        Assert.assertNotNull(windowOffScreen);
-        Assert.assertNotNull(demo);
-
-        setDemoFields(demo, windowOffScreen, windowOffScreen, debug);
-        windowOffScreen.addGLEventListener(demo);
-
-        if ( null != windowOnScreen ) {
-            if(null!=wl) {
-                windowOnScreen.addWindowListener(wl);
-            }
-            if(null!=ml) {
-                windowOnScreen.addMouseListener(ml);
-            }
-            windowOnScreen.setVisible(true);
-        }
-
-        GLDrawable readDrawable = windowOffScreen.getContext().getGLDrawable() ;
-
-        if ( null == windowOnScreen ) {
-            if(snapshot) {
-                Surface2File s2f = new Surface2File();
-                windowOffScreen.addSurfaceUpdatedListener(s2f);
-            }
-        } else {
-            ReadBuffer2Screen readDemo = new ReadBuffer2Screen( readDrawable ) ;
-            windowOnScreen.addGLEventListener(readDemo);
-        }
-        if(null!=ul) {
-            windowOffScreen.addSurfaceUpdatedListener(ul);
-        }
-
-        if(debug) {
-            System.out.println("+++++++++++++++++++++++++++");
-            System.out.println(windowOffScreen);
-            System.out.println("+++++++++++++++++++++++++++");
-        }
-
-        while ( windowOffScreen.getTotalFrames() < frames) {
-            windowOffScreen.display();
-        }
-        windowOffScreen.removeAllSurfaceUpdatedListener();
-
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/texture/TestTexture01AWT.java b/src/junit/com/jogamp/test/junit/jogl/texture/TestTexture01AWT.java
deleted file mode 100644
index 2eb6666..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/texture/TestTexture01AWT.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.texture;
-
-import com.jogamp.test.junit.jogl.util.texture.gl2.TextureGL2ListenerDraw1;
-
-import com.jogamp.test.junit.util.UITestCase;
-
-import javax.media.opengl.GLProfile;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.awt.GLCanvas;
-import com.jogamp.opengl.util.texture.TextureData;
-import com.jogamp.opengl.util.texture.awt.AWTTextureIO;
-import com.jogamp.opengl.util.Animator;
-
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Frame;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.image.BufferedImage;
-
-import java.io.IOException;
-import org.junit.Assert;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class TestTexture01AWT extends UITestCase {
-    static GLProfile glp;
-    static GLCapabilities caps;
-    BufferedImage textureImage;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        glp = GLProfile.get(GLProfile.GL2GL3);
-        Assert.assertNotNull(glp);
-        caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-    }
-
-    @Before
-    public void initTest() {
-        // create base image
-        BufferedImage baseImage = new BufferedImage(256, 256, BufferedImage.TYPE_3BYTE_BGR);
-        Assert.assertNotNull(baseImage);
-        Graphics2D g = baseImage.createGraphics();
-        Assert.assertNotNull(g);
-        g.setPaint(new GradientPaint(0, 0, Color.CYAN,
-                                 baseImage.getWidth(), baseImage.getHeight(), Color.BLUE));
-        g.fillRect(0, 0, baseImage.getWidth(), baseImage.getHeight());
-        g.dispose();
-
-        // create texture image
-        int imageType = BufferedImage.TYPE_3BYTE_BGR;
-        textureImage = new BufferedImage(baseImage.getWidth(),
-                                         baseImage.getHeight(),
-                                         imageType);
-        Assert.assertNotNull(textureImage);
-        g = textureImage.createGraphics();
-        g.setComposite(AlphaComposite.Src);
-        g.drawImage(baseImage, 0, 0, null);
-        g.dispose();
-
-        baseImage.flush();
-        baseImage=null;
-    }
-
-    @After
-    public void cleanupTest() {
-        Assert.assertNotNull(textureImage);
-        textureImage.flush();
-        textureImage=null;
-    }
-
-    @Test
-    public void test1() throws InterruptedException {
-        GLCanvas glCanvas = new GLCanvas(caps);
-
-        Frame frame = new Frame("Texture Test");
-        Assert.assertNotNull(frame);
-        frame.add(glCanvas);
-        frame.setSize(512, 512);
-
-        // create texture    
-        TextureData textureData = AWTTextureIO.newTextureData(caps.getGLProfile(), textureImage, false);
-        glCanvas.addGLEventListener(new TextureGL2ListenerDraw1(textureData));
-
-        Animator animator = new Animator(glCanvas);
-        frame.setVisible(true);
-        animator.start();
-
-        Thread.sleep(500); // 500 ms
-
-        animator.stop();
-        frame.setVisible(false);
-        frame.remove(glCanvas);
-        glCanvas=null;
-        Assert.assertNotNull(frame);
-        frame.dispose();
-        frame=null;
-    }
-
-    public static void main(String args[]) throws IOException {
-        String tstname = TestTexture01AWT.class.getName();
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/jogl/util/texture/gl2/TextureGL2ListenerDraw1.java b/src/junit/com/jogamp/test/junit/jogl/util/texture/gl2/TextureGL2ListenerDraw1.java
deleted file mode 100644
index a0c0fc7..0000000
--- a/src/junit/com/jogamp/test/junit/jogl/util/texture/gl2/TextureGL2ListenerDraw1.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.jogl.util.texture.gl2;
-
-import com.jogamp.opengl.util.texture.Texture;
-import com.jogamp.opengl.util.texture.TextureCoords;
-import com.jogamp.opengl.util.texture.TextureData;
-import com.jogamp.opengl.util.texture.TextureIO;
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2ES1;
-import javax.media.opengl.GL2;
-import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLEventListener;
-import javax.media.opengl.glu.GLU;
-
-public class TextureGL2ListenerDraw1 implements GLEventListener {
-    private GLU      glu = new GLU();
-    private TextureData textureData;
-    private Texture  texture;
-    
-    public TextureGL2ListenerDraw1(TextureData td) {
-        this.textureData = td;
-    }
-
-    public void init(GLAutoDrawable drawable) {
-        if(null!=textureData) {
-            this.texture = TextureIO.newTexture(textureData);
-        }
-    }
-
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        GL2 gl = drawable.getGL().getGL2();
-        gl.glMatrixMode(GL2ES1.GL_PROJECTION);
-        gl.glLoadIdentity();
-        glu.gluOrtho2D(0, 1, 0, 1);
-        gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
-        gl.glLoadIdentity();
-    }
-
-    public void dispose(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
-        if(null!=texture) {
-            texture.disable();
-            texture.destroy(gl);
-        }
-        if(null!=textureData) {
-            textureData.destroy();
-        }
-    }
-
-    public void display(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
-
-        // need a valid GL context for this ..
-
-        /** OpenGL ..
-        texture.updateSubImage(textureData, 0,
-                               20, 20, 
-                               20, 20,
-                               100, 100); */
-
-    
-        // Now draw one quad with the texture
-        if(null!=texture) {
-            texture.enable();
-            texture.bind();
-            gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_REPLACE);
-            TextureCoords coords = texture.getImageTexCoords();
-            gl.glBegin(GL2.GL_QUADS);
-            gl.glTexCoord2f(coords.left(), coords.bottom());
-            gl.glVertex3f(0, 0, 0);
-            gl.glTexCoord2f(coords.right(), coords.bottom());
-            gl.glVertex3f(1, 0, 0);
-            gl.glTexCoord2f(coords.right(), coords.top());
-            gl.glVertex3f(1, 1, 0);
-            gl.glTexCoord2f(coords.left(), coords.top());
-            gl.glVertex3f(0, 1, 0);
-            gl.glEnd();
-            texture.disable();
-        }
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/newt/TestCloseNewtAWT.java b/src/junit/com/jogamp/test/junit/newt/TestCloseNewtAWT.java
deleted file mode 100644
index 1899a6b..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestCloseNewtAWT.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.test.junit.newt;
-
-import org.junit.Test;
-
-import java.lang.reflect.InvocationTargetException;
-import java.awt.EventQueue;
-import java.awt.Toolkit;
-import javax.swing.JFrame;
-import javax.swing.SwingUtilities;
-
-import javax.media.nativewindow.NativeWindow;
-import javax.media.nativewindow.util.Point;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-import com.jogamp.newt.Window;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-import com.jogamp.newt.event.WindowAdapter;
-import com.jogamp.newt.event.WindowEvent;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.test.junit.util.UITestCase;
-
-public class TestCloseNewtAWT extends UITestCase {
-
-    GLWindow newtWindow = null;
-    NewtCanvasAWT newtCanvas = null;
-    JFrame frame = null;
-
-    class MyCanvas extends NewtCanvasAWT {
-         public MyCanvas(Window window) {
-            super(window);
-         }
-
-         public void addNotify() {
-            System.err.println("MyCanvas START add: "+Thread.currentThread()+", holds AWTTreeLock: "+Thread.holdsLock(this.getTreeLock()));
-            super.addNotify();
-            System.err.println("MyCanvas END add: "+Thread.currentThread()+", holds AWTTreeLock: "+Thread.holdsLock(this.getTreeLock()));
-         }
-
-         public void removeNotify() {
-            System.err.println("MyCanvas START remove: "+Thread.currentThread()+", holds AWTTreeLock: "+Thread.holdsLock(this.getTreeLock()));
-
-            // trigger critical situation around the AWT TreeLock
-            newtWindow.runOnEDTIfAvail(true, new Runnable() {
-                public void run() {
-                    // NEWT EDT while AWT is locked
-                    System.err.println("MyCanvas On NEWT-EDT From AWT-EDT: "+Thread.currentThread()+
-                                       ", holds AWTTreeLock: "+Thread.holdsLock(MyCanvas.this.getTreeLock()));
-
-                    // Critical: Within NEWT EDT, while AWT is locked
-                    NativeWindow nw = MyCanvas.this.getNativeWindow();
-                    if(null != nw) {
-                        Point p = nw.getLocationOnScreen(null);
-                        System.err.println("MyCanvas On NEWT-EDT: position: "+p);
-                    } else {
-                        System.err.println("MyCanvas On NEWT-EDT: position n/a, null NativeWindow");
-                    }
-                }
-            });
-            System.err.println("MyCanvas passed critical: "+Thread.currentThread()+", holds AWTTreeLock: "+Thread.holdsLock(this.getTreeLock()));
-
-            super.removeNotify();
-
-            System.err.println("MyCanvas END remove: "+Thread.currentThread()+", holds AWTTreeLock: "+Thread.holdsLock(this.getTreeLock()));
-         }
-    }
-
-    class NEWTWindowClosingAdapter extends WindowAdapter {
-        public void windowDestroyNotify(WindowEvent e) {
-            System.err.println("Destroy NEWT: windowDestroyNotify "+Thread.currentThread() + ", "+ e);
-        }
-    }
-
-    class AWTClosingWindowAdapter extends java.awt.event.WindowAdapter {
-        public void windowClosing(WindowEvent ev) {
-                System.err.println("Destroy AWT: windowClosing "+Thread.currentThread() + ", "+ ev);
-        }
-    }
-
-
-    @Test
-    public void testCloseNewtAWT() throws InterruptedException, InvocationTargetException {
-        newtWindow = GLWindow.create(new GLCapabilities(GLProfile.getDefault()));
-        newtWindow.addWindowListener(new NEWTWindowClosingAdapter());
-        newtCanvas = new MyCanvas(newtWindow);
-
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                frame = new JFrame("NEWT Close Test");
-                frame.addWindowListener(new AWTClosingWindowAdapter());
-                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
-                frame.getContentPane().add(newtCanvas);
-                frame.pack();
-                frame.setSize(800, 600);
-                frame.setVisible(true);
-            }
-        });
-        Thread.sleep(1000);
-
-        // programatically issue windowClosing
-        Toolkit tk = Toolkit.getDefaultToolkit();
-        EventQueue evtQ = tk.getSystemEventQueue();
-        evtQ.postEvent(new java.awt.event.WindowEvent(frame, java.awt.event.WindowEvent.WINDOW_CLOSING));
-        Thread.sleep(200);            
-
-        GLProfile.shutdown();
-    }
-
-    public static void main(String[] args) {
-        String tstname = TestCloseNewtAWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestDisplayLifecycle01NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestDisplayLifecycle01NEWT.java
deleted file mode 100644
index 94f9158..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestDisplayLifecycle01NEWT.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.test.junit.newt;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.util.MiscUtils;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestDisplayLifecycle01NEWT extends UITestCase {
-    static GLProfile glp;
-    static GLCapabilities caps;
-    static int width, height;
-    static long durationPerTest = 100; // ms
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        width  = 640;
-        height = 480;
-        glp = GLProfile.getDefault();
-        caps = new GLCapabilities(glp);
-    }
-
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height)
-        throws InterruptedException
-    {
-        Assert.assertNotNull(caps);
-
-        //
-        // Create native windowing resources .. X11/Win/OSX
-        // 
-        GLWindow glWindow;
-        if(null!=screen) {
-            Window window = NewtFactory.createWindow(screen, caps);
-            Assert.assertNotNull(window);
-            glWindow = GLWindow.create(window);
-        } else {
-            glWindow = GLWindow.create(caps);
-        }
-
-        GLEventListener demo = new Gears();
-        setDemoFields(demo, glWindow);
-        glWindow.addGLEventListener(demo);
-        glWindow.addWindowListener(new TraceWindowAdapter());
-        glWindow.setSize(width, height);
-        return glWindow;
-    }
-
-    private void testDisplayCreate01(Display display, Screen screen) throws InterruptedException {
-        // start-state == end-state
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(false,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-
-        // Create Window, pending lazy native creation
-        GLWindow window = createWindow(screen, caps, width, height);
-        Assert.assertEquals(screen,window.getScreen());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-
-        Assert.assertNotNull(window.getScreen());
-        Assert.assertEquals(true,window.isValid());
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        // lazy native creation sequence: Display, Screen and Window
-        Assert.assertEquals(0, window.getTotalFrames());
-        window.setVisible(true);
-
-        Assert.assertEquals(screen,window.getScreen());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(1,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-        System.err.println("Frames for setVisible(true) 1: "+window.getTotalFrames());
-        Assert.assertTrue(0 < window.getTotalFrames());
-
-        while(window.getDuration()<1*durationPerTest) {
-            window.display();
-            Thread.sleep(100);
-        }
-        System.err.println("duration: "+window.getDuration());
-
-        // just make the Window invisible
-        window.setVisible(false);
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        // just make the Window visible again
-        window.resetCounter();
-        Assert.assertEquals(0, window.getTotalFrames());
-        window.setVisible(true);
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-        System.err.println("Frames for setVisible(true) 1: "+window.getTotalFrames());
-        Assert.assertTrue(0 < window.getTotalFrames());
-
-        while(window.getDuration()<2*durationPerTest) {
-            window.display();
-            Thread.sleep(100);
-        }
-        System.err.println("duration: "+window.getDuration());
-
-        // destruction ..
-        window.destroy();
-        Assert.assertEquals(screen,window.getScreen());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(false,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(true, window.isValid());
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-        window.resetCounter();
-        Assert.assertEquals(0, window.getTotalFrames());
-
-        // a display call shall not change a thing
-        window.display();
-        Assert.assertEquals(0, window.getTotalFrames());
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        // recover Window
-        window.setVisible(true);
-
-        Assert.assertEquals(screen,window.getScreen());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(1,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-        System.err.println("Frames for setVisible(true) 2: "+window.getTotalFrames());
-        Assert.assertTrue(0 < window.getTotalFrames());
-
-        while(window.getDuration()<1*durationPerTest) {
-            window.display();
-            Thread.sleep(100);
-        }
-        System.err.println("duration: "+window.getDuration());
-
-        // destruction ..
-        window.destroy();
-        display.dumpDisplayList("Post destroy(true)");
-
-        // end-state == start-state
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(false,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-
-        Assert.assertNotNull(window.getScreen());
-        Assert.assertEquals(true,window.isValid());
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-    }
-
-    @Test
-    public void testDisplayCreate01_AutoDestroyLifecycle() throws InterruptedException {
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        // Create Display/Screen, pending lazy native creation
-        Display display = NewtFactory.createDisplay(null);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        testDisplayCreate01(display, screen);
-        testDisplayCreate01(display, screen);
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);
-        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        System.err.println("durationPerTest: "+durationPerTest);
-        String tstname = TestDisplayLifecycle01NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestDisplayLifecycle02NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestDisplayLifecycle02NEWT.java
deleted file mode 100644
index 9fc6e3b..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestDisplayLifecycle02NEWT.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.test.junit.newt;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import javax.media.nativewindow.*;
-import javax.media.opengl.*;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.util.MiscUtils;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestDisplayLifecycle02NEWT extends UITestCase {
-    static GLProfile glp;
-    static GLCapabilities caps;
-    static int width, height;
-    static long durationPerTest = 100; // ms
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        width  = 640;
-        height = 480;
-        glp = GLProfile.getDefault();
-        caps = new GLCapabilities(glp);
-    }
-
-    static GLWindow createWindow(GLCapabilities caps, int width, int height)
-        throws InterruptedException
-    {
-        Assert.assertNotNull(caps);
-
-        //
-        // Create native windowing resources .. X11/Win/OSX
-        // 
-        GLWindow glWindow = GLWindow.create(caps);
-
-        GLEventListener demo = new Gears();
-        setDemoFields(demo, glWindow);
-        glWindow.addGLEventListener(demo);
-        glWindow.addWindowListener(new TraceWindowAdapter());
-        glWindow.setSize(width, height);
-        return glWindow;
-    }
-
-    private void testDisplayCreate01Impl() throws InterruptedException {
-        // start-state == end-state
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        // Create Window, pending lazy native creation
-        GLWindow window = createWindow(caps, width, height);
-        Screen screen = window.getScreen();
-        Display display = screen.getDisplay();
-
-        Assert.assertEquals(screen,window.getScreen());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,Screen.getActiveScreenNumber());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        // lazy native creation sequence: Display, Screen and Window
-        Assert.assertEquals(0, window.getTotalFrames());
-        window.setVisible(true);
-
-        Assert.assertEquals(screen,window.getScreen());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(1,Screen.getActiveScreenNumber());
-        Assert.assertEquals(1,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-        System.err.println("Frames for setVisible(true) 1: "+window.getTotalFrames());
-        Assert.assertTrue(0 < window.getTotalFrames());
-
-        while(window.getDuration()<1*durationPerTest) {
-            window.display();
-            Thread.sleep(100);
-        }
-        System.err.println("duration: "+window.getDuration());
-
-        // just make the Window invisible
-        window.setVisible(false);
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        // just make the Window visible again
-        window.resetCounter();
-        Assert.assertEquals(0, window.getTotalFrames());
-        window.setVisible(true);
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-        System.err.println("Frames for setVisible(true) 1: "+window.getTotalFrames());
-        Assert.assertTrue(0 < window.getTotalFrames());
-
-        while(window.getDuration()<2*durationPerTest) {
-            window.display();
-            Thread.sleep(100);
-        }
-        System.err.println("duration: "+window.getDuration());
-
-        // destruction.. ref count down, but keep all
-        window.destroy();
-        Assert.assertEquals(screen,window.getScreen());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(false,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,Screen.getActiveScreenNumber());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertNotNull(window.getScreen());
-        Assert.assertEquals(true,window.isValid());
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        window.resetCounter();
-        Assert.assertEquals(0, window.getTotalFrames());
-
-        // a display call shall not change a thing
-        window.display();
-        Assert.assertEquals(0, window.getTotalFrames());
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        // recover Window
-        window.setVisible(true);
-
-        Assert.assertEquals(screen,window.getScreen());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,window.isValid());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(1,Screen.getActiveScreenNumber());
-        Assert.assertEquals(1,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-        System.err.println("Frames for setVisible(true) 2: "+window.getTotalFrames());
-        Assert.assertTrue(0 < window.getTotalFrames());
-
-        while(window.getDuration()<1*durationPerTest) {
-            window.display();
-            Thread.sleep(100);
-        }
-        System.err.println("duration: "+window.getDuration());
-
-        // destruction + invalidate, ie Display/Screen will be unreferenced
-        window.invalidate();
-        Assert.assertNull(window.getScreen());
-        Assert.assertEquals(false,window.isValid());
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        display.dumpDisplayList("Post destroy(true)");
-
-        // end-state == start-state
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(false,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,Screen.getActiveScreenNumber());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-    }
-
-    @Test
-    public void testDisplayCreate01() throws InterruptedException {
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        // Create Display/Screen, pending lazy native creation
-        testDisplayCreate01Impl();
-        testDisplayCreate01Impl();
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-    }
-
-    private void testDisplayCreate02Impl() throws InterruptedException {
-        // start-state == end-state
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        // Create Window, pending lazy native creation
-        GLWindow window1 = createWindow(caps, width, height);
-        window1.setPosition(0, 0);
-        Screen screen = window1.getScreen();
-        Display display = screen.getDisplay();
-
-        GLWindow window2 = createWindow(caps, width, height);
-        Assert.assertSame(screen, window2.getScreen());
-        Assert.assertSame(display, window2.getScreen().getDisplay());
-        window2.setPosition(screen.getWidth()-width, 0);
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,Screen.getActiveScreenNumber());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(false,window1.isNativeValid());
-        Assert.assertEquals(false,window1.isVisible());
-        Assert.assertEquals(false,window2.isNativeValid());
-        Assert.assertEquals(false,window2.isVisible());
-
-        // lazy native creation sequence: Display, Screen and Window
-        Assert.assertEquals(0, window1.getTotalFrames());
-        window1.setVisible(true);
-
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(1,Screen.getActiveScreenNumber());
-        Assert.assertEquals(1,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(true,window1.isNativeValid());
-        Assert.assertEquals(true,window1.isVisible());
-        System.err.println("Frames for setVisible(true) 1: "+window1.getTotalFrames());
-        Assert.assertTrue(0 < window1.getTotalFrames());
-
-        Assert.assertEquals(0, window2.getTotalFrames());
-        window2.setVisible(true);
-
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(1,Screen.getActiveScreenNumber());
-        Assert.assertEquals(2,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(true,window2.isNativeValid());
-        Assert.assertEquals(true,window2.isVisible());
-        System.err.println("Frames for setVisible(true) 2: "+window2.getTotalFrames());
-        Assert.assertTrue(0 < window2.getTotalFrames());
-
-        while(window1.getDuration()<1*durationPerTest) {
-            window1.display();
-            Thread.sleep(100);
-        }
-        System.err.println("duration: "+window1.getDuration());
-
-        // just make the Window invisible
-        window1.setVisible(false);
-        Assert.assertEquals(true,window1.isNativeValid());
-        Assert.assertEquals(false,window1.isVisible());
-
-        // destruction ...
-        window1.destroy();
-        Assert.assertNotNull(window1.getScreen());
-        Assert.assertEquals(true,window1.isValid());
-        Assert.assertEquals(false,window1.isNativeValid());
-        Assert.assertEquals(false,window1.isVisible());
-
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(1,Screen.getActiveScreenNumber());
-        Assert.assertEquals(1,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-
-        // destruction
-        window2.destroy();
-        Assert.assertNotNull(window2.getScreen());
-        Assert.assertEquals(true,window2.isValid());
-        Assert.assertEquals(false,window2.isNativeValid());
-        Assert.assertEquals(false,window2.isVisible());
-
-        // end-state == start-state
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(false,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,Screen.getActiveScreenNumber());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-
-        // invalidate .. remove all refs
-        window1.invalidate();
-        Assert.assertNull(window1.getScreen());
-        Assert.assertEquals(false,window1.isValid());
-        Assert.assertEquals(false,window1.isNativeValid());
-        Assert.assertEquals(false,window1.isVisible());
-
-        // invalidate .. remove all refs
-        window2.invalidate();
-        Assert.assertNull(window2.getScreen());
-        Assert.assertEquals(false,window2.isValid());
-        Assert.assertEquals(false,window2.isNativeValid());
-        Assert.assertEquals(false,window2.isVisible());
-
-    }
-
-    @Test
-    public void testDisplayCreate02() throws InterruptedException {
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        // Create Display/Screen, pending lazy native creation
-        testDisplayCreate02Impl();
-        testDisplayCreate02Impl();
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);
-        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        System.err.println("durationPerTest: "+durationPerTest);
-        String tstname = TestDisplayLifecycle02NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestEventSourceNotAWTBug.java b/src/junit/com/jogamp/test/junit/newt/TestEventSourceNotAWTBug.java
deleted file mode 100644
index ff791b0..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestEventSourceNotAWTBug.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import java.io.IOException;
-
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-import javax.swing.JFrame;
-import javax.swing.SwingUtilities;
-import javax.swing.WindowConstants;
-
-import com.jogamp.newt.awt.NewtCanvasAWT;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-import com.jogamp.test.junit.util.*;
-
-/**
- * This simple program will throw a {@link RuntimeException} when the application is closed.
- */
-public class TestEventSourceNotAWTBug extends UITestCase {
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-    }
-
-    @Test
-    public void testEventSourceNotNewtBug() throws InterruptedException {
-        JFrame jf = new JFrame();
-
-        jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
-
-        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
-        final GLWindow glWindow = GLWindow.create(caps);
-        final NewtCanvasAWT canvas = new NewtCanvasAWT(glWindow);
-        jf.getContentPane().add(canvas);
-
-        // The following line isn't event necessary to see the problem.
-        glWindow.addGLEventListener(new Gears());
-
-        final JFrame f_jf = jf;
-
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                f_jf.setSize(800, 600);
-                f_jf.setVisible(true);
-            }
-        });
-
-        Thread.sleep(500);
-
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                f_jf.dispose();
-            }
-        });
-        glWindow.invalidate();
-    }
-
-    public static void main(String args[]) throws IOException {
-        String tstname = TestEventSourceNotAWTBug.class.getName();
-        /*
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } ); */
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWTRobot.java b/src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWTRobot.java
deleted file mode 100644
index d597af8..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWTRobot.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import org.junit.Assert;
-import org.junit.AfterClass;
-
-import java.awt.AWTException;
-import java.awt.BorderLayout;
-import java.awt.Button;
-import java.awt.Robot;
-import java.lang.reflect.InvocationTargetException;
-
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLEventListener;
-import javax.media.opengl.GLProfile;
-import javax.swing.JFrame;
-
-import java.util.ArrayList;
-import java.io.IOException;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.jogamp.newt.awt.NewtCanvasAWT;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.test.junit.jogl.demos.es1.RedSquare;
-
-import com.jogamp.test.junit.util.*;
-
-public class TestFocus01SwingAWTRobot extends UITestCase {
-    static int width, height;
-    static long durationPerTest = 800;
-    static long awtWaitTimeout = 1000;
-
-    static GLCapabilities glCaps;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        width = 640;
-        height = 480;
-        glCaps = new GLCapabilities(null);
-    }
-
-    @AfterClass
-    public static void release() {
-    }
-
-    @Test
-    public void testFocus01ProgrFocus() throws AWTException, InterruptedException, InvocationTargetException {
-        testFocus01ProgrFocusImpl(null);
-    }
-
-    @Test
-    public void testFocus02RobotFocus() throws AWTException, InterruptedException, InvocationTargetException {
-        Robot robot = new Robot();
-        robot.setAutoWaitForIdle(true);
-        testFocus01ProgrFocusImpl(robot);
-    }
-
-    private void testFocus01ProgrFocusImpl(Robot robot) throws AWTException,
-            InvocationTargetException, InterruptedException {
-        ArrayList eventCountAdapters = new ArrayList();
-
-        // Create a window.
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        glWindow1.setTitle("testNewtChildFocus");
-        GLEventListener demo1 = new RedSquare();
-        TestListenerCom01AWT.setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-        NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
-        eventCountAdapters.add(glWindow1FA);
-        glWindow1.addWindowListener(glWindow1FA);
-
-        // Monitor NEWT focus and keyboard events.
-        NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
-        eventCountAdapters.add(glWindow1KA);
-        glWindow1.addKeyListener(glWindow1KA);
-
-        // Wrap the window in a canvas.
-        final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-
-        // Monitor AWT focus and keyboard events.
-        AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
-        newtCanvasAWT.addKeyListener(newtCanvasAWTKA);
-        eventCountAdapters.add(newtCanvasAWTKA);
-        AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
-        newtCanvasAWT.addFocusListener(newtCanvasAWTFA);
-        eventCountAdapters.add(newtCanvasAWTFA);
-
-        // Add the canvas to a frame, and make it all visible.
-        JFrame frame1 = new JFrame("Swing AWT Parent Frame: "
-                + glWindow1.getTitle());
-        frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
-        Button button = new Button("Click me ..");
-        AWTFocusAdapter buttonFA = new AWTFocusAdapter("Button");
-        button.addFocusListener(buttonFA);
-        eventCountAdapters.add(buttonFA);
-        AWTKeyAdapter buttonKA = new AWTKeyAdapter("Button");
-        button.addKeyListener(buttonKA);
-        eventCountAdapters.add(buttonKA);
-        frame1.getContentPane().add(button, BorderLayout.NORTH);
-        frame1.setSize(width, height);
-        frame1.setVisible(true);
-        Assert.assertTrue(AWTRobotUtil.toFront(robot, frame1));
-
-        int wait=0;
-        while(wait<awtWaitTimeout/100 && glWindow1.getTotalFrames()<1) { Thread.sleep(awtWaitTimeout/10); wait++; }
-        System.err.println("Frames for initial setVisible(true): "+glWindow1.getTotalFrames());
-        Assert.assertTrue(glWindow1.isVisible());
-        Assert.assertTrue(0 < glWindow1.getTotalFrames());
-
-        // Continuous animation ..
-        Animator animator = new Animator(glWindow1);
-        animator.start();
-
-        // Button Focus
-        Thread.sleep(100); // allow event sync
-        System.err.println("FOCUS AWT  Button request");
-        EventCountAdapterUtil.reset(eventCountAdapters);
-        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, button, button, buttonFA, null));
-        Assert.assertEquals(1, buttonFA.getCount());
-        Assert.assertEquals(0, glWindow1FA.getCount());
-        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
-        System.err.println("FOCUS AWT  Button sync");
-        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, button, buttonKA));
-
-        // Request the AWT focus, which should automatically provide the NEWT window with focus.
-        Thread.sleep(100); // allow event sync
-        System.err.println("FOCUS NEWT Canvas/GLWindow request");
-        EventCountAdapterUtil.reset(eventCountAdapters);
-        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, newtCanvasAWT, newtCanvasAWT.getNEWTChild(), glWindow1FA, buttonFA));
-        Assert.assertTrue(AWTRobotUtil.waitForCount(0, newtCanvasAWTFA));
-        Assert.assertEquals(1, glWindow1FA.getCount());
-        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
-        Assert.assertEquals(-1, buttonFA.getCount()); // lost focus
-        System.err.println("FOCUS NEWT Canvas/GLWindow sync");
-        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, glWindow1, glWindow1KA));
-        Assert.assertEquals("AWT parent canvas received keyboard events", 0, newtCanvasAWTKA.getCount());
-
-        // Remove listeners to avoid logging during dispose/destroy.
-        glWindow1.removeKeyListener(glWindow1KA);
-        glWindow1.removeWindowListener(glWindow1FA);
-        newtCanvasAWT.removeKeyListener(newtCanvasAWTKA);
-        newtCanvasAWT.removeFocusListener(newtCanvasAWTFA);
-
-        // Shutdown the test.
-        animator.stop();
-        frame1.dispose();
-        glWindow1.invalidate();
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestFocus01SwingAWTRobot.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestFocus02SwingAWTRobot.java b/src/junit/com/jogamp/test/junit/newt/TestFocus02SwingAWTRobot.java
deleted file mode 100644
index b96279c..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestFocus02SwingAWTRobot.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import java.lang.reflect.*;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import java.awt.AWTException;
-import java.awt.Button;
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.Robot;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-import java.util.ArrayList;
-
-import javax.media.opengl.*;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.newt.opengl.*;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.*;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestFocus02SwingAWTRobot extends UITestCase {
-    static int width, height;
-    static long durationPerTest = 800;
-    static long awtWaitTimeout = 1000;
-    static long waitReparent = 0;
-    static GLCapabilities glCaps;
-
-    @BeforeClass
-    public static void initClass() throws AWTException {
-        width  = 640;
-        height = 480;
-
-        JFrame f = new JFrame();
-        f.setSize(100,100);
-        f.setVisible(true);
-        f.dispose();
-        f=null;
-
-        GLProfile.initSingleton(false);
-        glCaps = new GLCapabilities(null);
-    }
-
-    @AfterClass
-    public static void release() {
-    }
-    
-    private void testFocus01ProgrFocusImpl(Robot robot) 
-        throws AWTException, InterruptedException, InvocationTargetException {
-        int x = 0;
-        int y = 0;
-
-        ArrayList eventCountAdapters = new ArrayList();
-
-        /**
-         * JFrame . JPanel . Container . NewtCanvasAWT . GLWindow
-         */
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        GLEventListener demo1 = new Gears();
-        glWindow1.addGLEventListener(demo1);
-        NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
-        glWindow1.addWindowListener(glWindow1FA);
-        eventCountAdapters.add(glWindow1FA);
-        NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
-        glWindow1.addKeyListener(glWindow1KA);
-        eventCountAdapters.add(glWindow1KA);
-        NEWTMouseAdapter glWindow1MA = new NEWTMouseAdapter("GLWindow1");
-        glWindow1.addMouseListener(glWindow1MA);
-        eventCountAdapters.add(glWindow1MA);
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-        AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
-        newtCanvasAWT.addFocusListener(newtCanvasAWTFA);
-        eventCountAdapters.add(newtCanvasAWTFA);
-        AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
-        newtCanvasAWT.addKeyListener(newtCanvasAWTKA);
-        eventCountAdapters.add(newtCanvasAWTKA);
-        AWTMouseAdapter newtCanvasAWTMA = new AWTMouseAdapter("NewtCanvasAWT");
-        newtCanvasAWT.addMouseListener(newtCanvasAWTMA);
-        eventCountAdapters.add(newtCanvasAWTMA);
-
-        Button buttonNorthInner = new Button("north");
-        AWTFocusAdapter buttonNorthInnerFA = new AWTFocusAdapter("ButtonNorthInner");
-        buttonNorthInner.addFocusListener(buttonNorthInnerFA);
-        eventCountAdapters.add(buttonNorthInnerFA);
-        AWTKeyAdapter buttonNorthInnerKA = new AWTKeyAdapter("ButtonNorthInner");
-        buttonNorthInner.addKeyListener(buttonNorthInnerKA);
-        eventCountAdapters.add(buttonNorthInnerKA);
-        AWTMouseAdapter buttonNorthInnerMA = new AWTMouseAdapter("ButtonNorthInner");
-        buttonNorthInner.addMouseListener(buttonNorthInnerMA);
-        eventCountAdapters.add(buttonNorthInnerMA);
-        Container container1 = new Container();
-        container1.setLayout(new BorderLayout());
-        container1.add(buttonNorthInner, BorderLayout.NORTH);
-        container1.add(new Button("south"), BorderLayout.SOUTH);
-        container1.add(new Button("east"), BorderLayout.EAST);
-        container1.add(new Button("west"), BorderLayout.WEST);
-        container1.add(newtCanvasAWT, BorderLayout.CENTER);
-
-        Button buttonNorthOuter = new Button("north");
-        AWTFocusAdapter buttonNorthOuterFA = new AWTFocusAdapter("ButtonNorthOuter");
-        buttonNorthOuter.addFocusListener(buttonNorthOuterFA);
-        eventCountAdapters.add(buttonNorthOuterFA);
-        AWTKeyAdapter buttonNorthOuterKA = new AWTKeyAdapter("ButtonNorthOuter");
-        buttonNorthOuter.addKeyListener(buttonNorthOuterKA);
-        eventCountAdapters.add(buttonNorthOuterKA);
-        AWTMouseAdapter buttonNorthOuterMA = new AWTMouseAdapter("ButtonNorthOuter");
-        buttonNorthOuter.addMouseListener(buttonNorthOuterMA);
-        eventCountAdapters.add(buttonNorthOuterMA);
-        JPanel jPanel1 = new JPanel();
-        jPanel1.setLayout(new BorderLayout());
-        jPanel1.add(buttonNorthOuter, BorderLayout.NORTH);
-        jPanel1.add(new Button("south"), BorderLayout.SOUTH);
-        jPanel1.add(new Button("east"), BorderLayout.EAST);
-        jPanel1.add(new Button("west"), BorderLayout.WEST);
-        jPanel1.add(container1, BorderLayout.CENTER);
-
-        JFrame jFrame1 = new JFrame("Swing Parent JFrame");
-        AWTFocusAdapter jFrame1FA = new AWTFocusAdapter("JFrame1");
-        jFrame1.addFocusListener(jFrame1FA);
-        // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
-        jFrame1.setContentPane(jPanel1);
-        jFrame1.setSize(width, height);
-        jFrame1.setVisible(true); // from here on, we need to run modifications on EDT
-        Assert.assertTrue(AWTRobotUtil.toFront(robot, jFrame1));
-
-        int wait=0;
-        while(wait<awtWaitTimeout/100 && glWindow1.getTotalFrames()<1) { Thread.sleep(awtWaitTimeout/10); wait++; }
-        System.err.println("Frames for initial setVisible(true): "+glWindow1.getTotalFrames());
-        Assert.assertTrue(glWindow1.isVisible());
-        Assert.assertTrue(0 < glWindow1.getTotalFrames());
-
-        // Continuous animation ..
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-
-        // Button Outer Focus
-        Thread.sleep(100); // allow event sync
-        System.err.println("FOCUS AWT  Button Outer request");
-        EventCountAdapterUtil.reset(eventCountAdapters);
-        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, buttonNorthOuter, buttonNorthOuter, buttonNorthOuterFA, null));
-        Assert.assertEquals(1, buttonNorthOuterFA.getCount());
-        Assert.assertEquals(0, glWindow1FA.getCount());
-        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
-        Assert.assertEquals(0, buttonNorthInnerFA.getCount());
-        Assert.assertEquals(0, jFrame1FA.getCount());
-        System.err.println("FOCUS AWT  Button Outer sync");
-        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, buttonNorthOuter, buttonNorthOuterKA));
-        Assert.assertEquals(1, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 1, 
-                                                           buttonNorthOuter, buttonNorthOuterMA));
-        Assert.assertEquals(3, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 2, 
-                                                           buttonNorthOuter, buttonNorthOuterMA));
-
-        // NEWT Focus
-        Thread.sleep(100); // allow event sync
-        System.err.println("FOCUS NEWT Canvas/GLWindow request");
-        EventCountAdapterUtil.reset(eventCountAdapters);
-        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, newtCanvasAWT, newtCanvasAWT.getNEWTChild(), glWindow1FA, buttonNorthOuterFA));
-        Assert.assertTrue(AWTRobotUtil.waitForCount(0, newtCanvasAWTFA));
-        Assert.assertEquals(1, glWindow1FA.getCount());
-        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
-        Assert.assertEquals(0, buttonNorthInnerFA.getCount());
-        Assert.assertEquals(-1, buttonNorthOuterFA.getCount()); // lost focus
-        Assert.assertEquals(0, jFrame1FA.getCount());
-        System.err.println("FOCUS NEWT Canvas/GLWindow sync");
-        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, glWindow1, glWindow1KA));
-        Assert.assertEquals("AWT parent canvas received keyboard events", 0, newtCanvasAWTKA.getCount());
-        Assert.assertEquals(1, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 1, 
-                                                           glWindow1, glWindow1MA));
-        Assert.assertEquals(3, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 2, 
-                                                           glWindow1, glWindow1MA));
-        Assert.assertEquals("AWT parent canvas received mouse events", 0, newtCanvasAWTMA.getCount());
-
-        // Button Inner Focus
-        Thread.sleep(100); // allow event sync
-        System.err.println("FOCUS AWT  Button request");
-        EventCountAdapterUtil.reset(eventCountAdapters);
-        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, buttonNorthInner, buttonNorthInner, buttonNorthInnerFA, glWindow1FA));
-        Assert.assertEquals(1, buttonNorthInnerFA.getCount());
-        Assert.assertEquals(-1, glWindow1FA.getCount()); // lost focus
-        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
-        Assert.assertEquals(0, buttonNorthOuterFA.getCount());
-        Assert.assertEquals(0, jFrame1FA.getCount());
-        System.err.println("FOCUS AWT  Button sync");
-        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, buttonNorthInner, buttonNorthInnerKA));
-        Assert.assertEquals(1, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 1, 
-                                                           buttonNorthInner, buttonNorthInnerMA));
-        Assert.assertEquals(3, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 2, 
-                                                           buttonNorthInner, buttonNorthInnerMA));
-
-        // NEWT Focus
-        Thread.sleep(100); // allow event sync
-        System.err.println("FOCUS NEWT Canvas/GLWindow request");
-        EventCountAdapterUtil.reset(eventCountAdapters);
-        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, newtCanvasAWT, newtCanvasAWT.getNEWTChild(), glWindow1FA, buttonNorthInnerFA));
-        Assert.assertTrue(AWTRobotUtil.waitForCount(0, newtCanvasAWTFA));
-        Assert.assertEquals(1, glWindow1FA.getCount());
-        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
-        Assert.assertEquals(-1, buttonNorthInnerFA.getCount()); // lost focus
-        Assert.assertEquals(0, buttonNorthOuterFA.getCount());
-        Assert.assertEquals(0, jFrame1FA.getCount());
-        System.err.println("FOCUS NEWT Canvas/GLWindow sync");
-        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, glWindow1, glWindow1KA));
-        Assert.assertEquals("AWT parent canvas received keyboard events", 0, newtCanvasAWTKA.getCount());
-        Assert.assertEquals(1, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 1, 
-                                                           glWindow1, glWindow1MA));
-        Assert.assertEquals(3, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 2, 
-                                                           glWindow1, glWindow1MA));
-        Assert.assertEquals("AWT parent canvas received mouse events", 0, newtCanvasAWTMA.getCount());
-
-
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-
-        final JFrame _jFrame1 = jFrame1;
-        final JPanel _jPanel1 = jPanel1;
-        final Container _container1 = container1;
-        SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    _jFrame1.setVisible(false);
-                    _jPanel1.remove(_container1);
-                    _jFrame1.dispose();
-                } });
-
-        glWindow1.invalidate();
-    }
-
-    @Test
-    public void testFocus01ProgrFocus() throws AWTException, InterruptedException, InvocationTargetException {
-        testFocus01ProgrFocusImpl(null);
-    }
-
-    @Test
-    public void testFocus02RobotFocus() throws AWTException, InterruptedException, InvocationTargetException {
-        Robot robot = new Robot();
-        robot.setAutoWaitForIdle(true);
-        testFocus01ProgrFocusImpl(robot);
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            } else if(args[i].equals("-wait")) {
-                waitReparent = atoi(args[++i]);
-            }
-        }
-        System.err.println("durationPerTest "+durationPerTest);
-        System.err.println("waitReparent "+waitReparent);
-        String tstname = TestFocus02SwingAWTRobot.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/newt/TestGLWindows00NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestGLWindows00NEWT.java
deleted file mode 100644
index 2769dc5..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestGLWindows00NEWT.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.media.opengl.*;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.util.MiscUtils;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-
-public class TestGLWindows00NEWT extends UITestCase {
-    static GLProfile glp;
-    static int width, height;
-    static long durationPerTest = 100; // ms
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        // GLProfile.initSingleton(false);
-        width  = 640;
-        height = 480;
-        glp = GLProfile.getDefault();
-    }
-
-    static GLWindow createWindow(Screen screen, GLCapabilitiesImmutable caps)
-        throws InterruptedException
-    {
-        Assert.assertNotNull(caps);
-        //
-        // Create native windowing resources .. X11/Win/OSX
-        // 
-        GLWindow glWindow;
-        if(null!=screen) {
-            glWindow = GLWindow.create(screen, caps);
-            Assert.assertNotNull(glWindow);
-        } else {
-            glWindow = GLWindow.create(caps);
-            Assert.assertNotNull(glWindow);
-        }
-
-        GLEventListener demo = new Gears();
-        glWindow.addGLEventListener(demo);
-
-        glWindow.setSize(512, 512);
-        glWindow.setVisible(true);
-        Assert.assertEquals(true,glWindow.isVisible());
-        Assert.assertEquals(true,glWindow.isNativeValid());
-
-        return glWindow;
-    }
-
-    static void destroyWindow(GLWindow glWindow) {
-        if(null!=glWindow) {
-            glWindow.invalidate();
-            Assert.assertEquals(false,glWindow.isNativeValid());
-            Assert.assertEquals(false,glWindow.isValid());
-        }
-    }
-
-    @Test
-    public void testWindow00() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        GLWindow window1 = createWindow(null, caps); // local
-        Assert.assertEquals(true,window1.isNativeValid());
-        Assert.assertEquals(true,window1.isVisible());
-        AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
-
-        System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
-
-        for(int state=0; state*100<durationPerTest; state++) {
-            Thread.sleep(100);
-        }
-
-        destroyWindow(window1);
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestGLWindows00NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java
deleted file mode 100644
index e2c65ad..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.media.opengl.*;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.util.MiscUtils;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestGLWindows01NEWT extends UITestCase {
-    static GLProfile glp;
-    static int width, height;
-    static long durationPerTest = 100; // ms
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        // GLProfile.initSingleton(false);
-        width  = 640;
-        height = 480;
-        glp = GLProfile.getDefault();
-    }
-
-    static GLWindow createWindow(Screen screen, GLCapabilities caps,
-                                 int width, int height, boolean onscreen, boolean undecorated,
-                                 boolean addGLEventListenerAfterVisible) 
-        throws InterruptedException
-    {
-        Assert.assertNotNull(caps);
-        caps.setOnscreen(onscreen);
-        // System.out.println("Requested: "+caps);
-
-        //
-        // Create native windowing resources .. X11/Win/OSX
-        // 
-        GLWindow glWindow;
-        if(null!=screen) {
-            glWindow = GLWindow.create(screen, caps);
-            Assert.assertNotNull(glWindow);
-        } else {
-            glWindow = GLWindow.create(caps);
-            Assert.assertNotNull(glWindow);
-        }
-
-        glWindow.setUndecorated(onscreen && undecorated);
-        Assert.assertEquals(false,glWindow.isVisible());
-        Assert.assertEquals(false,glWindow.isNativeValid());
-
-        GLEventListener demo = new Gears();
-        setDemoFields(demo, glWindow);
-        if(!addGLEventListenerAfterVisible) {
-            glWindow.addGLEventListener(demo);
-        }
-        glWindow.addWindowListener(new TraceWindowAdapter());
-
-        glWindow.setSize(width, height);
-
-        Assert.assertEquals(0, glWindow.getTotalFrames());
-        glWindow.setVisible(true);
-        Assert.assertEquals(true,glWindow.isVisible());
-        Assert.assertEquals(true,glWindow.isNativeValid());
-        System.out.println("Frames for initial setVisible(true): "+glWindow.getTotalFrames());
-        Assert.assertTrue(0 < glWindow.getTotalFrames());
-
-        //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
-        // equivalent to GLAutoDrawable methods: setVisible(true)
-        // 
-        GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
-        Assert.assertNotNull(caps2);
-        Assert.assertTrue(caps2.getGreenBits()>=5);
-        Assert.assertTrue(caps2.getBlueBits()>=5);
-        Assert.assertTrue(caps2.getRedBits()>=5);
-        Assert.assertEquals(caps2.isOnscreen(),onscreen);
-
-        if(addGLEventListenerAfterVisible) {
-            glWindow.addGLEventListener(demo);
-            glWindow.display();
-        }
-
-        return glWindow;
-    }
-
-    static void destroyWindow(GLWindow glWindow) {
-        if(null!=glWindow) {
-            glWindow.invalidate();
-            Assert.assertEquals(false,glWindow.isNativeValid());
-            Assert.assertEquals(false,glWindow.isValid());
-        }
-    }
-
-    @Test
-    public void testWindowNativeRecreate01aSimple() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
-                                       false /*addGLEventListenerAfterVisible*/);
-
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-        window.destroy();
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        window.display();
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        window.setVisible(true);
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-
-        window.setVisible(false);
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        destroyWindow(window);
-    }
-
-    @Test
-    public void testWindowNativeRecreate01bSimple() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
-                                       true /*addGLEventListenerAfterVisible*/);
-
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-        window.destroy();
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        window.display();
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        window.setVisible(true);
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-
-        window.setVisible(false);
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        destroyWindow(window);
-    }
-
-    @Test
-    public void testWindowDecor01aSimple() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
-                                       false /*addGLEventListenerAfterVisible*/);
-        System.out.println("Created: "+window);
-        int state;
-        for(state=0; state*100<durationPerTest; state++) {
-            Thread.sleep(100);
-        }
-        System.out.println("duration: "+window.getDuration());
-        destroyWindow(window);
-    }
-
-    @Test
-    public void testWindowDecor01bSimple() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
-                                       true /*addGLEventListenerAfterVisible*/);
-        System.out.println("Created: "+window);
-        int state;
-        for(state=0; state*100<durationPerTest; state++) {
-            Thread.sleep(100);
-        }
-        System.out.println("duration: "+window.getDuration());
-        destroyWindow(window);
-    }
-
-    @Test
-    public void testWindowDecor02DestroyWinTwiceA() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
-                                       false /*addGLEventListenerAfterVisible*/);
-        int state;
-        for(state=0; state*100<durationPerTest; state++) {
-            Thread.sleep(100);
-        }
-        System.out.println("duration: "+window.getDuration());
-        destroyWindow(window);
-    }
-
-    @Test
-    public void testWindowDecor03TwoWinOneDisplay() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-        GLWindow window1 = createWindow(screen, caps, width, height,
-                                       true /* onscreen */, false /* undecorated */, 
-                                       false /*addGLEventListenerAfterVisible*/);
-        Assert.assertNotNull(window1);
-
-        GLWindow window2 = createWindow(screen, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
-                                       false /*addGLEventListenerAfterVisible*/);
-        Assert.assertNotNull(window2);
-
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-
-        Assert.assertEquals(2,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-
-        int state;
-        for(state=0; state*100<durationPerTest; state++) {
-            Thread.sleep(100);
-        }
-        System.out.println("duration1: "+window1.getDuration());
-        System.out.println("duration2: "+window2.getDuration());
-
-        destroyWindow(window1);
-        destroyWindow(window2);
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(false,display.getEDTUtil().isRunning());
-
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-    }
-
-    @Test
-    public void testWindowDecor03TwoWinTwoDisplays() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-
-        Display display1 = NewtFactory.createDisplay(null, false); // local display
-        Assert.assertNotNull(display1);
-        Display display2 = NewtFactory.createDisplay(null, false); // local display
-        Assert.assertNotNull(display2);
-        Assert.assertNotSame(display1, display2);
-
-        Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
-        Assert.assertNotNull(screen1);
-        GLWindow window1 = createWindow(screen1, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
-                                       false /*addGLEventListenerAfterVisible*/);
-        Assert.assertNotNull(window1);
-
-        Screen screen2  = NewtFactory.createScreen(display2, 0); // screen 0
-        Assert.assertNotNull(screen2);
-        GLWindow window2 = createWindow(screen2, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
-                                       false /*addGLEventListenerAfterVisible*/);
-        Assert.assertNotNull(window2);
-
-        Assert.assertEquals(2,Display.getActiveDisplayNumber());
-
-        Assert.assertEquals(1,display1.getReferenceCount());
-        Assert.assertEquals(true,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(1,screen1.getReferenceCount());
-        Assert.assertEquals(true,screen1.isNativeValid());
-
-        Assert.assertEquals(1,display2.getReferenceCount());
-        Assert.assertEquals(true,display2.isNativeValid());
-        Assert.assertNotNull(display2.getEDTUtil());
-        Assert.assertEquals(true,display2.getEDTUtil().isRunning());
-        Assert.assertEquals(1,screen2.getReferenceCount());
-        Assert.assertEquals(true,screen2.isNativeValid());
-
-        int state;
-        for(state=0; state*100<durationPerTest; state++) {
-            Thread.sleep(100);
-        }
-        System.out.println("duration1: "+window1.getDuration());
-        System.out.println("duration2: "+window2.getDuration());
-
-        // It is observed that some X11 drivers, eg ATI, fglrx 8.78.6,
-        // are quite sensitive to multiple Display connections (NEWT Display -> X11 Display).
-        // In such cases, closing displays shall happen in the same order as
-        // opening them, otherwise some driver related bug appears.
-        // You may test this, ie just reverse the destroy order below.
-        // See also native test: jogl/test/native/displayMultiple02.c
-        destroyWindow(window1);
-        destroyWindow(window2);
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        Assert.assertEquals(0,display1.getReferenceCount());
-        Assert.assertEquals(false,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(false,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen1.getReferenceCount());
-        Assert.assertEquals(false,screen1.isNativeValid());
-
-        Assert.assertEquals(0,display2.getReferenceCount());
-        Assert.assertEquals(false,display2.isNativeValid());
-        Assert.assertNotNull(display2.getEDTUtil());
-        Assert.assertEquals(false,display2.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen2.getReferenceCount());
-        Assert.assertEquals(false,screen2.isNativeValid()); 
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);
-        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestGLWindows01NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestGLWindows02NEWTAnimated.java b/src/junit/com/jogamp/test/junit/newt/TestGLWindows02NEWTAnimated.java
deleted file mode 100644
index 34e4f64..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestGLWindows02NEWTAnimated.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.media.opengl.*;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.util.MiscUtils;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestGLWindows02NEWTAnimated extends UITestCase {
-    static GLProfile glp;
-    static int width, height;
-    static long durationPerTest = 100; // ms
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        width  = 640;
-        height = 480;
-        glp = GLProfile.getDefault();
-    }
-
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
-        Assert.assertNotNull(caps);
-        caps.setOnscreen(onscreen);
-        // System.out.println("Requested: "+caps);
-
-        //
-        // Create native windowing resources .. X11/Win/OSX
-        // 
-        GLWindow glWindow;
-        if(null!=screen) {
-            Window window = NewtFactory.createWindow(screen, caps);
-            Assert.assertNotNull(window);
-            glWindow = GLWindow.create(window);
-        } else {
-            glWindow = GLWindow.create(caps);
-        }
-        Assert.assertNotNull(glWindow);
-        glWindow.setUndecorated(onscreen && undecorated);
-
-        GLEventListener demo = new Gears();
-        setDemoFields(demo, glWindow);
-        glWindow.addGLEventListener(demo);
-        glWindow.addWindowListener(new TraceWindowAdapter());
-        Assert.assertEquals(false,glWindow.isNativeValid());
-
-        glWindow.setSize(width, height);
-        Assert.assertEquals(false,glWindow.isVisible());
-        glWindow.setVisible(true);
-        Assert.assertEquals(true,glWindow.isVisible());
-        Assert.assertEquals(true,glWindow.isNativeValid());
-        // Assert.assertEquals(width,glWindow.getWidth());
-        // Assert.assertEquals(height,glWindow.getHeight());
-        // System.out.println("Created: "+glWindow);
-
-        //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
-        // equivalent to GLAutoDrawable methods: setVisible(true)
-        // 
-        GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
-        Assert.assertNotNull(caps2);
-        Assert.assertTrue(caps2.getGreenBits()>=5);
-        Assert.assertTrue(caps2.getBlueBits()>=5);
-        Assert.assertTrue(caps2.getRedBits()>=5);
-        Assert.assertEquals(caps2.isOnscreen(),onscreen);
-
-        return glWindow;
-    }
-
-    static void destroyWindow(GLWindow glWindow) {
-        if(null!=glWindow) {
-            glWindow.destroy();
-        }
-    }
-
-    @Test
-    public void testWindowDecor01Simple() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Animator animator = new Animator(window);
-        animator.start();
-        while(animator.isAnimating() && animator.getDuration()<durationPerTest) {
-            Thread.sleep(100);
-        }
-        destroyWindow(window);
-        Assert.assertEquals(true, animator.isAnimating());
-        animator.stop();
-    }
-
-    @Test
-    public void testWindowDecor02DestroyWinTwiceA() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Animator animator = new Animator(window);
-        animator.start();
-        while(animator.isAnimating() && animator.getDuration()<durationPerTest) {
-            Thread.sleep(100);
-        }
-        destroyWindow(window);
-        destroyWindow(window);
-        Assert.assertEquals(true, animator.isAnimating());
-        animator.stop();
-    }
-
-    @Test
-    public void testWindowDecor03TwoWinOneDisplay() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-        GLWindow window1 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Assert.assertNotNull(window1);
-        window1.setPosition(0, 0);
-
-        GLWindow window2 = createWindow(screen, caps, width-10, height-10, true /* onscreen */, false /* undecorated */);
-        Assert.assertNotNull(window2);
-        window2.setPosition(screen.getWidth()-width, 0);
-
-        Animator animator = new Animator();
-        Assert.assertEquals(false, animator.isStarted());
-        Assert.assertEquals(false, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        animator.start();
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(false, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        animator.add(window1);
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(true, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        animator.add(window2);
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(true, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        while(animator.isAnimating() && animator.getDuration()<durationPerTest) {
-            Thread.sleep(100);
-        }
-        window1.invalidate();
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(true, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        while(animator.isAnimating() && animator.getDuration()<2*durationPerTest) {
-            Thread.sleep(100);
-        }
-        window2.invalidate();
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(false, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-        animator.stop();
-    }
-
-    @Test
-    public void testWindowDecor03TwoWinTwoDisplays() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-
-        Display display1 = NewtFactory.createDisplay(null, false); // local display
-        Assert.assertNotNull(display1);
-        Display display2 = NewtFactory.createDisplay(null, false); // local display
-        Assert.assertNotNull(display2);
-        Assert.assertNotSame(display1, display2);
-
-        Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
-        Assert.assertNotNull(screen1);
-        GLWindow window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Assert.assertNotNull(window1);
-        window1.setPosition(0, 0);
-
-        Screen screen2  = NewtFactory.createScreen(display2, 0); // screen 0
-        Assert.assertNotNull(screen2);
-        GLWindow window2 = createWindow(screen2, caps, width-10, height-10, true /* onscreen */, false /* undecorated */);
-        Assert.assertNotNull(window2);
-        window2.setPosition(screen2.getWidth()-width, 0);
-
-        Animator animator = new Animator();
-        Assert.assertEquals(false, animator.isStarted());
-        Assert.assertEquals(false, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        animator.start();
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(false, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        animator.add(window1);
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(true, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        animator.add(window2);
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(true, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        while(animator.isAnimating() && animator.getDuration()<durationPerTest) {
-            Thread.sleep(100);
-        }
-        destroyWindow(window1);
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(true, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        while(animator.isAnimating() && animator.getDuration()<2*durationPerTest) {
-            Thread.sleep(100);
-        }
-        destroyWindow(window2);
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(true, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        Assert.assertEquals(true, animator.pause());
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(false, animator.isAnimating());
-        Assert.assertEquals(true, animator.isPaused());
-
-        Assert.assertEquals(true, animator.resume());
-        Assert.assertEquals(true, animator.isStarted());
-        Assert.assertEquals(true, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-
-        animator.stop();
-        Assert.assertEquals(false, animator.isStarted());
-        Assert.assertEquals(false, animator.isAnimating());
-        Assert.assertEquals(false, animator.isPaused());
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);
-        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        String tstname = TestGLWindows02NEWTAnimated.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestListenerCom01AWT.java b/src/junit/com/jogamp/test/junit/newt/TestListenerCom01AWT.java
deleted file mode 100644
index 4407ffe..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestListenerCom01AWT.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import java.awt.Button;
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-import java.awt.Frame;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.*;
-import com.jogamp.test.junit.jogl.demos.es1.RedSquare;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestListenerCom01AWT extends UITestCase {
-    static int width, height;
-    static long durationPerTest = 500;
-    static boolean verbose = false;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        width  = 640;
-        height = 480;
-    }
-
-    @Test
-    public void testListenerStringPassingAndOrder() throws InterruptedException {
-        // setup NEWT GLWindow ..
-        GLWindow glWindow = GLWindow.create(new GLCapabilities(null));
-        Assert.assertNotNull(glWindow);
-        glWindow.setTitle("NEWT - CHILD");
-
-        System.out.println("durationPerTest "+durationPerTest);
-
-        GLEventListener demo = new Gears();
-        setDemoFields(demo, glWindow, false);
-        glWindow.addGLEventListener(demo);
-
-        WindowEventCom1 wl1 = new WindowEventCom1();
-        WindowEventCom2 wl2 = new WindowEventCom2();
-        WindowEventCom3 wl3 = new WindowEventCom3();
-
-        // TraceWindowAdapter wlT = new TraceWindowAdapter();
-        // glWindow.addWindowListener(0, wlT);
-        // Assert.assertEquals(wlT, glWindow.getWindowListener(0));
-
-        glWindow.addWindowListener(0, wl3);
-        glWindow.addWindowListener(0, wl2);
-        glWindow.addWindowListener(0, wl1);
-
-        Assert.assertEquals(wl1, glWindow.getWindowListener(0));
-        Assert.assertEquals(wl2, glWindow.getWindowListener(1));
-        Assert.assertEquals(wl3, glWindow.getWindowListener(2));
-
-        // attach NEWT GLWindow to AWT Canvas
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
-        Frame frame = new Frame("AWT Parent Frame");
-        frame.add(newtCanvasAWT);
-        frame.setSize(width, height);
-        frame.setVisible(true);
-
-        Animator animator1 = new Animator(glWindow);
-        animator1.start();
-        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
-            Thread.sleep(100);
-            width+=10; height+=10;
-            frame.setSize(width, height);
-        }
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-
-        frame.dispose();
-        glWindow.invalidate();
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);
-        Window window = glWindow.getWindow();
-        if(debug) {
-            MiscUtils.setFieldIfExists(demo, "glDebug", true);
-            MiscUtils.setFieldIfExists(demo, "glTrace", true);
-        }
-        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        verbose = true;
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        String tstname = TestListenerCom01AWT.class.getName();
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestRemoteGLWindows01NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestRemoteGLWindows01NEWT.java
deleted file mode 100644
index fc5327c..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestRemoteGLWindows01NEWT.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.util.Animator;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.opengl.*;
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.UITestCase;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.NativeWindowException;
-
-public class TestRemoteGLWindows01NEWT extends UITestCase {
-    static GLProfile glp;
-    static int width, height;
-    static long durationPerTest = 100; // ms
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        // GLProfile.initSingleton(false);
-        width  = 640;
-        height = 480;
-        glp = GLProfile.getDefault();
-    }
-
-    static GLWindow createWindow(Screen screen, GLCapabilities caps)
-        throws InterruptedException
-    {
-        Assert.assertNotNull(caps);
-        //
-        // Create native windowing resources .. X11/Win/OSX
-        // 
-        GLWindow glWindow;
-        if(null!=screen) {
-            glWindow = GLWindow.create(screen, caps);
-            Assert.assertNotNull(glWindow);
-        } else {
-            glWindow = GLWindow.create(caps);
-            Assert.assertNotNull(glWindow);
-        }
-
-        GLEventListener demo = new Gears();
-        glWindow.addGLEventListener(demo);
-
-        glWindow.setSize(512, 512);
-        glWindow.setVisible(true);
-        Assert.assertEquals(true,glWindow.isVisible());
-        Assert.assertEquals(true,glWindow.isNativeValid());
-
-        return glWindow;
-    }
-
-    static void destroyWindow(GLWindow glWindow) {
-        if(null!=glWindow) {
-            glWindow.invalidate();
-            Assert.assertEquals(false,glWindow.isNativeValid());
-            Assert.assertEquals(false,glWindow.isValid());
-        }
-    }
-
-    @Test
-    public void testRemoteWindow01() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        GLWindow window1 = createWindow(null, caps); // local
-        Assert.assertEquals(true,window1.isNativeValid());
-        Assert.assertEquals(true,window1.isVisible());
-        AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
-
-        System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
-
-        Animator animator1 = new Animator(window1);
-        animator1.start();
-
-        // Eager initialization of NEWT Display -> AbstractGraphicsDevice -> GLProfile (device)
-        Display display2 = NewtFactory.createDisplay("charelle:0.0"); // remote display
-        try {
-            display2.createNative(); 
-        } catch (NativeWindowException nwe) {
-            System.err.println(nwe);
-            Assume.assumeNoException(nwe);
-            destroyWindow(window1);
-            return;
-        }
-        AbstractGraphicsDevice device2 = display2.getGraphicsDevice();
-        GLProfile.initProfiles(device2); // just to make sure
-        System.err.println("");
-        System.err.println("GLProfiles window2: "+device2.getConnection()+": "+GLProfile.glAvailabilityToString(device2));
-
-        Screen screen2  = NewtFactory.createScreen(display2, 0); // screen 0
-        GLWindow window2 = createWindow(screen2, caps); // remote
-        Assert.assertEquals(true,window2.isNativeValid());
-        Assert.assertEquals(true,window2.isVisible());
-
-        Animator animator2 = new Animator(window2);
-        animator2.start();
-
-        for(int state=0; state*100<durationPerTest; state++) {
-            Thread.sleep(100);
-        }
-
-        destroyWindow(window1);
-        destroyWindow(window2);
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestRemoteGLWindows01NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestRemoteWindow01NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestRemoteWindow01NEWT.java
deleted file mode 100644
index b384145..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestRemoteWindow01NEWT.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import javax.media.nativewindow.*;
-
-import com.jogamp.newt.*;
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.UITestCase;
-
-public class TestRemoteWindow01NEWT extends UITestCase {
-    static int width, height;
-
-    @BeforeClass
-    public static void initClass() {
-        NativeWindowFactory.initSingleton(true);
-        width  = 640;
-        height = 480;
-    }
-
-    static Window createWindow(Screen screen, Capabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
-        Assert.assertNotNull(caps);
-        caps.setOnscreen(onscreen);
-        // System.out.println("Requested: "+caps);
-
-        //
-        // Create native windowing resources .. X11/Win/OSX
-        // 
-        Window window = NewtFactory.createWindow(screen, caps);
-        Assert.assertNotNull(window);
-        window.setUndecorated(onscreen && undecorated);
-        window.setSize(width, height);
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-        window.setVisible(true);
-        Assert.assertEquals(true,window.isVisible());
-        Assert.assertEquals(true,window.isNativeValid());
-        // Assert.assertEquals(width,window.getWidth());
-        // Assert.assertEquals(height,window.getHeight());
-        // System.out.println("Created: "+window);
-
-        //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
-        // equivalent to GLAutoDrawable methods: setVisible(true)
-        // 
-        CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
-        Assert.assertNotNull(chosenCapabilities);
-        Assert.assertTrue(chosenCapabilities.getGreenBits()>5);
-        Assert.assertTrue(chosenCapabilities.getBlueBits()>5);
-        Assert.assertTrue(chosenCapabilities.getRedBits()>5);
-        Assert.assertEquals(chosenCapabilities.isOnscreen(),onscreen);
-
-        return window;
-    }
-
-    static void destroyWindow(Display display, Screen screen, Window window) {
-        if(null!=window) {
-            window.destroy();
-        }
-        if(null!=screen) {
-            screen.destroy();
-        }
-        if(null!=display) {
-            display.destroy();
-        }
-    }
-
-    @Test
-    public void testRemoteWindow01() throws InterruptedException {
-        Capabilities caps = new Capabilities();
-        Display display1 = NewtFactory.createDisplay(null); // local display
-        Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
-        Window window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */);
-        window1.setVisible(true);
-
-        Assert.assertEquals(true,window1.isNativeValid());
-        Assert.assertEquals(true,window1.isVisible());
-
-        Display display2 = NewtFactory.createDisplay("charelle:0.0"); // remote display
-        try {
-            display2.createNative(); 
-        } catch (NativeWindowException nwe) {
-            System.err.println(nwe);
-            Assume.assumeNoException(nwe);
-            destroyWindow(display1, screen1, window1);
-            return;
-        }
-        Screen screen2  = NewtFactory.createScreen(display2, 0); // screen 0
-        Window window2 = createWindow(screen2, caps, width, height, true /* onscreen */, false /* undecorated */);
-        window2.setVisible(true);
-
-        Assert.assertEquals(true,window2.isNativeValid());
-        Assert.assertEquals(true,window2.isVisible());
-
-        Thread.sleep(500); // 500 ms
-
-        destroyWindow(display1, screen1, window1);
-        destroyWindow(display2, screen2, window2);
-    }
-
-    public static void main(String args[]) throws IOException {
-        String tstname = TestRemoteWindow01NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestScreenMode00NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestScreenMode00NEWT.java
deleted file mode 100644
index 9f39274..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestScreenMode00NEWT.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import java.io.IOException;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.jogamp.newt.Display;
-import com.jogamp.newt.NewtFactory;
-import com.jogamp.newt.Screen;
-import com.jogamp.newt.Window;
-import com.jogamp.newt.ScreenMode;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.newt.util.MonitorMode;
-import com.jogamp.newt.util.ScreenModeUtil;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-import com.jogamp.test.junit.util.UITestCase;
-import java.util.Iterator;
-import java.util.List;
-import javax.media.nativewindow.Capabilities;
-import javax.media.nativewindow.util.Dimension;
-import javax.media.nativewindow.util.DimensionReadOnly;
-import javax.media.nativewindow.util.SurfaceSize;
-
-public class TestScreenMode00NEWT extends UITestCase {
-    static int width, height;
-    
-    static int waitTimeShort = 4; //1 sec
-    static int waitTimeLong = 6; //6 sec
-    
-    
-
-    @BeforeClass
-    public static void initClass() {
-        NativeWindowFactory.initSingleton(true);
-        width  = 640;
-        height = 480;
-    }
-
-    @Test
-    public void testScreenModeInfo00() throws InterruptedException {
-        DimensionReadOnly res = new Dimension(640, 480);
-        SurfaceSize surfsz = new SurfaceSize(res, 32);
-        DimensionReadOnly mm = new Dimension(500, 400);
-        MonitorMode mon = new MonitorMode(surfsz, mm, 60);
-        ScreenMode sm_out = new ScreenMode(mon, 90);
-        System.err.println("00 out: "+sm_out);
-
-        int[] props = ScreenModeUtil.streamOut(sm_out);
-        ScreenMode sm_in = ScreenModeUtil.streamIn(props, 0);
-        System.err.println("00 in : "+sm_in);
-
-        Assert.assertEquals(sm_in.getMonitorMode().getSurfaceSize().getResolution(),
-                            sm_out.getMonitorMode().getSurfaceSize().getResolution());
-
-        Assert.assertEquals(sm_in.getMonitorMode().getSurfaceSize(),
-                            sm_out.getMonitorMode().getSurfaceSize());
-
-        Assert.assertEquals(sm_in.getMonitorMode().getScreenSizeMM(),
-                            sm_out.getMonitorMode().getScreenSizeMM());
-
-        Assert.assertEquals(sm_in.getMonitorMode(), sm_out.getMonitorMode());
-
-        Assert.assertEquals(sm_in, sm_out);
-        
-        Assert.assertEquals(sm_out.hashCode(), sm_in.hashCode());
-    }
-
-    @Test
-    public void testScreenModeInfo01() throws InterruptedException {
-    	Capabilities caps = new Capabilities();
-        Window window = NewtFactory.createWindow(caps);
-        window.setSize(width, height);
-        window.setVisible(true);
-
-        Screen screen = window.getScreen();
-
-        List screenModes = screen.getScreenModes();
-        if(null != screenModes) {
-            Assert.assertTrue(screenModes.size()>0);
-            int i=0;
-            for(Iterator iter=screenModes.iterator(); iter.hasNext(); i++) {
-                System.err.println(i+": "+iter.next());
-            }
-            ScreenMode sm_o = screen.getOriginalScreenMode();
-            Assert.assertNotNull(sm_o);            
-            ScreenMode sm_c = screen.getOriginalScreenMode();
-            Assert.assertNotNull(sm_c);
-            System.err.println("orig: "+sm_o);
-            System.err.println("curr: "+sm_c);
-        } else {
-            // no support ..
-            System.err.println("Your platform has no ScreenMode change support, sorry");
-        }
-
-        window.invalidate();
-
-        Assert.assertEquals(false,window.isVisible());
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(false,screen.getDisplay().isNativeValid());
-    }
-
-    public static void main(String args[]) throws IOException {
-        String tstname = TestScreenMode00NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestScreenMode01NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestScreenMode01NEWT.java
deleted file mode 100644
index de4def2..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestScreenMode01NEWT.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import java.io.IOException;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.opengl.util.Animator;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.jogamp.newt.Display;
-import com.jogamp.newt.NewtFactory;
-import com.jogamp.newt.Screen;
-import com.jogamp.newt.Window;
-import com.jogamp.newt.ScreenMode;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.newt.util.ScreenModeUtil;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-import com.jogamp.test.junit.util.UITestCase;
-import java.util.List;
-import javax.media.nativewindow.util.Dimension;
-
-public class TestScreenMode01NEWT extends UITestCase {
-    static GLProfile glp;
-    static int width, height;
-    
-    static int waitTimeShort = 1000; // 1 sec
-    static int waitTimeLong = 5000; // 5 sec
-    
-    
-
-    @BeforeClass
-    public static void initClass() {
-        NativeWindowFactory.initSingleton(true);
-        width  = 640;
-        height = 480;
-        glp = GLProfile.getDefault();
-    }
-
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
-        Assert.assertNotNull(caps);
-        caps.setOnscreen(onscreen);
-
-        GLWindow window = GLWindow.create(screen, caps);
-        window.setSize(width, height);
-        window.addGLEventListener(new Gears());
-        Assert.assertNotNull(window);
-        window.setVisible(true);
-        return window;
-    }
-
-    static void destroyWindow(Window window) {
-        if(null!=window) {
-            window.destroy();
-        }
-    }
-    
-    @Test
-    public void testFullscreenChange01() throws InterruptedException {
-    	GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-
-        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Animator animator = new Animator(window);
-        animator.start();
-        
-        window.setFullscreen(true);
-        Assert.assertEquals(true, window.isFullscreen());
-        
-        Thread.sleep(waitTimeShort);
-
-        window.setFullscreen(false);
-        Assert.assertEquals(false, window.isFullscreen());
-        
-        Thread.sleep(waitTimeShort);
-
-        animator.stop();
-        destroyWindow(window);    	
-    }
-
-    @Test
-    public void testScreenModeChange01() throws InterruptedException {
-        Thread.sleep(waitTimeShort);
-
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Assert.assertNotNull(window);
-
-        List screenModes = screen.getScreenModes();
-        if(null==screenModes) {
-            // no support ..
-            System.err.println("Your platform has no ScreenMode change support, sorry");
-            destroyWindow(window);
-            return;
-        }
-        Assert.assertTrue(screenModes.size()>0);
-
-        Animator animator = new Animator(window);
-        animator.start();
-
-        ScreenMode smCurrent = screen.getCurrentScreenMode();
-        Assert.assertNotNull(smCurrent);
-        ScreenMode smOrig = screen.getOriginalScreenMode();
-        Assert.assertNotNull(smOrig);
-        Assert.assertEquals(smCurrent, smOrig);
-        System.err.println("[0] current/orig: "+smCurrent);
-
-        screenModes = ScreenModeUtil.filterByRate(screenModes, smOrig.getMonitorMode().getRefreshRate());
-        Assert.assertNotNull(screenModes);
-        Assert.assertTrue(screenModes.size()>0);
-        screenModes = ScreenModeUtil.filterByRotation(screenModes, 0);
-        Assert.assertNotNull(screenModes);
-        Assert.assertTrue(screenModes.size()>0);
-        screenModes = ScreenModeUtil.filterByResolution(screenModes, new Dimension(801, 601));
-        Assert.assertNotNull(screenModes);
-        Assert.assertTrue(screenModes.size()>0);
-        screenModes = ScreenModeUtil.getHighestAvailableBpp(screenModes);
-        Assert.assertNotNull(screenModes);
-        Assert.assertTrue(screenModes.size()>0);
-
-        ScreenMode sm = (ScreenMode) screenModes.get(0);
-        System.err.println("[0] set current: "+sm);
-        screen.setCurrentScreenMode(sm);
-        Assert.assertEquals(sm, screen.getCurrentScreenMode());
-        Assert.assertNotSame(smOrig, screen.getCurrentScreenMode());
-
-        Thread.sleep(waitTimeLong);
-
-        // check reset ..
-
-        ScreenMode saveOrigMode = (ScreenMode) smOrig.clone();
-
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-
-        animator.stop();
-        destroyWindow(window);
-
-        Assert.assertEquals(false,window.isVisible());
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(false,display.isNativeValid());
-
-        screen.createNative(); // trigger native re-creation
-
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertEquals(true,screen.isNativeValid());
-
-        smCurrent = screen.getCurrentScreenMode();
-        System.err.println("[1] current/orig: "+smCurrent);
-
-        Assert.assertNotNull(smCurrent);
-        Assert.assertEquals(saveOrigMode, smOrig);
-
-        screen.destroy();
-
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(false,display.isNativeValid());
-
-        Thread.sleep(waitTimeShort);
-    }
-
-    @Test
-    public void testScreenModeChangeWithFS01Pre() throws InterruptedException {
-        Thread.sleep(waitTimeShort);
-        testScreenModeChangeWithFS01Impl(true) ;
-        Thread.sleep(waitTimeShort);
-    }
-
-    @Test
-    public void testScreenModeChangeWithFS01Post() throws InterruptedException {
-        Thread.sleep(waitTimeShort);
-        testScreenModeChangeWithFS01Impl(false) ;
-        Thread.sleep(waitTimeShort);
-    }
-
-    protected void testScreenModeChangeWithFS01Impl(boolean preFS) throws InterruptedException {
-    	GLCapabilities caps = new GLCapabilities(glp);
-        Display display = NewtFactory.createDisplay(null); // local display
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Animator animator = new Animator(window);
-        animator.start();
-
-        ScreenMode smOrig = screen.getOriginalScreenMode();
-        List screenModes = screen.getScreenModes();
-        if(null==screenModes) {
-            // no support ..
-            destroyWindow(window);
-            return;
-        }
-        Assert.assertTrue(screenModes.size()>0);
-        screenModes = ScreenModeUtil.filterByRate(screenModes, smOrig.getMonitorMode().getRefreshRate());
-        screenModes = ScreenModeUtil.filterByRotation(screenModes, 0);
-        screenModes = ScreenModeUtil.filterByResolution(screenModes, new Dimension(801, 601));
-        screenModes = ScreenModeUtil.getHighestAvailableBpp(screenModes);
-
-        ScreenMode screenMode = (ScreenMode) screenModes.get(0);
-        Assert.assertNotNull(screenMode);
-        
-        if(preFS) {
-            System.err.println("[0] set FS pre 0: "+window.isFullscreen());
-            window.setFullscreen(true);
-            Assert.assertEquals(true, window.isFullscreen());
-            System.err.println("[0] set FS pre X: "+window.isFullscreen());
-        }
-
-        System.err.println("[0] set current: "+screenMode);
-        screen.setCurrentScreenMode(screenMode);
-        
-        if(!preFS) {
-            System.err.println("[0] set FS post 0: "+window.isFullscreen());
-            window.setFullscreen(true);
-            Assert.assertEquals(true, window.isFullscreen());
-            System.err.println("[0] set FS post X: "+window.isFullscreen());
-        }
-
-        Thread.sleep(waitTimeLong);
-        
-        // check reset ..
-
-        ScreenMode saveOrigMode = (ScreenMode) smOrig.clone();
-
-        animator.stop();
-        destroyWindow(window);
-
-        screen.createNative(); // trigger native re-creation
-
-        ScreenMode smCurrent = screen.getCurrentScreenMode();
-        System.err.println("[1] current/orig: "+smCurrent);
-
-        Assert.assertNotNull(smCurrent);
-        Assert.assertEquals(saveOrigMode, smOrig);
-
-        screen.destroy();
-    }
-
-    public static void main(String args[]) throws IOException {
-        String tstname = TestScreenMode01NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestScreenMode02NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestScreenMode02NEWT.java
deleted file mode 100644
index 011af63..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestScreenMode02NEWT.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import java.io.IOException;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.opengl.util.Animator;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import com.jogamp.newt.Display;
-import com.jogamp.newt.NewtFactory;
-import com.jogamp.newt.Screen;
-import com.jogamp.newt.Window;
-import com.jogamp.newt.ScreenMode;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.newt.util.ScreenModeUtil;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-import com.jogamp.test.junit.util.UITestCase;
-import java.util.List;
-import javax.media.nativewindow.util.Dimension;
-
-public class TestScreenMode02NEWT extends UITestCase {
-    static GLProfile glp;
-    static int width, height;
-    
-    static int waitTimeShort = 1000; // 1 sec
-    static int waitTimeLong = 5000; // 5 sec
-
-    @BeforeClass
-    public static void initClass() {
-        NativeWindowFactory.initSingleton(true);
-        width  = 640;
-        height = 480;
-        glp = GLProfile.getDefault();
-    }
-
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
-        Assert.assertNotNull(caps);
-        caps.setOnscreen(onscreen);
-
-        GLWindow window = GLWindow.create(screen, caps);
-        window.setSize(width, height);
-        window.addGLEventListener(new Gears());
-        Assert.assertNotNull(window);
-        window.setVisible(true);
-        Assert.assertTrue(window.isVisible());
-        return window;
-    }
-
-    static void destroyWindow(Window window) {
-        if(null!=window) {
-            window.destroy();
-        }
-    }
-    
-    @Test
-    public void testScreenRotationChange01() throws InterruptedException {
-        Thread.sleep(waitTimeShort);
-
-        GLCapabilities caps = new GLCapabilities(glp);
-        Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Assert.assertNotNull(window);
-
-        List screenModes = screen.getScreenModes();
-        if(null==screenModes) {
-            // no support ..
-            System.err.println("Your platform has no ScreenMode change support, sorry");
-            destroyWindow(window);
-            return;
-        }
-        Assert.assertTrue(screenModes.size()>0);
-
-        Animator animator = new Animator(window);
-        animator.start();
-
-        ScreenMode smCurrent = screen.getCurrentScreenMode();
-        Assert.assertNotNull(smCurrent);
-        ScreenMode smOrig = screen.getOriginalScreenMode();
-        Assert.assertNotNull(smOrig);
-        Assert.assertEquals(smCurrent, smOrig);
-        System.err.println("[0] current/orig: "+smCurrent);
-
-        screenModes = ScreenModeUtil.filterByRate(screenModes, smOrig.getMonitorMode().getRefreshRate());
-        Assert.assertNotNull(screenModes);
-        Assert.assertTrue(screenModes.size()>0);
-        screenModes = ScreenModeUtil.filterByRotation(screenModes, 90);
-        if(null==screenModes) {
-            // no rotation support ..
-            System.err.println("Your platform has no rotation support, sorry");
-            destroyWindow(window);
-            return;
-        }
-        Assert.assertTrue(screenModes.size()>0);
-        screenModes = ScreenModeUtil.filterByResolution(screenModes, new Dimension(801, 601));
-        Assert.assertNotNull(screenModes);
-        Assert.assertTrue(screenModes.size()>0);
-        screenModes = ScreenModeUtil.getHighestAvailableBpp(screenModes);
-        Assert.assertNotNull(screenModes);
-        Assert.assertTrue(screenModes.size()>0);
-
-        ScreenMode sm = (ScreenMode) screenModes.get(0);
-        System.err.println("[0] set current: "+sm);
-        screen.setCurrentScreenMode(sm);
-        Assert.assertEquals(sm, screen.getCurrentScreenMode());
-        Assert.assertNotSame(smOrig, screen.getCurrentScreenMode());
-
-        Thread.sleep(waitTimeLong);
-
-        // check reset ..
-
-        ScreenMode saveOrigMode = (ScreenMode) smOrig.clone();
-
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-
-        animator.stop();
-        destroyWindow(window);
-
-        Assert.assertEquals(false,window.isVisible());
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(false,display.isNativeValid());
-
-        screen.createNative(); // trigger native re-creation
-
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertEquals(true,screen.isNativeValid());
-
-        smCurrent = screen.getCurrentScreenMode();
-        System.err.println("[1] current/orig: "+smCurrent);
-
-        Assert.assertNotNull(smCurrent);
-        Assert.assertEquals(saveOrigMode, smOrig);
-
-        screen.destroy();
-
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(false,display.isNativeValid());
-
-        Thread.sleep(waitTimeShort);
-    }
-
-    public static void main(String args[]) throws IOException {
-        String tstname = TestScreenMode02NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/TestWindows01NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestWindows01NEWT.java
deleted file mode 100644
index 033542b..0000000
--- a/src/junit/com/jogamp/test/junit/newt/TestWindows01NEWT.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import javax.media.nativewindow.*;
-
-import com.jogamp.newt.*;
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.UITestCase;
-
-public class TestWindows01NEWT extends UITestCase {
-    static int width, height;
-
-    @BeforeClass
-    public static void initClass() {
-        NativeWindowFactory.initSingleton(true);
-        width  = 640;
-        height = 480;
-    }
-
-    static Window createWindow(Screen screen, Capabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
-        Assert.assertNotNull(caps);
-        caps.setOnscreen(onscreen);
-        // System.out.println("Requested: "+caps);
-
-        //
-        // Create native windowing resources .. X11/Win/OSX
-        // 
-        Window window = NewtFactory.createWindow(screen, caps);
-        Assert.assertNotNull(window);
-        window.setUndecorated(onscreen && undecorated);
-        window.setSize(width, height);
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-        window.setVisible(true);
-        Assert.assertEquals(true,window.isVisible());
-        Assert.assertEquals(true,window.isNativeValid());
-        // Assert.assertEquals(width,window.getWidth());
-        // Assert.assertEquals(height,window.getHeight());
-        // System.out.println("Created: "+window);
-
-        //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
-        // equivalent to GLAutoDrawable methods: setVisible(true)
-        // 
-        CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
-        Assert.assertNotNull(chosenCapabilities);
-        Assert.assertTrue(chosenCapabilities.getGreenBits()>5);
-        Assert.assertTrue(chosenCapabilities.getBlueBits()>5);
-        Assert.assertTrue(chosenCapabilities.getRedBits()>5);
-        Assert.assertEquals(chosenCapabilities.isOnscreen(),onscreen);
-
-        return window;
-    }
-
-    static void destroyWindow(Display display, Screen screen, Window window) {
-        if(null!=window) {
-            window.destroy();
-        }
-        if(null!=screen) {
-            screen.destroy();
-        }
-        if(null!=display) {
-            display.destroy();
-        }
-    }
-
-    @Test
-    public void testWindowNativeRecreate01Simple() throws InterruptedException {
-        Capabilities caps = new Capabilities();
-        Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-
-        Window window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        window.destroy();
-        Assert.assertEquals(false,window.isNativeValid());
-        Assert.assertEquals(false,window.isVisible());
-
-        window.setVisible(true);
-        Assert.assertEquals(true,window.isNativeValid());
-        Assert.assertEquals(true,window.isVisible());
-
-        Thread.sleep(100); // 100 ms
-        destroyWindow(display, screen, window);
-    }
-
-    @Test
-    public void testWindowDecor01Simple() throws InterruptedException {
-        Capabilities caps = new Capabilities();
-        Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-
-        Window window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Thread.sleep(100); // 100 ms
-        destroyWindow(display, screen, window);
-    }
-
-    @Test
-    public void testWindowDecor02DestroyWinTwiceA() throws InterruptedException {
-        Capabilities caps = new Capabilities();
-        Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-
-        Window window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Thread.sleep(100); // 100 ms
-        destroyWindow(null, null, window);
-        destroyWindow(display, screen, window);
-    }
-
-    @Test
-    public void testWindowDecor03TwoWin() throws InterruptedException {
-        Capabilities caps = new Capabilities();
-        Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-
-        Window window1 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Window window2 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Thread.sleep(100); // 100 ms
-        destroyWindow(null, null, window2);
-        destroyWindow(display, screen, window1);
-    }
-
-    public static void main(String args[]) throws IOException {
-        String tstname = TestWindows01NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/WindowEventCom1.java b/src/junit/com/jogamp/test/junit/newt/WindowEventCom1.java
deleted file mode 100644
index 74b2ed1..0000000
--- a/src/junit/com/jogamp/test/junit/newt/WindowEventCom1.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import com.jogamp.newt.event.*;
-
-class WindowEventCom1 extends WindowAdapter {
-
-    public void windowResized(WindowEvent e) {
-        e.setAttachment(new String("WindowEventCom1.windowResized: "+e));
-    }
-    public void windowMoved(WindowEvent e) {
-        e.setAttachment(new String("WindowEventCom1.windowMoved: "+e));
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/newt/WindowEventCom2.java b/src/junit/com/jogamp/test/junit/newt/WindowEventCom2.java
deleted file mode 100644
index 551c84a..0000000
--- a/src/junit/com/jogamp/test/junit/newt/WindowEventCom2.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import com.jogamp.newt.event.*;
-
-class WindowEventCom2 extends WindowAdapter {
-
-    public void windowResized(WindowEvent e) {
-        String str = (String) e.getAttachment();
-        if(null==str) {
-            e.setAttachment(new String("WindowEventCom2.windowResized: "+e));
-        }
-    }
-    public void windowMoved(WindowEvent e) {
-        String str = (String) e.getAttachment();
-        if(null==str) {
-            e.setAttachment(new String("WindowEventCom2.windowMoved: "+e));
-        }
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/newt/WindowEventCom3.java b/src/junit/com/jogamp/test/junit/newt/WindowEventCom3.java
deleted file mode 100644
index 0c097fc..0000000
--- a/src/junit/com/jogamp/test/junit/newt/WindowEventCom3.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt;
-
-import com.jogamp.newt.event.*;
-
-class WindowEventCom3 extends WindowAdapter {
-
-    public void windowResized(WindowEvent e) {
-        String str = (String) e.getAttachment();
-        System.out.println("WindowEventCom3.windowResized: "+str);
-    }
-    public void windowMoved(WindowEvent e) {
-        String str = (String) e.getAttachment();
-        System.out.println("WindowEventCom3.windowMoved: "+str);
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/GLRunnableDummy.java b/src/junit/com/jogamp/test/junit/newt/parenting/GLRunnableDummy.java
deleted file mode 100644
index 2459c86..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/GLRunnableDummy.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt.parenting;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import javax.media.opengl.*;
-
-public class GLRunnableDummy implements GLRunnable {
-    float r=0.0f;
-    float g=0.0f;
-    float b=0.0f;
-    float d=0.001f;
-
-    public void run(GLAutoDrawable drawable) {
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
-        gl.glClearColor(r, g, b, 1f);
-        r+=d;
-        if(r>1f) {
-            r=1f;
-            d*=-1f;
-        } else if(r<0f) {
-            r=0f;
-            d*=-1f;
-        }
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/KeyAction.java b/src/junit/com/jogamp/test/junit/newt/parenting/KeyAction.java
deleted file mode 100644
index 4948ce9..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/KeyAction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-
-package com.jogamp.test.junit.newt.parenting;
-
-import com.jogamp.newt.event.*;
-
-class KeyAction extends KeyAdapter {
-    NEWTEventFiFo eventFifo;
-
-    public KeyAction(NEWTEventFiFo eventFifo) { 
-        this.eventFifo = eventFifo; 
-    }
-
-    public void keyTyped(KeyEvent e) {
-        eventFifo.put(e);
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01NEWT.java b/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01NEWT.java
deleted file mode 100644
index 21c0a47..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01NEWT.java
+++ /dev/null
@@ -1,716 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt.parenting;
-
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.media.opengl.*;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.*;
-import com.jogamp.test.junit.jogl.demos.es1.RedSquare;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestParenting01NEWT extends UITestCase {
-    static int width, height;
-    static long durationPerTest = 500;
-    static long waitAbout10FramesAt30fps = 10*34; // 10 frames @ 30fps
-    static GLCapabilities glCaps;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        width  = 640;
-        height = 480;
-        glCaps = new GLCapabilities(null);
-    }
-
-    @Test
-    public void testWindowParenting01CreateVisibleDestroy() throws InterruptedException {
-        int x = 0;
-        int y = 0;
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Display display = null;
-        Screen screen = null;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        Assert.assertNotNull(glWindow1);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertNull(glWindow1.getParent());
-        screen = glWindow1.getScreen();
-        display = screen.getDisplay();
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        glWindow1.setSize(640, 480);
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-
-        GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
-        Assert.assertNotNull(glWindow2);
-        Assert.assertEquals(false, glWindow2.isVisible());
-        Assert.assertEquals(false, glWindow2.isNativeValid());
-        Assert.assertSame(glWindow1,glWindow2.getParent());
-        Assert.assertSame(screen,glWindow2.getScreen());
-        Assert.assertSame(display,glWindow2.getScreen().getDisplay());
-        glWindow2.setSize(320, 240);
-        GLEventListener demo2 = new Gears();
-        setDemoFields(demo2, glWindow2, false);
-        glWindow2.addGLEventListener(demo2);
-
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning()); // GLWindow -> invoke ..
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        // visible test
-        Assert.assertEquals(0, glWindow1.getTotalFrames());
-        Assert.assertEquals(0, glWindow2.getTotalFrames());
-        glWindow1.setVisible(true);
-        System.err.println("Frames for setVisible(true): A1: "+glWindow1.getTotalFrames()+", B1: "+glWindow2.getTotalFrames());
-        Assert.assertTrue(0 < glWindow1.getTotalFrames());
-        Assert.assertTrue(0 < glWindow2.getTotalFrames());
-
-        Assert.assertEquals(true, glWindow1.isVisible());
-        Assert.assertEquals(true, glWindow1.isNativeValid());
-        Assert.assertEquals(true, glWindow2.isVisible());
-        Assert.assertEquals(true, glWindow2.isNativeValid());
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(2,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-
-        glWindow1.setVisible(false);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(true, glWindow1.isNativeValid());
-        Assert.assertEquals(false, glWindow2.isVisible());
-        Assert.assertEquals(true, glWindow2.isNativeValid());
-
-        glWindow1.resetCounter();
-        glWindow2.resetCounter();
-        Assert.assertEquals(0, glWindow1.getTotalFrames());
-        Assert.assertEquals(0, glWindow2.getTotalFrames());
-        glWindow1.setVisible(true);
-        System.err.println("Frames for setVisible(true): A2: "+glWindow1.getTotalFrames()+", B2: "+glWindow2.getTotalFrames());
-        Assert.assertTrue(0 < glWindow1.getTotalFrames());
-        Assert.assertTrue(0 < glWindow2.getTotalFrames());
-
-        Assert.assertEquals(true, glWindow1.isVisible());
-        Assert.assertEquals(true, glWindow1.isNativeValid());
-        Assert.assertEquals(true, glWindow2.isVisible());
-        Assert.assertEquals(true, glWindow2.isNativeValid());
-
-        glWindow1.resetCounter();
-        glWindow2.resetCounter();
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-        Assert.assertEquals(true, animator1.isAnimating());
-        Assert.assertEquals(false, animator1.isPaused());
-        Assert.assertNotNull(animator1.getThread());
-        Animator animator2 = new Animator(glWindow2);
-        animator2.start();
-        Assert.assertEquals(true, animator2.isAnimating());
-        Assert.assertEquals(false, animator2.isPaused());
-        Assert.assertNotNull(animator2.getThread());
-        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
-            Thread.sleep(100);
-        }
-        System.err.println("Frames for setVisible(true): A3: "+glWindow1.getTotalFrames()+", B3: "+glWindow2.getTotalFrames());
-        Assert.assertTrue(0 < glWindow1.getTotalFrames());
-        Assert.assertTrue(0 < glWindow2.getTotalFrames());
-
-        Assert.assertEquals(true, animator1.pause());
-        Assert.assertEquals(false, animator1.isAnimating());
-        Assert.assertEquals(true, animator1.isPaused());
-        Assert.assertNotNull(animator1.getThread());
-        Assert.assertEquals(true, animator2.pause());
-        Assert.assertEquals(false, animator2.isAnimating());
-        Assert.assertEquals(true, animator2.isPaused());
-        Assert.assertNotNull(animator2.getThread());
-
-        glWindow1.resetCounter();
-        glWindow2.resetCounter();
-        Assert.assertEquals(true, animator1.resume());
-        Assert.assertEquals(true, animator1.isAnimating());
-        Assert.assertEquals(false, animator1.isPaused());
-        Assert.assertNotNull(animator1.getThread());
-        Assert.assertEquals(true, animator2.resume());
-        Assert.assertEquals(true, animator2.isAnimating());
-        Assert.assertEquals(false, animator2.isPaused());
-        Assert.assertNotNull(animator2.getThread());
-        Thread.sleep(waitAbout10FramesAt30fps);
-        System.err.println("Frames for setVisible(true): A4: "+glWindow1.getTotalFrames()+", B4: "+glWindow2.getTotalFrames());
-        Assert.assertTrue(0 < glWindow1.getTotalFrames());
-        Assert.assertTrue(0 < glWindow2.getTotalFrames());
-
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-        Assert.assertEquals(false, animator1.isPaused());
-        Assert.assertEquals(null, animator1.getThread());
-        animator2.stop();
-        Assert.assertEquals(false, animator2.isAnimating());
-        Assert.assertEquals(false, animator2.isPaused());
-        Assert.assertEquals(null, animator2.getThread());
-
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(2,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-
-        glWindow2.destroy(); // can be recreated, refs are hold
-        Assert.assertEquals(true,  glWindow1.isVisible());
-        Assert.assertEquals(true,  glWindow1.isNativeValid());
-        Assert.assertEquals(true,  glWindow1.isValid());
-        Assert.assertEquals(false, glWindow2.isVisible());
-        Assert.assertEquals(false, glWindow2.isNativeValid());
-        Assert.assertEquals(true,  glWindow2.isValid());
-
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(1,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-
-        glWindow1.destroy(); // can be recreated, refs are hold
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertEquals(true,  glWindow1.isValid());
-        Assert.assertEquals(false, glWindow2.isVisible());
-        Assert.assertEquals(false, glWindow2.isNativeValid());
-        Assert.assertEquals(true,  glWindow2.isValid());
-
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(false,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        // recreation ..
-        glWindow1.resetCounter();
-        glWindow2.resetCounter();
-        Assert.assertEquals(0, glWindow1.getTotalFrames());
-        Assert.assertEquals(0, glWindow2.getTotalFrames());
-        glWindow1.setVisible(true);
-        Assert.assertEquals(true, glWindow1.isVisible());
-        Assert.assertEquals(true, glWindow1.isNativeValid());
-        Assert.assertEquals(true, glWindow2.isVisible());
-        Assert.assertEquals(true, glWindow2.isNativeValid());
-
-        System.err.println("Frames for setVisible(true): A3: "+glWindow1.getTotalFrames()+", B3: "+glWindow2.getTotalFrames());
-        Assert.assertTrue(0 < glWindow1.getTotalFrames());
-        Assert.assertTrue(0 < glWindow2.getTotalFrames());
-
-        Assert.assertEquals(1,display.getReferenceCount());
-        Assert.assertEquals(true,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(true,display.getEDTUtil().isRunning());
-        Assert.assertEquals(2,screen.getReferenceCount());
-        Assert.assertEquals(true,screen.isNativeValid());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-
-        // chain glwindow1 -> glwindow2 ; can be recreated ..
-        glWindow1.destroy();
-        Assert.assertEquals(true, glWindow1.isValid());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertEquals(true, glWindow2.isValid());
-        Assert.assertEquals(false, glWindow2.isNativeValid());
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(false,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        glWindow1.invalidate();
-        Assert.assertEquals(false, glWindow1.isValid());
-        Assert.assertEquals(false, glWindow2.isValid());
-
-        // test double destroy/invalidate ..
-        glWindow2.invalidate();
-        Assert.assertEquals(false, glWindow2.isValid());
-
-        Assert.assertEquals(0,display.getReferenceCount());
-        Assert.assertEquals(false,display.isNativeValid());
-        Assert.assertNotNull(display.getEDTUtil());
-        Assert.assertEquals(false,display.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen.getReferenceCount());
-        Assert.assertEquals(false,screen.isNativeValid());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-    }
-
-    @Test
-    public void testWindowParenting02ReparentTop2WinReparentRecreate() throws InterruptedException {
-        testWindowParenting02ReparentTop2WinImpl(true);
-    }
-
-    @Test
-    public void testWindowParenting02ReparentTop2WinReparentNative() throws InterruptedException {
-        testWindowParenting02ReparentTop2WinImpl(false);
-    }
-
-    /**
-     * @param reparentRecreate true, if the followup reparent should utilize destroy/create, instead of native reparenting
-     */
-    protected void testWindowParenting02ReparentTop2WinImpl(boolean reparentRecreate) throws InterruptedException {
-        int x = 0;
-        int y = 0;
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Display display1 = null;
-        Screen screen1 = null;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        glWindow1.setTitle("testWindowParenting02ReparentTop2Win");
-        glWindow1.setSize(640, 480);
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-        screen1 = glWindow1.getScreen();
-        display1 = screen1.getDisplay();
-
-        Assert.assertEquals(0,display1.getReferenceCount());
-        Assert.assertEquals(false,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen1.getReferenceCount());
-        Assert.assertEquals(false,screen1.isNativeValid());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        GLWindow glWindow2 = GLWindow.create(glCaps);
-        glWindow2.setSize(320, 240);
-        GLEventListener demo2 = new Gears();
-        setDemoFields(demo2, glWindow2, false);
-        glWindow2.addGLEventListener(demo2);
-        Assert.assertSame(screen1, glWindow2.getScreen());
-        Assert.assertSame(display1, glWindow2.getScreen().getDisplay());
-
-        Assert.assertEquals(0,display1.getReferenceCount());
-        Assert.assertEquals(false,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen1.getReferenceCount());
-        Assert.assertEquals(false,screen1.isNativeValid());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        Assert.assertEquals(0, glWindow1.getTotalFrames());
-        glWindow1.setVisible(true);
-        Assert.assertEquals(1,display1.getReferenceCount());
-        Assert.assertEquals(true,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(1,screen1.getReferenceCount());
-        Assert.assertEquals(true,screen1.isNativeValid());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-        Assert.assertEquals(true, glWindow1.isVisible());
-        System.err.println("Frames for setVisible(true) A1: "+glWindow1.getTotalFrames());
-        Assert.assertTrue(0 < glWindow1.getTotalFrames());
-
-        Assert.assertEquals(0, glWindow2.getTotalFrames());
-        glWindow2.setVisible(true);
-
-        Assert.assertEquals(1,display1.getReferenceCount());
-        Assert.assertEquals(true,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(2,screen1.getReferenceCount());
-        Assert.assertEquals(true,screen1.isNativeValid());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-        Assert.assertEquals(true, glWindow2.isVisible());
-        System.err.println("Frames for setVisible(true) B1: "+glWindow2.getTotalFrames());
-        Assert.assertTrue(0 < glWindow1.getTotalFrames());
-
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-        Animator animator2 = new Animator(glWindow2);
-        animator2.start();
-
-        int state = 0;
-        int reparentAction;
-        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
-            Thread.sleep(durationPerTest);
-            switch(state) {
-                case 0:
-                    // glWindow2 -- child --> glWindow1: compatible
-                    Assert.assertEquals(true, glWindow2.isVisible());
-                    System.err.println("Frames(1) "+glWindow2.getTotalFrames());
-                    reparentAction = glWindow2.reparentWindow(glWindow1, reparentRecreate);
-                    System.err.println("Frames(2) "+glWindow2.getTotalFrames());
-                    Assert.assertTrue(Window.ReparentAction.ACTION_INVALID < reparentAction);
-                    Assert.assertEquals(true, glWindow2.isVisible());
-                    Assert.assertEquals(true, glWindow2.isNativeValid());
-                    Assert.assertSame(glWindow1,glWindow2.getParent());
-                    System.err.println("Frames for reparentWindow(parent, "+reparentRecreate+"): "+reparentAction+", B2: "+glWindow2.getTotalFrames());
-                    Assert.assertTrue(0 < glWindow2.getTotalFrames());
-
-                    Assert.assertEquals(1,display1.getReferenceCount());
-                    Assert.assertEquals(true,display1.isNativeValid());
-                    Assert.assertNotNull(display1.getEDTUtil());
-                    Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-                    Assert.assertEquals(true,screen1.isNativeValid());
-                    Assert.assertSame(screen1,glWindow2.getScreen());
-                    Assert.assertSame(display1,glWindow2.getScreen().getDisplay());
-                    Assert.assertEquals(2,screen1.getReferenceCount());
-                    Assert.assertEquals(1,Display.getActiveDisplayNumber());
-
-                    break;
-
-                case 1:
-                    // glWindow2 --> top
-                    Assert.assertEquals(true, glWindow2.isVisible());
-
-                    reparentAction = glWindow2.reparentWindow(null, reparentRecreate);
-                    Assert.assertTrue(Window.ReparentAction.ACTION_INVALID < reparentAction);
-                    Assert.assertEquals(true, glWindow2.isVisible());
-                    Assert.assertEquals(true, glWindow2.isNativeValid());
-                    Assert.assertNull(glWindow2.getParent());
-                    System.err.println("Frames for reparentWindow(parent, "+reparentRecreate+"): "+reparentAction+", B3: "+glWindow2.getTotalFrames());
-                    Assert.assertTrue(0 < glWindow2.getTotalFrames());
-
-                    Assert.assertEquals(1,display1.getReferenceCount());
-                    Assert.assertEquals(true,display1.isNativeValid());
-                    Assert.assertNotNull(display1.getEDTUtil());
-                    Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-                    Assert.assertEquals(true,screen1.isNativeValid());
-                    Assert.assertSame(screen1,glWindow2.getScreen());
-                    Assert.assertSame(display1,glWindow2.getScreen().getDisplay());
-                    Assert.assertEquals(2,screen1.getReferenceCount());
-                    Assert.assertEquals(1,Display.getActiveDisplayNumber());
-
-                    break;
-            }
-            state++;
-        }
-        //
-        // both windows are now top level
-        //
-
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-        Assert.assertEquals(false, animator1.isPaused());
-        Assert.assertEquals(null, animator1.getThread());
-        animator2.stop();
-        Assert.assertEquals(false, animator2.isAnimating());
-        Assert.assertEquals(false, animator2.isPaused());
-        Assert.assertEquals(null, animator2.getThread());
-
-        // pre-destroy check (both valid and running)
-        Assert.assertEquals(1,display1.getReferenceCount());
-        Assert.assertEquals(true,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(2,screen1.getReferenceCount());
-        Assert.assertEquals(true,screen1.isNativeValid());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-
-        // destroy glWindow2
-        glWindow2.destroy();
-        Assert.assertEquals(true,  glWindow1.isValid());
-        Assert.assertEquals(true,  glWindow1.isNativeValid());
-        Assert.assertEquals(true,  glWindow1.isVisible());
-        Assert.assertEquals(true,  glWindow2.isValid());
-        Assert.assertEquals(false, glWindow2.isNativeValid());
-        Assert.assertEquals(false, glWindow2.isVisible());
-
-        Assert.assertEquals(1,display1.getReferenceCount());
-        Assert.assertEquals(true,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(1,screen1.getReferenceCount());
-        Assert.assertEquals(true,screen1.isNativeValid());
-
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-
-        // destroy glWindow1
-        glWindow1.destroy();
-        Assert.assertEquals(true,  glWindow1.isValid());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(true,  glWindow2.isValid());
-        Assert.assertEquals(false, glWindow2.isNativeValid());
-        Assert.assertEquals(false, glWindow2.isVisible());
-
-        Assert.assertEquals(0,display1.getReferenceCount());
-        Assert.assertEquals(false,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(false,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen1.getReferenceCount());
-        Assert.assertEquals(false,screen1.isNativeValid());
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        glWindow1.invalidate();
-        Assert.assertEquals(false, glWindow1.isValid());
-        Assert.assertEquals(true,  glWindow2.isValid());
-
-        glWindow2.invalidate();
-        Assert.assertEquals(false, glWindow2.isValid());
-    }
-
-    @Test
-    public void testWindowParenting03ReparentWin2TopReparentRecreate() throws InterruptedException {
-        testWindowParenting03ReparentWin2TopImpl(true);
-    }
-
-    @Test
-    public void testWindowParenting03ReparentWin2TopReparentNative() throws InterruptedException {
-        testWindowParenting03ReparentWin2TopImpl(false);
-    }
-
-    protected void testWindowParenting03ReparentWin2TopImpl(boolean reparentRecreate) throws InterruptedException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-        Display display1 = null;
-        Screen screen1 = null;
-        Display display2 = null;
-        Screen screen2 = null;
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        screen1 = glWindow1.getScreen();
-        display1 = screen1.getDisplay();
-        glWindow1.setTitle("testWindowParenting03ReparentWin2Top");
-        glWindow1.setSize(640, 480);
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-
-        Assert.assertEquals(0,display1.getReferenceCount());
-        Assert.assertEquals(false,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen1.getReferenceCount());
-        Assert.assertEquals(false,screen1.isNativeValid());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
-        screen2 = glWindow2.getScreen();
-        display2 = screen2.getDisplay();
-        glWindow2.setSize(320, 240);
-        GLEventListener demo2 = new Gears();
-        setDemoFields(demo2, glWindow2, false);
-        glWindow2.addGLEventListener(demo2);
-
-        Assert.assertEquals(0,display2.getReferenceCount());
-        Assert.assertEquals(false,display2.isNativeValid());
-        Assert.assertNotNull(display2.getEDTUtil());
-        Assert.assertEquals(true,display2.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen2.getReferenceCount());
-        Assert.assertEquals(false,screen2.isNativeValid());
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        Assert.assertSame(screen1,glWindow2.getScreen());
-        Assert.assertSame(display1,glWindow2.getScreen().getDisplay());
-
-        Assert.assertEquals(0, glWindow1.getTotalFrames());
-        Assert.assertEquals(0, glWindow2.getTotalFrames());
-        glWindow1.setVisible(true);
-        System.err.println("Frames for setVisible(): A1: "+glWindow1.getTotalFrames()+", B1: "+glWindow2.getTotalFrames());
-        Assert.assertTrue(0 < glWindow2.getTotalFrames());
-        Assert.assertTrue(0 < glWindow1.getTotalFrames());
-
-        Assert.assertEquals(1,display1.getReferenceCount());
-        Assert.assertEquals(true,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(2,screen1.getReferenceCount());
-        Assert.assertEquals(true,screen1.isNativeValid());
-        Assert.assertSame(glWindow1,glWindow2.getParent());
-        Assert.assertSame(screen1,glWindow2.getScreen());
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-        Animator animator2 = new Animator(glWindow2);
-        animator2.start();
-
-        int state = 0;
-        int reparentAction;
-        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
-            Thread.sleep(durationPerTest);
-            switch(state) {
-                case 0:
-                    Assert.assertEquals(true, glWindow2.isVisible());
-                    reparentAction = glWindow2.reparentWindow(null, reparentRecreate);
-                    Assert.assertTrue(Window.ReparentAction.ACTION_INVALID < reparentAction);
-                    Assert.assertEquals(true, glWindow2.isVisible());
-                    Assert.assertEquals(true, glWindow2.isNativeValid());
-                    System.err.println("Frames for reparentWindow(parent, "+reparentRecreate+"): "+reparentAction+", B2: "+glWindow2.getTotalFrames());
-                    Assert.assertTrue(0 < glWindow2.getTotalFrames());
-                    Assert.assertNull(glWindow2.getParent());
-                    Assert.assertSame(screen1,glWindow2.getScreen());
-                    Assert.assertSame(display1,glWindow2.getScreen().getDisplay());
-                    Assert.assertEquals(1,Display.getActiveDisplayNumber());
-                    break;
-                case 1:
-                    Assert.assertEquals(true, glWindow2.isVisible());
-                    reparentAction = glWindow2.reparentWindow(glWindow1, reparentRecreate);
-                    Assert.assertTrue(Window.ReparentAction.ACTION_INVALID < reparentAction);
-                    Assert.assertEquals(true, glWindow2.isVisible());
-                    Assert.assertEquals(true, glWindow2.isNativeValid());
-                    System.err.println("Frames for reparentWindow(parent, "+reparentRecreate+"): "+reparentAction+", B3 "+glWindow2.getTotalFrames());
-                    Assert.assertTrue(0 < glWindow2.getTotalFrames());
-                    Assert.assertSame(glWindow1,glWindow2.getParent());
-                    Assert.assertSame(screen1,glWindow2.getScreen());
-                    Assert.assertSame(display1,glWindow2.getScreen().getDisplay());
-                    Assert.assertEquals(1,Display.getActiveDisplayNumber());
-                    break;
-            }
-            state++;
-        }
-        //
-        // glwindow2 is child of glwindow1
-        //
-
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-        Assert.assertEquals(false, animator1.isPaused());
-        Assert.assertEquals(null, animator1.getThread());
-        animator2.stop();
-        Assert.assertEquals(false, animator2.isAnimating());
-        Assert.assertEquals(false, animator2.isPaused());
-        Assert.assertEquals(null, animator2.getThread());
-
-        Assert.assertEquals(1,display1.getReferenceCount());
-        Assert.assertEquals(true,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(2,screen1.getReferenceCount());
-        Assert.assertEquals(true,screen1.isNativeValid());
-        Assert.assertSame(glWindow1,glWindow2.getParent());
-        Assert.assertSame(screen1,glWindow2.getScreen());
-
-        Assert.assertEquals(1,Display.getActiveDisplayNumber());
-
-        glWindow1.destroy(); // should destroy both windows, actually, since glWindow2 is a child
-        Assert.assertEquals(true,  glWindow1.isValid());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(true,  glWindow2.isValid());
-        Assert.assertEquals(false, glWindow2.isNativeValid());
-        Assert.assertEquals(false, glWindow2.isVisible());
-
-        Assert.assertEquals(0,display1.getReferenceCount());
-        Assert.assertEquals(false,display1.isNativeValid());
-        Assert.assertNotNull(display1.getEDTUtil());
-        Assert.assertEquals(false,display1.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen1.getReferenceCount());
-        Assert.assertEquals(false,screen1.isNativeValid());
-
-        Assert.assertEquals(0,display2.getReferenceCount());
-        Assert.assertEquals(false,display2.isNativeValid());
-        Assert.assertNotNull(display2.getEDTUtil());
-        Assert.assertEquals(false,display2.getEDTUtil().isRunning());
-        Assert.assertEquals(0,screen2.getReferenceCount());
-        Assert.assertEquals(false,screen2.isNativeValid());
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-
-        glWindow2.destroy(); // dbl destroy check ..
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertEquals(false, glWindow2.isNativeValid());
-
-        glWindow1.invalidate(); // parent -> child
-        Assert.assertEquals(false, glWindow1.isValid());
-        Assert.assertEquals(false, glWindow2.isValid());
-
-        Assert.assertEquals(0,Display.getActiveDisplayNumber());
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);        
-        if(debug) {
-            MiscUtils.setFieldIfExists(demo, "glDebug", true);
-            MiscUtils.setFieldIfExists(demo, "glTrace", true);
-        }
-        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow.getWindow())) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        System.err.println("durationPerTest: "+durationPerTest);
-        String tstname = TestParenting01NEWT.class.getName();
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
-
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01aAWT.java b/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01aAWT.java
deleted file mode 100644
index fd52c86..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01aAWT.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.test.junit.newt.parenting;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import java.awt.Button;
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-import java.awt.Container;
-import java.awt.Frame;
-import java.awt.Dimension;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.*;
-import com.jogamp.test.junit.jogl.demos.es1.RedSquare;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestParenting01aAWT extends UITestCase {
-    static int width, height;
-    static long durationPerTest = 800;
-    static long waitReparent = 0;
-    static GLCapabilities glCaps;
-
-    @BeforeClass
-    public static void initClass() throws InterruptedException {
-        GLProfile.initSingleton(true);
-        width  = 640;
-        height = 480;
-        glCaps = new GLCapabilities(null);
-        // Thread.sleep(10000);
-    }
-
-    @Test
-    public void testWindowParenting01CreateVisibleDestroy1() throws InterruptedException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        Assert.assertNotNull(glWindow1);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertNull(glWindow1.getParent());
-        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-        Assert.assertNotNull(newtCanvasAWT);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertNull(glWindow1.getParent());
-
-        Frame frame1 = new Frame("AWT Parent Frame");
-        frame1.setLayout(new BorderLayout());
-        frame1.add(new Button("North"), BorderLayout.NORTH);
-        frame1.add(new Button("South"), BorderLayout.SOUTH);
-        frame1.add(new Button("East"), BorderLayout.EAST);
-        frame1.add(new Button("West"), BorderLayout.WEST);
-
-        Container container1 = new Container();
-        container1.setLayout(new BorderLayout());
-        container1.add(new Button("north"), BorderLayout.NORTH);
-        container1.add(new Button("south"), BorderLayout.SOUTH);
-        container1.add(new Button("east"), BorderLayout.EAST);
-        container1.add(new Button("west"), BorderLayout.WEST);
-        container1.add(newtCanvasAWT, BorderLayout.CENTER);
-
-        frame1.add(container1, BorderLayout.CENTER);
-        frame1.setSize(width, height);
-
-        // visible test
-        frame1.setVisible(true);
-        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
-            Thread.sleep(100);
-        }
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-
-        frame1.setVisible(false);
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        frame1.setVisible(true);
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        frame1.remove(newtCanvasAWT);
-        // Assert.assertNull(glWindow1.getParent());
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        frame1.dispose();
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        glWindow1.invalidate();
-        //Assert.assertEquals(false, glWindow1.isValid());
-    }
-
-    @Test
-    public void testWindowParenting02CreateVisibleDestroy2Defered() throws InterruptedException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        Assert.assertNotNull(glWindow1);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertNull(glWindow1.getParent());
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-        Assert.assertNotNull(newtCanvasAWT);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertNull(glWindow1.getParent());
-
-        Frame frame = new Frame("AWT Parent Frame");
-        Assert.assertNotNull(frame);
-        frame.setSize(width, height);
-
-        // visible test
-        frame.setVisible(true);
-
-        frame.add(newtCanvasAWT);
-        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
-            Thread.sleep(100);
-        }
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-
-        frame.dispose();
-        glWindow1.invalidate();
-    }
-
-    @Test
-    public void testWindowParenting02CreateVisibleDestroy3Odd() throws InterruptedException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-
-        Frame frame = new Frame("AWT Parent Frame");
-        Assert.assertNotNull(frame);
-        frame.setSize(width, height);
-
-        // visible test
-        frame.setVisible(true);
-
-        frame.add(newtCanvasAWT);
-
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-        Assert.assertEquals(true, animator1.isStarted());
-        Assert.assertEquals(true, animator1.isAnimating());
-        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
-            Thread.sleep(100);
-        }
-
-        Assert.assertEquals(true, animator1.isAnimating()); // !!!
-
-        frame.dispose();
-        glWindow1.invalidate();
-    }
-
-    @Test
-    public void testWindowParenting03ReparentNewtWin2Top() throws InterruptedException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-
-        Frame frame = new Frame("AWT Parent Frame");
-        frame.setSize(width, height);
-        frame.setLocation(640, 480);
-        frame.setVisible(true);
-
-        frame.add(newtCanvasAWT);
-        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-
-        int state = 0;
-        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
-            Thread.sleep(durationPerTest);
-            switch(state) {
-                case 0:
-                    glWindow1.reparentWindow(null);
-                    Assert.assertEquals(true, glWindow1.isNativeValid());
-                    Assert.assertNull(glWindow1.getParent());
-                    break;
-                case 1:
-                    glWindow1.reparentWindow(newtCanvasAWT.getNativeWindow());
-                    Assert.assertEquals(true, glWindow1.isNativeValid());
-                    Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-                    break;
-            }
-            state++;
-        }
-
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-
-        frame.dispose();
-        glWindow1.invalidate();
-    }
-
-    @Test
-    public void testWindowParenting04ReparentNewtWin2TopLayouted() throws InterruptedException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-
-        Frame frame = new Frame("AWT Parent Frame");
-        frame.setLayout(new BorderLayout());
-        frame.add(new Button("North"), BorderLayout.NORTH);
-        frame.add(new Button("South"), BorderLayout.SOUTH);
-        frame.add(new Button("East"), BorderLayout.EAST);
-        frame.add(new Button("West"), BorderLayout.WEST);
-        frame.setSize(width, height);
-        frame.setLocation(640, 480);
-        frame.setVisible(true);
-
-        frame.add(newtCanvasAWT, BorderLayout.CENTER);
-        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-
-        int state = 0;
-        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
-            Thread.sleep(durationPerTest);
-            switch(state) {
-                case 0:
-                    glWindow1.reparentWindow(null);
-                    Assert.assertEquals(true, glWindow1.isNativeValid());
-                    Assert.assertNull(glWindow1.getParent());
-                    break;
-                case 1:
-                    glWindow1.reparentWindow(newtCanvasAWT.getNativeWindow());
-                    Assert.assertEquals(true, glWindow1.isNativeValid());
-                    Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-                    break;
-            }
-            state++;
-        }
-
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-
-        frame.dispose();
-        glWindow1.invalidate();
-    }
-
-    @Test
-    public void testWindowParenting05ReparentAWTWinHopFrame2Frame() throws InterruptedException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        glWindow1.setUndecorated(true);
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-
-        Frame frame1 = new Frame("AWT Parent Frame");
-        frame1.setLayout(new BorderLayout());
-        frame1.add(new Button("North"), BorderLayout.NORTH);
-        frame1.add(new Button("South"), BorderLayout.SOUTH);
-        frame1.add(new Button("East"), BorderLayout.EAST);
-        frame1.add(new Button("West"), BorderLayout.WEST);
-        frame1.setSize(width, height);
-        frame1.setLocation(0, 0);
-        frame1.setVisible(true);
-
-        Frame frame2 = new Frame("AWT Parent Frame");
-        frame2.setLayout(new BorderLayout());
-        frame2.add(new Button("North"), BorderLayout.NORTH);
-        frame2.add(new Button("South"), BorderLayout.SOUTH);
-        frame2.add(new Button("East"), BorderLayout.EAST);
-        frame2.add(new Button("West"), BorderLayout.WEST);
-        frame2.setSize(width, height);
-        frame2.setLocation(640, 480);
-        frame2.setVisible(true);
-
-        frame1.add(newtCanvasAWT, BorderLayout.CENTER);
-        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-
-        int state = 0;
-        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
-            Thread.sleep(durationPerTest);
-            switch(state) {
-                case 0:
-                    frame1.remove(newtCanvasAWT);
-                    frame2.add(newtCanvasAWT, BorderLayout.CENTER);
-                    break;
-                case 1:
-                    frame2.remove(newtCanvasAWT);
-                    frame1.add(newtCanvasAWT, BorderLayout.CENTER);
-                    break;
-            }
-            state++;
-        }
-
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-
-        frame1.dispose();
-        frame2.dispose();
-        glWindow1.invalidate();
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);        
-        if(debug) {
-            MiscUtils.setFieldIfExists(demo, "glDebug", true);
-            MiscUtils.setFieldIfExists(demo, "glTrace", true);
-        }
-        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow.getWindow())) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            } else if(args[i].equals("-wait")) {
-                waitReparent = atoi(args[++i]);
-            }
-        }
-        String tstname = TestParenting01aAWT.class.getName();
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01bAWT.java b/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01bAWT.java
deleted file mode 100644
index 89cefa8..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01bAWT.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt.parenting;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import java.awt.Button;
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-import java.awt.Frame;
-import java.awt.Dimension;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.FPSAnimator;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.*;
-import com.jogamp.test.junit.jogl.demos.es1.RedSquare;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestParenting01bAWT extends UITestCase {
-    static int width, height;
-    static long durationPerTest = 800;
-    static long waitReparent = 0;
-    static GLCapabilities glCaps;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        width  = 640;
-        height = 480;
-        glCaps = new GLCapabilities(null);
-    }
-
-    @Test
-    public void testWindowParenting05ReparentAWTWinHopFrame2FrameFPS25Animator() throws InterruptedException {
-        testWindowParenting05ReparentAWTWinHopFrame2FrameImpl(25);
-    }
-
-    @Test
-    public void testWindowParenting05ReparentAWTWinHopFrame2FrameStdAnimator() throws InterruptedException {
-        testWindowParenting05ReparentAWTWinHopFrame2FrameImpl(0);
-    }
-
-    public void testWindowParenting05ReparentAWTWinHopFrame2FrameImpl(int fps) throws InterruptedException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        glWindow1.setUndecorated(true);
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-
-        Frame frame1 = new Frame("AWT Parent Frame");
-        frame1.setLayout(new BorderLayout());
-        frame1.add(new Button("North"), BorderLayout.NORTH);
-        frame1.add(new Button("South"), BorderLayout.SOUTH);
-        frame1.add(new Button("East"), BorderLayout.EAST);
-        frame1.add(new Button("West"), BorderLayout.WEST);
-        frame1.setSize(width, height);
-        frame1.setLocation(0, 0);
-        frame1.setVisible(true);
-
-        Frame frame2 = new Frame("AWT Parent Frame");
-        frame2.setLayout(new BorderLayout());
-        frame2.add(new Button("North"), BorderLayout.NORTH);
-        frame2.add(new Button("South"), BorderLayout.SOUTH);
-        frame2.add(new Button("East"), BorderLayout.EAST);
-        frame2.add(new Button("West"), BorderLayout.WEST);
-        frame2.setSize(width, height);
-        frame2.setLocation(640, 480);
-        frame2.setVisible(true);
-
-        frame1.add(newtCanvasAWT, BorderLayout.CENTER);
-        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-
-        GLAnimatorControl animator1;
-        if(fps>0) {
-            animator1 = new FPSAnimator(glWindow1, fps);
-        } else {
-            animator1 = new Animator(glWindow1);
-        }
-        animator1.start();
-
-        int state;
-        for(state=0; state<3; state++) {
-            Thread.sleep(durationPerTest);
-            switch(state) {
-                case 0:
-                    frame1.remove(newtCanvasAWT);
-                    frame2.add(newtCanvasAWT, BorderLayout.CENTER);
-                    break;
-                case 1:
-                    frame2.remove(newtCanvasAWT);
-                    frame1.add(newtCanvasAWT, BorderLayout.CENTER);
-                    break;
-            }
-        }
-
-        Assert.assertEquals(true, animator1.isAnimating());
-        Assert.assertEquals(false, animator1.isPaused());
-        Assert.assertNotNull(animator1.getThread());
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-        Assert.assertEquals(false, animator1.isPaused());
-        Assert.assertEquals(null, animator1.getThread());
-
-        frame1.dispose();
-        frame2.dispose();
-        glWindow1.invalidate();
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);
-        Window window = glWindow.getWindow();
-        if(debug) {
-            MiscUtils.setFieldIfExists(demo, "glDebug", true);
-            MiscUtils.setFieldIfExists(demo, "glTrace", true);
-        }
-        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            } else if(args[i].equals("-wait")) {
-                waitReparent = atoi(args[++i]);
-            }
-        }
-        String tstname = TestParenting01bAWT.class.getName();
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01cAWT.java b/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01cAWT.java
deleted file mode 100644
index b79f4c5..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01cAWT.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt.parenting;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import java.awt.Button;
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-import java.awt.Container;
-import java.awt.Frame;
-import java.awt.Dimension;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.*;
-import com.jogamp.test.junit.jogl.demos.es1.RedSquare;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestParenting01cAWT extends UITestCase {
-    static int width, height;
-    static long durationPerTest = 800;
-    static GLCapabilities glCaps;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        width  = 640;
-        height = 480;
-        glCaps = new GLCapabilities(null);
-    }
-
-    @Test
-    public void testWindowParenting01CreateVisibleDestroy1() throws InterruptedException {
-        int x = 0;
-        int y = 0;
-        int i;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        Assert.assertNotNull(glWindow1);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertNull(glWindow1.getParent());
-        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-        Assert.assertNotNull(newtCanvasAWT);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertNull(glWindow1.getParent());
-
-        Frame frame1 = new Frame("AWT Parent Frame");
-        frame1.setLayout(new BorderLayout());
-        frame1.add(new Button("North"), BorderLayout.NORTH);
-        frame1.add(new Button("South"), BorderLayout.SOUTH);
-        frame1.add(new Button("East"), BorderLayout.EAST);
-        frame1.add(new Button("West"), BorderLayout.WEST);
-
-        Container container1 = new Container();
-        container1.setLayout(new BorderLayout());
-        container1.add(new Button("north"), BorderLayout.NORTH);
-        container1.add(new Button("south"), BorderLayout.SOUTH);
-        container1.add(new Button("east"), BorderLayout.EAST);
-        container1.add(new Button("west"), BorderLayout.WEST);
-        container1.add(newtCanvasAWT, BorderLayout.CENTER);
-
-        frame1.add(container1, BorderLayout.CENTER);
-        frame1.setSize(width, height);
-
-        // visible test
-        frame1.setVisible(true);
-        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-
-        for(i=0; i*100<durationPerTest; i++) {
-            Thread.sleep(100);
-        }
-
-        frame1.setVisible(false);
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        frame1.setVisible(true);
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        frame1.remove(newtCanvasAWT);
-        // Assert.assertNull(glWindow1.getParent());
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        frame1.dispose();
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        glWindow1.invalidate();
-        //Assert.assertEquals(false, glWindow1.isValid());
-    }
-
-    @Test
-    public void testWindowParenting05ReparentAWTWinHopFrame2Frame() throws InterruptedException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        glWindow1.setUndecorated(true);
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-
-        Frame frame1 = new Frame("AWT Parent Frame");
-        frame1.setLayout(new BorderLayout());
-        frame1.add(new Button("North"), BorderLayout.NORTH);
-        frame1.add(new Button("South"), BorderLayout.SOUTH);
-        frame1.add(new Button("East"), BorderLayout.EAST);
-        frame1.add(new Button("West"), BorderLayout.WEST);
-        frame1.setSize(width, height);
-        frame1.setLocation(0, 0);
-        frame1.setVisible(true);
-
-        Frame frame2 = new Frame("AWT Parent Frame");
-        frame2.setLayout(new BorderLayout());
-        frame2.add(new Button("North"), BorderLayout.NORTH);
-        frame2.add(new Button("South"), BorderLayout.SOUTH);
-        frame2.add(new Button("East"), BorderLayout.EAST);
-        frame2.add(new Button("West"), BorderLayout.WEST);
-        frame2.setSize(width, height);
-        frame2.setLocation(640, 480);
-        frame2.setVisible(true);
-
-        frame1.add(newtCanvasAWT, BorderLayout.CENTER);
-        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-
-        int state;
-        for(state=0; state<3; state++) {
-            Thread.sleep(durationPerTest);
-            switch(state) {
-                case 0:
-                    frame1.remove(newtCanvasAWT);
-                    frame2.add(newtCanvasAWT, BorderLayout.CENTER);
-                    break;
-                case 1:
-                    frame2.remove(newtCanvasAWT);
-                    frame1.add(newtCanvasAWT, BorderLayout.CENTER);
-                    break;
-            }
-        }
-
-        frame1.dispose();
-        frame2.dispose();
-        glWindow1.invalidate();
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);
-        Window window = glWindow.getWindow();
-        if(debug) {
-            MiscUtils.setFieldIfExists(demo, "glDebug", true);
-            MiscUtils.setFieldIfExists(demo, "glTrace", true);
-        }
-        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        String tstname = TestParenting01cAWT.class.getName();
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01cSwingAWT.java b/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01cSwingAWT.java
deleted file mode 100644
index fb2c744..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01cSwingAWT.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt.parenting;
-
-import java.lang.reflect.*;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.awt.Button;
-import java.awt.BorderLayout;
-import java.awt.Container;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-
-import javax.media.opengl.*;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.*;
-import com.jogamp.test.junit.jogl.demos.es1.RedSquare;
-
-public class TestParenting01cSwingAWT extends UITestCase {
-    static int width, height;
-    static long durationPerTest = 800;
-    static long waitReparent = 0;
-    static GLCapabilities glCaps;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        width  = 640;
-        height = 480;
-        glCaps = new GLCapabilities(null);
-    }
-
-    @Test
-    public void testWindowParenting01CreateVisibleDestroy1() throws InterruptedException, InvocationTargetException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        /**
-         * JFrame . JPanel . Container . NewtCanvasAWT . GLWindow
-         */
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        Assert.assertNotNull(glWindow1);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertNull(glWindow1.getParent());
-        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-        final GLWindow _glWindow1 = glWindow1;
-        final GLRunnable _glRunnable = new GLRunnableDummy();
-        Thread disturbanceThread = new Thread(new Runnable() {
-            public void run() {
-                System.out.println("$");
-                while(true) 
-                {
-                   try {
-                       _glWindow1.invoke(true, _glRunnable);
-                       Thread.yield();
-                   } catch (Throwable t) {}
-               }
-            }
-        });
-        disturbanceThread.start();
-
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-        Assert.assertNotNull(newtCanvasAWT);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertNull(glWindow1.getParent());
-
-        Container container1 = new Container();
-        container1.setLayout(new BorderLayout());
-        container1.add(new Button("north"), BorderLayout.NORTH);
-        container1.add(new Button("south"), BorderLayout.SOUTH);
-        container1.add(new Button("east"), BorderLayout.EAST);
-        container1.add(new Button("west"), BorderLayout.WEST);
-        container1.add(newtCanvasAWT, BorderLayout.CENTER);
-
-        JPanel jPanel1 = new JPanel();
-        jPanel1.setLayout(new BorderLayout());
-        jPanel1.add(new Button("north"), BorderLayout.NORTH);
-        jPanel1.add(new Button("south"), BorderLayout.SOUTH);
-        jPanel1.add(new Button("east"), BorderLayout.EAST);
-        jPanel1.add(new Button("west"), BorderLayout.WEST);
-        jPanel1.add(container1, BorderLayout.CENTER);
-
-        JFrame jFrame1 = new JFrame("Swing Parent JFrame");
-        // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
-        jFrame1.setContentPane(jPanel1);
-        jFrame1.setSize(width, height);
-        System.out.println("Demos: 1 - Visible");
-        jFrame1.setVisible(true); // from here on, we need to run modifications on EDT
-
-        final JFrame _jFrame1 = jFrame1;
-        final JPanel _jPanel1 = jPanel1;
-        final Container _container1 = container1;
-
-        // visible test
-        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-
-        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
-            Thread.sleep(100);
-        }
-        System.out.println("Demos: 2 - StopAnimator");
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-		    System.out.println("Demos: 3 - !Visible");
-                    _jFrame1.setVisible(false);
-                } });
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-		    System.out.println("Demos: 4 - Visible");
-                    _jFrame1.setVisible(true);
-                } });
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-		    System.out.println("Demos: 5 - X Container");
-                    _jPanel1.remove(_container1);
-                } });
-        // Assert.assertNull(glWindow1.getParent());
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    _jFrame1.dispose();
-                } });
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        glWindow1.invalidate();
-        //Assert.assertEquals(false, glWindow1.isValid());
-    }
-
-    @Test
-    public void testWindowParenting05ReparentAWTWinHopFrame2Frame() throws InterruptedException, InvocationTargetException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        /**
-         * JFrame . JPanel . Container . NewtCanvasAWT . GLWindow
-         */
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        Assert.assertNotNull(glWindow1);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertNull(glWindow1.getParent());
-        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-        Animator animator1 = new Animator(glWindow1);
-        animator1.start();
-        final GLWindow _glWindow1 = glWindow1;
-        final GLRunnable _glRunnable = new GLRunnableDummy();
-        Thread disturbanceThread = new Thread(new Runnable() {
-            public void run() {
-                System.out.println("$");
-                while(true) 
-                {
-                   try {
-                       _glWindow1.invoke(true, _glRunnable);
-                       Thread.yield();
-                   } catch (Throwable t) {}
-               }
-            }
-        });
-        disturbanceThread.start();
-
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-        Assert.assertNotNull(newtCanvasAWT);
-        Assert.assertEquals(false, glWindow1.isVisible());
-        Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertNull(glWindow1.getParent());
-
-        Container container1 = new Container();
-        container1.setLayout(new BorderLayout());
-        container1.add(new Button("north"), BorderLayout.NORTH);
-        container1.add(new Button("south"), BorderLayout.SOUTH);
-        container1.add(new Button("east"), BorderLayout.EAST);
-        container1.add(new Button("west"), BorderLayout.WEST);
-        container1.add(newtCanvasAWT, BorderLayout.CENTER);
-
-        JPanel jPanel1 = new JPanel();
-        jPanel1.setLayout(new BorderLayout());
-        jPanel1.add(new Button("north"), BorderLayout.NORTH);
-        jPanel1.add(new Button("south"), BorderLayout.SOUTH);
-        jPanel1.add(new Button("east"), BorderLayout.EAST);
-        jPanel1.add(new Button("west"), BorderLayout.WEST);
-        jPanel1.add(container1, BorderLayout.CENTER);
-
-        JFrame jFrame1 = new JFrame("Swing Parent JFrame");
-        // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
-        jFrame1.setContentPane(jPanel1);
-        jFrame1.setLocation(0, 0);
-        jFrame1.setSize(width, height);
-        jFrame1.setVisible(true); // from here on, we need to run modifications on EDT
-
-        JPanel jPanel2 = new JPanel();
-        jPanel2.setLayout(new BorderLayout());
-        jPanel2.add(new Button("north"), BorderLayout.NORTH);
-        jPanel2.add(new Button("south"), BorderLayout.SOUTH);
-        jPanel2.add(new Button("east"), BorderLayout.EAST);
-        jPanel2.add(new Button("west"), BorderLayout.WEST);
-
-        JFrame jFrame2 = new JFrame("Swing Parent JFrame");
-        // jFrame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        jFrame2.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
-        jFrame2.setContentPane(jPanel2);
-        jFrame2.setLocation(640, 480);
-        jFrame2.setSize(width, height);
-        jFrame2.setVisible(true); // from here on, we need to run modifications on EDT
-
-        final NewtCanvasAWT _newtCanvasAWT = newtCanvasAWT;
-        final JFrame _jFrame1 = jFrame1;
-        final JPanel _jPanel1 = jPanel1;
-        final Container _container1 = container1;
-        final JFrame _jFrame2 = jFrame2;
-        final JPanel _jPanel2 = jPanel2;
-
-        // visible test
-        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
-
-        int state = 0;
-        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
-            Thread.sleep(durationPerTest);
-            switch(state) {
-                case 0:
-                    SwingUtilities.invokeAndWait(new Runnable() {
-                            public void run() {
-                                _container1.remove(_newtCanvasAWT);
-                                _jPanel2.add(_newtCanvasAWT, BorderLayout.CENTER);
-                            } });
-                    break;
-                case 1:
-                    SwingUtilities.invokeAndWait(new Runnable() {
-                            public void run() {
-                                _jPanel2.remove(_newtCanvasAWT);
-                                _container1.add(_newtCanvasAWT, BorderLayout.CENTER);
-                            } });
-                    break;
-            }
-            state++;
-        }
-
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    _jFrame1.setVisible(false);
-                    _jFrame2.setVisible(false);
-                } });
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    _jFrame1.dispose();
-                    _jFrame2.dispose();
-                } });
-        Assert.assertEquals(true, glWindow1.isValid());
-
-        glWindow1.invalidate();
-        //Assert.assertEquals(false, glWindow1.isValid());
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);
-        Window window = glWindow.getWindow();
-        if(debug) {
-            MiscUtils.setFieldIfExists(demo, "glDebug", true);
-            MiscUtils.setFieldIfExists(demo, "glTrace", true);
-        }
-        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            } else if(args[i].equals("-wait")) {
-                waitReparent = atoi(args[++i]);
-            }
-        }
-        System.out.println("durationPerTest "+durationPerTest);
-        System.out.println("waitReparent "+waitReparent);
-        String tstname = TestParenting01cSwingAWT.class.getName();
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting02AWT.java b/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting02AWT.java
deleted file mode 100644
index 6c9e5b2..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting02AWT.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt.parenting;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import java.awt.Button;
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-import java.awt.Frame;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.*;
-import com.jogamp.test.junit.jogl.demos.es1.RedSquare;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestParenting02AWT extends UITestCase {
-    static int width, height;
-    static long durationPerTest = 500;
-    static long waitReparent = 300;
-    static boolean verbose = false;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        width  = 640;
-        height = 480;
-    }
-
-    @Test
-    public void testWindowParenting01NewtChildOnAWTParentLayouted() throws InterruptedException {
-        runNewtChildOnAWTParent(true, false);
-    }
-
-    @Test
-    public void testWindowParenting02NewtChildOnAWTParentLayoutedDef() throws InterruptedException {
-        runNewtChildOnAWTParent(true, true);
-    }
-
-    @Test
-    public void testWindowParenting03NewtChildOnAWTParentDirect() throws InterruptedException {
-        runNewtChildOnAWTParent(false, false);
-    }
-
-    @Test
-    public void testWindowParenting04NewtChildOnAWTParentDirectDef() throws InterruptedException {
-        runNewtChildOnAWTParent(false, true);
-    }
-
-    public void runNewtChildOnAWTParent(boolean useLayout, boolean deferredPeer) throws InterruptedException {
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        // setup NEWT GLWindow ..
-        GLWindow glWindow = GLWindow.create(new GLCapabilities(null));
-        Assert.assertNotNull(glWindow);
-        glWindow.setTitle("NEWT - CHILD");
-        glWindow.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo)));
-        glWindow.addWindowListener(new TraceWindowAdapter(new WindowAction(eventFifo)));
-        GLEventListener demo = new Gears();
-        setDemoFields(demo, glWindow, false);
-        glWindow.addGLEventListener(demo);
-
-        // attach NEWT GLWindow to AWT Canvas
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
-        Assert.assertNotNull(newtCanvasAWT);
-        Assert.assertEquals(false, glWindow.isVisible());
-        Assert.assertEquals(false, glWindow.isNativeValid());
-        Assert.assertNull(glWindow.getParent());
-
-        Frame frame = new Frame("AWT Parent Frame");
-        Assert.assertNotNull(frame);
-        if(useLayout) {
-            frame.setLayout(new BorderLayout());
-            frame.add(new Button("North"), BorderLayout.NORTH);
-            frame.add(new Button("South"), BorderLayout.SOUTH);
-            frame.add(new Button("East"), BorderLayout.EAST);
-            frame.add(new Button("West"), BorderLayout.WEST);
-            if(!deferredPeer) {
-                frame.add(newtCanvasAWT, BorderLayout.CENTER);
-            }
-        } else {
-            if(!deferredPeer) {
-                frame.add(newtCanvasAWT);
-            }
-        }
-
-        frame.setSize(width, height);
-
-        frame.setVisible(true);
-        // X11: true, Windows: false - Assert.assertEquals(true, glWindow.isVisible());
-
-        if(deferredPeer) {
-            if(useLayout) {
-                frame.add(newtCanvasAWT, BorderLayout.CENTER);
-            } else {
-                frame.add(newtCanvasAWT);
-            }
-        }
-
-        // Since it is not defined when AWT's addNotify call happen
-        // we just have to wait for it in this junit test
-        // because we have assertions on the state.
-        // Regular application shall not need to do that.
-        do {
-            Thread.yield();
-            // 1st display .. creation
-            glWindow.display();
-        } while(!glWindow.isNativeValid()) ;
-
-        Assert.assertEquals(true, glWindow.isNativeValid());
-        Assert.assertNotNull(glWindow.getParent());
-        if(verbose) {
-            System.out.println("+++++++++++++++++++ 1st ADDED");
-        }
-        Thread.sleep(waitReparent);
-
-        if(useLayout) {
-            // test some fancy re-layout ..
-            frame.remove(newtCanvasAWT);
-            Assert.assertEquals(false, glWindow.isVisible());
-            Assert.assertEquals(true, glWindow.isNativeValid());
-            Assert.assertNull(glWindow.getParent());
-            if(verbose) {
-                System.out.println("+++++++++++++++++++ REMOVED!");
-            }
-            Thread.sleep(waitReparent);
-
-            // should recreate properly ..
-            frame.add(newtCanvasAWT, BorderLayout.CENTER);
-            glWindow.display();
-            Assert.assertEquals(true, glWindow.isVisible());
-            Assert.assertEquals(true, glWindow.isNativeValid());
-            Assert.assertNotNull(glWindow.getParent());
-            if(verbose) {
-                System.out.println("+++++++++++++++++++ 2nd ADDED");
-            }
-            Thread.sleep(waitReparent);
-        }
-
-        long duration = durationPerTest;
-        long step = 20;
-        NEWTEvent event;
-        boolean shouldQuit = false;
-
-        while (duration>0 && !shouldQuit) {
-            glWindow.display();
-            Thread.sleep(step);
-            duration -= step;
-
-            while( null != ( event = (NEWTEvent) eventFifo.get() ) ) {
-                Window source = (Window) event.getSource();
-                if(event instanceof KeyEvent) {
-                    KeyEvent keyEvent = (KeyEvent) event;
-                    switch(keyEvent.getKeyChar()) {
-                        case 'q':
-                            shouldQuit = true;
-                            break;
-                        case 'f':
-                            source.setFullscreen(!source.isFullscreen());
-                            break;
-                    }
-                } 
-            }
-        }
-        if(verbose) {
-            System.out.println("+++++++++++++++++++ END");
-        }
-        Thread.sleep(waitReparent);
-
-        glWindow.invalidate();
-        if(useLayout) {
-            frame.remove(newtCanvasAWT);
-        }
-        frame.dispose();
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);
-        Window window = glWindow.getWindow();
-        if(debug) {
-            MiscUtils.setFieldIfExists(demo, "glDebug", true);
-            MiscUtils.setFieldIfExists(demo, "glTrace", true);
-        }
-        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        verbose = true;
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            } else if(args[i].equals("-wait")) {
-                waitReparent = atoi(args[++i]);
-            }
-        }
-        String tstname = TestParenting02AWT.class.getName();
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting02NEWT.java b/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting02NEWT.java
deleted file mode 100644
index 23e3e1c..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting02NEWT.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-
-package com.jogamp.test.junit.newt.parenting;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.*;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.*;
-import com.jogamp.test.junit.jogl.demos.es1.RedSquare;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestParenting02NEWT extends UITestCase {
-    static int width, height;
-    static long durationPerTest = 500;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        width  = 640;
-        height = 480;
-    }
-
-    static Window createWindow(Screen screen, Capabilities caps) {
-        Assert.assertNotNull(caps);
-        Window window = NewtFactory.createWindow(screen, caps) ;
-        Assert.assertNotNull(window);
-        return window;
-    }
-
-    static Window createWindow(NativeWindow parent, Capabilities caps) {
-        Assert.assertNotNull(caps);
-        Window window = NewtFactory.createWindow(parent, caps);
-        window.setUndecorated(true);
-        Assert.assertNotNull(window);
-        return window;
-    }
-
-    static void destroyWindow(Display display, Screen screen, Window window, GLWindow glWindow) {
-        if(null!=glWindow) {
-            glWindow.destroy();
-        }
-        if(null!=window) {
-            window.destroy();
-        }
-        if(null!=screen) {
-            screen.destroy();
-        }
-        if(null!=display) {
-            display.destroy();
-        }
-    }
-
-    @Test
-    public void testWindowParenting01NewtOnNewtParentChildDraw() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(null);
-        Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
-        Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        Assert.assertNotNull(screen);
-
-        int x = 1;
-        int y = 1;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        Window window1 = createWindow(screen, caps);
-        Assert.assertNotNull(window1);
-        GLWindow glWindow1 = GLWindow.create(window1);
-        Assert.assertNotNull(glWindow1);
-        glWindow1.setSize(width, height);
-        Assert.assertEquals(width,glWindow1.getWidth());
-        Assert.assertEquals(height,glWindow1.getHeight());
-        glWindow1.setTitle("testWindowParenting01NewtOnNewtParentChildDraw - PARENT");
-        glWindow1.setPosition(x,y);
-        glWindow1.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo)));
-        glWindow1.addWindowListener(new TraceWindowAdapter());
-
-        GLEventListener demo1 = new RedSquare();
-        setDemoFields(demo1, window1, glWindow1, false);
-        // glWindow1.addGLEventListener(demo1);
-
-        glWindow1.setVisible(true);
-        CapabilitiesImmutable capsChosen = glWindow1.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
-        Assert.assertNotNull(capsChosen);
-        Assert.assertTrue(capsChosen.isOnscreen()==true);
-
-        Window window2 = createWindow(window1, caps);
-        Assert.assertNotNull(window2);
-        GLWindow glWindow2 = GLWindow.create(window2);
-        Assert.assertNotNull(glWindow2);
-        glWindow2.setSize(width/2, height/2);
-        //Assert.assertEquals(width/2,glWindow2.getWidth());
-        //Assert.assertEquals(height/2,glWindow2.getHeight());
-        glWindow2.setTitle("testWindowParenting01NewtOnNewtParentChildDraw - CHILD");
-        glWindow2.setPosition(glWindow1.getWidth()/2, glWindow1.getHeight()/2);
-        glWindow2.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo)));
-        glWindow2.addWindowListener(new TraceWindowAdapter(new WindowAction(eventFifo)));
-        // glWindow2.addMouseListener(new TraceMouseAdapter());
-
-        GLEventListener demo2 = new Gears();
-        setDemoFields(demo2, window2, glWindow2, false);
-        // glWindow2.addGLEventListener(demo2);
-
-        glWindow2.setVisible(true);
-        capsChosen = glWindow2.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
-        Assert.assertNotNull(capsChosen);
-        Assert.assertTrue(capsChosen.isOnscreen()==true);
-
-        glWindow1.addGLEventListener(demo1);
-        glWindow2.addGLEventListener(demo2);
-
-        boolean shouldQuit = false;
-        long duration = durationPerTest;
-        long step = 20;
-        NEWTEvent event;
-
-        while (duration>0 && !shouldQuit) {
-            glWindow1.display();
-            glWindow2.display();
-            Thread.sleep(step);
-            duration -= step;
-            x += 1;
-            y += 1;
-            glWindow1.setPosition(x,y);
-            glWindow2.setPosition(glWindow1.getWidth()/2,glWindow1.getHeight()/2-y);
-
-            while( null != ( event = (NEWTEvent) eventFifo.get() ) ) {
-                Window source = (Window) event.getSource();
-                if(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY == event.getEventType()) {
-                    shouldQuit = true;
-                } else if(event instanceof KeyEvent) {
-                    KeyEvent keyEvent = (KeyEvent) event;
-                    switch(keyEvent.getKeyChar()) {
-                        case 'q':
-                            shouldQuit = true;
-                            break;
-                        case 'f':
-                            source.setFullscreen(!source.isFullscreen());
-                            break;
-                    }
-                } 
-            }
-        }
-        destroyWindow(null, null, window2, glWindow2);
-        destroyWindow(display, screen, window1, glWindow1);
-    }
-
-    public static void setDemoFields(GLEventListener demo, Window window, GLWindow glWindow, boolean debug) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(window);
-        if(debug) {
-            MiscUtils.setFieldIfExists(demo, "glDebug", true);
-            MiscUtils.setFieldIfExists(demo, "glTrace", true);
-        }
-        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            }
-        }
-        String tstname = TestParenting02NEWT.class.getName();
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting03AWT.java b/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting03AWT.java
deleted file mode 100644
index 6108609..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting03AWT.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt.parenting;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import java.awt.Button;
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Frame;
-import java.awt.Label;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.FPSAnimator;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.*;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestParenting03AWT extends UITestCase {
-    static Dimension size;
-    static long durationPerTest = 400;
-    static long waitAdd2nd = 200;
-    static GLCapabilities glCaps;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        size = new Dimension(400,200);
-        glCaps = new GLCapabilities(null);
-        glCaps.setAlphaBits(8);
-        glCaps.setBackgroundOpaque(false);
-    }
-
-    @Test
-    public void testWindowParenting1AWTOneNewtChild01() throws InterruptedException, InvocationTargetException {
-        testWindowParenting1AWTOneNewtChild();
-    }
-
-    public void testWindowParenting1AWTOneNewtChild() throws InterruptedException, InvocationTargetException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        glWindow1.enablePerfLog(true);
-        glWindow1.setUndecorated(true);
-        NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
-        newtCanvasAWT1.setPreferredSize(size);
-
-        GLEventListener demo1 = new Gears(1);
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-        final NewtCanvasAWT f_newtCanvasAWT1 = newtCanvasAWT1;
-        final GLWindow f_glWindow1 = glWindow1;
-        glWindow1.addKeyListener(new KeyAdapter() {
-            public void keyTyped(KeyEvent e) {
-                if(e.getKeyChar()=='d') {
-                    f_glWindow1.setUndecorated(!f_glWindow1.isUndecorated());
-                } else if(e.getKeyChar()=='f') {
-                    f_glWindow1.setFullscreen(!f_glWindow1.isFullscreen());
-                } else if(e.getKeyChar()=='r') {
-                    if(f_glWindow1.getParent()==null) {
-                        System.err.println("XXX glWin1 -> home");
-                        f_glWindow1.reparentWindow(f_newtCanvasAWT1.getNativeWindow());
-                    } else {
-                        System.err.println("XXX glWin1 -> TOP");
-                        f_glWindow1.reparentWindow(null);
-                    }
-                }
-            }
-        });
-        GLAnimatorControl animator1 = new Animator(glWindow1);
-        animator1.start();
-
-        Container cont1 = new Container();
-        cont1.setLayout(new BorderLayout());
-        cont1.add(newtCanvasAWT1, BorderLayout.CENTER);
-        cont1.setVisible(true);
-        final Container f_cont1 = cont1;
-
-        Frame frame1 = new Frame("AWT Parent Frame");
-        frame1.setLayout(new BorderLayout());
-        frame1.add(cont1, BorderLayout.EAST);
-        frame1.add(new Label("center"), BorderLayout.CENTER);
-        frame1.setLocation(0, 0);
-        frame1.setSize((int)size.getWidth(), (int)size.getHeight());
-        final Frame f_frame1 = frame1;
-        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                f_frame1.pack();
-                f_frame1.setVisible(true);
-            }});
-
-        Assert.assertEquals(newtCanvasAWT1.getNativeWindow(),glWindow1.getParent());
-        Assert.assertEquals(true, animator1.isAnimating());
-        Assert.assertEquals(false, animator1.isPaused());
-        Assert.assertNotNull(animator1.getThread());
-
-        Thread.sleep(durationPerTest);
-
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-        Assert.assertEquals(false, animator1.isPaused());
-        Assert.assertEquals(null, animator1.getThread());
-
-        frame1.dispose();
-        glWindow1.invalidate();
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);
-        Window window = glWindow.getWindow();
-        if(debug) {
-            MiscUtils.setFieldIfExists(demo, "glDebug", true);
-            MiscUtils.setFieldIfExists(demo, "glTrace", true);
-        }
-        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            } else if(args[i].equals("-wait")) {
-                waitAdd2nd = atoi(args[++i]);
-            }
-        }
-        String tstname = TestParenting03AWT.class.getName();
-        /*
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } ); */
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting03bAWT.java b/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting03bAWT.java
deleted file mode 100644
index a31e49b..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/TestParenting03bAWT.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.newt.parenting;
-
-import java.lang.reflect.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Test;
-
-import java.awt.Button;
-import java.awt.BorderLayout;
-import java.awt.Canvas;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Frame;
-import java.awt.Label;
-
-import javax.media.opengl.*;
-import javax.media.nativewindow.*;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.FPSAnimator;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.opengl.*;
-import com.jogamp.newt.awt.NewtCanvasAWT;
-
-import java.io.IOException;
-
-import com.jogamp.test.junit.util.*;
-import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears;
-
-public class TestParenting03bAWT extends UITestCase {
-    static Dimension size;
-    static long durationPerTest = 800;
-    static long waitAdd2nd = 500;
-    static GLCapabilities glCaps;
-
-    @BeforeClass
-    public static void initClass() {
-        GLProfile.initSingleton(true);
-        size = new Dimension(400,200);
-        glCaps = new GLCapabilities(null);
-    }
-
-    @Test
-    public void testWindowParenting1AWTTwoNewtChilds01() throws InterruptedException, InvocationTargetException {
-        testWindowParenting1AWTTwoNewtChilds();
-    }
-
-    public void testWindowParenting1AWTTwoNewtChilds() throws InterruptedException, InvocationTargetException {
-        int x = 0;
-        int y = 0;
-
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
-
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        glWindow1.enablePerfLog(true);
-        glWindow1.setUndecorated(true);
-        NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
-        newtCanvasAWT1.setPreferredSize(size);
-
-        GLEventListener demo1 = new Gears(1);
-        setDemoFields(demo1, glWindow1, false);
-        glWindow1.addGLEventListener(demo1);
-        final NewtCanvasAWT f_newtCanvasAWT1 = newtCanvasAWT1;
-        final GLWindow f_glWindow1 = glWindow1;
-        glWindow1.addKeyListener(new KeyAdapter() {
-            public void keyTyped(KeyEvent e) {
-                if(e.getKeyChar()=='d') {
-                    f_glWindow1.setUndecorated(!f_glWindow1.isUndecorated());
-                } else if(e.getKeyChar()=='f') {
-                    f_glWindow1.setFullscreen(!f_glWindow1.isFullscreen());
-                } else if(e.getKeyChar()=='r') {
-                    if(f_glWindow1.getParent()==null) {
-                        System.err.println("XXX glWin1 -> home");
-                        f_glWindow1.reparentWindow(f_newtCanvasAWT1.getNativeWindow());
-                    } else {
-                        System.err.println("XXX glWin1 -> TOP");
-                        f_glWindow1.reparentWindow(null);
-                    }
-                }
-            }
-        });
-        GLAnimatorControl animator1 = new Animator(glWindow1);
-        animator1.start();
-
-        GLWindow glWindow2 = GLWindow.create(glCaps);
-        glWindow2.enablePerfLog(true);
-        glWindow2.setUndecorated(true);
-        NewtCanvasAWT newtCanvasAWT2 = new NewtCanvasAWT(glWindow2);
-        newtCanvasAWT2.setPreferredSize(size);
-
-        GLEventListener demo2 = new Gears(1);
-        setDemoFields(demo2, glWindow2, false);
-        glWindow2.addGLEventListener(demo2);
-        final NewtCanvasAWT f_newtCanvasAWT2 = newtCanvasAWT2;
-        final GLWindow f_glWindow2 = glWindow2;
-        glWindow2.addKeyListener(new KeyAdapter() {
-            public void keyTyped(KeyEvent e) {
-                if(e.getKeyChar()=='d') {
-                    f_glWindow2.setUndecorated(!f_glWindow2.isUndecorated());
-                } else if(e.getKeyChar()=='f') {
-                    f_glWindow2.setFullscreen(!f_glWindow2.isFullscreen());
-                } else if(e.getKeyChar()=='r') {
-                    if(f_glWindow2.getParent()==null) {
-                        System.err.println("XXX glWin2 -> home");
-                        f_glWindow2.reparentWindow(f_newtCanvasAWT2.getNativeWindow());
-                    } else {
-                        System.err.println("XXX glWin2 -> TOP");
-                        f_glWindow2.reparentWindow(null);
-                    }
-                }
-            }
-        });
-        GLAnimatorControl animator2 = new Animator(glWindow2);
-        animator2.start();
-
-        Container cont1 = new Container();
-        cont1.setLayout(new BorderLayout());
-        cont1.add(newtCanvasAWT1, BorderLayout.CENTER);
-        cont1.setVisible(true);
-        final Container f_cont1 = cont1;
-
-        Container cont2 = new Container();
-        cont2.setLayout(new BorderLayout());
-        cont2.add(newtCanvasAWT2, BorderLayout.CENTER);
-        cont2.setVisible(true);
-        final Container f_cont2 = cont2;
-
-        Frame frame1 = new Frame("AWT Parent Frame");
-        frame1.setLayout(new BorderLayout());
-        frame1.add(cont1, BorderLayout.EAST);
-        frame1.add(new Label("center"), BorderLayout.CENTER);
-        frame1.setLocation(0, 0);
-        frame1.setSize((int)size.getWidth()*2, (int)size.getHeight()*2);
-        final Frame f_frame1 = frame1;
-        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                f_frame1.pack();
-                f_frame1.setVisible(true);
-            }});
-
-        Assert.assertEquals(newtCanvasAWT1.getNativeWindow(),glWindow1.getParent());
-        Assert.assertEquals(newtCanvasAWT2.getNativeWindow(),glWindow2.getParent());
-
-        Assert.assertEquals(true, animator1.isAnimating());
-        Assert.assertEquals(false, animator1.isPaused());
-        Assert.assertNotNull(animator1.getThread());
-
-        Assert.assertEquals(true, animator2.isAnimating());
-        Assert.assertEquals(false, animator2.isPaused());
-        Assert.assertNotNull(animator2.getThread());
-
-        Thread.sleep(waitAdd2nd);
-
-        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                f_frame1.add(f_cont2, BorderLayout.WEST);
-                f_frame1.pack();
-            }});
-
-        Thread.sleep(durationPerTest);
-
-        animator1.stop();
-        Assert.assertEquals(false, animator1.isAnimating());
-        Assert.assertEquals(false, animator1.isPaused());
-        Assert.assertEquals(null, animator1.getThread());
-
-        animator2.stop();
-        Assert.assertEquals(false, animator2.isAnimating());
-        Assert.assertEquals(false, animator2.isPaused());
-        Assert.assertEquals(null, animator2.getThread());
-
-        frame1.dispose();
-        glWindow1.invalidate();
-        glWindow2.invalidate();
-    }
-
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
-        Assert.assertNotNull(demo);
-        Assert.assertNotNull(glWindow);
-        Window window = glWindow.getWindow();
-        if(debug) {
-            MiscUtils.setFieldIfExists(demo, "glDebug", true);
-            MiscUtils.setFieldIfExists(demo, "glTrace", true);
-        }
-        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
-            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
-        }
-    }
-
-    static int atoi(String a) {
-        int i=0;
-        try {
-            i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
-        return i;
-    }
-
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                durationPerTest = atoi(args[++i]);
-            } else if(args[i].equals("-wait")) {
-                waitAdd2nd = atoi(args[++i]);
-            }
-        }
-        String tstname = TestParenting03bAWT.class.getName();
-        /*
-        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
-            tstname,
-            "filtertrace=true",
-            "haltOnError=false",
-            "haltOnFailure=false",
-            "showoutput=true",
-            "outputtoformatters=true",
-            "logfailedtests=true",
-            "logtestlistenerevents=true",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
-            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } ); */
-        org.junit.runner.JUnitCore.main(tstname);
-    }
-
-}
diff --git a/src/junit/com/jogamp/test/junit/newt/parenting/WindowAction.java b/src/junit/com/jogamp/test/junit/newt/parenting/WindowAction.java
deleted file mode 100644
index bcfb294..0000000
--- a/src/junit/com/jogamp/test/junit/newt/parenting/WindowAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.test.junit.newt.parenting;
-
-import com.jogamp.newt.event.*;
-
-class WindowAction extends WindowAdapter {
-    NEWTEventFiFo eventFifo;
-
-    public WindowAction(NEWTEventFiFo eventFifo) { 
-        this.eventFifo = eventFifo; 
-    }
-
-    public void windowDestroyNotify(WindowEvent e) {
-        eventFifo.put(e);
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/util/AWTFocusAdapter.java b/src/junit/com/jogamp/test/junit/util/AWTFocusAdapter.java
deleted file mode 100644
index 1741526..0000000
--- a/src/junit/com/jogamp/test/junit/util/AWTFocusAdapter.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-
-public class AWTFocusAdapter implements EventCountAdapter, FocusListener {
-
-    String prefix;
-    int focusGained;
-    boolean wasTemporary;
-
-    public AWTFocusAdapter(String prefix) {
-        this.prefix = prefix;
-        reset();
-    }
-
-    /** @return the balance of focus gained/lost, ie should be 0 or 1 */
-    public int getCount() {
-        return focusGained;
-    }
-
-    public void reset() {
-        focusGained = 0;
-        wasTemporary = false;
-    }
-
-    /** @return true, if the last change was temporary */
-    public boolean getWasTemporary() {
-        return wasTemporary;
-    }
-
-    @Override 
-    public void focusGained(FocusEvent e) {
-        ++focusGained;
-        wasTemporary = e.isTemporary();
-        System.err.println("FOCUS AWT  GAINED "+(wasTemporary?"TEMP":"PERM")+" ["+focusGained+"]: "+prefix+", "+e);
-    }
-
-    @Override
-    public void focusLost(FocusEvent e) {
-        --focusGained;
-        wasTemporary = e.isTemporary();
-        System.err.println("FOCUS AWT  LOST   "+(wasTemporary?"TEMP":"PERM")+" ["+focusGained+"]: "+prefix+", "+e);
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/util/AWTKeyAdapter.java b/src/junit/com/jogamp/test/junit/util/AWTKeyAdapter.java
deleted file mode 100644
index 8e255ac..0000000
--- a/src/junit/com/jogamp/test/junit/util/AWTKeyAdapter.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-public class AWTKeyAdapter extends java.awt.event.KeyAdapter implements EventCountAdapter {
-
-    String prefix;
-    int keyTyped;
-
-    public AWTKeyAdapter(String prefix) {
-        this.prefix = prefix;
-        reset();
-    }
-
-    public int getCount() {
-        return keyTyped;
-    }
-
-    public void reset() {
-        keyTyped = 0;
-    }
-
-    public void keyTyped(java.awt.event.KeyEvent e) {
-        ++keyTyped;
-        System.err.println("KEY AWT  TYPED ["+keyTyped+"]: "+prefix+", "+e);
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/util/AWTMouseAdapter.java b/src/junit/com/jogamp/test/junit/util/AWTMouseAdapter.java
deleted file mode 100644
index d78b3ed..0000000
--- a/src/junit/com/jogamp/test/junit/util/AWTMouseAdapter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements EventCountAdapter {
-    String prefix;
-    int mouseClicked;
-
-    public AWTMouseAdapter(String prefix) {
-        this.prefix = prefix;
-        reset();
-    }
-
-    public int getCount() {
-        return mouseClicked;
-    }
-
-    public void reset() {
-        mouseClicked = 0;
-    }
-
-    public void mouseClicked(java.awt.event.MouseEvent e) {
-        mouseClicked+=e.getClickCount();
-        System.err.println("MOUSE AWT CLICKED ["+mouseClicked+"]: "+prefix+", "+e);
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/util/AWTRobotUtil.java b/src/junit/com/jogamp/test/junit/util/AWTRobotUtil.java
deleted file mode 100644
index c49de3e..0000000
--- a/src/junit/com/jogamp/test/junit/util/AWTRobotUtil.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-import java.lang.reflect.InvocationTargetException;
-import java.awt.AWTException;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.KeyboardFocusManager;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.Robot;
-import java.awt.Window;
-import java.awt.event.InputEvent;
-import javax.swing.JFrame;
-
-public class AWTRobotUtil {
-
-    public static int TIME_OUT = 1000; // 1s
-    public static int ROBOT_DELAY = 50; // ms
-    public static int POLL_DIVIDER = 20; // TO/20
-
-    public static Point getCenterLocation(Object obj, boolean frameTitlebar) 
-        throws InterruptedException, InvocationTargetException {
-        Component comp = null;
-        com.jogamp.newt.Window win = null;
-
-        if(obj instanceof com.jogamp.newt.Window) {
-            win = (com.jogamp.newt.Window) obj;
-        } else if(obj instanceof Component) {
-            comp = (Component) obj;
-        } else {
-            throw new RuntimeException("Neither AWT nor NEWT: "+obj);
-        }
-
-        int x0, y0;
-        if(null!=comp) {
-            Point p0 = comp.getLocationOnScreen();
-            Rectangle r0 = comp.getBounds();
-            if( frameTitlebar && comp instanceof JFrame ) {
-                JFrame jFrame = (JFrame) comp;
-                Container cont = jFrame.getContentPane();
-                Point p1 = cont.getLocationOnScreen();
-                int dx = (int) ( r0.getWidth() / 2.0 + .5 );
-                int dy = (int) ( ( p1.getY() - p0.getY() ) / 2.0 + .5 );
-                x0 = (int) ( p0.getX() + dx + .5 ) ;
-                y0 = (int) ( p0.getY() + dy + .5 ) ;
-            } else {
-                x0 = (int) ( p0.getX() + r0.getWidth()  / 2.0 + .5 ) ;
-                y0 = (int) ( p0.getY() + r0.getHeight() / 2.0 + .5 ) ;
-            }
-        } else {
-            javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null);
-            p0.translate(win.getWidth()/2, win.getHeight()/2);
-            x0 = p0.getX();
-            y0 = p0.getY();
-        }
-
-        return new Point(x0, y0);
-    }
-
-    /**
-     * toFront, call setVisible(true) and toFront(),
-     * after positioning the mouse in the middle of the window via robot.
-     * If the given robot is null, a new one is created (waitForIdle=true).
-     *
-     * @return True if the Window became the global focused Window within TIME_OUT
-     */
-    public static boolean toFront(Robot robot, Window window) 
-        throws AWTException, InterruptedException, InvocationTargetException {
-
-        if(null == robot) {
-            robot = new Robot();
-            robot.setAutoWaitForIdle(true);
-        }
-        Point p0 = getCenterLocation(window, false);
-        System.err.println("robot pos: "+p0);
-        robot.mouseMove( (int) p0.getX(), (int) p0.getY() );
-        robot.delay(ROBOT_DELAY);
-
-        final Window f_window = window;
-        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                f_window.setVisible(true);
-                f_window.toFront();
-                f_window.requestFocus();
-            }});
-        robot.delay(ROBOT_DELAY);
-
-        KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
-        int wait;
-        for (wait=0; wait<POLL_DIVIDER && window != kfm.getFocusedWindow(); wait++) {
-            Thread.sleep(TIME_OUT/POLL_DIVIDER);
-        }
-        return wait<POLL_DIVIDER;
-    }
-
-    /**
-     * centerMouse
-     */
-    public static void centerMouse(Robot robot, Object obj) 
-        throws AWTException, InterruptedException, InvocationTargetException {
-        Component comp = null;
-        com.jogamp.newt.Window win = null;
-
-        if(null == robot) {
-            robot = new Robot();
-            robot.setAutoWaitForIdle(true);
-        }
-
-        if(obj instanceof com.jogamp.newt.Window) {
-            win = (com.jogamp.newt.Window) obj;
-        } else if(obj instanceof Component) {
-            comp = (Component) obj;
-        } else {
-            throw new RuntimeException("Neither AWT nor NEWT: "+obj);
-        }
-
-        Point p0 = getCenterLocation(obj, false);
-        System.err.println("robot pos: "+p0);
-
-        robot.mouseMove( (int) p0.getX(), (int) p0.getY() );
-        robot.delay(ROBOT_DELAY);
-    }
-
-    /**
-     * requestFocus, if robot is valid, use mouse operation,
-     * otherwise programatic, ie call requestFocus
-     */
-    public static void requestFocus(Robot robot, Object obj) 
-        throws AWTException, InterruptedException, InvocationTargetException {
-        Component comp = null;
-        com.jogamp.newt.Window win = null;
-
-        if(obj instanceof com.jogamp.newt.Window) {
-            win = (com.jogamp.newt.Window) obj;
-        } else if(obj instanceof Component) {
-            comp = (Component) obj;
-        } else {
-            throw new RuntimeException("Neither AWT nor NEWT: "+obj);
-        }
-
-        if(null == robot) {
-            if(null!=comp) {
-                final Component f_comp = comp;
-                javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-                    public void run() {
-                        f_comp.requestFocus();
-                    }});
-            } else {
-                win.requestFocus();
-            }
-            return;
-        }
-
-        centerMouse(robot, obj);
-
-        robot.delay(ROBOT_DELAY);
-        robot.mousePress(InputEvent.BUTTON1_MASK);
-        robot.delay(ROBOT_DELAY);
-        robot.mouseRelease(InputEvent.BUTTON1_MASK);
-        robot.delay(ROBOT_DELAY);
-    }
-
-    /**
-     *
-     * @return True if the Window became the global focused Window within TIME_OUT
-     */
-    public static boolean waitForFocus(Object obj) throws InterruptedException {
-        int wait;
-        if(obj instanceof Component) {
-            Component comp = (Component) obj;
-            KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
-            for (wait=0; wait<POLL_DIVIDER && comp != kfm.getPermanentFocusOwner(); wait++) {
-                Thread.sleep(TIME_OUT/POLL_DIVIDER);
-            }
-        } else if(obj instanceof com.jogamp.newt.Window) {
-            com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
-            for (wait=0; wait<POLL_DIVIDER && !win.hasFocus(); wait++) {
-                Thread.sleep(TIME_OUT/POLL_DIVIDER);
-            }
-        } else {
-            throw new RuntimeException("Neither AWT nor NEWT: "+obj);
-        }
-        return wait<POLL_DIVIDER;
-    }
-
-    /**
-     *
-     * @return True if the Window became the global focused Window within TIME_OUT
-     */
-    public static boolean waitForFocus(Object obj, int gainT0, EventCountAdapter gain, 
-                                                   int lostT0, EventCountAdapter lost) throws InterruptedException {
-        if(!waitForFocus(obj)) {
-            return false;
-        }
-        int wait;
-        for (wait=0; wait<POLL_DIVIDER; wait++) {
-            int gainT1 = gain.getCount();
-            int lostT1 = (null!=lost) ? lost.getCount() : -1;
-            if(gainT1-gainT0==1 && lostT1-lostT0==-1) {
-                return true;
-            }
-            Thread.sleep(TIME_OUT/POLL_DIVIDER);
-        }
-        return false;
-    }
-
-    public static boolean requestFocusAndWait(Robot robot, Object requestFocus, Object waitForFocus)
-        throws AWTException, InterruptedException, InvocationTargetException {
-
-        requestFocus(robot, requestFocus);
-        return waitForFocus(waitForFocus);
-    }
-
-    public static boolean requestFocusAndWait(Robot robot, Object requestFocus, Object waitForFocus, 
-                                              EventCountAdapter gain, EventCountAdapter lost)
-        throws AWTException, InterruptedException, InvocationTargetException {
-
-        int gainT0 = gain.getCount();
-        int lostT0 = (null!=lost) ? lost.getCount() : 0;
-
-        requestFocus(robot, requestFocus);
-        return waitForFocus(waitForFocus, gainT0, gain, lostT0, lost);
-    }
-
-    /**
-     * @param keyTypedCounter shall return the number of keys typed (press + release)
-     * @return True if typeCount keys within TIME_OUT has been received
-     */
-    public static int testKeyType(Robot robot, int typeCount, Object obj, EventCountAdapter keyTypedCounter) 
-        throws AWTException, InterruptedException, InvocationTargetException {
-        Component comp = null;
-        com.jogamp.newt.Window win = null;
-
-        if(null == robot) {
-            robot = new Robot();
-            robot.setAutoWaitForIdle(true);
-        }
-
-        centerMouse(robot, obj);
-
-        int c0 = keyTypedCounter.getCount();
-
-        for(int i=0; i<typeCount; i++) {
-            robot.keyPress(java.awt.event.KeyEvent.VK_A);
-            robot.delay(ROBOT_DELAY);
-            robot.keyRelease(java.awt.event.KeyEvent.VK_A);
-            robot.delay(ROBOT_DELAY);
-        }
-
-        // Wait for the key events to be processed.
-        int wait;
-        for (wait=0; wait<POLL_DIVIDER && (keyTypedCounter.getCount()-c0)<typeCount; wait++) {
-            Thread.sleep(TIME_OUT/POLL_DIVIDER);
-        }
-        return keyTypedCounter.getCount()-c0;
-    }
-
-    /**
-     * @param mouseButton ie InputEvent.BUTTON1_MASK
-     * @param clickCount ie 1, or 2
-     * @return True if the desired clickCount within TIME_OUT has been received
-     */
-    public static int testMouseClick(Robot robot, int mouseButton, int clickCount,
-                                     Object obj, EventCountAdapter mouseClickCounter) 
-        throws AWTException, InterruptedException, InvocationTargetException {
-
-        if(null == robot) {
-            robot = new Robot();
-            robot.setAutoWaitForIdle(true);
-        }
-
-        final int clickTO = com.jogamp.newt.event.MouseEvent.getClickTimeout();
-
-        centerMouse(robot, obj);
-
-        robot.delay(2*clickTO);
-
-        int c0 = mouseClickCounter.getCount();
-
-        for(int i=0; i<clickCount; i++) {
-            robot.mousePress(mouseButton);
-            robot.delay(clickTO/4);
-            robot.mouseRelease(mouseButton);
-            robot.delay(clickTO/4);
-        }
-
-        // Wait for the key events to be processed.
-        int wait;
-        for (wait=0; wait<POLL_DIVIDER && (mouseClickCounter.getCount()-c0)<clickCount; wait++) {
-            Thread.sleep(TIME_OUT/POLL_DIVIDER);
-        }
-        return mouseClickCounter.getCount()-c0;
-    }
-
-    /**
-     *
-     * @return True if the EventCountAdapter became the desired value within TIME_OUT
-     */
-    public static boolean waitForCount(int desired, EventCountAdapter eca) throws InterruptedException {
-        for (int wait=0; wait<POLL_DIVIDER; wait++) {
-            if( eca.getCount() == desired ) {
-                return true;
-            }
-            Thread.sleep(TIME_OUT/POLL_DIVIDER);
-        }
-        return false;
-    }
-
-}
-
diff --git a/src/junit/com/jogamp/test/junit/util/DumpVersion.java b/src/junit/com/jogamp/test/junit/util/DumpVersion.java
deleted file mode 100644
index 25b1fe8..0000000
--- a/src/junit/com/jogamp/test/junit/util/DumpVersion.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-
-import javax.media.opengl.*;
-import com.jogamp.opengl.JoglVersion;
-
-
-public class DumpVersion implements GLEventListener {
-
-    public void init(GLAutoDrawable drawable) {
-        GL gl = drawable.getGL();
-
-        System.err.println(JoglVersion.getInstance().toString(gl));
-    }
-
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-    }
-
-    public void display(GLAutoDrawable drawable) {
-    }
-
-    public void dispose(GLAutoDrawable drawable) {
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/util/EventCountAdapter.java b/src/junit/com/jogamp/test/junit/util/EventCountAdapter.java
deleted file mode 100644
index e056121..0000000
--- a/src/junit/com/jogamp/test/junit/util/EventCountAdapter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-public interface EventCountAdapter {
-
-    int getCount();
-    void reset();
-}
-
diff --git a/src/junit/com/jogamp/test/junit/util/EventCountAdapterUtil.java b/src/junit/com/jogamp/test/junit/util/EventCountAdapterUtil.java
deleted file mode 100644
index 40b192a..0000000
--- a/src/junit/com/jogamp/test/junit/util/EventCountAdapterUtil.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-import java.util.List;
-import java.util.Iterator;
-
-public abstract class EventCountAdapterUtil {
-
-    public static void reset(EventCountAdapter[] adapters) {
-        for(int i=0; i<adapters.length; i++) {
-            adapters[i].reset();
-        }
-    }
-
-    public static void reset(List/*<EventCountAdapter>*/ adapters) {
-        for(Iterator i = adapters.iterator(); i.hasNext(); ) {
-            EventCountAdapter adapter = (EventCountAdapter) i.next();
-            adapter.reset();
-        }
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/util/GLSLSimpleProgram.java b/src/junit/com/jogamp/test/junit/util/GLSLSimpleProgram.java
deleted file mode 100644
index 82be0eb..0000000
--- a/src/junit/com/jogamp/test/junit/util/GLSLSimpleProgram.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.test.junit.util;
-
-import com.jogamp.opengl.util.glsl.ShaderUtil;
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2ES2;
-import org.junit.Assert;
-
-public class GLSLSimpleProgram {
-    private int shaderProgram;
-    private int vertShader;
-    private int fragShader;
-
-    private GLSLSimpleProgram(int shaderProgram, int vertShader, int fragShader) {
-        this.shaderProgram = shaderProgram;
-        this.vertShader = vertShader;
-        this.fragShader = fragShader;
-    }
-
-    public static GLSLSimpleProgram create(GL2ES2 gl, String vertShaderCode, String fragShaderCode, boolean link) {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        PrintStream pbaos = new PrintStream(baos);
-
-        int vertShader = gl.glCreateShader(GL2ES2.GL_VERTEX_SHADER);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
-        int fragShader = gl.glCreateShader(GL2ES2.GL_FRAGMENT_SHADER);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
-        String[] vlines = new String[] { vertShaderCode };
-        int[] vlengths = new int[] { vlines[0].length() };
-        gl.glShaderSource(vertShader, vlines.length, vlines, vlengths, 0);
-        gl.glCompileShader(vertShader);
-        if(!ShaderUtil.isShaderStatusValid(gl, vertShader, gl.GL_COMPILE_STATUS, pbaos)) {
-            System.out.println("getShader:postCompile vertShader: "+baos.toString());
-            Assert.assertTrue(false);
-        }
-        pbaos.flush(); baos.reset();
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
-        
-        String[] flines = new String[] { fragShaderCode };
-        int[] flengths = new int[] { flines[0].length() };
-        gl.glShaderSource(fragShader, flines.length, flines, flengths, 0);
-        gl.glCompileShader(fragShader);
-        if(!ShaderUtil.isShaderStatusValid(gl, fragShader, gl.GL_COMPILE_STATUS, pbaos)) {
-            System.out.println("getShader:postCompile fragShader: "+baos.toString());
-            Assert.assertTrue(false);
-        }
-        pbaos.flush(); baos.reset();
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
-        int shaderProgram = gl.glCreateProgram();
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        gl.glAttachShader(shaderProgram, vertShader);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        gl.glAttachShader(shaderProgram, fragShader);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
-        if(link) {
-            gl.glLinkProgram(shaderProgram);
-            if(!ShaderUtil.isProgramValid(gl, shaderProgram, pbaos)) {
-                System.out.println("Error (GLSL link error):  "+baos.toString());
-                Assert.assertTrue(false);
-            }
-        }
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        GLSLSimpleProgram res = new GLSLSimpleProgram(shaderProgram, vertShader, fragShader);
-        return res;
-    }
-
-    public void release(GL2ES2 gl) {
-        gl.glUseProgram(0);
-        gl.glDetachShader(shaderProgram, vertShader);
-        gl.glDeleteShader(vertShader);
-        gl.glDetachShader(shaderProgram, fragShader);
-        gl.glDeleteShader(fragShader);
-        gl.glDeleteProgram(shaderProgram);
-    }
-
-    public int getFragShader() {
-        return fragShader;
-    }
-
-    public int getShaderProgram() {
-        return shaderProgram;
-    }
-
-    public int getVertShader() {
-        return vertShader;
-    }
-}
diff --git a/src/junit/com/jogamp/test/junit/util/MiscUtils.java b/src/junit/com/jogamp/test/junit/util/MiscUtils.java
deleted file mode 100644
index bb2abcd..0000000
--- a/src/junit/com/jogamp/test/junit/util/MiscUtils.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-
-package com.jogamp.test.junit.util;
-
-import java.lang.reflect.*;
-
-public class MiscUtils {
-    public static int atoi(String str, int def) {
-        try {
-            return Integer.parseInt(str);
-        } catch (Exception ex) {
-            ex.printStackTrace();
-        }
-        return def;
-    }
-
-    public static boolean setFieldIfExists(Object instance, String fieldName, Object value) {
-        try {
-            Field f = instance.getClass().getField(fieldName);
-            if(value instanceof Boolean || f.getType().isInstance(value)) {
-                f.set(instance, value);
-                return true;
-            } else {
-                System.out.println(instance.getClass()+" '"+fieldName+"' field not assignable with "+value.getClass()+", it's a: "+f.getType());
-            }
-        } catch (IllegalAccessException ex) {
-            throw new RuntimeException(ex);
-        } catch (NoSuchFieldException nsfe) {
-            // OK - throw new RuntimeException(instance.getClass()+" has no '"+fieldName+"' field", nsfe);
-        }
-        return false;
-    }
-}
-
-
-
diff --git a/src/junit/com/jogamp/test/junit/util/NEWTFocusAdapter.java b/src/junit/com/jogamp/test/junit/util/NEWTFocusAdapter.java
deleted file mode 100644
index 5cbd9fd..0000000
--- a/src/junit/com/jogamp/test/junit/util/NEWTFocusAdapter.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-import com.jogamp.newt.event.WindowAdapter;
-import com.jogamp.newt.event.WindowEvent;
-
-public class NEWTFocusAdapter extends WindowAdapter implements EventCountAdapter {
-
-    String prefix;
-    int focusGained;
-
-    public NEWTFocusAdapter(String prefix) {
-        this.prefix = prefix;
-        reset();
-    }
-
-    public int getCount() {
-        return focusGained;
-    }
-
-    public void reset() {
-        focusGained = 0;
-    }
-
-    @Override
-    public void windowGainedFocus(WindowEvent e) {
-        ++focusGained;
-        System.err.println("FOCUS NEWT GAINED ["+focusGained+"]: "+prefix+", "+e);
-    }
-
-    @Override
-    public void windowLostFocus(WindowEvent e) {
-        --focusGained;
-        System.err.println("FOCUS NEWT LOST   ["+focusGained+"]: "+prefix+", "+e);
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/util/NEWTKeyAdapter.java b/src/junit/com/jogamp/test/junit/util/NEWTKeyAdapter.java
deleted file mode 100644
index 73caa18..0000000
--- a/src/junit/com/jogamp/test/junit/util/NEWTKeyAdapter.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-import com.jogamp.newt.event.KeyAdapter;
-import com.jogamp.newt.event.KeyEvent;
-
-public class NEWTKeyAdapter extends KeyAdapter implements EventCountAdapter {
-
-    String prefix;
-    int keyTyped;
-
-    public NEWTKeyAdapter(String prefix) {
-        this.prefix = prefix;
-        reset();
-    }
-
-    public int getCount() {
-        return keyTyped;
-    }
-
-    public void reset() {
-        keyTyped = 0;
-    }
-
-    @Override
-    public void keyTyped(KeyEvent e) {
-        ++keyTyped;
-        System.err.println("KEY NEWT TYPED ["+keyTyped+"]: "+prefix+", "+e);
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/util/NEWTMouseAdapter.java b/src/junit/com/jogamp/test/junit/util/NEWTMouseAdapter.java
deleted file mode 100644
index fc5c653..0000000
--- a/src/junit/com/jogamp/test/junit/util/NEWTMouseAdapter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-import com.jogamp.newt.event.MouseAdapter;
-import com.jogamp.newt.event.MouseEvent;
-
-public class NEWTMouseAdapter extends MouseAdapter implements EventCountAdapter {
-
-    String prefix;
-    int mouseClicked;
-
-    public NEWTMouseAdapter(String prefix) {
-        this.prefix = prefix;
-        reset();
-    }
-
-    public int getCount() {
-        return mouseClicked;
-    }
-
-    public void reset() {
-        mouseClicked = 0;
-    }
-
-    public void mouseClicked(MouseEvent e) {
-        mouseClicked+=e.getClickCount();
-        System.err.println("MOUSE NEWT CLICKED ["+mouseClicked+"]: "+prefix+", "+e);
-    }
-}
-
diff --git a/src/junit/com/jogamp/test/junit/util/QuitAdapter.java b/src/junit/com/jogamp/test/junit/util/QuitAdapter.java
deleted file mode 100644
index 2581325..0000000
--- a/src/junit/com/jogamp/test/junit/util/QuitAdapter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.newt.event.*;
-
-public class QuitAdapter extends WindowAdapter implements WindowListener, KeyListener {
-    boolean shouldQuit = false;
-
-    public boolean shouldQuit() { return shouldQuit; }
-
-    public void windowDestroyNotify(WindowEvent e) {
-        System.out.println("QUIT Window "+Thread.currentThread());
-        shouldQuit = true;
-    }
-
-    public void keyTyped(KeyEvent e) {
-        if(e.getKeyChar()=='q') {
-            System.out.println("QUIT Key "+Thread.currentThread());
-            shouldQuit = true;
-        }
-    }
-    public void keyPressed(KeyEvent e) {}
-    public void keyReleased(KeyEvent e) {}
-}
-
diff --git a/src/junit/com/jogamp/test/junit/util/SingletonInstance.java b/src/junit/com/jogamp/test/junit/util/SingletonInstance.java
deleted file mode 100644
index 997742c..0000000
--- a/src/junit/com/jogamp/test/junit/util/SingletonInstance.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.nio.channels.FileLock;
-
-public class SingletonInstance {
-
-    static final boolean DEBUG = true;
-    static final String temp_file_path;
-
-    static {
-        String s = null;
-        try {
-            File tmpFile = File.createTempFile("TEST", "tst");
-            String absTmpFile = tmpFile.getCanonicalPath();
-            tmpFile.delete();
-            s = absTmpFile.substring(0, absTmpFile.lastIndexOf(File.separator));
-        } catch (IOException ex) {
-            ex.printStackTrace();
-        }
-        temp_file_path = s;
-    }
-
-    public static String getCanonicalTempPath() {
-        return temp_file_path;
-    }
-
-    public static String getCanonicalTempLockFilePath(String basename) {
-        return getCanonicalTempPath() + File.separator + basename;
-    }
-
-    public SingletonInstance(String lockFileBasename) {
-        this.file = new File ( getCanonicalTempLockFilePath ( lockFileBasename ) );
-    }
-
-    public SingletonInstance(File lockFile) {
-        this.file = lockFile ;
-    }
-
-    public synchronized void lock(long timeout_ms, long poll_ms) {
-        long i=0;
-        try {
-            do {
-                if(tryLock()) {
-                    return;
-                }
-                if(DEBUG && 0==i) {
-                    System.err.println("Wait for lock " + file);
-                }
-                i++;
-                Thread.sleep(poll_ms);
-            } while ( i < timeout_ms / poll_ms ) ;
-        } catch ( InterruptedException ie ) {
-            throw new  RuntimeException(ie);
-        }
-        throw new RuntimeException("SingletonInstance couldn't get lock within "+timeout_ms+"ms");
-    }
-
-    public synchronized boolean tryLock() {
-        try {
-            randomAccessFile = new RandomAccessFile(file, "rw");
-            fileLock = randomAccessFile.getChannel().tryLock();
-
-            if (fileLock != null) {
-                //final File f_file = file;
-                //final RandomAccessFile f_randomAccessFile = randomAccessFile;
-                //final FileLock f_fileLock = fileLock;
-                Runtime.getRuntime().addShutdownHook(new Thread() {
-                    public void run() {
-                        unlock();
-                    }
-                });
-                locked = true;
-                if(DEBUG) {
-                    System.err.println("Locked " + file);
-                }
-                return true;
-            }
-        } catch (Exception e) {
-            System.err.println("Unable to create and/or lock file: " + file);
-            e.printStackTrace();
-        }
-        return false;
-    }
-
-    public synchronized boolean unlock() {
-        if(locked) {
-            try {
-                fileLock.release();
-                randomAccessFile.close();
-                file.delete();
-                return true;
-            } catch (Exception e) {
-                System.err.println("Unable to remove lock file: " + file);
-                e.printStackTrace();
-            } finally {
-                fileLock = null;
-                randomAccessFile = null;
-                locked = false;
-            }
-        }
-        return false;
-    }
-
-    public synchronized boolean isLocked() {
-        return locked;
-    }
-
-    File file = null;
-    RandomAccessFile randomAccessFile = null;
-    FileLock fileLock = null;
-    boolean locked = false;
-}
diff --git a/src/junit/com/jogamp/test/junit/util/UITestCase.java b/src/junit/com/jogamp/test/junit/util/UITestCase.java
deleted file mode 100644
index 8baa716..0000000
--- a/src/junit/com/jogamp/test/junit/util/UITestCase.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.test.junit.util;
-
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-
-
-public abstract class UITestCase {
-
-    public static final String SINGLE_INSTANCE_LOCK_FILE = "UITestCase.lock";
-
-    static SingletonInstance singletonInstance;
-
-    protected SingletonInstance getSingletonInstance() {
-        return singletonInstance;
-    }
-
-    @BeforeClass
-    public static void oneTimeSetUp() {
-        // one-time initialization code        
-        singletonInstance = new SingletonInstance(SINGLE_INSTANCE_LOCK_FILE);
-        singletonInstance.lock(3*60*1000, 100); // wait up to 3 min, poll every 100ms
-    }
-
-    @AfterClass
-    public static void oneTimeTearDown() {
-        // one-time cleanup code
-        System.gc(); // force cleanup
-        singletonInstance.unlock();
-    }
-
-    @Before
-    public void setUp() {
-        System.err.println("++++ UITestCase.setUp: "+getClass().getName());
-    }
-
-    @After
-    public void tearDown() {
-        System.err.println("++++ UITestCase.tearDown: "+getClass().getName());
-    }
-
-}
-
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
index 6f4c758..38bd70a 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
@@ -28,6 +28,7 @@
  
 package com.jogamp.nativewindow;
 
+import com.jogamp.common.GlueGenVersion;
 import com.jogamp.common.util.JogampVersion;
 import com.jogamp.common.util.VersionUtil;
 import java.util.jar.Manifest;
@@ -41,7 +42,7 @@ public class NativeWindowVersion extends JogampVersion {
     }
 
     public static NativeWindowVersion getInstance() {
-        if(null == jogampCommonVersionInfo) {
+        if(null == jogampCommonVersionInfo) { // volatile: ok
             synchronized(NativeWindowVersion.class) {
                 if( null == jogampCommonVersionInfo ) {
                     final String packageName = "javax.media.nativewindow";
@@ -55,6 +56,7 @@ public class NativeWindowVersion extends JogampVersion {
 
     public static void main(String args[]) {
         System.err.println(VersionUtil.getPlatformInfo());
+        System.err.println(GlueGenVersion.getInstance());
         System.err.println(NativeWindowVersion.getInstance());
     }
 }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/Debug.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/Debug.java
deleted file mode 100644
index edb6823..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/Debug.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.nativewindow.impl;
-
-import java.security.*;
-
-/** Helper routines for logging and debugging. */
-
-public class Debug {
-  // Some common properties
-  private static boolean verbose;
-  private static boolean debugAll;
-  private static AccessControlContext localACC;
-  
-  static {
-    localACC=AccessController.getContext();
-    verbose = isPropertyDefined("nativewindow.verbose", true);
-    debugAll = isPropertyDefined("nativewindow.debug", true);
-    if (verbose) {
-       Package p = Package.getPackage("javax.media.nativewindow");
-       System.err.println("NativeWindow specification version " + p.getSpecificationVersion());
-       System.err.println("NativeWindow implementation version " + p.getImplementationVersion());
-       System.err.println("NativeWindow implementation vendor " + p.getImplementationVendor());
-    }
-  }
-
-  static int getIntProperty(final String property, final boolean jnlpAlias) {
-      return getIntProperty(property, jnlpAlias, localACC);
-  }
-
-  public static int getIntProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    int i=0;
-    try {
-        Integer iv = Integer.valueOf(Debug.getProperty(property, jnlpAlias, acc));
-        i = iv.intValue();
-    } catch (NumberFormatException nfe) {}
-    return i;
-  }
-
-  static boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
-    return getBooleanProperty(property, jnlpAlias, localACC);
-  }
-
-  public static boolean getBooleanProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    Boolean b = Boolean.valueOf(Debug.getProperty(property, jnlpAlias, acc));
-    return b.booleanValue();
-  }
-
-  static boolean isPropertyDefined(final String property, final boolean jnlpAlias) {
-    return isPropertyDefined(property, jnlpAlias, localACC);
-  }
-
-  public static boolean isPropertyDefined(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    return (Debug.getProperty(property, jnlpAlias, acc) != null) ? true : false;
-  }
-
-  static String getProperty(final String property, final boolean jnlpAlias) {
-    return getProperty(property, jnlpAlias, localACC);
-  }
-
-  public static String getProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    String s=null;
-    if(null!=acc && acc.equals(localACC)) {
-        s = (String) AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() {
-              String val=null;
-              try {
-                  val = System.getProperty(property);
-              } catch (Exception e) {}
-              if(null==val && jnlpAlias && !property.startsWith(jnlp_prefix)) {
-                  try {
-                      val = System.getProperty(jnlp_prefix + property);
-                  } catch (Exception e) {}
-              }
-              return val;
-            }
-          });
-    } else {
-        try {
-            s = System.getProperty(property);
-        } catch (Exception e) {}
-        if(null==s && jnlpAlias && !property.startsWith(jnlp_prefix)) {
-            try {
-                s = System.getProperty(jnlp_prefix + property);
-            } catch (Exception e) {}
-        }
-    }
-    return s;
-  }
-  public static final String jnlp_prefix = "jnlp." ;
-
-  public static boolean verbose() {
-    return verbose;
-  }
-
-  public static boolean debugAll() {
-    return debugAll;
-  }
-
-  public static boolean debug(String subcomponent) {
-    return debugAll() || isPropertyDefined("nativewindow.debug." + subcomponent, true);
-  }
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/GraphicsConfigurationFactoryImpl.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/GraphicsConfigurationFactoryImpl.java
deleted file mode 100644
index c53f4c8..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/GraphicsConfigurationFactoryImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.nativewindow.impl;
-
-import javax.media.nativewindow.*;
-
-public class GraphicsConfigurationFactoryImpl extends GraphicsConfigurationFactory {
-    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen) {
-        return new DefaultGraphicsConfiguration(screen, capsChosen, capsRequested);
-    }
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/NWJNILibLoader.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/NWJNILibLoader.java
deleted file mode 100644
index 3b2a728..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/NWJNILibLoader.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-
-package com.jogamp.nativewindow.impl;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import com.jogamp.common.jvm.JNILibLoaderBase;
-
-public class NWJNILibLoader extends JNILibLoaderBase {
-  
-  public static void loadNativeWindow(final String ossuffix) {
-    AccessController.doPrivileged(new PrivilegedAction() {
-      public Object run() {
-        loadLibrary("nativewindow_"+ossuffix, null, false);
-        return null;
-      }
-    });
-  }
-
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/NativeWindowFactoryImpl.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/NativeWindowFactoryImpl.java
deleted file mode 100644
index 34f5d62..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/NativeWindowFactoryImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.nativewindow.impl;
-
-import com.jogamp.common.util.*;
-import java.lang.reflect.*;
-import java.security.*;
-
-import javax.media.nativewindow.*;
-
-public class NativeWindowFactoryImpl extends NativeWindowFactory {
-    protected static final boolean DEBUG = Debug.debug("NativeWindow");
-
-    private static final ToolkitLock nullToolkitLock = new NullToolkitLock();
-
-    public static ToolkitLock getNullToolkitLock() {
-            return nullToolkitLock;
-    }
-
-    // This subclass of NativeWindowFactory handles the case of
-    // NativeWindows being passed in
-    protected NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException {
-        if (null == winObj) {
-            throw new IllegalArgumentException("winObj is null");
-        }
-        if (winObj instanceof NativeWindow) {
-            // Use the NativeWindow directly
-            return (NativeWindow) winObj;
-        }
-
-        if (null == config) {
-            throw new IllegalArgumentException("AbstractGraphicsConfiguration is null with a non NativeWindow object");
-        }
-
-        if (NativeWindowFactory.isAWTAvailable() && ReflectionUtil.instanceOf(winObj, AWTComponentClassName)) {
-            return getAWTNativeWindow(winObj, config);
-        }
-
-        throw new IllegalArgumentException("Target window object type " +
-                                           winObj.getClass().getName() + " is unsupported; expected " +
-                                           "javax.media.nativewindow.NativeWindow or "+AWTComponentClassName);
-    }
-    
-    private Constructor nativeWindowConstructor = null;
-
-    private NativeWindow getAWTNativeWindow(Object winObj, AbstractGraphicsConfiguration config) {
-        if (nativeWindowConstructor == null) {
-            try {
-                String osType = getNativeWindowType(true);
-                String windowClassName = null;
-
-                // We break compile-time dependencies on the AWT here to
-                // make it easier to run this code on mobile devices
-
-                if (osType.equals(TYPE_WINDOWS)) {
-                    windowClassName = "com.jogamp.nativewindow.impl.jawt.windows.WindowsJAWTWindow";
-                } else if (osType.equals(TYPE_MACOSX)) {
-                    windowClassName = "com.jogamp.nativewindow.impl.jawt.macosx.MacOSXJAWTWindow";
-                } else if (osType.equals(TYPE_X11)) {
-                    // Assume Linux, Solaris, etc. Should probably test for these explicitly.
-                    windowClassName = "com.jogamp.nativewindow.impl.jawt.x11.X11JAWTWindow";
-                } else {
-                    throw new IllegalArgumentException("OS " + getNativeOSName(false) + " not yet supported");
-                }
-
-                nativeWindowConstructor = ReflectionUtil.getConstructor(
-                                            windowClassName, new Class[] { Object.class, AbstractGraphicsConfiguration.class }, 
-                                            getClass().getClassLoader());
-            } catch (Exception e) {
-                throw (IllegalArgumentException) new IllegalArgumentException().initCause(e);
-            }
-        }
-
-        try {
-            return (NativeWindow) nativeWindowConstructor.newInstance(new Object[] { winObj, config });
-        } catch (Exception ie) {
-            throw (IllegalArgumentException) new IllegalArgumentException().initCause(ie);
-        }
-    }
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/NullToolkitLock.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/NullToolkitLock.java
deleted file mode 100644
index db4db11..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/NullToolkitLock.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.nativewindow.impl;
-
-import javax.media.nativewindow.ToolkitLock;
-
-/**
- * Implementing a singleton global recursive {@link javax.media.nativewindow.ToolkitLock}
- * without any locking. Since there is no locking it all,
- * it is intrinsically recursive.
- */
-public class NullToolkitLock implements ToolkitLock {
-
-    /** Singleton via {@link NativeWindowFactoryImpl#getNullToolkitLock()} */
-    protected NullToolkitLock() { }
-    
-    public final void lock() {
-        if(TRACE_LOCK) {
-            String msg = "NullToolkitLock.lock()";
-            System.err.println(msg);
-            // Throwable t = new Throwable(msg);
-            // t.printStackTrace();
-        }
-    }
-
-    public final void unlock() {
-        if(TRACE_LOCK) { System.err.println("NullToolkitLock.unlock()"); }
-    }
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/ProxySurface.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/ProxySurface.java
deleted file mode 100644
index de766ac..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/ProxySurface.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.nativewindow.impl;
-
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.NativeWindow;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.SurfaceChangeable;
-
-import com.jogamp.common.util.locks.RecursiveLock;
-
-public class ProxySurface implements NativeSurface, SurfaceChangeable {
-  private RecursiveLock recurLock = new RecursiveLock();
-  protected int width, height, scrnIndex;
-  protected long surfaceHandle, displayHandle;
-  protected AbstractGraphicsConfiguration config;
-
-  public ProxySurface(AbstractGraphicsConfiguration cfg) {
-    invalidate();
-    config = cfg;
-    displayHandle=cfg.getScreen().getDevice().getHandle();
-    scrnIndex=cfg.getScreen().getIndex();
-  }
-
-  protected void init(Object windowObject) throws NativeWindowException {
-  }
-
-  protected void initNative() throws NativeWindowException {
-  }
-
-  public NativeWindow getParent() {
-    return null;
-  }
-
-  public void destroy() {
-    invalidate();
-  }
-
-  public synchronized void invalidate() {
-    displayHandle=0;
-    scrnIndex=-1;
-    surfaceHandle=0;
-  }
-
-  public final int lockSurface() throws NativeWindowException {
-    recurLock.lock();
-
-    if(recurLock.getRecursionCount() == 0) {
-        config.getScreen().getDevice().lock();
-    }
-    return LOCK_SUCCESS;
-  }
-
-  public final void unlockSurface() {
-    recurLock.validateLocked();
-
-    if(recurLock.getRecursionCount()==0) {
-        config.getScreen().getDevice().unlock();
-    }
-    recurLock.unlock();
-  }
-
-  public final boolean isSurfaceLockedByOtherThread() {
-    return recurLock.isLockedByOtherThread();
-  }
-
-  public final boolean isSurfaceLocked() {
-    return recurLock.isLocked();
-  }
-
-  public final Thread getSurfaceLockOwner() {
-    return recurLock.getOwner();
-  }
-
-  public boolean surfaceSwap() {
-    return false;
-  }
-
-  public long getSurfaceHandle() {
-    return surfaceHandle;
-  }
-
-  public int getWidth() {
-    return width;
-  }
-
-  public int getHeight() {
-    return height;
-  }
-
-  public AbstractGraphicsConfiguration getGraphicsConfiguration() {
-    return config;
-  }
-
-  public void surfaceUpdated(Object updater, NativeSurface ns, long when) { }
-
-  public long getDisplayHandle() {
-    return displayHandle;
-  }
-  public int getScreenIndex() {
-    return scrnIndex;
-  }
-  
-  public void setSurfaceHandle(long surfaceHandle) {
-    this.surfaceHandle=surfaceHandle;
-  }
-
-  public void setSize(int width, int height) {
-    this.width=width;
-    this.height=height;
-  }
-
-  public String toString() {
-    return "ProxySurface[config "+config+
-                ", displayHandle 0x"+Long.toHexString(getDisplayHandle())+
-                ", surfaceHandle 0x"+Long.toHexString(getSurfaceHandle())+
-                ", size "+getWidth()+"x"+getHeight()+"]";
-  }
-
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTJNILibLoader.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTJNILibLoader.java
deleted file mode 100644
index 4ea404c..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTJNILibLoader.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.nativewindow.impl.jawt;
-
-import javax.media.nativewindow.NativeWindowFactory;
-import com.jogamp.nativewindow.impl.NWJNILibLoader;
-
-import java.awt.Toolkit;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-public class JAWTJNILibLoader extends NWJNILibLoader {
-  public static void loadAWTImpl() {
-    AccessController.doPrivileged(new PrivilegedAction() {
-      public Object run() {
-        // Make sure that awt.dll is loaded before loading jawt.dll. Otherwise
-        // a Dialog with "awt.dll not found" might pop up.
-        // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4481947.
-        Toolkit.getDefaultToolkit();
-        
-        // Must pre-load JAWT on all non-Mac platforms to
-        // ensure references from jogl_awt shared object
-        // will succeed since JAWT shared object isn't in
-        // default library path
-        if ( ! NativeWindowFactory.TYPE_MACOSX.equals( NativeWindowFactory.getNativeWindowType(false) ) ) {
-            try {
-                loadLibrary("jawt", null, true);
-            } catch (Throwable t) {
-                // It might be ok .. if it's already loaded
-                if(DEBUG) {
-                    t.printStackTrace();
-                }
-            }
-        }
-        return null;
-      }
-    });
-  }
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTToolkitLock.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTToolkitLock.java
deleted file mode 100644
index 017d748..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTToolkitLock.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.nativewindow.impl.jawt;
-
-import javax.media.nativewindow.ToolkitLock;
-
-/**
- * Implementing a singleton global recursive {@link javax.media.nativewindow.ToolkitLock}
- * utilizing JAWT's AWT lock via {@link JAWTUtil#lockToolkit()}.
- * <br>
- * This strategy should only be used if AWT is using the underlying native windowing toolkit
- * in a not intrinsic thread safe manner, e.g. under X11 where no XInitThreads() call
- * is issued before any other X11 usage. This is the current situation for e.g. Webstart or Applets.
- */
-public class JAWTToolkitLock implements ToolkitLock {
-
-    /** Singleton via {@link JAWTUtil#getJAWTToolkitLock()} */
-    protected JAWTToolkitLock() {}
-
-    public final void lock() {
-        if(TRACE_LOCK) { System.err.println("JAWTToolkitLock.lock()"); }
-        JAWTUtil.lockToolkit();
-    }
-
-    public final void unlock() {
-        if(TRACE_LOCK) { System.err.println("JAWTToolkitLock.unlock()"); }
-        JAWTUtil.unlockToolkit();
-    }
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTUtil.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTUtil.java
deleted file mode 100644
index 9f120e9..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTUtil.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.nativewindow.impl.jawt;
-
-import com.jogamp.nativewindow.impl.*;
-
-import javax.media.nativewindow.*;
-
-
-import java.awt.GraphicsEnvironment;
-import java.lang.reflect.*;
-import java.security.*;
-
-public class JAWTUtil {
-  protected static final boolean DEBUG = Debug.debug("JAWT");
-
-  // See whether we're running in headless mode
-  private static final boolean headlessMode;
-
-  // Java2D magic ..
-  private static final Method isQueueFlusherThread;
-  private static final boolean j2dExist;
-
-  private static Class   sunToolkitClass;
-  private static Method  sunToolkitAWTLockMethod;
-  private static Method  sunToolkitAWTUnlockMethod;
-  private static boolean hasSunToolkitAWTLock;
-
-  private static final JAWTToolkitLock jawtToolkitLock;
-
-  static {
-    JAWTJNILibLoader.loadAWTImpl();
-    JAWTJNILibLoader.loadNativeWindow("awt");
-
-    headlessMode = GraphicsEnvironment.isHeadless();
-
-    boolean ok = false;
-    Class jC = null;
-    Method m = null;
-    if (!headlessMode) {
-        try {
-            jC = Class.forName("com.jogamp.opengl.impl.awt.Java2D");
-            m = jC.getMethod("isQueueFlusherThread", null);
-            ok = true;
-        } catch (Exception e) {
-        }
-    }
-    isQueueFlusherThread = m;
-    j2dExist = ok;
-
-    AccessController.doPrivileged(new PrivilegedAction() {
-        public Object run() {
-            try {
-                sunToolkitClass = Class.forName("sun.awt.SunToolkit");
-                sunToolkitAWTLockMethod = sunToolkitClass.getDeclaredMethod("awtLock", new Class[]{});
-                sunToolkitAWTLockMethod.setAccessible(true);
-                sunToolkitAWTUnlockMethod = sunToolkitClass.getDeclaredMethod("awtUnlock", new Class[]{});
-                sunToolkitAWTUnlockMethod.setAccessible(true);
-            } catch (Exception e) {
-                // Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
-            }
-            return null;
-        }
-    });
-    boolean _hasSunToolkitAWTLock = false;
-    if (null != sunToolkitAWTLockMethod && null != sunToolkitAWTUnlockMethod) {
-        try {
-            sunToolkitAWTLockMethod.invoke(null, null);
-            sunToolkitAWTUnlockMethod.invoke(null, null);
-            _hasSunToolkitAWTLock = true;
-        } catch (Exception e) {
-        }
-    }
-    hasSunToolkitAWTLock = _hasSunToolkitAWTLock;
-    // hasSunToolkitAWTLock = false;
-
-    jawtToolkitLock = new JAWTToolkitLock();
-
-    if (DEBUG) {
-        System.err.println("JAWTUtil: Has sun.awt.SunToolkit.awtLock/awtUnlock " + hasSunToolkitAWTLock);
-        System.err.println("JAWTUtil: Has Java2D " + j2dExist);
-        System.err.println("JAWTUtil: Is headless " + headlessMode);
-    }
-  }
-
-  public static void initSingleton() {
-      // just exist to ensure static init has been run
-  }
-
-
-  public static final boolean hasJava2D() {
-    return j2dExist;
-  }
-
-  public static final boolean isJava2DQueueFlusherThread() {
-    boolean b = false;
-    if(j2dExist) {
-        try {
-            b = ((Boolean)isQueueFlusherThread.invoke(null, null)).booleanValue();
-        } catch (Exception e) {}
-    }
-    return b;
-  }
-
-  public static boolean isHeadlessMode() {
-    return headlessMode;
-  }
-
-  /**
-   * Locks the AWT's global ReentrantLock.<br>
-   *
-   * JAWT's native Lock() function calls SunToolkit.awtLock(),
-   * which just uses AWT's global ReentrantLock.<br>
-   */
-  public static void awtLock() {
-    if(hasSunToolkitAWTLock) {
-        try {
-            sunToolkitAWTLockMethod.invoke(null, null);
-        } catch (Exception e) {
-          throw new NativeWindowException("SunToolkit.awtLock failed", e);
-        }
-    } else {
-        JAWT.getJAWT().Lock();
-    }
-  }
-
-  /**
-   * Unlocks the AWT's global ReentrantLock.<br>
-   *
-   * JAWT's native Unlock() function calls SunToolkit.awtUnlock(),
-   * which just uses AWT's global ReentrantLock.<br>
-   */
-  public static void awtUnlock() {
-    if(hasSunToolkitAWTLock) {
-        try {
-            sunToolkitAWTUnlockMethod.invoke(null, null);
-        } catch (Exception e) {
-          throw new NativeWindowException("SunToolkit.awtUnlock failed", e);
-        }
-    } else {
-        JAWT.getJAWT().Unlock();
-    }
-  }
-
-  public static void lockToolkit() throws NativeWindowException {
-    if(!headlessMode && !isJava2DQueueFlusherThread()) {
-        awtLock();
-    }
-  }
-
-  public static void unlockToolkit() {
-    if(!headlessMode && !isJava2DQueueFlusherThread()) {
-        awtUnlock();
-    }
-  }
-
-  public static JAWTToolkitLock getJAWTToolkitLock() {
-    return jawtToolkitLock;
-  }
-}
-
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTWindow.java
deleted file mode 100644
index de63602..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTWindow.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.nativewindow.impl.jawt;
-
-import com.jogamp.common.util.locks.RecursiveLock;
-
-import java.awt.Component;
-import java.awt.Window;
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.NativeWindow;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.util.Point;
-import javax.media.nativewindow.util.Rectangle;
-
-public abstract class JAWTWindow implements NativeWindow {
-  protected static final boolean DEBUG = JAWTUtil.DEBUG;
-
-  // lifetime: forever
-  protected Component component;
-  protected AbstractGraphicsConfiguration config;
-
-  // lifetime: valid after lock, forever until invalidate
-  protected long drawable;
-  protected Rectangle bounds;
-
-  public JAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
-    if (config == null) {
-        throw new NativeWindowException("Error: AbstractGraphicsConfiguration is null");
-    }
-    this.config = config;
-    init((Component)comp);
-  }
-
-  private final void init(Component windowObject) throws NativeWindowException {
-    invalidate();
-    this.component = windowObject;
-    validateNative();
-  }
-  protected abstract void validateNative() throws NativeWindowException;
-
-  protected synchronized void invalidate() {
-    component = null;
-    drawable= 0;
-    bounds = new Rectangle();
-  }
-
-  protected final void updateBounds(JAWT_Rectangle jawtBounds) {
-    bounds.setX(jawtBounds.getX());
-    bounds.setY(jawtBounds.getY());
-    bounds.setWidth(jawtBounds.getWidth());
-    bounds.setHeight(jawtBounds.getHeight());
-  }
-
-  /** @return the JAWT_DrawingSurfaceInfo's (JAWT_Rectangle) bounds, updated with lock */
-  public final Rectangle getBounds() { return bounds; }
-
-  public final Component getAWTComponent() {
-    return component;
-  }
-
-  //
-  // SurfaceUpdateListener
-  //
-
-  public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
-      // nop
-  }
-  
-  //
-  // NativeSurface
-  //
-
-  private RecursiveLock recurLock = new RecursiveLock();
-
-  protected abstract int lockSurfaceImpl() throws NativeWindowException;
-
-  public final int lockSurface() throws NativeWindowException {
-    int res = LOCK_SURFACE_NOT_READY;
-
-    recurLock.lock();
-
-    if(recurLock.getRecursionCount() == 0) {
-        config.getScreen().getDevice().lock();
-        try {
-            res = lockSurfaceImpl();
-        } finally {
-            // Unlock in case surface couldn't be locked
-            if(LOCK_SURFACE_NOT_READY >= res ) {
-                config.getScreen().getDevice().unlock();
-                recurLock.unlock();
-            }
-        }
-    } else {
-        res = LOCK_SUCCESS;
-    }
-
-    return res;
-  }
-
-  protected abstract void unlockSurfaceImpl() throws NativeWindowException;
-
-  public final void unlockSurface() {
-    recurLock.validateLocked();
-
-    if(recurLock.getRecursionCount()==0) {
-        try {
-            unlockSurfaceImpl();
-        } finally {
-            config.getScreen().getDevice().unlock();
-        }
-    }
-    recurLock.unlock();
-  }
-
-  public final boolean isSurfaceLockedByOtherThread() {
-    return recurLock.isLockedByOtherThread();
-  }
-
-  public final boolean isSurfaceLocked() {
-    return recurLock.isLocked();
-  }
-
-  public final Thread getSurfaceLockOwner() {
-    return recurLock.getOwner();
-  }
-
-  public final boolean surfaceSwap() {
-    return false;
-  }
-
-  public final void surfaceUpdated(Object updater, NativeWindow window, long when) { }
-
-  public final long getSurfaceHandle() {
-    return drawable;
-  }
-  public final AbstractGraphicsConfiguration getGraphicsConfiguration() {
-    return config;
-  }
-
-  public final long getDisplayHandle() {
-    return config.getScreen().getDevice().getHandle();
-  }
-
-  public final int getScreenIndex() {
-    return config.getScreen().getIndex();
-  }
-
-  public final void setSize(int width, int height) {
-    component.setSize(width, height);
-  }
-
-  public final int getWidth() {
-    return component.getWidth();
-  }
-
-  public final int getHeight() {
-    return component.getHeight();
-  }
-
-  //
-  // NativeWindow
-  //
-
-  public synchronized void destroy() {
-    if(null!=component) {
-        if(component instanceof Window) {
-            ((Window)component).dispose();
-        }
-    }
-    invalidate();
-  }
-
-  public final NativeWindow getParent() {
-      return null;
-  }
-
-  public long getWindowHandle() {
-    return drawable;
-  }
-
-  public final int getX() {
-      return component.getX();
-  }
-
-  public final int getY() {
-      return component.getY();
-  }
-
-  public Point getLocationOnScreen(Point storage) {
-        if( 0 != getWindowHandle() ) {
-            Point d;
-            // windowLock.lock();
-            try {
-                d = getLocationOnScreenImpl(0, 0);
-            } finally {
-                // windowLock.unlock();
-            }
-            if(null!=d) {
-                if(null!=storage) {
-                    storage.translate(d.getX(),d.getY());
-                    return storage;
-                }
-                return d;
-            }
-            // fall through intended ..
-        }
-
-        if(!Thread.holdsLock(component.getTreeLock())) {
-            return null; // avoid deadlock ..
-        }
-        java.awt.Point awtLOS = component.getLocationOnScreen();
-        int dx = (int) ( awtLOS.getX() + .5 ) ;
-        int dy = (int) ( awtLOS.getY() + .5 ) ;
-        if(null!=storage) {
-            return storage.translate(dx, dy);
-        }
-        return new Point(dx, dy);
-  }
-  protected abstract Point getLocationOnScreenImpl(int x, int y);
-
-  public String toString() {
-    StringBuffer sb = new StringBuffer();
-
-    sb.append("JAWT-Window["+
-                "windowHandle 0x"+Long.toHexString(getWindowHandle())+
-                ", surfaceHandle 0x"+Long.toHexString(getSurfaceHandle())+
-                ", bounds "+bounds);
-    if(null!=component) {
-      sb.append(", pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+
-                ", visible "+component.isVisible());
-    } else {
-      sb.append(", component NULL");
-    }
-    sb.append(", lockedExt "+isSurfaceLockedByOtherThread()+
-              ",\n\tconfig "+config+
-              ",\n\tawtComponent "+getAWTComponent()+"]");
-
-    return sb.toString();
-  }
-
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWT_PlatformInfo.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWT_PlatformInfo.java
deleted file mode 100644
index d49e2f8..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWT_PlatformInfo.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.nativewindow.impl.jawt;
-
-import com.jogamp.nativewindow.impl.*;
-
-/** Marker class for all window system-specific JAWT data structures. */
-
-public interface JAWT_PlatformInfo {
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java
deleted file mode 100644
index fc56077..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.nativewindow.impl.jawt.macosx;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.NativeWindow;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.util.Point;
-
-import com.jogamp.nativewindow.impl.jawt.JAWT;
-import com.jogamp.nativewindow.impl.jawt.JAWTFactory;
-import com.jogamp.nativewindow.impl.jawt.JAWTWindow;
-import com.jogamp.nativewindow.impl.jawt.JAWT_DrawingSurface;
-import com.jogamp.nativewindow.impl.jawt.JAWT_DrawingSurfaceInfo;
-
-public class MacOSXJAWTWindow extends JAWTWindow {
-
-  public MacOSXJAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
-    super(comp, config);
-  }
-
-  protected void validateNative() throws NativeWindowException {
-  }
-
-  protected int lockSurfaceImpl() throws NativeWindowException {
-    int ret = NativeWindow.LOCK_SUCCESS;
-    ds = JAWT.getJAWT().GetDrawingSurface(component);
-    if (ds == null) {
-      // Widget not yet realized
-      unlockSurfaceImpl();
-      return NativeWindow.LOCK_SURFACE_NOT_READY;
-    }
-    int res = ds.Lock();
-    dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
-    if (!dsLocked) {
-      unlockSurfaceImpl();
-      throw new NativeWindowException("Unable to lock surface");
-    }
-    // See whether the surface changed and if so destroy the old
-    // OpenGL context so it will be recreated (NOTE: removeNotify
-    // should handle this case, but it may be possible that race
-    // conditions can cause this code to be triggered -- should test
-    // more)
-    if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
-      ret = NativeWindow.LOCK_SURFACE_CHANGED;
-    }
-    if (firstLock) {
-      AccessController.doPrivileged(new PrivilegedAction() {
-          public Object run() {
-            dsi = ds.GetDrawingSurfaceInfo();
-            return null;
-          }
-        });
-    } else {
-      dsi = ds.GetDrawingSurfaceInfo();
-    }
-    if (dsi == null) {
-      unlockSurfaceImpl();
-      return NativeWindow.LOCK_SURFACE_NOT_READY;
-    }
-    firstLock = false;
-    macosxdsi = (JAWT_MacOSXDrawingSurfaceInfo) dsi.platformInfo();
-    if (macosxdsi == null) {
-      unlockSurfaceImpl();
-      return NativeWindow.LOCK_SURFACE_NOT_READY;
-    }
-    drawable = macosxdsi.getCocoaViewRef();
-
-    if (drawable == 0) {
-      unlockSurfaceImpl();
-      return NativeWindow.LOCK_SURFACE_NOT_READY;
-    } else {
-      updateBounds(dsi.getBounds());
-    }
-    return ret;
-  }
-    
-  protected void unlockSurfaceImpl() throws NativeWindowException {
-    if(null!=ds) {
-        if (null!=dsi) {
-            ds.FreeDrawingSurfaceInfo(dsi);
-        }
-        if (dsLocked) {
-            ds.Unlock();
-        }
-        JAWT.getJAWT().FreeDrawingSurface(ds);
-    }
-    ds = null;
-    dsi = null;
-    macosxdsi = null;
-  }
-
-  protected Point getLocationOnScreenImpl(int x, int y) {
-    return null; // FIXME
-  }
-
-  // Variables for lockSurface/unlockSurface
-  private JAWT_DrawingSurface ds;
-  private boolean dsLocked;
-  private JAWT_DrawingSurfaceInfo dsi;
-  private JAWT_MacOSXDrawingSurfaceInfo macosxdsi;
-
-  // Workaround for instance of 4796548
-  private boolean firstLock = true;
-
-}
-
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java
deleted file mode 100644
index d7cd55f..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.nativewindow.impl.jawt.windows;
-
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.NativeWindow;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.util.Point;
-
-import com.jogamp.nativewindow.impl.jawt.JAWT;
-import com.jogamp.nativewindow.impl.jawt.JAWTFactory;
-import com.jogamp.nativewindow.impl.jawt.JAWTWindow;
-import com.jogamp.nativewindow.impl.jawt.JAWT_DrawingSurface;
-import com.jogamp.nativewindow.impl.jawt.JAWT_DrawingSurfaceInfo;
-import com.jogamp.nativewindow.impl.windows.GDI;
-
-public class WindowsJAWTWindow extends JAWTWindow {
-
-  public WindowsJAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
-    super(comp, config);
-  }
-
-  protected void validateNative() throws NativeWindowException {
-  }
-
-  protected synchronized void invalidate() {
-    super.invalidate();
-    windowHandle = 0;
-  }
-
-  protected int lockSurfaceImpl() throws NativeWindowException {
-    int ret = NativeWindow.LOCK_SUCCESS;
-    ds = JAWT.getJAWT().GetDrawingSurface(component);
-    if (ds == null) {
-      // Widget not yet realized
-      unlockSurfaceImpl();
-      return LOCK_SURFACE_NOT_READY;
-    }
-    int res = ds.Lock();
-    dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
-    if (!dsLocked) {
-      unlockSurfaceImpl();
-      throw new NativeWindowException("Unable to lock surface");
-    }
-    // See whether the surface changed and if so destroy the old
-    // OpenGL context so it will be recreated (NOTE: removeNotify
-    // should handle this case, but it may be possible that race
-    // conditions can cause this code to be triggered -- should test
-    // more)
-    if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
-      ret = LOCK_SURFACE_CHANGED;
-    }
-    dsi = ds.GetDrawingSurfaceInfo();
-    if (dsi == null) {
-      unlockSurfaceImpl();
-      return LOCK_SURFACE_NOT_READY;
-    }
-    win32dsi = (JAWT_Win32DrawingSurfaceInfo) dsi.platformInfo();
-    if (win32dsi == null) {
-      unlockSurfaceImpl();
-      return LOCK_SURFACE_NOT_READY;
-    }
-    windowHandle = win32dsi.getHandle();
-    drawable = win32dsi.getHdc();
-    if (windowHandle == 0 || drawable == 0) {
-      unlockSurfaceImpl();
-      return LOCK_SURFACE_NOT_READY;
-    } else {
-      updateBounds(dsi.getBounds());
-    }
-    return ret;
-  }
-
-  protected void unlockSurfaceImpl() throws NativeWindowException {
-    long startTime = 0;
-    if(null!=ds) {
-        if (null!=dsi) {
-            ds.FreeDrawingSurfaceInfo(dsi);
-        }
-        if (dsLocked) {
-            ds.Unlock();
-        }
-        JAWT.getJAWT().FreeDrawingSurface(ds);
-    }
-    ds = null;
-    dsi = null;
-    win32dsi = null;
-  }
-
-  public long getWindowHandle() {
-    return windowHandle;
-  }
-
-  protected Point getLocationOnScreenImpl(int x, int y) {
-    return GDI.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
-  }
-
-  // Variables for lockSurface/unlockSurface
-  private JAWT_DrawingSurface ds;
-  private boolean dsLocked;
-  private JAWT_DrawingSurfaceInfo dsi;
-  private JAWT_Win32DrawingSurfaceInfo win32dsi;
-
-  // lifetime: valid after lock, forever until invalidate
-  protected long windowHandle;
-}
-
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11JAWTToolkitLock.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11JAWTToolkitLock.java
deleted file mode 100644
index 7eaac2c..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11JAWTToolkitLock.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.nativewindow.impl.jawt.x11;
-
-import com.jogamp.nativewindow.impl.jawt.*;
-import com.jogamp.nativewindow.impl.x11.X11Util;
-import javax.media.nativewindow.ToolkitLock;
-
-/**
- * Implementing a recursive {@link javax.media.nativewindow.ToolkitLock}
- * utilizing JAWT's AWT lock via {@link JAWTUtil#lockToolkit()} and {@link X11Util#XLockDisplay(long)}.
- * <br>
- * This strategy should only be used if AWT is using the underlying native windowing toolkit
- * in a not intrinsic thread safe manner, e.g. under X11 where no XInitThreads() call
- * is issued before any other X11 usage. This is the current situation for e.g. Webstart or Applets.
- */
-public class X11JAWTToolkitLock implements ToolkitLock {
-    long displayHandle;
-
-    public X11JAWTToolkitLock(long displayHandle) {
-        this.displayHandle = displayHandle;
-    }
-
-    public final void lock() {
-        if(TRACE_LOCK) { System.err.println("X11JAWTToolkitLock.lock()"); }
-        JAWTUtil.lockToolkit();
-        X11Util.XLockDisplay(displayHandle);
-    }
-
-    public final void unlock() {
-        if(TRACE_LOCK) { System.err.println("X11JAWTToolkitLock.unlock()"); }
-        X11Util.XUnlockDisplay(displayHandle);
-        JAWTUtil.unlockToolkit();
-    }
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11JAWTWindow.java
deleted file mode 100644
index f87558d..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11JAWTWindow.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.nativewindow.impl.jawt.x11;
-
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.NativeWindow;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.nativewindow.awt.AWTGraphicsDevice;
-import javax.media.nativewindow.util.Point;
-
-import com.jogamp.nativewindow.impl.jawt.JAWT;
-import com.jogamp.nativewindow.impl.jawt.JAWTFactory;
-import com.jogamp.nativewindow.impl.jawt.JAWTWindow;
-import com.jogamp.nativewindow.impl.jawt.JAWT_DrawingSurface;
-import com.jogamp.nativewindow.impl.jawt.JAWT_DrawingSurfaceInfo;
-import com.jogamp.nativewindow.impl.x11.X11Util;
-
-public class X11JAWTWindow extends JAWTWindow {
-
-  public X11JAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
-    super(comp, config);
-  }
-
-  protected void validateNative() throws NativeWindowException {
-    AWTGraphicsDevice awtDevice = (AWTGraphicsDevice) config.getScreen().getDevice();
-
-    if(awtDevice.getHandle() != 0) {
-        // subtype and handle set already, done
-        return;
-    }
-
-    long displayHandle = 0;
-    
-    // first try a pre-existing attached native configuration, ie native X11GraphicsDevice
-    AbstractGraphicsConfiguration aconfig = (null!=config) ? config.getNativeGraphicsConfiguration() : null;
-    AbstractGraphicsScreen ascreen = (null!=aconfig) ? aconfig.getScreen() : null;
-    AbstractGraphicsDevice adevice = (null!=ascreen) ? ascreen.getDevice() : null; // X11GraphicsDevice
-    if(null!=adevice) {
-        displayHandle = adevice.getHandle();
-    }
-
-    if(0 == displayHandle) {
-        displayHandle = X11SunJDKReflection.graphicsDeviceGetDisplay(awtDevice.getGraphicsDevice());
-    }
-    if(0==displayHandle) {
-        throw new InternalError("X11JAWTWindow: No X11 Display handle available");
-    }
-    awtDevice.setSubType(NativeWindowFactory.TYPE_X11, displayHandle);
-  }
-
-  protected int lockSurfaceImpl() throws NativeWindowException {
-    int ret = NativeWindow.LOCK_SUCCESS;
-    ds = JAWT.getJAWT().GetDrawingSurface(component);
-    if (ds == null) {
-      // Widget not yet realized
-      unlockSurfaceImpl();
-      return LOCK_SURFACE_NOT_READY;
-    }
-    int res = ds.Lock();
-    dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
-    if (!dsLocked) {
-      unlockSurfaceImpl();
-      throw new NativeWindowException("Unable to lock surface");
-    }
-    // See whether the surface changed and if so destroy the old
-    // OpenGL context so it will be recreated (NOTE: removeNotify
-    // should handle this case, but it may be possible that race
-    // conditions can cause this code to be triggered -- should test
-    // more)
-    if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
-      ret = LOCK_SURFACE_CHANGED;
-    }
-    dsi = ds.GetDrawingSurfaceInfo();
-    if (dsi == null) {
-      unlockSurfaceImpl();
-      return LOCK_SURFACE_NOT_READY;
-    }
-    x11dsi = (JAWT_X11DrawingSurfaceInfo) dsi.platformInfo();
-    if (x11dsi == null) {
-      unlockSurfaceImpl();
-      return LOCK_SURFACE_NOT_READY;
-    }
-    drawable = x11dsi.getDrawable();
-    if (drawable == 0) {
-      unlockSurfaceImpl();
-      return LOCK_SURFACE_NOT_READY;
-    } else {
-      updateBounds(dsi.getBounds());
-    }
-    return ret;
-  }
-
-  protected void unlockSurfaceImpl() throws NativeWindowException {
-    if(null!=ds) {
-        if (null!=dsi) {
-            ds.FreeDrawingSurfaceInfo(dsi);
-        }
-        if (dsLocked) {
-            ds.Unlock();
-        }
-        JAWT.getJAWT().FreeDrawingSurface(ds);
-    }
-    ds = null;
-    dsi = null;
-    x11dsi = null;
-  }
-
-  protected Point getLocationOnScreenImpl(int x, int y) {
-    return X11Util.GetRelativeLocation( getDisplayHandle(), getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
-  }
-  
-  // Variables for lockSurface/unlockSurface
-  private JAWT_DrawingSurface ds;
-  private boolean dsLocked;
-  private JAWT_DrawingSurfaceInfo dsi;
-  private JAWT_X11DrawingSurfaceInfo x11dsi;
-  
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11SunJDKReflection.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11SunJDKReflection.java
deleted file mode 100644
index 081975a..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11SunJDKReflection.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.nativewindow.impl.jawt.x11;
-
-import com.jogamp.nativewindow.impl.x11.*;
-
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.lang.reflect.*;
-import java.security.*;
-
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.awt.AWTGraphicsConfiguration;
-
-/** This class encapsulates the reflection routines necessary to peek
-    inside a few data structures in the AWT implementation on X11 for
-    the purposes of correctly enumerating the available visuals. */
-
-public class X11SunJDKReflection {
-  private static Class   x11GraphicsDeviceClass;
-  private static Method  x11GraphicsDeviceGetScreenMethod;
-  private static Method  x11GraphicsDeviceGetDisplayMethod;
-  private static Class   x11GraphicsConfigClass;
-  private static Method  x11GraphicsConfigGetVisualMethod;
-  private static boolean initted;
-
-  static {
-    AccessController.doPrivileged(new PrivilegedAction() {
-        public Object run() {
-          try {
-            x11GraphicsDeviceClass = Class.forName("sun.awt.X11GraphicsDevice");
-            x11GraphicsDeviceGetScreenMethod = x11GraphicsDeviceClass.getDeclaredMethod("getScreen", new Class[] {});
-            x11GraphicsDeviceGetScreenMethod.setAccessible(true);
-            x11GraphicsDeviceGetDisplayMethod = x11GraphicsDeviceClass.getDeclaredMethod("getDisplay", new Class[] {});
-            x11GraphicsDeviceGetDisplayMethod.setAccessible(true);
-
-            x11GraphicsConfigClass = Class.forName("sun.awt.X11GraphicsConfig");
-            x11GraphicsConfigGetVisualMethod = x11GraphicsConfigClass.getDeclaredMethod("getVisual", new Class[] {});
-            x11GraphicsConfigGetVisualMethod.setAccessible(true);
-            initted = true;
-          } catch (Exception e) {
-            // Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
-          }
-          return null;
-        }
-      });
-  }
-
-  public static int graphicsDeviceGetScreen(GraphicsDevice device) {
-    if (!initted) {
-      return 0;
-    }
-
-    try {
-      return ((Integer) x11GraphicsDeviceGetScreenMethod.invoke(device, null)).intValue();
-    } catch (Exception e) {
-      return 0;
-    }
-  }
-
-  public static long graphicsDeviceGetDisplay(GraphicsDevice device) {
-    if (!initted) {
-      return 0;
-    }
-
-    try {
-      return ((Long) x11GraphicsDeviceGetDisplayMethod.invoke(device, null)).longValue();
-    } catch (Exception e) {
-      return 0;
-    }
-  }
-
-  public static int graphicsConfigurationGetVisualID(AbstractGraphicsConfiguration config) {
-      try {
-          if (config instanceof AWTGraphicsConfiguration) {
-              return graphicsConfigurationGetVisualID(((AWTGraphicsConfiguration) config).getGraphicsConfiguration());
-          }
-          return 0;
-      } catch (Exception e) {
-          return 0;
-      }
-  }
-
-  public static int graphicsConfigurationGetVisualID(GraphicsConfiguration config) {
-    if (!initted) {
-      return 0;
-    }
-
-    try {
-      return ((Integer) x11GraphicsConfigGetVisualMethod.invoke(config, null)).intValue();
-    } catch (Exception e) {
-      return 0;
-    }
-  }
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java
deleted file mode 100644
index fec7ca2..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.nativewindow.impl.x11;
-
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.x11.*;
-
-public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactory {
-    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-        CapabilitiesImmutable  capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen)
-        throws IllegalArgumentException, NativeWindowException {
-
-        if(!(screen instanceof X11GraphicsScreen)) {
-            throw new NativeWindowException("Only valid X11GraphicsScreen are allowed");
-        }
-        return new X11GraphicsConfiguration((X11GraphicsScreen)screen,  capsChosen, capsRequested, getXVisualInfo(screen, capsChosen));
-    }
-
-    public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, long visualID)
-    {
-        XVisualInfo xvi_temp = XVisualInfo.create();
-        xvi_temp.setVisualid(visualID);
-        xvi_temp.setScreen(screen.getIndex());
-        int num[] = { -1 };
-        long display = screen.getDevice().getHandle();
-
-        XVisualInfo[] xvis = X11Util.XGetVisualInfo(display, X11Lib.VisualIDMask|X11Lib.VisualScreenMask, xvi_temp, num, 0);
-
-        if(xvis==null || num[0]<1) {
-            return null;
-        }
-
-        return XVisualInfo.create(xvis[0]);
-    }
-
-    public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, CapabilitiesImmutable capabilities)
-    {
-        XVisualInfo xv = getXVisualInfoImpl(screen, capabilities, 4 /* TrueColor */);
-        if(null!=xv) return xv;
-        return getXVisualInfoImpl(screen, capabilities, 5 /* DirectColor */);
-    }
-
-    private static XVisualInfo getXVisualInfoImpl(AbstractGraphicsScreen screen, CapabilitiesImmutable capabilities, int c_class)
-    {
-        XVisualInfo ret = null;
-        int[] num = { -1 };
-
-        XVisualInfo vinfo_template = XVisualInfo.create();
-        vinfo_template.setScreen(screen.getIndex());
-        vinfo_template.setC_class(c_class);
-        long display = screen.getDevice().getHandle();
-
-        XVisualInfo[] vinfos = X11Util.XGetVisualInfo(display, X11Lib.VisualScreenMask, vinfo_template, num, 0);
-        XVisualInfo best=null;
-        int rdepth = capabilities.getRedBits() + capabilities.getGreenBits() + capabilities.getBlueBits() + capabilities.getAlphaBits();
-        for (int i = 0; vinfos!=null && i < num[0]; i++) {
-            if ( best == null || 
-                 best.getDepth() < vinfos[i].getDepth() )
-            {
-                best = vinfos[i];
-                if(rdepth <= best.getDepth())
-                    break;
-            }
-        }
-        if ( null!=best && ( rdepth <= best.getDepth() || 24 == best.getDepth()) ) {
-            ret = XVisualInfo.create(best);
-        }
-        best = null;
-
-        return ret;
-    }
-}
-
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11ToolkitLock.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11ToolkitLock.java
deleted file mode 100644
index 2e0e911..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11ToolkitLock.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.nativewindow.impl.x11;
-
-import javax.media.nativewindow.ToolkitLock;
-
-/**
- * Implementing a recursive {@link javax.media.nativewindow.ToolkitLock}
- * utilizing {@link X11Util#XLockDisplay(long)}.
- * <br>
- * This strategy should not be used in case XInitThreads() is being used,
- * or a higher level toolkit lock is required, ie AWT lock.
- */
-public class X11ToolkitLock implements ToolkitLock {
-    long displayHandle;
-
-    public X11ToolkitLock(long displayHandle) {
-        this.displayHandle = displayHandle;
-    }
-
-    public final void lock() {
-        if(TRACE_LOCK) { System.err.println("X11ToolkitLock.lock()"); }
-        X11Util.XLockDisplay(displayHandle);
-    }
-
-    public final void unlock() {
-        if(TRACE_LOCK) { System.err.println("X11ToolkitLock.unlock()"); }
-        X11Util.XUnlockDisplay(displayHandle);
-    }
-}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java
deleted file mode 100644
index ecb4a7a..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-package com.jogamp.nativewindow.impl.x11;
-
-import com.jogamp.common.util.LongObjectHashMap;
-
-import javax.media.nativewindow.*;
-
-import com.jogamp.nativewindow.impl.*;
-import java.nio.Buffer;
-import java.nio.IntBuffer;
-import java.nio.ShortBuffer;
-import java.security.AccessController;
-import java.util.ArrayList;
-import java.util.List;
-import javax.media.nativewindow.util.Point;
-
-/**
- * Contains a thread safe X11 utility to retrieve display connections.
- */
-public class X11Util {
-    private static final boolean DEBUG = Debug.debug("X11Util");
-    private static final boolean TRACE_DISPLAY_LIFECYCLE = Debug.getBooleanProperty("nativewindow.debug.X11Util.TraceDisplayLifecycle", true, AccessController.getContext());
-
-    private static String nullDisplayName = null;
-    private static boolean isFirstX11ActionOnProcess = false;
-    private static boolean isInit = false;
-
-    private static int setX11ErrorHandlerRecCount = 0;
-    private static Object setX11ErrorHandlerLock = new Object();
-
-    public static synchronized void initSingleton(boolean firstX11ActionOnProcess) {
-        if(!isInit) {
-            NWJNILibLoader.loadNativeWindow("x11");
-
-            /**
-             * Always issue XInitThreads() since we have independent
-             * off-thread created Display connections able to utilize multithreading, ie NEWT */
-            initialize0( true );
-            // initialize0( firstX11ActionOnProcess );
-            isFirstX11ActionOnProcess = firstX11ActionOnProcess;
-
-            if(DEBUG) {
-                System.out.println("X11Util.isFirstX11ActionOnProcess: "+isFirstX11ActionOnProcess);
-            }
-            isInit = true;
-        }
-    }
-
-    public static void setX11ErrorHandler(boolean onoff, boolean quiet) {
-        synchronized(setX11ErrorHandlerLock) {
-            if(onoff) {
-                if(0==setX11ErrorHandlerRecCount) {
-                    setX11ErrorHandler0(true, quiet);
-                }
-                setX11ErrorHandlerRecCount++;
-            } else {
-                if(0 >= setX11ErrorHandlerRecCount) {
-                    throw new InternalError();
-                }
-                setX11ErrorHandlerRecCount--;
-                if(0==setX11ErrorHandlerRecCount) {
-                    setX11ErrorHandler0(false, false);
-                }
-            }
-        }
-    }
-
-    public static boolean isFirstX11ActionOnProcess() {
-        return isFirstX11ActionOnProcess;
-    }
-
-    public static void lockDefaultToolkit(long dpyHandle) {
-        NativeWindowFactory.getDefaultToolkitLock().lock();
-        if(!isFirstX11ActionOnProcess) {
-            X11Util.XLockDisplay(dpyHandle);
-        }
-    }
-
-    public static void unlockDefaultToolkit(long dpyHandle) {
-        if(!isFirstX11ActionOnProcess) {
-            X11Util.XUnlockDisplay(dpyHandle);
-        }
-        NativeWindowFactory.getDefaultToolkitLock().unlock();
-    }
-
-    public static String getNullDisplayName() {
-        if(null==nullDisplayName) {
-            synchronized(X11Util.class) {
-                if(null==nullDisplayName) {
-                    NativeWindowFactory.getDefaultToolkitLock().lock();
-                    try {
-                        long dpy = X11Lib.XOpenDisplay(null);
-                        nullDisplayName = X11Lib.XDisplayString(dpy);
-                        X11Lib.XCloseDisplay(dpy);
-                    } finally {
-                        NativeWindowFactory.getDefaultToolkitLock().unlock();
-                    }
-                    if(DEBUG) {
-                        System.out.println("X11 Display(NULL) <"+nullDisplayName+">");
-                    }
-                }
-            }
-        }
-        return nullDisplayName;
-    }
-
-    private X11Util() {}
-
-    // not exactly thread safe, but good enough for our purpose,
-    // which is to tag a NamedDisplay uncloseable after creation.
-    private static Object globalLock = new Object(); 
-    private static LongObjectHashMap globalNamedDisplayMap = new LongObjectHashMap();
-    private static List openDisplayList = new ArrayList();
-    private static List pendingDisplayList = new ArrayList();
-
-    public static class NamedDisplay {
-        String name;
-        long   handle;
-        int    refCount;
-        boolean unCloseable;
-        Throwable creationStack;
-
-        protected NamedDisplay(String name, long handle) {
-            this.name=name;
-            this.handle=handle;
-            this.refCount=1;
-            this.unCloseable=false;
-            if(DEBUG) {
-                this.creationStack=new Throwable("NamedDisplay Created at:");
-            } else {
-                this.creationStack=null;
-            }
-        }
-
-        public final String getName() { return name; }
-        public final long   getHandle() { return handle; }
-        public final int    getRefCount() { return refCount; }
-
-        public final void setUncloseable(boolean v) { unCloseable = v; }
-        public final boolean isUncloseable() { return unCloseable; }
-
-        public final Throwable getCreationStack() { return creationStack; }
-
-        public Object clone() throws CloneNotSupportedException {
-          return super.clone();
-        }
-
-        public String toString() {
-            return "NamedX11Display["+name+", 0x"+Long.toHexString(handle)+", refCount "+refCount+", unCloseable "+unCloseable+"]";
-        }
-    }
-
-    /** Returns the number of unclosed X11 Displays.
-      * @param realXCloseAndPendingDisplays if true, {@link #closePendingDisplayConnections()} is called.
-      */
-    public static int shutdown(boolean realXCloseOpenAndPendingDisplays, boolean verbose) {
-        int num=0;
-        if(DEBUG||verbose||pendingDisplayList.size() > 0) {
-            String msg = "X11Util.Display: Shutdown (close open / pending Displays: "+realXCloseOpenAndPendingDisplays+
-                         ", open (no close attempt): "+globalNamedDisplayMap.size()+"/"+openDisplayList.size()+
-                         ", open (no close attempt and uncloseable): "+pendingDisplayList.size()+")" ;
-            if(DEBUG) {
-                Exception e = new Exception(msg);
-                e.printStackTrace();
-            } else {
-                System.err.println(msg);
-            }
-            if( openDisplayList.size() > 0) {
-                X11Util.dumpOpenDisplayConnections();
-            }
-            if( pendingDisplayList.size() > 0 ) {
-                X11Util.dumpPendingDisplayConnections();
-            }
-        }
-
-        synchronized(globalLock) {
-            if(realXCloseOpenAndPendingDisplays) {
-                closePendingDisplayConnections();    
-            }
-            openDisplayList.clear();
-            pendingDisplayList.clear();
-            globalNamedDisplayMap.clear();
-        }
-        return num;
-    }
-
-    /**
-     * Closing pending Display connections in reverse order.
-     *
-     * @return number of closed Display connections
-     */
-    public static int closePendingDisplayConnections() {
-        int num=0;
-        synchronized(globalLock) {
-            if(DEBUG) {
-                System.err.println("X11Util: Closing Pending X11 Display Connections: "+pendingDisplayList.size());
-            }
-            for(int i=pendingDisplayList.size()-1; i>=0; i--) {
-                NamedDisplay ndpy = (NamedDisplay) pendingDisplayList.get(i);
-                if(DEBUG) {
-                    System.err.println("X11Util.closePendingDisplayConnections(): Closing ["+i+"]: "+ndpy);
-                }
-                XCloseDisplay(ndpy.getHandle());
-                num++;
-            }
-        }
-        return num;
-    }
-
-    public static int getOpenDisplayConnectionNumber() {
-        synchronized(globalLock) {
-            return openDisplayList.size();
-        }
-    }
-        
-    public static void dumpOpenDisplayConnections() {
-        synchronized(globalLock) {
-            System.err.println("X11Util: Open X11 Display Connections: "+openDisplayList.size());
-            for(int i=0; i<pendingDisplayList.size(); i++) {
-                NamedDisplay ndpy = (NamedDisplay) openDisplayList.get(i);
-                System.err.println("X11Util: ["+i+"]: "+ndpy);
-                if(null!=ndpy) {
-                    Throwable t = ndpy.getCreationStack();
-                    if(null!=t) {
-                        t.printStackTrace();
-                    }
-                }
-            }
-        }
-    }
-
-    public static int getPendingDisplayConnectionNumber() {
-        synchronized(globalLock) {
-            return pendingDisplayList.size();
-        }
-    }
-
-    public static void dumpPendingDisplayConnections() {
-        synchronized(globalLock) {
-            System.err.println("X11Util: Pending X11 Display Connections: "+pendingDisplayList.size());
-            for(int i=0; i<pendingDisplayList.size(); i++) {
-                NamedDisplay ndpy = (NamedDisplay) pendingDisplayList.get(i);
-                System.err.println("X11Util: ["+i+"]: "+ndpy);
-                if(null!=ndpy) {
-                    Throwable t = ndpy.getCreationStack();
-                    if(null!=t) {
-                        t.printStackTrace();
-                    }
-                }
-            }
-        }
-    }
-
-    public static boolean markDisplayUncloseable(long handle) {
-        NamedDisplay ndpy;
-        synchronized(globalLock) {
-            ndpy = (NamedDisplay) globalNamedDisplayMap.get(handle);
-        }
-        if( null != ndpy ) {
-            ndpy.setUncloseable(true);
-            return true;
-        }
-        return false;
-    }
-
-    /** Returns this created named display. */
-    public static long createDisplay(String name) {
-        name = validateDisplayName(name);
-        long dpy = XOpenDisplay(name);
-        if(0==dpy) {
-            throw new NativeWindowException("X11Util.Display: Unable to create a display("+name+") connection. Thread "+Thread.currentThread().getName());
-        }
-        // if you like to debug and synchronize X11 commands ..
-        // setSynchronizeDisplay(dpy, true);
-        NamedDisplay namedDpy = new NamedDisplay(name, dpy);
-        synchronized(globalLock) {
-            globalNamedDisplayMap.put(dpy, namedDpy);
-            openDisplayList.add(namedDpy);
-            pendingDisplayList.add(namedDpy);
-        }
-        if(DEBUG) {
-            Exception e = new Exception("X11Util.Display: Created new "+namedDpy+". Thread "+Thread.currentThread().getName());
-            e.printStackTrace();
-        }
-        return namedDpy.getHandle();
-    }
-
-    public static void closeDisplay(long handle) {
-        NamedDisplay namedDpy;
-
-        synchronized(globalLock) {
-            namedDpy = (NamedDisplay) globalNamedDisplayMap.remove(handle);
-            if(namedDpy!=null) {
-                if(!openDisplayList.remove(namedDpy)) { throw new RuntimeException("Internal: "+namedDpy); }
-            }
-        }
-        if(null==namedDpy) {
-            X11Util.dumpPendingDisplayConnections();
-            throw new RuntimeException("X11Util.Display: Display(0x"+Long.toHexString(handle)+") with given handle is not mapped. Thread "+Thread.currentThread().getName());
-        }
-        if(namedDpy.getHandle()!=handle) {
-            X11Util.dumpPendingDisplayConnections();
-            throw new RuntimeException("X11Util.Display: Display(0x"+Long.toHexString(handle)+") Mapping error: "+namedDpy+". Thread "+Thread.currentThread().getName());
-        }
-
-        if(DEBUG) {
-            Exception e = new Exception("X11Util.Display: Closing new "+namedDpy+". Thread "+Thread.currentThread().getName());
-            e.printStackTrace();
-        }
-
-        if(!namedDpy.isUncloseable()) {
-            synchronized(globalLock) {
-                if(!pendingDisplayList.remove(namedDpy)) { throw new RuntimeException("Internal: "+namedDpy); }
-            }
-            XCloseDisplay(namedDpy.getHandle());
-        }
-    }
-
-    public static NamedDisplay getNamedDisplay(long handle) {
-        synchronized(globalLock) {
-            return (NamedDisplay) globalNamedDisplayMap.get(handle);
-        }
-    }
-
-    /** 
-     * @return If name is null, it returns the previous queried NULL display name,
-     * otherwise the name. */
-    public static String validateDisplayName(String name) {
-        return ( null == name ) ? getNullDisplayName() : name ;
-    }
-
-    public static String validateDisplayName(String name, long handle) {
-        if(null==name && 0!=handle) {
-            name = XDisplayString(handle);
-        }
-        return validateDisplayName(name);
-    }
-
-    /*******************************
-     **
-     ** Locked X11Lib wrapped functions
-     **
-     *******************************/
-
-    public static long XOpenDisplay(String arg0) {
-        NativeWindowFactory.getDefaultToolkitLock().lock();
-        try {
-            long handle = X11Lib.XOpenDisplay(arg0);
-            if(TRACE_DISPLAY_LIFECYCLE) {
-                Throwable t = new Throwable(Thread.currentThread()+" - X11Util.XOpenDisplay("+arg0+") 0x"+Long.toHexString(handle));
-                t.printStackTrace();
-            }
-            return handle;
-        } finally {
-            NativeWindowFactory.getDefaultToolkitLock().unlock();
-        }
-    }
-
-    public static int XCloseDisplay(long display) {
-        NativeWindowFactory.getDefaultToolkitLock().lock();
-        try {
-            if(TRACE_DISPLAY_LIFECYCLE) {
-                Throwable t = new Throwable(Thread.currentThread()+" - X11Util.XCloseDisplay() 0x"+Long.toHexString(display));
-                t.printStackTrace();
-            }
-            return X11Lib.XCloseDisplay(display);
-        } finally {
-            NativeWindowFactory.getDefaultToolkitLock().unlock();
-        }
-    }
-
-    public static int XFree(Buffer arg0)  {
-        NativeWindowFactory.getDefaultToolkitLock().lock();
-        try {
-            return X11Lib.XFree(arg0);
-        } finally {
-            NativeWindowFactory.getDefaultToolkitLock().unlock();
-        }
-    }
-
-    public static int XSync(long display, boolean discard) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XSync(display, discard);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static void XSynchronize(long display, boolean onoff) {
-        lockDefaultToolkit(display);
-        try {
-            X11Lib.XSynchronize(display, onoff);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static boolean XineramaEnabled(long display) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XineramaEnabled(display);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static int DefaultScreen(long display) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.DefaultScreen(display);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static long RootWindow(long display, int screen_number) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.RootWindow(display, screen_number);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static long XCreatePixmap(long display, long arg1, int arg2, int arg3, int arg4) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XCreatePixmap(display, arg1, arg2, arg3, arg4);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static String XDisplayString(long display) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XDisplayString(display);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static int XFlush(long display) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XFlush(display);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static int XFreePixmap(long display, long arg1) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XFreePixmap(display, arg1);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static long DefaultVisualID(long display, int screen) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.DefaultVisualID(display, screen);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static long CreateDummyWindow(long display, int screen_index, long visualID) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.CreateDummyWindow(display, screen_index, visualID);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static void DestroyDummyWindow(long display, long window) {
-        lockDefaultToolkit(display);
-        try {
-            X11Lib.DestroyDummyWindow(display, window);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static Point GetRelativeLocation(long display, int screen_index, long src_win, long dest_win, int src_x, int src_y) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.GetRelativeLocation(display, screen_index, src_win, dest_win, src_x, src_y);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static XVisualInfo[] XGetVisualInfo(long display, long arg1, XVisualInfo arg2, int[] arg3, int arg3_offset) {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XGetVisualInfo(display, arg1, arg2, arg3, arg3_offset);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static boolean XF86VidModeGetGammaRamp(long display, int screen, int size, ShortBuffer red_array, ShortBuffer green_array, ShortBuffer blue_array)  {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XF86VidModeGetGammaRamp(display, screen, size, red_array, green_array, blue_array);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static boolean XF86VidModeGetGammaRamp(long display, int screen, int size, short[] red_array, int red_array_offset, short[] green_array, int green_array_offset, short[] blue_array, int blue_array_offset)  {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XF86VidModeGetGammaRamp(display, screen, size, red_array, red_array_offset, green_array, green_array_offset, blue_array, blue_array_offset);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static boolean XF86VidModeGetGammaRampSize(long display, int screen, IntBuffer size)  {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XF86VidModeGetGammaRampSize(display, screen, size);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static boolean XF86VidModeGetGammaRampSize(long display, int screen, int[] size, int size_offset)  {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XF86VidModeGetGammaRampSize(display, screen, size, size_offset);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static boolean XF86VidModeSetGammaRamp(long display, int screen, int size, ShortBuffer red_array, ShortBuffer green_array, ShortBuffer blue_array)  {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XF86VidModeSetGammaRamp(display, screen, size, red_array, green_array, blue_array);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static boolean XF86VidModeSetGammaRamp(long display, int screen, int size, short[] red_array, int red_array_offset, short[] green_array, int green_array_offset, short[] blue_array, int blue_array_offset)  {
-        lockDefaultToolkit(display);
-        try {
-            return X11Lib.XF86VidModeSetGammaRamp(display, screen, size, red_array, red_array_offset, green_array, green_array_offset, blue_array, blue_array_offset);
-        } finally {
-            unlockDefaultToolkit(display);
-        }
-    }
-
-    public static void XLockDisplay(long handle) {
-        if(ToolkitLock.TRACE_LOCK) {
-            System.out.println("+++ X11 Display Lock get 0x"+Long.toHexString(handle));
-        }
-        X11Lib.XLockDisplay(handle);
-    }
-
-    public static void XUnlockDisplay(long handle) {
-        if(ToolkitLock.TRACE_LOCK) {
-            System.out.println("--- X11 Display Lock rel 0x"+Long.toHexString(handle));
-        }
-        X11Lib.XUnlockDisplay(handle);
-    }
-
-    private static native void initialize0(boolean firstUIActionOnProcess);
-    private static native void setX11ErrorHandler0(boolean onoff, boolean quiet);
-}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
index e844c4f..79d69c7 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
@@ -44,7 +44,7 @@ package javax.media.nativewindow;
     must support, such as color depth per channel. It currently
     contains the minimal number of routines which allow configuration
     on all supported window systems. */
-public class Capabilities implements CapabilitiesImmutable, Cloneable {
+public class Capabilities implements CapabilitiesImmutable, Cloneable, Comparable {
   private int     redBits        = 8;
   private int     greenBits      = 8;
   private int     blueBits       = 8;
@@ -114,6 +114,30 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
     return res;
   }
 
+  /** comparing RGBA values only */
+  public int compareTo(Object o) {
+    if ( ! ( o instanceof Capabilities ) ) {
+        Class c = (null != o) ? o.getClass() : null ;
+        throw new ClassCastException("Not a Capabilities object: " + c);
+    }
+
+    final Capabilities caps = (Capabilities) o;
+
+    final int a = ( alphaBits > 0 ) ? alphaBits : 1;
+    final int rgba = redBits * greenBits * blueBits * a;
+
+    final int xa = ( caps.alphaBits ) > 0 ? caps.alphaBits : 1;
+    final int xrgba = caps.redBits * caps.greenBits * caps.blueBits * xa;
+
+    if(rgba > xrgba) {
+        return 1;
+    } else if(rgba < xrgba) {
+        return -1;
+    }
+
+    return 0; // they are equal: RGBA
+  }
+
   /** Returns the number of bits requested for the color buffer's red
       component. On some systems only the color depth, which is the
       sum of the red, green, and blue bits, is considered. */
@@ -274,25 +298,31 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
       A value of -1 is interpreted as any value. */
   public void setTransparentAlphaValue(int transValueAlpha) { transparentValueAlpha=transValueAlpha; }
 
+  public StringBuffer toString(StringBuffer sink) {
+    if(null == sink) {
+        sink = new StringBuffer();
+    }
+    if(onscreen) {
+        sink.append("on-scr");
+    } else {
+        sink.append("offscr");
+    }
+    sink.append(", rgba ").append(redBits).append("/").append(greenBits).append("/").append(blueBits).append("/").append(alphaBits);
+    if(backgroundOpaque) {
+        sink.append(", opaque");
+    } else {
+        sink.append(", trans-rgba 0x").append(Integer.toHexString(transparentValueRed)).append("/").append(Integer.toHexString(transparentValueGreen)).append("/").append(Integer.toHexString(transparentValueBlue)).append("/").append(Integer.toHexString(transparentValueAlpha));
+    }
+    return sink;
+  }
 
   /** Returns a textual representation of this Capabilities
       object. */ 
   public String toString() {
     StringBuffer msg = new StringBuffer();
-    msg.append("Capabilities[");
-	msg.append("Onscreen: "+ onscreen +
-        ", Red: " + redBits +
-	    ", Green: " + greenBits +
-	    ", Blue: " + blueBits +
-	    ", Alpha: " + alphaBits +
-        ", Opaque: " + backgroundOpaque);
-    if(!backgroundOpaque) {
-        msg.append(", Transparent RGBA: [0x"+ Integer.toHexString(transparentValueRed)+
-                   " 0x"+ Integer.toHexString(transparentValueGreen)+
-                   " 0x"+ Integer.toHexString(transparentValueBlue)+
-                   " 0x"+ Integer.toHexString(transparentValueAlpha)+"] ");
-    }
-	msg.append("]");
+    msg.append("Caps[");
+    toString(msg);
+    msg.append("]");
     return msg.toString();
   }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java b/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java
index 94b0f68..a306363 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java
@@ -39,6 +39,8 @@
 
 package javax.media.nativewindow;
 
+import java.util.List;
+
 /** Provides a mechanism by which applications can customize the
     window type selection for a given {@link Capabilities}.
     Developers can implement this interface and pass an instance into
@@ -63,6 +65,6 @@ public interface CapabilitiesChooser {
       choice to some other CapabilitiesChooser object.
   */
   public int chooseCapabilities(CapabilitiesImmutable desired,
-                                CapabilitiesImmutable[] available,
+                                List /*<CapabilitiesImmutable>*/ available,
                                 int windowSystemRecommendedChoice);
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesImmutable.java
index 72828b9..3aae8c8 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesImmutable.java
@@ -109,6 +109,9 @@ public interface CapabilitiesImmutable extends WriteCloneable {
     /** hash code over the immutable attributes of both objects */
     int hashCode();
 
+    /** Return a textual representation of this object. Use the given StringBuffer [optional]. */
+    StringBuffer toString(StringBuffer sink);
+
     /** Returns a textual representation of this object. */
     String toString();
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
index 856c294..b43db82 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -39,6 +40,8 @@
 
 package javax.media.nativewindow;
 
+import java.util.List;
+
 /** <P> The default implementation of the {@link
     CapabilitiesChooser} interface, which provides consistent visual
     selection behavior across platforms. The precise algorithm is
@@ -63,37 +66,38 @@ package javax.media.nativewindow;
 public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
   private static final boolean DEBUG = false; // FIXME: Debug.debug("DefaultCapabilitiesChooser");
 
-  public int chooseCapabilities(CapabilitiesImmutable desired,
-                                CapabilitiesImmutable[] available,
-                                int windowSystemRecommendedChoice) {
+  public int chooseCapabilities(final CapabilitiesImmutable desired,
+                                final List /*<CapabilitiesImmutable>*/ available,
+                                final int windowSystemRecommendedChoice) {
     if (DEBUG) {
       System.err.println("Desired: " + desired);
-      for (int i = 0; i < available.length; i++) {
-        System.err.println("Available " + i + ": " + available[i]);
+      for (int i = 0; i < available.size(); i++) {
+        System.err.println("Available " + i + ": " + available.get(i));
       }
       System.err.println("Window system's recommended choice: " + windowSystemRecommendedChoice);
     }
+    final int availnum = available.size();
 
     if (windowSystemRecommendedChoice >= 0 &&
-        windowSystemRecommendedChoice < available.length &&
-        available[windowSystemRecommendedChoice] != null) {
+        windowSystemRecommendedChoice < availnum &&
+        null != available.get(windowSystemRecommendedChoice)) {
       if (DEBUG) {
         System.err.println("Choosing window system's recommended choice of " + windowSystemRecommendedChoice);
-        System.err.println(available[windowSystemRecommendedChoice]);
+        System.err.println(available.get(windowSystemRecommendedChoice));
       }
       return windowSystemRecommendedChoice;
     }
 
     // Create score array
-    int[] scores = new int[available.length];
+    int[] scores = new int[availnum];
     int NO_SCORE = -9999999;
     int COLOR_MISMATCH_PENALTY_SCALE     = 36;
-    for (int i = 0; i < scores.length; i++) {
+    for (int i = 0; i < availnum; i++) {
       scores[i] = NO_SCORE;
     }
     // Compute score for each
-    for (int i = 0; i < scores.length; i++) {
-      CapabilitiesImmutable cur = available[i];
+    for (int i = 0; i < availnum; i++) {
+      CapabilitiesImmutable cur = (CapabilitiesImmutable) available.get(i);
       if (cur == null) {
         continue;
       }
@@ -107,7 +111,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
 
     if (DEBUG) {
       System.err.print("Scores: [");
-      for (int i = 0; i < available.length; i++) {
+      for (int i = 0; i < availnum; i++) {
         if (i > 0) {
           System.err.print(",");
         }
@@ -119,7 +123,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
     // Ready to select. Choose score closest to 0. 
     int scoreClosestToZero = NO_SCORE;
     int chosenIndex = -1;
-    for (int i = 0; i < scores.length; i++) {
+    for (int i = 0; i < availnum; i++) {
       int score = scores[i];
       if (score == NO_SCORE) {
         continue;
@@ -138,7 +142,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
     if (DEBUG) {
       System.err.println("Chosen index: " + chosenIndex);
       System.err.println("Chosen capabilities:");
-      System.err.println(available[chosenIndex]);
+      System.err.println(available.get(chosenIndex));
     }
 
     return chosenIndex;
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
index 47110ad..ffa8bfa 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
@@ -39,12 +39,21 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
 
     public DefaultGraphicsConfiguration(AbstractGraphicsScreen screen, 
                                         CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
+        if(null == screen) {
+            throw new NativeWindowException("Null screen");
+        }
+        if(null == capsChosen) {
+            throw new NativeWindowException("Null chosen caps");
+        }
+        if(null == capsRequested) {
+            throw new NativeWindowException("Null requested caps");
+        }
         this.screen = screen;
-
         this.capabilitiesChosen = capsChosen;
         this.capabilitiesRequested = capsRequested;
     }
 
+    @Override
     public Object clone() {
         try {
           return super.clone();
@@ -95,10 +104,19 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
         this.screen = (AbstractGraphicsScreen) screen.clone();
     }
 
+    @Override
     public String toString() {
-        return getClass().toString()+"[" + screen +
+        return getClass().getSimpleName()+"[" + screen +
                                        ",\n\tchosen    " + capabilitiesChosen+
                                        ",\n\trequested " + capabilitiesRequested+ 
                                        "]";
     }
+
+    public static String toHexString(int val) {
+        return "0x"+Integer.toHexString(val);
+    }
+
+    public static String toHexString(long val) {
+        return "0x"+Long.toHexString(val);
+    }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
index cb367f9..c2aa6fa 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
@@ -33,7 +33,7 @@
 
 package javax.media.nativewindow;
 
-import com.jogamp.nativewindow.impl.NativeWindowFactoryImpl;
+import jogamp.nativewindow.NativeWindowFactoryImpl;
 
 public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice {
     private static final String separator = "_";
@@ -88,6 +88,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
         setToolkitLock( locker );
     }
 
+    @Override
     public Object clone() {
         try {
           return super.clone();
@@ -142,15 +143,16 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
         return false;
     }
 
+    @Override
     public String toString() {
-        return getClass().toString()+"[type "+getType()+", connection "+getConnection()+", unitID "+getUnitID()+", handle 0x"+Long.toHexString(getHandle())+"]";
+        return getClass().getSimpleName()+"[type "+getType()+", connection "+getConnection()+", unitID "+getUnitID()+", handle 0x"+Long.toHexString(getHandle())+"]";
     }
 
     /**
      * Set the internal ToolkitLock, which is used within the
      * {@link #lock()} and {@link #unlock()} implementation.
      *
-     * @param locker the ToolkitLock, if null, {@link com.jogamp.nativewindow.impl.NullToolkitLock} is being used
+     * @param locker the ToolkitLock, if null, {@link jogamp.nativewindow.NullToolkitLock} is being used
      */
     protected void setToolkitLock(ToolkitLock locker) {
         this.toolkitLock = ( null == locker ) ? NativeWindowFactoryImpl.getNullToolkitLock() : locker ;
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
index 065385a..f50bd0e 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
@@ -45,6 +45,7 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen
         return new DefaultGraphicsScreen(new DefaultGraphicsDevice(type, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT), 0);
     }
 
+    @Override
     public Object clone() {
         try {
           return super.clone();
@@ -61,7 +62,8 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen
       return idx;
     }
 
+    @Override
     public String toString() {
-        return getClass().toString()+"["+device+", idx "+idx+"]";
+        return getClass().getSimpleName()+"["+device+", idx "+idx+"]";
     }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
index c061f59..fa3923d 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
@@ -33,10 +33,13 @@
 
 package javax.media.nativewindow;
 
-import java.util.*;
+import com.jogamp.common.util.ReflectionUtil;
+import jogamp.nativewindow.Debug;
+import jogamp.nativewindow.DefaultGraphicsConfigurationFactoryImpl;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 
-import com.jogamp.common.util.*;
-import com.jogamp.nativewindow.impl.*;
 
 /**
  * Provides the mechanism by which the graphics configuration for a
@@ -65,6 +68,18 @@ public abstract class GraphicsConfigurationFactory {
         initialize();
     }
 
+    protected static String getThreadName() {
+        return Thread.currentThread().getName();
+    }
+
+    protected static String toHexString(int val) {
+        return "0x" + Integer.toHexString(val);
+    }
+
+    protected static String toHexString(long val) {
+        return "0x" + Long.toHexString(val);
+    }
+
     /** Creates a new NativeWindowFactory instance. End users do not
         need to call this method. */
     protected GraphicsConfigurationFactory() {
@@ -76,7 +91,7 @@ public abstract class GraphicsConfigurationFactory {
         if (NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(true))) {
             try {
                 GraphicsConfigurationFactory factory = (GraphicsConfigurationFactory)
-                    ReflectionUtil.createInstance("com.jogamp.nativewindow.impl.x11.X11GraphicsConfigurationFactory", null,
+                    ReflectionUtil.createInstance("jogamp.nativewindow.x11.X11GraphicsConfigurationFactory", null,
                                                   GraphicsConfigurationFactory.class.getClassLoader());
                 registerFactory(javax.media.nativewindow.x11.X11GraphicsDevice.class, factory);
             } catch (Exception e) {
@@ -88,7 +103,7 @@ public abstract class GraphicsConfigurationFactory {
         // AWTGraphicsDevice instances -- the OpenGL binding will take
         // care of handling AWTGraphicsDevices on X11 platforms (as
         // well as X11GraphicsDevices in non-AWT situations)
-        registerFactory(abstractGraphicsDeviceClass, new GraphicsConfigurationFactoryImpl());
+        registerFactory(abstractGraphicsDeviceClass, new DefaultGraphicsConfigurationFactoryImpl());
     }
 
     /** Returns the factory for use with the given type of
@@ -232,4 +247,5 @@ public abstract class GraphicsConfigurationFactory {
         chooseGraphicsConfigurationImpl(CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
                                         CapabilitiesChooser chooser, AbstractGraphicsScreen screen)
         throws IllegalArgumentException, NativeWindowException;
+
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
index a364408..b0f5cb3 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -38,7 +38,7 @@ import java.util.*;
 
 import com.jogamp.common.util.*;
 import com.jogamp.common.jvm.JVMUtil;
-import com.jogamp.nativewindow.impl.*;
+import jogamp.nativewindow.*;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 
@@ -49,7 +49,7 @@ import java.lang.reflect.Method;
     hardware-accelerated rendering using the OpenGL API. */
 
 public abstract class NativeWindowFactory {
-    protected static final boolean DEBUG = Debug.debug("NativeWindow");
+    protected static final boolean DEBUG;
 
     /** OpenKODE/EGL type, as retrieved with {@link #getNativeWindowType(boolean)}*/
     public static final String TYPE_EGL = "EGL";
@@ -78,10 +78,11 @@ public abstract class NativeWindowFactory {
     private static String nativeOSNameCustom;
     private static boolean isAWTAvailable;
     public static final String AWTComponentClassName = "java.awt.Component" ;
-    public static final String JAWTUtilClassName = "com.jogamp.nativewindow.impl.jawt.JAWTUtil" ;
-    public static final String X11UtilClassName = "com.jogamp.nativewindow.impl.x11.X11Util";
-    public static final String X11JAWTToolkitLockClassName = "com.jogamp.nativewindow.impl.jawt.x11.X11JAWTToolkitLock" ;
-    public static final String X11ToolkitLockClassName = "com.jogamp.nativewindow.impl.x11.X11ToolkitLock" ;
+    public static final String JAWTUtilClassName = "jogamp.nativewindow.jawt.JAWTUtil" ;
+    public static final String X11UtilClassName = "jogamp.nativewindow.x11.X11Util";
+    public static final String GDIClassName = "jogamp.nativewindow.windows.GDI";
+    public static final String X11JAWTToolkitLockClassName = "jogamp.nativewindow.jawt.x11.X11JAWTToolkitLock" ;
+    public static final String X11ToolkitLockClassName = "jogamp.nativewindow.x11.X11ToolkitLock" ;
     private static Class  jawtUtilClass;
     private static Method jawtUtilGetJAWTToolkitMethod;
     private static Method jawtUtilInitMethod;
@@ -113,13 +114,41 @@ public abstract class NativeWindowFactory {
 
     static {
         JVMUtil.initSingleton();
+        DEBUG = Debug.debug("NativeWindow");
+        if(DEBUG) {
+            Throwable td = new Throwable(Thread.currentThread().getName()+" - Info: NativeWindowFactory.<init>");
+            td.printStackTrace();
+        }
     }
 
     static boolean initialized = false;
 
+    private static void initNativeImpl(final boolean firstUIActionOnProcess, final ClassLoader cl) {
+        String clazzName = null;
+        if( TYPE_X11.equals(nativeWindowingTypePure) ) {
+            clazzName = X11UtilClassName;
+        } else if( TYPE_WINDOWS.equals(nativeWindowingTypePure) ) {
+            clazzName = GDIClassName;
+        }
+        if( null != clazzName ) {
+            ReflectionUtil.callStaticMethod(clazzName, "initSingleton",
+                                            new Class[] { boolean.class },
+                                            new Object[] { new Boolean(firstUIActionOnProcess) }, cl );
+        }
+    }
+
     /**
      * Static one time initialization of this factory.<br>
-     * This initialization method <b>must be called</b> once by the program or utilizing modules!<br>
+     * This initialization method <b>must be called</b> once by the program or utilizing modules!
+     * <p>
+     * The parameter <code>firstUIActionOnProcess</code> has an impact on concurrent locking:
+     * <ul>
+     *   <li> {@link #getDefaultToolkitLock() getDefaultToolkitLock() }</li>
+     *   <li> {@link #getDefaultToolkitLock(java.lang.String) getDefaultToolkitLock(type) }</li>
+     *   <li> {@link #createDefaultToolkitLock(java.lang.String, long) createDefaultToolkitLock(type, dpyHandle) }</li>
+     *   <li> {@link #createDefaultToolkitLockNoAWT(java.lang.String, long) createDefaultToolkitLockNoAWT(type, dpyHandle) }</li>
+     * </ul>
+     * </p>
      * @param firstUIActionOnProcess Should be <code>true</code> if called before the first UI action of the running program,
      * otherwise <code>false</code>.
      */
@@ -128,8 +157,7 @@ public abstract class NativeWindowFactory {
             initialized = true;
 
             if(DEBUG) {
-                Throwable td = new Throwable("Info: NativeWindowFactory.initSingleton("+firstUIActionOnProcess+")");
-                td.printStackTrace();
+                System.err.println(Thread.currentThread().getName()+" - NativeWindowFactory.initSingleton("+firstUIActionOnProcess+")");
             }
 
             // Gather the windowing OS first
@@ -144,15 +172,14 @@ public abstract class NativeWindowFactory {
                 nativeWindowingTypeCustom = nativeOSNameCustom;
             }
 
-            ClassLoader cl = NativeWindowFactory.class.getClassLoader();
+            final ClassLoader cl = NativeWindowFactory.class.getClassLoader();
 
-            if( TYPE_X11.equals(nativeWindowingTypePure) ) {
-                // explicit initialization of X11Util
-                ReflectionUtil.callStaticMethod(X11UtilClassName, "initSingleton", 
-                                                new Class[] { boolean.class }, 
-                                                new Object[] { new Boolean(firstUIActionOnProcess) }, cl );
+            if(firstUIActionOnProcess) {
+                // X11 initialization before possible AWT initialization
+                initNativeImpl(firstUIActionOnProcess, cl);
             }
             isFirstUIActionOnProcess = firstUIActionOnProcess;
+            isAWTAvailable = false; // may be set to true below
 
             if( !Debug.getBooleanProperty("java.awt.headless", true, acc) &&
                 ReflectionUtil.isClassAvailable(AWTComponentClassName, cl) &&
@@ -162,7 +189,7 @@ public abstract class NativeWindowFactory {
                     public Object run() {
                         try {
                             jawtUtilClass = Class.forName(JAWTUtilClassName, false, NativeWindowFactory.class.getClassLoader());
-                            jawtUtilInitMethod = jawtUtilClass.getDeclaredMethod("initSingleton", null);
+                            jawtUtilInitMethod = jawtUtilClass.getDeclaredMethod("initSingleton", (Class[])null);
                             jawtUtilInitMethod.setAccessible(true);
                             jawtUtilGetJAWTToolkitMethod = jawtUtilClass.getDeclaredMethod("getJAWTToolkitLock", new Class[]{});
                             jawtUtilGetJAWTToolkitMethod.setAccessible(true);
@@ -180,16 +207,13 @@ public abstract class NativeWindowFactory {
                         // AWT is only available in case all above classes are available
                         // and AWT is not int headless mode
                         isAWTAvailable = ((Boolean)resO).equals(Boolean.FALSE);
-                    } else {
-                        isAWTAvailable = false;
                     }
-                } else {
-                    isAWTAvailable = false;
                 }
-            } else {
-                isAWTAvailable = false;
             }
-
+            if(!firstUIActionOnProcess) {
+                // X11 initialization after possible AWT initialization
+                initNativeImpl(firstUIActionOnProcess, cl);
+            }
             registeredFactories = Collections.synchronizedMap(new HashMap());
 
             // register our default factory -> NativeWindow
@@ -270,10 +294,7 @@ public abstract class NativeWindowFactory {
     /**
      * Provides the system default {@link ToolkitLock}, a singleton instance.
      * <br>
-     * This is a {@link com.jogamp.nativewindow.impl.jawt.JAWTToolkitLock}
-     * in case of a <b>X11 system</b> <em>and</em> <b>AWT availability</b> and if
-     * this factory has been initialized with <b>{@link #initSingleton(boolean) initSingleton(firstUIActionOnProcess==true)}</b>, <br>
-     * otherwise {@link com.jogamp.nativewindow.impl.NullToolkitLock} is returned.
+     * @see #getDefaultToolkitLock(java.lang.String)
      */
     public static ToolkitLock getDefaultToolkitLock() {
         return getDefaultToolkitLock(getNativeWindowType(false));
@@ -282,15 +303,27 @@ public abstract class NativeWindowFactory {
     /**
      * Provides the default {@link ToolkitLock} for <code>type</code>, a singleton instance.
      * <br>
-     * This is a {@link com.jogamp.nativewindow.impl.jawt.JAWTToolkitLock}
-     * in case of a <b>X11 type</b> or <b>AWT type / X11 system</b> <em>and</em> <b>AWT availability</b> and if
-     * this factory has been initialized with <b>{@link #initSingleton(boolean) initSingleton(firstUIActionOnProcess==true)}</b>, <br>
-     * otherwise {@link com.jogamp.nativewindow.impl.NullToolkitLock} is returned.
+     * <ul>
+     *   <li> If {@link #initSingleton(boolean) initSingleton( <b>firstUIActionOnProcess := false</b> )} </li>
+     *   <ul>
+     *     <li>If native <b>X11 type</b> with or w/o AWT</li>
+     *     <ul>
+     *       <li> If <b>AWT available</b> </li>
+     *       <ul>
+     *         <li> return {@link jogamp.nativewindow.jawt.JAWTToolkitLock} </li>
+     *       </ul>
+     *     </ul>
+     *   </ul>
+     *   <li> Otherwise return {@link jogamp.nativewindow.NullToolkitLock} </li>
+     * </ul>
      */
     public static ToolkitLock getDefaultToolkitLock(String type) {
-        if( isAWTAvailable() && !isFirstUIActionOnProcess() &&
-            ( TYPE_X11 == type || TYPE_AWT == type && TYPE_X11 == getNativeWindowType(false) ) ) {
-            return getAWTToolkitLock();
+        if( !isFirstUIActionOnProcess() ) {
+            if( TYPE_X11 == type || TYPE_AWT == type && TYPE_X11 == getNativeWindowType(false) ) {
+                if( isAWTAvailable() ) {
+                    return getAWTToolkitLock();
+                }
+            }
         }
         return NativeWindowFactoryImpl.getNullToolkitLock();
     }
@@ -308,39 +341,63 @@ public abstract class NativeWindowFactory {
     public static ToolkitLock getNullToolkitLock() {
         return NativeWindowFactoryImpl.getNullToolkitLock();
     }
+
     /**
      * Creates the default {@link ToolkitLock} for <code>type</code> and <code>deviceHandle</code>.
      * <br>
-     * This is a {@link com.jogamp.nativewindow.impl.jawt.x11.X11JAWTToolkitLock}
-     * in case of a <b>X11 type</b> <em>and</em> <b>AWT availability</b> and if
-     * this factory has been initialized with <b>{@link #initSingleton(boolean) initSingleton(firstUIActionOnProcess==true)}</b>, <br>
-     * or a {@link com.jogamp.nativewindow.impl.x11.X11ToolkitLock}
-     * in case of a <b>X11 type</b> <em>and</em> <b>no AWT availability</b> and if
-     * this factory has been initialized with <b>{@link #initSingleton(boolean) initSingleton(firstUIActionOnProcess==true)}</b>, <br>
-     * otherwise {@link com.jogamp.nativewindow.impl.NullToolkitLock} is returned.
+     * <ul>
+     *   <li> If {@link #initSingleton(boolean) initSingleton( <b>firstUIActionOnProcess := false</b> )} </li>
+     *   <ul>
+     *     <li>If <b>X11 type</b> </li>
+     *     <ul>
+     *       <li> If <b>AWT available</b> </li>
+     *       <ul>
+     *         <li> return {@link jogamp.nativewindow.jawt.x11.X11JAWTToolkitLock} </li>
+     *       </ul>
+     *       <li> If <b>AWT not available</b> </li>
+     *       <ul>
+     *         <li> return {@link jogamp.nativewindow.x11.X11ToolkitLock} </li>
+     *       </ul>
+     *     </ul>
+     *   </ul>
+     *   <li> Otherwise return {@link jogamp.nativewindow.NullToolkitLock} </li>
+     * </ul>
      */
     public static ToolkitLock createDefaultToolkitLock(String type, long deviceHandle) {
-        if( TYPE_X11 == type ) {
-            if( 0== deviceHandle ) {
-                throw new RuntimeException("JAWTUtil.createDefaultToolkitLock() called with NULL device but on X11");
-            }
-            if( !isFirstUIActionOnProcess() ) {
+        if( !isFirstUIActionOnProcess() ) {
+            if( TYPE_X11 == type ) {
+                if( 0== deviceHandle ) {
+                    throw new RuntimeException("JAWTUtil.createDefaultToolkitLock() called with NULL device but on X11");
+                }
                 if( isAWTAvailable() ) {
                     return createX11AWTToolkitLock(deviceHandle);
-                } else {
-                    return createX11ToolkitLock(deviceHandle);
                 }
+                return createX11ToolkitLock(deviceHandle);
             }
         }
         return NativeWindowFactoryImpl.getNullToolkitLock();
     }
 
+    /**
+     * Creates the default {@link ToolkitLock} for <code>type</code> and <code>deviceHandle</code>.
+     * <br>
+     * <ul>
+     *   <li> If {@link #initSingleton(boolean) initSingleton( <b>firstUIActionOnProcess := false</b> )} </li>
+     *   <ul>
+     *     <li>If <b>X11 type</b> </li>
+     *     <ul>
+     *       <li> return {@link jogamp.nativewindow.x11.X11ToolkitLock} </li>
+     *     </ul>
+     *   </ul>
+     *   <li> Otherwise return {@link jogamp.nativewindow.NullToolkitLock} </li>
+     * </ul>
+     */
     public static ToolkitLock createDefaultToolkitLockNoAWT(String type, long deviceHandle) {
-        if( TYPE_X11 == type ) {
-            if( 0== deviceHandle ) {
-                throw new RuntimeException("JAWTUtil.createDefaultToolkitLockNoAWT() called with NULL device but on X11");
-            }
-            if( !isFirstUIActionOnProcess() ) {
+        if( !isFirstUIActionOnProcess() ) {
+            if( TYPE_X11 == type ) {
+                if( 0== deviceHandle ) {
+                    throw new RuntimeException("JAWTUtil.createDefaultToolkitLockNoAWT() called with NULL device but on X11");
+                }
                 return createX11ToolkitLock(deviceHandle);
             }
         }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
new file mode 100644
index 0000000..038580c
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
@@ -0,0 +1,150 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package javax.media.nativewindow;
+
+import com.jogamp.common.util.locks.RecursiveLock;
+
+public abstract class ProxySurface implements NativeSurface {
+    protected RecursiveLock surfaceLock = new RecursiveLock();
+    protected AbstractGraphicsConfiguration config;
+    protected long displayHandle;
+    protected int height;
+    protected int scrnIndex;
+    protected int width;
+
+    public ProxySurface(AbstractGraphicsConfiguration cfg) {
+        invalidate();
+        config = cfg;
+        displayHandle=cfg.getScreen().getDevice().getHandle();
+    }
+
+    void invalidate() {
+        displayHandle = 0;
+        invalidateImpl();
+    }
+    protected abstract void invalidateImpl();
+
+    public final long getDisplayHandle() {
+        return displayHandle;
+    }
+
+    public final AbstractGraphicsConfiguration getGraphicsConfiguration() {
+        return config;
+    }
+
+    public final int getScreenIndex() {
+        return config.getScreen().getIndex();
+    }
+
+    public abstract long getSurfaceHandle();
+
+    public final int getWidth() {
+        return width;
+    }
+
+    public final int getHeight() {
+        return height;
+    }
+
+    public void setSize(int width, int height) {
+        this.width = width;
+        this.height = height;
+    }
+
+    public boolean surfaceSwap() {
+        return false;
+    }
+
+    public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+    }
+
+    public int lockSurface() throws NativeWindowException {
+        surfaceLock.lock();
+        int res = surfaceLock.getRecursionCount() == 0 ? LOCK_SURFACE_NOT_READY : LOCK_SUCCESS;
+
+        if ( LOCK_SURFACE_NOT_READY == res ) {
+            try {
+                final AbstractGraphicsDevice adevice = config.getScreen().getDevice();
+                adevice.lock();
+                try {
+                    res = lockSurfaceImpl();
+                } finally {
+                    if (LOCK_SURFACE_NOT_READY >= res) {
+                        adevice.unlock();
+                    }
+                }
+            } finally {
+                if (LOCK_SURFACE_NOT_READY >= res) {
+                    surfaceLock.unlock();
+                }
+            }
+        }
+        return res;
+    }
+
+    public final void unlockSurface() {
+        surfaceLock.validateLocked();
+
+        if (surfaceLock.getRecursionCount() == 0) {
+            final AbstractGraphicsDevice adevice = config.getScreen().getDevice();
+            try {
+                unlockSurfaceImpl();
+            } finally {
+                adevice.unlock();
+            }
+        }
+        surfaceLock.unlock();
+    }
+
+    protected abstract int lockSurfaceImpl();
+
+    protected abstract void unlockSurfaceImpl() ;
+
+    public final void validateSurfaceLocked() {
+        surfaceLock.validateLocked();
+    }
+
+    public final boolean isSurfaceLocked() {
+        return surfaceLock.isLocked();
+    }
+
+    public final boolean isSurfaceLockedByOtherThread() {
+        return surfaceLock.isLockedByOtherThread();
+    }
+
+    public final Thread getSurfaceLockOwner() {
+        return surfaceLock.getOwner();
+    }
+
+    public final int getSurfaceRecursionCount() {
+        return surfaceLock.getRecursionCount();
+    }
+
+    public abstract String toString();
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java b/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java
index 2269988..982ce46 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java
@@ -28,14 +28,14 @@
 
 package javax.media.nativewindow;
 
-import com.jogamp.nativewindow.impl.Debug;
+import jogamp.nativewindow.Debug;
 import java.security.AccessController;
 
 /**
  * Marker for a singleton global recursive blocking lock implementation,
  * optionally locking a native windowing toolkit as well.
  * <br>
- * One use case is the AWT locking on X11, see {@link com.jogamp.nativewindow.impl.jawt.JAWTToolkitLock}.
+ * One use case is the AWT locking on X11, see {@link jogamp.nativewindow.jawt.JAWTToolkitLock}.
  */
 public interface ToolkitLock {
     public static final boolean TRACE_LOCK = Debug.isPropertyDefined("nativewindow.debug.ToolkitLock.TraceLock", true, AccessController.getContext());
diff --git a/src/nativewindow/classes/javax/media/nativewindow/WindowClosingProtocol.java b/src/nativewindow/classes/javax/media/nativewindow/WindowClosingProtocol.java
new file mode 100644
index 0000000..949aee7
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/WindowClosingProtocol.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package javax.media.nativewindow;
+
+/**
+ * Protocol for handling window closing events.
+ * <p>
+ * The implementation shall obey either the user value set by this interface,<br>
+ * an underlying toolkit set user value or it's default, eg. {@link #DO_NOTHING_ON_CLOSE DO_NOTHING_ON_CLOSE} within an AWT environment.<br>
+ * If none of the above determines the operation,
+ * this protocol default behavior {@link #DISPOSE_ON_CLOSE DISPOSE_ON_CLOSE} shall be used.</p>
+ */
+public interface WindowClosingProtocol {
+    /**
+     * Dispose resources on native window close operation.<br>
+     * This is the default behavior in case no underlying toolkit defines otherwise.
+     */
+    int DISPOSE_ON_CLOSE = 1;
+
+    /**
+     * Do nothing on native window close operation.<br>
+     * This is the default behavior within an AWT environment.
+     */
+    int DO_NOTHING_ON_CLOSE = 0;
+
+    /**
+     * @return the current close operation value
+     * @see #DISPOSE_ON_CLOSE
+     * @see #DO_NOTHING_ON_CLOSE
+     */
+    int getDefaultCloseOperation();
+
+    /**
+     * @param op the new close operation value
+     * @return the previous close operation value
+     * @see #DISPOSE_ON_CLOSE
+     * @see #DO_NOTHING_ON_CLOSE
+     */
+    int setDefaultCloseOperation(int op);
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java
index c3d10de..d83a92a 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java
@@ -46,7 +46,7 @@ import java.awt.GraphicsConfiguration;
 import java.awt.GraphicsDevice;
 import java.awt.image.ColorModel;
 import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import com.jogamp.nativewindow.impl.Debug;
+import jogamp.nativewindow.Debug;
 
 /** A wrapper for an AWT GraphicsConfiguration allowing it to be
     handled in a toolkit-independent manner. */
@@ -103,6 +103,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
       return new AWTGraphicsConfiguration(awtScreen, capsChosen, capsRequested, awtGfxConfig);
   }
 
+    @Override
   public Object clone() {
       return super.clone();
   }
@@ -111,6 +112,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
     return config;
   }
 
+    @Override
   public AbstractGraphicsConfiguration getNativeGraphicsConfiguration() {
     return (null!=encapsulated)?encapsulated:this;
   }
@@ -154,8 +156,9 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
     return capabilities;
   }
 
+    @Override
   public String toString() {
-    return getClass().toString()+"[" + getScreen() + 
+    return getClass().getSimpleName()+"[" + getScreen() +
                                    ",\n\tchosen    " + capabilitiesChosen+
                                    ",\n\trequested " + capabilitiesRequested+ 
                                    ",\n\t" + config +
diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java
index cc4cd46..66a63bf 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java
@@ -65,6 +65,7 @@ public class AWTGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
     return new AWTGraphicsDevice(awtDevice, unitID);
   }
 
+    @Override
   public Object clone() {
       return super.clone();
   }
@@ -90,8 +91,9 @@ public class AWTGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
     return subType;
   }
 
+    @Override
   public String toString() {
-    return getClass().toString()+"[type "+getType()+"[subType "+getSubType()+"], connection "+getConnection()+", unitID "+getUnitID()+", awtDevice "+device+", handle 0x"+Long.toHexString(getHandle())+"]";
+    return getClass().getSimpleName()+"[type "+getType()+"[subType "+getSubType()+"], connection "+getConnection()+", unitID "+getUnitID()+", awtDevice "+device+", handle 0x"+Long.toHexString(getHandle())+"]";
   }
 }
 
diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTWindowClosingProtocol.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTWindowClosingProtocol.java
new file mode 100644
index 0000000..e7db942
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTWindowClosingProtocol.java
@@ -0,0 +1,139 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package javax.media.nativewindow.awt;
+
+import java.awt.Component;
+import java.awt.Window;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import javax.media.nativewindow.WindowClosingProtocol;
+import jogamp.nativewindow.awt.AWTMisc;
+
+public class AWTWindowClosingProtocol implements WindowClosingProtocol {
+
+  private Component comp;
+  private Runnable closingOperation;
+  private volatile boolean closingListenerSet = false;
+  private Object closingListenerLock = new Object();
+  private int defaultCloseOperation = DISPOSE_ON_CLOSE;
+  private boolean defaultCloseOperationSetByUser = false;
+
+  public AWTWindowClosingProtocol(Component comp, Runnable closingOperation) {
+      this.comp = comp;
+      this.closingOperation = closingOperation;
+  }
+
+  class WindowClosingAdapter extends WindowAdapter {
+    @Override
+    public void windowClosing(WindowEvent e) {
+      int op = AWTWindowClosingProtocol.this.getDefaultCloseOperation();
+
+      if( DISPOSE_ON_CLOSE == op ) {
+          // we have to issue this call right away,
+          // otherwise the window gets destroyed
+          closingOperation.run();
+      }
+    }
+  }
+  WindowListener windowClosingAdapter = new WindowClosingAdapter();
+
+  final boolean addClosingListenerImpl() {
+    Window w = AWTMisc.getWindow(comp);
+    if(null!=w) {
+        w.addWindowListener(windowClosingAdapter);
+        return true;
+    }
+    return false;
+  }
+
+  /**
+   * Adds this closing listener to the components Window if exist and only one time.<br>
+   * Hence you may call this method every time to ensure it has been set,
+   * ie in case the Window parent is not available yet.
+   *
+   * @return
+   */
+  public final boolean addClosingListenerOneShot() {
+    if(!closingListenerSet) { // volatile: ok
+      synchronized(closingListenerLock) {
+        if(!closingListenerSet) {
+            closingListenerSet=addClosingListenerImpl();
+            return closingListenerSet;
+        }
+      }
+    }
+    return false;
+  }
+
+  public final boolean removeClosingListener() {
+    if(closingListenerSet) { // volatile: ok
+      synchronized(closingListenerLock) {
+        if(closingListenerSet) {
+            Window w = AWTMisc.getWindow(comp);
+            if(null!=w) {
+                w.removeWindowListener(windowClosingAdapter);
+                closingListenerSet = false;
+                return true;
+            }
+        }
+      }
+    }
+    return false;
+  }
+
+  /**
+   *
+   * @return the user set close operation if set by {@link #setDefaultCloseOperation(int) setDefaultCloseOperation(int)},
+   *         otherwise return the AWT/Swing close operation value translated to
+   *         a {@link WindowClosingProtocol} value .
+   */
+  public final int getDefaultCloseOperation() {
+      int op = -1;
+      synchronized(closingListenerLock) {
+        if(defaultCloseOperationSetByUser) {
+          op = defaultCloseOperation;
+        }
+      }
+      if(0 <= op) {
+          return op;
+      }
+      // User didn't determine the behavior, use underlying AWT behavior
+      return AWTMisc.getNWClosingOperation(comp);
+  }
+
+  public final int setDefaultCloseOperation(int op) {
+      synchronized(closingListenerLock) {
+          int _op = defaultCloseOperation;
+          defaultCloseOperation = op;
+          defaultCloseOperationSetByUser = true;
+          return _op;
+      }
+  }
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java
index 7bd27fd..2dfd9f0 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java
@@ -38,19 +38,21 @@ import javax.media.nativewindow.*;
  */
 
 public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
+    boolean closeDisplay = false;
+
     /**
      * Note that this is not an open connection, ie no native display handle exist.
      * This constructor exist to setup a default device connection/unit.<br>
      */
-    public EGLGraphicsDevice(int unitID) {
-        super(NativeWindowFactory.TYPE_EGL, AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID);
+    public EGLGraphicsDevice(String connection, int unitID) {
+        super(NativeWindowFactory.TYPE_EGL, connection, unitID);
     }
 
     /** Constructs a new EGLGraphicsDevice corresponding to the given EGL display handle. */
-    public EGLGraphicsDevice(long eglDisplay, int unitID) {
-        super(NativeWindowFactory.TYPE_EGL, AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID, eglDisplay);
+    public EGLGraphicsDevice(long eglDisplay, String connection, int unitID) {
+        super(NativeWindowFactory.TYPE_EGL, connection, unitID, eglDisplay);
     }
-
+    
     public Object clone() {
       return super.clone();
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/package.html b/src/nativewindow/classes/javax/media/nativewindow/package.html
index 1eb1cef..14730a5 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/package.html
+++ b/src/nativewindow/classes/javax/media/nativewindow/package.html
@@ -24,20 +24,20 @@
   <ul>
     <li>{@link javax.media.nativewindow.AbstractGraphicsDevice AbstractGraphicsDevice},<br>
        <br>
-       Shall return the new string identifier with {@link javax.media.nativewindow.AbstractGraphicsDevice#getType() getType()}</li><br>
+       Shall return the new string identifier with {@link javax.media.nativewindow.AbstractGraphicsDevice#getType() getType()}</li>
     <li>{@link javax.media.nativewindow.AbstractGraphicsScreen AbstractGraphicsScreen}</li>
-    <li>{@link javax.media.nativewindow.AbstractGraphicsConfiguration AbstractGraphicsConfiguration}</li><br>
+    <li>{@link javax.media.nativewindow.AbstractGraphicsConfiguration AbstractGraphicsConfiguration}</li>
   </ul>
   <br>
   The implementor has to provide the following:<br><br>
   <ul>
     <li> The specialisation of the abstract class {@link javax.media.nativewindow.NativeWindowFactory NativeWindowFactory}<br>
          <br>
-         shall be registered with {@link javax.media.nativewindow.NativeWindowFactory#registerFactory NativeWindowFactory.registerFactory(..)}.</li><br>
+         shall be registered with {@link javax.media.nativewindow.NativeWindowFactory#registerFactory NativeWindowFactory.registerFactory(..)}.</li>
 
     <li> The specialisation of the abstract class {@link javax.media.nativewindow.GraphicsConfigurationFactory GraphicsConfigurationFactory}<br>
          <br>
-         shall be registered with {@link javax.media.nativewindow.GraphicsConfigurationFactory#registerFactory GraphicsConfigurationFactory.registerFactory(..)}.</li><br>
+         shall be registered with {@link javax.media.nativewindow.GraphicsConfigurationFactory#registerFactory GraphicsConfigurationFactory.registerFactory(..)}.</li>
   </ul><br>
   This protocol <i>does not</i> describe how to <i>create</i> native windows, but how to <i>bind</i> a native surface to an implementation of 
   and window to an implementation of {@link javax.media.nativewindow.NativeSurface NativeSurface}.<br>
@@ -45,50 +45,54 @@
   However, an implementation of this protocol (e.g. {@link com.jogamp.newt}) may support the creation.<br>
    
 <h3>Dependencies</h3>
-  This binding has dependencies to the following:<br><br>
+  This binding has dependencies to the following:
   <ul>
-    <li> Either of the following Java implementations:<br>
+    <li> Either of the following Java implementations:<br/>
     <ul>
-        <li> <a href="http://java.sun.com/j2se/1.4.2/docs/api/">Java SE 1.4 or later</a> </li><br>
-        <li> <a href="http://java.sun.com/javame/technology/cdc/">Java ME CDC 1.1.2 (JSR 218)</a> and 
-             <a href="http://java.sun.com/products/foundation/">Foundation Profile 1.1.2 (JSR 219)</a><br>
-             and either of the following <i>java.nio</i> implementations:<br>
-             <ul>
-                <li> <a href="http://java.sun.com/javame/reference/apis/jsr239/java/nio/package-summary.html"> JSR239 <i>java.nio</i> subset</a> </li>
+        <li> <a href="http://java.sun.com/j2se/1.5.0/docs/api/">Java SE 1.5 or later</a> </li>
+        <li> A mobile JavaVM with language 1.5 support, ie:
+            <ul>
+                <li> <a href="http://developer.android.com/reference/packages.html">Dalvik API Level 7</a> </li>
+                <li> <a href="http://jamvm.sourceforge.net/">JamVM</a> </li>
+            </ul>
+            with
+            <ul>
+                <li> <a href="http://java.sun.com/products/foundation/">Foundation Profile 1.1.2 (JSR 219)</a> </li>
                 <li> <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/package-summary.html"> Java 1.4 <i>java.nio</i> implementation</a> </li>
-             </ul><br>
-    </ul>    
+            </ul></li>
+    </ul></li>
   </ul>
   <br>
 
 <h3>Package Structure</h3>
-  The packages defined by this specification include:<br><br>
+  The packages defined by this specification include:<br/><br/>
 <ul>
     <li>The <b>javax.media.nativewindow</b> package<br>
       <br>
   This package contains Java bindings for a native windowing system.<br>
-  Subsequent packages contain marker type classes, containing native characteristics of the windowing system.</li><br><br>
+  Subsequent packages contain marker type classes, containing native characteristics of the windowing system.
+
   <ul>
     <li>The <b>javax.media.nativewindow.awt</b> package<br>
       <br>
-  This sub package contains classes to cover the native characteristics of the AWT windowing system.</li><br>
+  This sub package contains classes to cover the native characteristics of the AWT windowing system.</li>
 
     <li>The <b>javax.media.nativewindow.x11</b> package<br>
       <br>
-  This sub package contains classes to cover the native characteristics of the X11 windowing system.</li><br>
+  This sub package contains classes to cover the native characteristics of the X11 windowing system.</li>
 
     <li>The <b>javax.media.nativewindow.windows</b> package<br>
       <br>
-  This sub package contains classes to cover the native characteristics of the Windows windowing system.</li><br>
+  This sub package contains classes to cover the native characteristics of the Windows windowing system.</li>
 
     <li>The <b>javax.media.nativewindow.macosx</b> package<br>
       <br>
-  This sub package contains classes to cover the native characteristics of the MacOSX windowing system.</li><br>
+  This sub package contains classes to cover the native characteristics of the MacOSX windowing system.</li>
 
     <li>The <b>javax.media.nativewindow.egl</b> package<br>
       <br>
-  This sub package contains classes to cover the native characteristics of the EGL/OpenKODE windowing system.</li><br>
-  </ul>
+  This sub package contains classes to cover the native characteristics of the EGL/OpenKODE windowing system.</li>
+  </ul></li>
 </ul>
 
 <h3>Factory Model</h3>
@@ -103,7 +107,8 @@ Regardless of the knowledge of the underly
   </h3>
    
 <ul>
-<li> Early Draft Review, June 2009
+<li> Early Draft Review, June 2009</li>
+<li> 2.0.0 Maintenance Release, February 2011</li>
 </ul>
   <br>
   <br>
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
index a970be1..4151c15 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
@@ -90,8 +90,7 @@ public class Dimension implements Cloneable, DimensionReadOnly {
     public int hashCode() {
         // 31 * x == (x << 5) - x
         int hash = 31 + width;
-        hash = ((hash << 5) - hash) + height;
-        return hash;
+        return ((hash << 5) - hash) + height;
     }
 }
 
diff --git a/src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java
index d5e3238..5d0129e 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java
@@ -40,7 +40,11 @@ import javax.media.nativewindow.*;
 public class WindowsGraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
     /** Constructs a new WindowsGraphicsDevice */
     public WindowsGraphicsDevice(int unitID) {
-        super(NativeWindowFactory.TYPE_WINDOWS, AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID);
+        this(AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID);
+    }
+
+    public WindowsGraphicsDevice(String connection, int unitID) {
+        super(NativeWindowFactory.TYPE_WINDOWS, connection, unitID);
     }
 
     public Object clone() {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java
index 07171e1..100b6b8 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java
@@ -33,7 +33,8 @@
 package javax.media.nativewindow.x11;
 
 import javax.media.nativewindow.*;
-import com.jogamp.nativewindow.impl.x11.XVisualInfo;
+
+import jogamp.nativewindow.x11.XVisualInfo;
 
 /** Encapsulates a graphics configuration, or OpenGL pixel format, on
     X11 platforms. Objects of this type are returned from {@link
@@ -51,6 +52,7 @@ public class X11GraphicsConfiguration extends DefaultGraphicsConfiguration imple
         this.info = info;
     }
 
+    @Override
     public Object clone() {
       return super.clone();
     }
@@ -67,8 +69,9 @@ public class X11GraphicsConfiguration extends DefaultGraphicsConfiguration imple
         return (null!=info)?info.getVisualid():0;
     }
     
+    @Override
     public String toString() {
-        return getClass().toString()+"["+getScreen()+", visualID 0x" + Long.toHexString(getVisualID()) + 
+        return getClass().getSimpleName()+"["+getScreen()+", visualID 0x" + Long.toHexString(getVisualID()) +
                                        ",\n\tchosen    " + capabilitiesChosen+
                                        ",\n\trequested " + capabilitiesRequested+ 
                                        "]";
diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java
index 31e03f8..48fd63e 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java
@@ -32,13 +32,18 @@
 
 package javax.media.nativewindow.x11;
 
-import com.jogamp.nativewindow.impl.x11.X11Util;
-import javax.media.nativewindow.*;
+import jogamp.nativewindow.Debug;
+import jogamp.nativewindow.x11.X11Util;
+import javax.media.nativewindow.DefaultGraphicsDevice;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.nativewindow.ToolkitLock;
 
 /** Encapsulates a graphics device on X11 platforms.
  */
 
 public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
+    public static final boolean DEBUG = Debug.debug("GraphicsDevice");
     boolean closeDisplay = false;
 
     /** Constructs a new X11GraphicsDevice corresponding to the given connection and default
@@ -78,15 +83,21 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
 
     public void setCloseDisplay(boolean close) {
         closeDisplay = close;
+        if(DEBUG && close) {
+            System.err.println(Thread.currentThread().getName() + " - X11GraphicsDevice.setCloseDisplay(true): "+this);
+        }
     }
     public boolean close() {
         // FIXME: shall we respect the unitID ?
         if(closeDisplay && 0 != handle) {
+            if(DEBUG) {
+                System.err.println(Thread.currentThread().getName() + " - X11GraphicsDevice.close(): "+this);
+            }
             X11Util.closeDisplay(handle);
             handle = 0;
             return true;
         }
-        return true;
+        return false;
     }
 }
 
diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java
index 9de3baa..ffe84cb 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java
@@ -33,7 +33,7 @@
 package javax.media.nativewindow.x11;
 
 import javax.media.nativewindow.*;
-import com.jogamp.nativewindow.impl.x11.X11Util;
+import jogamp.nativewindow.x11.X11Util;
 
 /** Encapsulates a screen index on X11
     platforms. Objects of this type are passed to {@link
diff --git a/src/nativewindow/classes/jogamp/nativewindow/Debug.java b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
new file mode 100644
index 0000000..f1cd209
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.nativewindow;
+
+import java.security.*;
+
+/** Helper routines for logging and debugging. */
+
+public class Debug {
+  // Some common properties
+  private static boolean verbose;
+  private static boolean debugAll;
+  private static AccessControlContext localACC;
+  
+  static {
+    localACC=AccessController.getContext();
+    verbose = isPropertyDefined("nativewindow.verbose", true);
+    debugAll = isPropertyDefined("nativewindow.debug", true);
+    if (verbose) {
+       Package p = Package.getPackage("javax.media.nativewindow");
+       System.err.println("NativeWindow specification version " + p.getSpecificationVersion());
+       System.err.println("NativeWindow implementation version " + p.getImplementationVersion());
+       System.err.println("NativeWindow implementation vendor " + p.getImplementationVendor());
+    }
+  }
+
+  static int getIntProperty(final String property, final boolean jnlpAlias) {
+      return getIntProperty(property, jnlpAlias, localACC);
+  }
+
+  public static int getIntProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    int i=0;
+    try {
+        Integer iv = Integer.valueOf(Debug.getProperty(property, jnlpAlias, acc));
+        i = iv.intValue();
+    } catch (NumberFormatException nfe) {}
+    return i;
+  }
+
+  static boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
+    return getBooleanProperty(property, jnlpAlias, localACC);
+  }
+
+  public static boolean getBooleanProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    Boolean b = Boolean.valueOf(Debug.getProperty(property, jnlpAlias, acc));
+    return b.booleanValue();
+  }
+
+  static boolean isPropertyDefined(final String property, final boolean jnlpAlias) {
+    return isPropertyDefined(property, jnlpAlias, localACC);
+  }
+
+  public static boolean isPropertyDefined(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    return (Debug.getProperty(property, jnlpAlias, acc) != null) ? true : false;
+  }
+
+  static String getProperty(final String property, final boolean jnlpAlias) {
+    return getProperty(property, jnlpAlias, localACC);
+  }
+
+  public static String getProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    String s=null;
+    if(null!=acc && acc.equals(localACC)) {
+        s = (String) AccessController.doPrivileged(new PrivilegedAction() {
+            public Object run() {
+              String val=null;
+              try {
+                  val = System.getProperty(property);
+              } catch (Exception e) {}
+              if(null==val && jnlpAlias && !property.startsWith(jnlp_prefix)) {
+                  try {
+                      val = System.getProperty(jnlp_prefix + property);
+                  } catch (Exception e) {}
+              }
+              return val;
+            }
+          });
+    } else {
+        try {
+            s = System.getProperty(property);
+        } catch (Exception e) {}
+        if(null==s && jnlpAlias && !property.startsWith(jnlp_prefix)) {
+            try {
+                s = System.getProperty(jnlp_prefix + property);
+            } catch (Exception e) {}
+        }
+    }
+    return s;
+  }
+  public static final String jnlp_prefix = "jnlp." ;
+
+  public static boolean verbose() {
+    return verbose;
+  }
+
+  public static boolean debugAll() {
+    return debugAll;
+  }
+
+  public static boolean debug(String subcomponent) {
+    return debugAll() || isPropertyDefined("nativewindow.debug." + subcomponent, true);
+  }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
new file mode 100644
index 0000000..f34b740
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.nativewindow;
+
+import javax.media.nativewindow.*;
+
+public class DefaultGraphicsConfigurationFactoryImpl extends GraphicsConfigurationFactory {
+    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
+            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen) {
+        return new DefaultGraphicsConfiguration(screen, capsChosen, capsRequested);
+    }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
new file mode 100644
index 0000000..33e2905
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+
+package jogamp.nativewindow;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import com.jogamp.common.jvm.JNILibLoaderBase;
+
+public class NWJNILibLoader extends JNILibLoaderBase {
+  
+  public static void loadNativeWindow(final String ossuffix) {
+    AccessController.doPrivileged(new PrivilegedAction() {
+      public Object run() {
+        loadLibrary("nativewindow_"+ossuffix, null, false);
+        return null;
+      }
+    });
+  }
+
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
new file mode 100644
index 0000000..3db8f32
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.nativewindow;
+
+import com.jogamp.common.util.*;
+import java.lang.reflect.*;
+
+import javax.media.nativewindow.*;
+
+public class NativeWindowFactoryImpl extends NativeWindowFactory {
+    private static final ToolkitLock nullToolkitLock = new NullToolkitLock();
+
+    public static ToolkitLock getNullToolkitLock() {
+            return nullToolkitLock;
+    }
+
+    // This subclass of NativeWindowFactory handles the case of
+    // NativeWindows being passed in
+    protected NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException {
+        if (null == winObj) {
+            throw new IllegalArgumentException("winObj is null");
+        }
+        if (winObj instanceof NativeWindow) {
+            // Use the NativeWindow directly
+            return (NativeWindow) winObj;
+        }
+
+        if (null == config) {
+            throw new IllegalArgumentException("AbstractGraphicsConfiguration is null with a non NativeWindow object");
+        }
+
+        if (NativeWindowFactory.isAWTAvailable() && ReflectionUtil.instanceOf(winObj, AWTComponentClassName)) {
+            return getAWTNativeWindow(winObj, config);
+        }
+
+        throw new IllegalArgumentException("Target window object type " +
+                                           winObj.getClass().getName() + " is unsupported; expected " +
+                                           "javax.media.nativewindow.NativeWindow or "+AWTComponentClassName);
+    }
+    
+    private Constructor nativeWindowConstructor = null;
+
+    private NativeWindow getAWTNativeWindow(Object winObj, AbstractGraphicsConfiguration config) {
+        if (nativeWindowConstructor == null) {
+            try {
+                String osType = getNativeWindowType(true);
+                String windowClassName = null;
+
+                // We break compile-time dependencies on the AWT here to
+                // make it easier to run this code on mobile devices
+
+                if (osType.equals(TYPE_WINDOWS)) {
+                    windowClassName = "jogamp.nativewindow.jawt.windows.WindowsJAWTWindow";
+                } else if (osType.equals(TYPE_MACOSX)) {
+                    windowClassName = "jogamp.nativewindow.jawt.macosx.MacOSXJAWTWindow";
+                } else if (osType.equals(TYPE_X11)) {
+                    // Assume Linux, Solaris, etc. Should probably test for these explicitly.
+                    windowClassName = "jogamp.nativewindow.jawt.x11.X11JAWTWindow";
+                } else {
+                    throw new IllegalArgumentException("OS " + getNativeOSName(false) + " not yet supported");
+                }
+
+                nativeWindowConstructor = ReflectionUtil.getConstructor(
+                                            windowClassName, new Class[] { Object.class, AbstractGraphicsConfiguration.class }, 
+                                            getClass().getClassLoader());
+            } catch (Exception e) {
+                throw new IllegalArgumentException(e);
+            }
+        }
+
+        try {
+            return (NativeWindow) nativeWindowConstructor.newInstance(new Object[] { winObj, config });
+        } catch (Exception ie) {
+            throw new IllegalArgumentException(ie);
+        }
+    }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
new file mode 100644
index 0000000..2056d20
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
@@ -0,0 +1,55 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.nativewindow;
+
+import javax.media.nativewindow.ToolkitLock;
+
+/**
+ * Implementing a singleton global recursive {@link javax.media.nativewindow.ToolkitLock}
+ * without any locking. Since there is no locking it all,
+ * it is intrinsically recursive.
+ */
+public class NullToolkitLock implements ToolkitLock {
+
+    /** Singleton via {@link NativeWindowFactoryImpl#getNullToolkitLock()} */
+    protected NullToolkitLock() { }
+    
+    public final void lock() {
+        if(TRACE_LOCK) {
+            String msg = "NullToolkitLock.lock()";
+            System.err.println(msg);
+            // Throwable t = new Throwable(msg);
+            // t.printStackTrace();
+        }
+    }
+
+    public final void unlock() {
+        if(TRACE_LOCK) { System.err.println("NullToolkitLock.unlock()"); }
+    }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
new file mode 100644
index 0000000..4c2b1c8
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
@@ -0,0 +1,70 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.nativewindow;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.ProxySurface;
+import javax.media.nativewindow.SurfaceChangeable;
+
+
+public class WrappedSurface extends ProxySurface implements  SurfaceChangeable {
+  protected long surfaceHandle;
+
+  public WrappedSurface(AbstractGraphicsConfiguration cfg) {
+      this(cfg, 0);
+  }
+
+  public WrappedSurface(AbstractGraphicsConfiguration cfg, long handle) {
+    super(cfg);
+    surfaceHandle=handle;
+  }
+  
+  protected final void invalidateImpl() {
+    surfaceHandle = 0;
+  }
+
+  public long getSurfaceHandle() {
+    return surfaceHandle;
+  }
+
+  public void setSurfaceHandle(long surfaceHandle) {
+    this.surfaceHandle=surfaceHandle;
+  }
+
+  protected int lockSurfaceImpl() {
+      return LOCK_SUCCESS;
+  }
+
+  protected void unlockSurfaceImpl() {
+  }
+
+  public String toString() {
+    return "WrappedSurface[config " + config + ", displayHandle 0x" + Long.toHexString(getDisplayHandle()) + ", surfaceHandle 0x" + Long.toHexString(getSurfaceHandle()) + ", size " + getWidth() + "x" + getHeight() + "]";
+  }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
new file mode 100644
index 0000000..834d8a7
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.nativewindow.awt;
+
+import java.awt.Window;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Frame;
+import javax.swing.JFrame;
+import javax.swing.WindowConstants;
+
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.WindowClosingProtocol;
+import javax.swing.MenuSelectionManager;
+
+public class AWTMisc {
+
+    public static JFrame getJFrame(Component c) {
+        while (c != null && !(c instanceof JFrame)) {
+            c = c.getParent();
+        }
+        return (JFrame) c;
+    }
+
+    public static Frame getFrame(Component c) {
+        while (c != null && !(c instanceof Frame)) {
+            c = c.getParent();
+        }
+        return (Frame) c;
+    }
+
+    public static Window getWindow(Component c) {
+        while (c != null && !(c instanceof Window)) {
+            c = c.getParent();
+        }
+        return (Window) c;
+    }
+
+    public static Container getContainer(Component c) {
+        while (c != null && !(c instanceof Container)) {
+            c = c.getParent();
+        }
+        return (Container) c;
+    }
+
+    /**
+     * Issue this when your non AWT toolkit gains focus to clear AWT menu path
+     */
+    public static void clearAWTMenus() {
+        MenuSelectionManager.defaultManager().clearSelectedPath();
+    }
+
+    public static int AWT2NWClosingOperation(int awtClosingOperation) {
+        switch (awtClosingOperation) {
+            case WindowConstants.DISPOSE_ON_CLOSE:
+            case WindowConstants.EXIT_ON_CLOSE:
+                return WindowClosingProtocol.DISPOSE_ON_CLOSE;
+            case WindowConstants.DO_NOTHING_ON_CLOSE:
+            case WindowConstants.HIDE_ON_CLOSE:
+                return WindowClosingProtocol.DO_NOTHING_ON_CLOSE;
+            default:
+                throw new NativeWindowException("Unhandled AWT Closing Operation: " + awtClosingOperation);
+        }
+    }
+
+    public static int getNWClosingOperation(Component c) {
+        JFrame jf = getJFrame(c);
+        int op = (null != jf) ? jf.getDefaultCloseOperation() : WindowConstants.DO_NOTHING_ON_CLOSE ;
+        return AWT2NWClosingOperation(op);
+    }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
new file mode 100644
index 0000000..1ac9e17
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.nativewindow.jawt;
+
+import javax.media.nativewindow.NativeWindowFactory;
+import jogamp.nativewindow.NWJNILibLoader;
+
+import java.awt.Toolkit;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+public class JAWTJNILibLoader extends NWJNILibLoader {
+  public static void loadAWTImpl() {
+    AccessController.doPrivileged(new PrivilegedAction() {
+      public Object run() {
+        // Make sure that awt.dll is loaded before loading jawt.dll. Otherwise
+        // a Dialog with "awt.dll not found" might pop up.
+        // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4481947.
+        Toolkit.getDefaultToolkit();
+        
+        // Must pre-load JAWT on all non-Mac platforms to
+        // ensure references from jogl_awt shared object
+        // will succeed since JAWT shared object isn't in
+        // default library path
+        if ( ! NativeWindowFactory.TYPE_MACOSX.equals( NativeWindowFactory.getNativeWindowType(false) ) ) {
+            try {
+                loadLibrary("jawt", null, true);
+            } catch (Throwable t) {
+                // It might be ok .. if it's already loaded
+                if(DEBUG) {
+                    t.printStackTrace();
+                }
+            }
+        }
+        return null;
+      }
+    });
+  }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTToolkitLock.java
new file mode 100644
index 0000000..37e34c0
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTToolkitLock.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.nativewindow.jawt;
+
+import javax.media.nativewindow.ToolkitLock;
+
+/**
+ * Implementing a singleton global recursive {@link javax.media.nativewindow.ToolkitLock}
+ * utilizing JAWT's AWT lock via {@link JAWTUtil#lockToolkit()}.
+ * <br>
+ * This strategy should only be used if AWT is using the underlying native windowing toolkit
+ * in a not intrinsic thread safe manner, e.g. under X11 where no XInitThreads() call
+ * is issued before any other X11 usage. This is the current situation for e.g. Webstart or Applets.
+ */
+public class JAWTToolkitLock implements ToolkitLock {
+
+    /** Singleton via {@link JAWTUtil#getJAWTToolkitLock()} */
+    protected JAWTToolkitLock() {}
+
+    public final void lock() {
+        if(TRACE_LOCK) { System.err.println("JAWTToolkitLock.lock()"); }
+        JAWTUtil.lockToolkit();
+    }
+
+    public final void unlock() {
+        if(TRACE_LOCK) { System.err.println("JAWTToolkitLock.unlock()"); }
+        JAWTUtil.unlockToolkit();
+    }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
new file mode 100644
index 0000000..80dd5c4
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package jogamp.nativewindow.jawt;
+
+import jogamp.nativewindow.*;
+import java.awt.EventQueue;
+
+import javax.media.nativewindow.*;
+
+
+import java.awt.GraphicsEnvironment;
+import java.awt.Toolkit;
+import java.lang.reflect.*;
+import java.security.*;
+import java.util.ArrayList;
+import java.util.Map;
+
+public class JAWTUtil {
+  protected static final boolean DEBUG = Debug.debug("JAWT");
+
+  // See whether we're running in headless mode
+  private static final boolean headlessMode;
+
+  // Java2D magic ..
+  private static final Method isQueueFlusherThread;
+  private static final boolean j2dExist;
+
+  private static final Class   sunToolkitClass;
+  private static final Method  sunToolkitAWTLockMethod;
+  private static final Method  sunToolkitAWTUnlockMethod;
+  private static final boolean hasSunToolkitAWTLock;
+
+  private static final JAWTToolkitLock jawtToolkitLock;
+
+  private static class PrivilegedDataBlob1 {
+    PrivilegedDataBlob1() {
+        ok = false;
+    }  
+    Class   sunToolkitClass;
+    Method  sunToolkitAWTLockMethod;
+    Method  sunToolkitAWTUnlockMethod;
+    boolean ok;
+  }
+  
+  static {
+    JAWTJNILibLoader.loadAWTImpl();
+    JAWTJNILibLoader.loadNativeWindow("awt");
+
+    headlessMode = GraphicsEnvironment.isHeadless();
+
+    boolean ok = false;
+    Class jC = null;
+    Method m = null;
+    if (!headlessMode) {
+        try {
+            jC = Class.forName("jogamp.opengl.awt.Java2D");
+            m = jC.getMethod("isQueueFlusherThread", (Class[])null);
+            ok = true;
+        } catch (Exception e) {
+        }
+    }
+    isQueueFlusherThread = m;
+    j2dExist = ok;
+
+    PrivilegedDataBlob1 pdb1 = (PrivilegedDataBlob1) AccessController.doPrivileged(new PrivilegedAction() {        
+        public Object run() {
+            PrivilegedDataBlob1 d = new PrivilegedDataBlob1();
+            try {                
+                d.sunToolkitClass = Class.forName("sun.awt.SunToolkit");
+                d.sunToolkitAWTLockMethod = sunToolkitClass.getDeclaredMethod("awtLock", new Class[]{});
+                d.sunToolkitAWTLockMethod.setAccessible(true);
+                d.sunToolkitAWTUnlockMethod = sunToolkitClass.getDeclaredMethod("awtUnlock", new Class[]{});
+                d.sunToolkitAWTUnlockMethod.setAccessible(true);
+                d.ok=true;
+            } catch (Exception e) {
+                // Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
+            }
+            return d;
+        }
+    });
+    sunToolkitClass = pdb1.sunToolkitClass;
+    sunToolkitAWTLockMethod = pdb1.sunToolkitAWTLockMethod;
+    sunToolkitAWTUnlockMethod = pdb1.sunToolkitAWTUnlockMethod;
+    
+    boolean _hasSunToolkitAWTLock = false;
+    if ( pdb1.ok ) {
+        try {
+            sunToolkitAWTLockMethod.invoke(null, (Object[])null);
+            sunToolkitAWTUnlockMethod.invoke(null, (Object[])null);
+            _hasSunToolkitAWTLock = true;
+        } catch (Exception e) {
+        }
+    }
+    hasSunToolkitAWTLock = _hasSunToolkitAWTLock;
+    // hasSunToolkitAWTLock = false;
+
+    jawtToolkitLock = new JAWTToolkitLock();
+
+    // trigger native AWT toolkit / properties initialization
+    Map desktophints = null;
+    try {
+        if(EventQueue.isDispatchThread()) {
+            desktophints = (Map)(Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"));
+        } else {
+            final ArrayList desktophintsBucket = new ArrayList(1);
+            EventQueue.invokeAndWait(new Runnable() {
+                public void run() {
+                    Map _desktophints = (Map)(Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"));
+                    if(null!=_desktophints) {
+                        desktophintsBucket.add(_desktophints);
+                    }
+                }
+            });
+            desktophints = ( desktophintsBucket.size() > 0 ) ? (Map)desktophintsBucket.get(0) : null ;
+        }
+    } catch (InterruptedException ex) {
+        ex.printStackTrace();
+    } catch (InvocationTargetException ex) {
+        ex.printStackTrace();
+    }
+
+    if (DEBUG) {
+        System.err.println("JAWTUtil: Has sun.awt.SunToolkit.awtLock/awtUnlock " + hasSunToolkitAWTLock);
+        System.err.println("JAWTUtil: Has Java2D " + j2dExist);
+        System.err.println("JAWTUtil: Is headless " + headlessMode);
+        int hints = ( null != desktophints ) ? desktophints.size() : 0 ;
+        System.err.println("JAWTUtil: AWT Desktop hints " + hints);
+    }
+  }
+
+  public static void initSingleton() {
+      // just exist to ensure static init has been run
+  }
+
+
+  public static boolean hasJava2D() {
+    return j2dExist;
+  }
+
+  public static boolean isJava2DQueueFlusherThread() {
+    boolean b = false;
+    if(j2dExist) {
+        try {
+            b = ((Boolean)isQueueFlusherThread.invoke(null, (Object[])null)).booleanValue();
+        } catch (Exception e) {}
+    }
+    return b;
+  }
+
+  public static boolean isHeadlessMode() {
+    return headlessMode;
+  }
+
+  /**
+   * Locks the AWT's global ReentrantLock.<br>
+   *
+   * JAWT's native Lock() function calls SunToolkit.awtLock(),
+   * which just uses AWT's global ReentrantLock.<br>
+   */
+  public static void awtLock() {
+    if(hasSunToolkitAWTLock) {
+        try {
+            sunToolkitAWTLockMethod.invoke(null, (Object[])null);
+        } catch (Exception e) {
+          throw new NativeWindowException("SunToolkit.awtLock failed", e);
+        }
+    } else {
+        JAWT.getJAWT().Lock();
+    }
+  }
+
+  /**
+   * Unlocks the AWT's global ReentrantLock.<br>
+   *
+   * JAWT's native Unlock() function calls SunToolkit.awtUnlock(),
+   * which just uses AWT's global ReentrantLock.<br>
+   */
+  public static void awtUnlock() {
+    if(hasSunToolkitAWTLock) {
+        try {
+            sunToolkitAWTUnlockMethod.invoke(null, (Object[])null);
+        } catch (Exception e) {
+          throw new NativeWindowException("SunToolkit.awtUnlock failed", e);
+        }
+    } else {
+        JAWT.getJAWT().Unlock();
+    }
+  }
+
+  public static void lockToolkit() throws NativeWindowException {
+    if(!headlessMode && !isJava2DQueueFlusherThread()) {
+        awtLock();
+    }
+  }
+
+  public static void unlockToolkit() {
+    if(!headlessMode && !isJava2DQueueFlusherThread()) {
+        awtUnlock();
+    }
+  }
+
+  public static JAWTToolkitLock getJAWTToolkitLock() {
+    return jawtToolkitLock;
+  }
+}
+
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java
new file mode 100644
index 0000000..67f6fe4
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTWindow.java
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package jogamp.nativewindow.jawt;
+
+import com.jogamp.common.util.locks.RecursiveLock;
+
+import java.awt.Component;
+import java.awt.Window;
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.NativeWindow;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.util.Point;
+import javax.media.nativewindow.util.Rectangle;
+
+public abstract class JAWTWindow implements NativeWindow {
+  protected static final boolean DEBUG = JAWTUtil.DEBUG;
+
+  // lifetime: forever
+  protected Component component;
+  protected AbstractGraphicsConfiguration config;
+
+  // lifetime: valid after lock, forever until invalidate
+  protected long drawable;
+  protected Rectangle bounds;
+
+  public JAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+    if (config == null) {
+        throw new NativeWindowException("Error: AbstractGraphicsConfiguration is null");
+    }
+    this.config = config;
+    init((Component)comp);
+  }
+
+  private void init(Component windowObject) throws NativeWindowException {
+    invalidate();
+    this.component = windowObject;
+    validateNative();
+  }
+  protected abstract void validateNative() throws NativeWindowException;
+
+  protected synchronized void invalidate() {
+    component = null;
+    drawable= 0;
+    bounds = new Rectangle();
+  }
+
+  protected final void updateBounds(JAWT_Rectangle jawtBounds) {
+    bounds.setX(jawtBounds.getX());
+    bounds.setY(jawtBounds.getY());
+    bounds.setWidth(jawtBounds.getWidth());
+    bounds.setHeight(jawtBounds.getHeight());
+  }
+
+  /** @return the JAWT_DrawingSurfaceInfo's (JAWT_Rectangle) bounds, updated with lock */
+  public final Rectangle getBounds() { return bounds; }
+
+  public final Component getAWTComponent() {
+    return component;
+  }
+
+  //
+  // SurfaceUpdateListener
+  //
+
+  public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+      // nop
+  }
+  
+  //
+  // NativeSurface
+  //
+
+  private RecursiveLock surfaceLock = new RecursiveLock();
+
+  protected abstract int lockSurfaceImpl() throws NativeWindowException;
+
+  public final int lockSurface() throws NativeWindowException {
+    surfaceLock.lock();
+    int res = surfaceLock.getRecursionCount() == 0 ? LOCK_SURFACE_NOT_READY : LOCK_SUCCESS;
+
+    if ( LOCK_SURFACE_NOT_READY == res ) {
+        try {
+            final AbstractGraphicsDevice adevice = config.getScreen().getDevice();
+            adevice.lock();
+            try {
+                res = lockSurfaceImpl();
+            } finally {
+                if (LOCK_SURFACE_NOT_READY >= res) {
+                    adevice.unlock();
+                }
+            }
+        } finally {
+            if (LOCK_SURFACE_NOT_READY >= res) {
+                surfaceLock.unlock();
+            }
+        }
+    }
+    return res;
+  }
+
+  protected abstract void unlockSurfaceImpl() throws NativeWindowException;
+
+  public final void unlockSurface() {
+    surfaceLock.validateLocked();
+
+    if (surfaceLock.getRecursionCount() == 0) {
+        final AbstractGraphicsDevice adevice = config.getScreen().getDevice();
+        try {
+            unlockSurfaceImpl();
+        } finally {
+            adevice.unlock();
+        }
+    }
+    surfaceLock.unlock();
+  }
+
+  public final boolean isSurfaceLockedByOtherThread() {
+    return surfaceLock.isLockedByOtherThread();
+  }
+
+  public final boolean isSurfaceLocked() {
+    return surfaceLock.isLocked();
+  }
+
+  public final Thread getSurfaceLockOwner() {
+    return surfaceLock.getOwner();
+  }
+
+  public final boolean surfaceSwap() {
+    return false;
+  }
+
+  public final void surfaceUpdated(Object updater, NativeWindow window, long when) { }
+
+  public final long getSurfaceHandle() {
+    return drawable;
+  }
+  public final AbstractGraphicsConfiguration getGraphicsConfiguration() {
+    return config;
+  }
+
+  public final long getDisplayHandle() {
+    return config.getScreen().getDevice().getHandle();
+  }
+
+  public final int getScreenIndex() {
+    return config.getScreen().getIndex();
+  }
+
+  public final void setSize(int width, int height) {
+    component.setSize(width, height);
+  }
+
+  public final int getWidth() {
+    return component.getWidth();
+  }
+
+  public final int getHeight() {
+    return component.getHeight();
+  }
+
+  //
+  // NativeWindow
+  //
+
+  public synchronized void destroy() {
+    if(null!=component) {
+        if(component instanceof Window) {
+            ((Window)component).dispose();
+        }
+    }
+    invalidate();
+  }
+
+  public final NativeWindow getParent() {
+      return null;
+  }
+
+  public long getWindowHandle() {
+    return drawable;
+  }
+
+  public final int getX() {
+      return component.getX();
+  }
+
+  public final int getY() {
+      return component.getY();
+  }
+
+  public Point getLocationOnScreen(Point storage) {
+        if( 0 != getWindowHandle() ) {
+            Point d;
+            // windowLock.lock();
+            try {
+                d = getLocationOnScreenImpl(0, 0);
+            } finally {
+                // windowLock.unlock();
+            }
+            if(null!=d) {
+                if(null!=storage) {
+                    storage.translate(d.getX(),d.getY());
+                    return storage;
+                }
+                return d;
+            }
+            // fall through intended ..
+        }
+
+        if(!Thread.holdsLock(component.getTreeLock())) {
+            return null; // avoid deadlock ..
+        }
+        java.awt.Point awtLOS = component.getLocationOnScreen();
+        int dx = (int) ( awtLOS.getX() + .5 ) ;
+        int dy = (int) ( awtLOS.getY() + .5 ) ;
+        if(null!=storage) {
+            return storage.translate(dx, dy);
+        }
+        return new Point(dx, dy);
+  }
+  protected abstract Point getLocationOnScreenImpl(int x, int y);
+
+    @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+
+    sb.append("JAWT-Window["+
+                "windowHandle 0x"+Long.toHexString(getWindowHandle())+
+                ", surfaceHandle 0x"+Long.toHexString(getSurfaceHandle())+
+                ", bounds "+bounds);
+    if(null!=component) {
+      sb.append(", pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+
+                ", visible "+component.isVisible());
+    } else {
+      sb.append(", component NULL");
+    }
+    sb.append(", lockedExt "+isSurfaceLockedByOtherThread()+
+              ",\n\tconfig "+config+
+              ",\n\tawtComponent "+getAWTComponent()+"]");
+
+    return sb.toString();
+  }
+
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java
new file mode 100644
index 0000000..40d7b80
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWT_PlatformInfo.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.nativewindow.jawt;
+
+/** Marker class for all window system-specific JAWT data structures. */
+
+public interface JAWT_PlatformInfo {
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
new file mode 100644
index 0000000..9c29bbd
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.nativewindow.jawt.macosx;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.NativeWindow;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.util.Point;
+
+import jogamp.nativewindow.jawt.JAWT;
+import jogamp.nativewindow.jawt.JAWTFactory;
+import jogamp.nativewindow.jawt.JAWTWindow;
+import jogamp.nativewindow.jawt.JAWT_DrawingSurface;
+import jogamp.nativewindow.jawt.JAWT_DrawingSurfaceInfo;
+
+public class MacOSXJAWTWindow extends JAWTWindow {
+
+  public MacOSXJAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+    super(comp, config);
+  }
+
+  protected void validateNative() throws NativeWindowException {
+  }
+
+  protected int lockSurfaceImpl() throws NativeWindowException {
+    int ret = NativeWindow.LOCK_SUCCESS;
+    ds = JAWT.getJAWT().GetDrawingSurface(component);
+    if (ds == null) {
+      // Widget not yet realized
+      unlockSurfaceImpl();
+      return NativeWindow.LOCK_SURFACE_NOT_READY;
+    }
+    int res = ds.Lock();
+    dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
+    if (!dsLocked) {
+      unlockSurfaceImpl();
+      throw new NativeWindowException("Unable to lock surface");
+    }
+    // See whether the surface changed and if so destroy the old
+    // OpenGL context so it will be recreated (NOTE: removeNotify
+    // should handle this case, but it may be possible that race
+    // conditions can cause this code to be triggered -- should test
+    // more)
+    if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
+      ret = NativeWindow.LOCK_SURFACE_CHANGED;
+    }
+    if (firstLock) {
+      AccessController.doPrivileged(new PrivilegedAction() {
+          public Object run() {
+            dsi = ds.GetDrawingSurfaceInfo();
+            return null;
+          }
+        });
+    } else {
+      dsi = ds.GetDrawingSurfaceInfo();
+    }
+    if (dsi == null) {
+      unlockSurfaceImpl();
+      return NativeWindow.LOCK_SURFACE_NOT_READY;
+    }
+    firstLock = false;
+    macosxdsi = (JAWT_MacOSXDrawingSurfaceInfo) dsi.platformInfo();
+    if (macosxdsi == null) {
+      unlockSurfaceImpl();
+      return NativeWindow.LOCK_SURFACE_NOT_READY;
+    }
+    drawable = macosxdsi.getCocoaViewRef();
+
+    if (drawable == 0) {
+      unlockSurfaceImpl();
+      return NativeWindow.LOCK_SURFACE_NOT_READY;
+    } else {
+      updateBounds(dsi.getBounds());
+    }
+    return ret;
+  }
+    
+  protected void unlockSurfaceImpl() throws NativeWindowException {
+    if(null!=ds) {
+        if (null!=dsi) {
+            ds.FreeDrawingSurfaceInfo(dsi);
+        }
+        if (dsLocked) {
+            ds.Unlock();
+        }
+        JAWT.getJAWT().FreeDrawingSurface(ds);
+    }
+    ds = null;
+    dsi = null;
+    macosxdsi = null;
+  }
+
+  protected Point getLocationOnScreenImpl(int x, int y) {
+    return null; // FIXME
+  }
+
+  // Variables for lockSurface/unlockSurface
+  private JAWT_DrawingSurface ds;
+  private boolean dsLocked;
+  private JAWT_DrawingSurfaceInfo dsi;
+  private JAWT_MacOSXDrawingSurfaceInfo macosxdsi;
+
+  // Workaround for instance of 4796548
+  private boolean firstLock = true;
+
+}
+
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
new file mode 100644
index 0000000..5ad2280
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.nativewindow.jawt.windows;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.awt.AWTGraphicsConfiguration;
+
+/** This class encapsulates the reflection routines necessary to peek
+    inside a few data structures in the AWT implementation on X11 for
+    the purposes of correctly enumerating the available visuals. */
+
+public class Win32SunJDKReflection {
+  private static Class   win32GraphicsDeviceClass;
+  private static Class   win32GraphicsConfigClass;
+  private static Method  win32GraphicsConfigGetConfigMethod;
+  private static Method  win32GraphicsConfigGetVisualMethod;
+  private static boolean initted;
+
+  static {
+    AccessController.doPrivileged(new PrivilegedAction() {
+        public Object run() {
+          try {
+            win32GraphicsDeviceClass = Class.forName("sun.awt.Win32GraphicsDevice");
+            win32GraphicsConfigClass = Class.forName("sun.awt.Win32GraphicsConfig");
+            win32GraphicsConfigGetConfigMethod = win32GraphicsConfigClass.getDeclaredMethod("getConfig", new Class[] { win32GraphicsDeviceClass, int.class });
+            win32GraphicsConfigGetConfigMethod.setAccessible(true);
+            win32GraphicsConfigGetVisualMethod = win32GraphicsConfigClass.getDeclaredMethod("getVisual", new Class[] {});
+            win32GraphicsConfigGetVisualMethod.setAccessible(true);
+            initted = true;
+          } catch (Exception e) {
+            // Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
+          }
+          return null;
+        }
+      });
+  }
+
+  public static GraphicsConfiguration graphicsConfigurationGet(GraphicsDevice device, int pfdID) {
+    if (!initted) {
+      return null;
+    }
+
+    try {
+      return (GraphicsConfiguration) win32GraphicsConfigGetConfigMethod.invoke(null, new Object[] { device, new Integer(pfdID) });
+    } catch (Exception e) {
+      return null;
+    }
+  }
+
+  public static int graphicsConfigurationGetPixelFormatID(AbstractGraphicsConfiguration config) {
+      try {
+          if (config instanceof AWTGraphicsConfiguration) {
+              return graphicsConfigurationGetPixelFormatID(((AWTGraphicsConfiguration) config).getGraphicsConfiguration());
+          }
+          return 0;
+      } catch (Exception e) {
+          return 0;
+      }
+  }
+
+  public static int graphicsConfigurationGetPixelFormatID(GraphicsConfiguration config) {
+    if (!initted) {
+      return 0;
+    }
+
+    try {
+      return ((Integer) win32GraphicsConfigGetVisualMethod.invoke(config, (Object[])null)).intValue();
+    } catch (Exception e) {
+      return 0;
+    }
+  }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
new file mode 100644
index 0000000..982b948
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.nativewindow.jawt.windows;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.NativeWindow;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.util.Point;
+
+import jogamp.nativewindow.jawt.JAWT;
+import jogamp.nativewindow.jawt.JAWTFactory;
+import jogamp.nativewindow.jawt.JAWTWindow;
+import jogamp.nativewindow.jawt.JAWT_DrawingSurface;
+import jogamp.nativewindow.jawt.JAWT_DrawingSurfaceInfo;
+import jogamp.nativewindow.windows.GDI;
+
+public class WindowsJAWTWindow extends JAWTWindow {
+
+  public WindowsJAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+    super(comp, config);
+  }
+
+  protected void validateNative() throws NativeWindowException {
+  }
+
+  @Override
+  protected synchronized void invalidate() {
+    super.invalidate();
+    windowHandle = 0;
+  }
+
+  protected int lockSurfaceImpl() throws NativeWindowException {
+    int ret = NativeWindow.LOCK_SUCCESS;
+    ds = JAWT.getJAWT().GetDrawingSurface(component);
+    if (ds == null) {
+      // Widget not yet realized
+      unlockSurfaceImpl();
+      return LOCK_SURFACE_NOT_READY;
+    }
+    int res = ds.Lock();
+    dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
+    if (!dsLocked) {
+      unlockSurfaceImpl();
+      throw new NativeWindowException("Unable to lock surface");
+    }
+    // See whether the surface changed and if so destroy the old
+    // OpenGL context so it will be recreated (NOTE: removeNotify
+    // should handle this case, but it may be possible that race
+    // conditions can cause this code to be triggered -- should test
+    // more)
+    if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
+      ret = LOCK_SURFACE_CHANGED;
+    }
+    dsi = ds.GetDrawingSurfaceInfo();
+    if (dsi == null) {
+      unlockSurfaceImpl();
+      return LOCK_SURFACE_NOT_READY;
+    }
+    win32dsi = (JAWT_Win32DrawingSurfaceInfo) dsi.platformInfo();
+    if (win32dsi == null) {
+      unlockSurfaceImpl();
+      return LOCK_SURFACE_NOT_READY;
+    }
+    windowHandle = win32dsi.getHandle();
+    drawable = win32dsi.getHdc();
+    if (windowHandle == 0 || drawable == 0) {
+      unlockSurfaceImpl();
+      return LOCK_SURFACE_NOT_READY;
+    } else {
+      updateBounds(dsi.getBounds());
+    }
+    return ret;
+  }
+
+  protected void unlockSurfaceImpl() throws NativeWindowException {
+    long startTime = 0;
+    if(null!=ds) {
+        if (null!=dsi) {
+            ds.FreeDrawingSurfaceInfo(dsi);
+        }
+        if (dsLocked) {
+            ds.Unlock();
+        }
+        JAWT.getJAWT().FreeDrawingSurface(ds);
+    }
+    ds = null;
+    dsi = null;
+    win32dsi = null;
+  }
+
+  @Override
+  public long getWindowHandle() {
+    return windowHandle;
+  }
+
+  protected Point getLocationOnScreenImpl(int x, int y) {
+    return GDI.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
+  }
+
+  // Variables for lockSurface/unlockSurface
+  private JAWT_DrawingSurface ds;
+  private boolean dsLocked;
+  private JAWT_DrawingSurfaceInfo dsi;
+  private JAWT_Win32DrawingSurfaceInfo win32dsi;
+
+  // lifetime: valid after lock, forever until invalidate
+  protected long windowHandle;
+}
+
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTToolkitLock.java
new file mode 100644
index 0000000..5d4fa0d
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTToolkitLock.java
@@ -0,0 +1,60 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.nativewindow.jawt.x11;
+
+import jogamp.nativewindow.jawt.*;
+import jogamp.nativewindow.x11.X11Util;
+import javax.media.nativewindow.ToolkitLock;
+
+/**
+ * Implementing a recursive {@link javax.media.nativewindow.ToolkitLock}
+ * utilizing JAWT's AWT lock via {@link JAWTUtil#lockToolkit()} and {@link X11Util#XLockDisplay(long)}.
+ * <br>
+ * This strategy should only be used if AWT is using the underlying native windowing toolkit
+ * in a not intrinsic thread safe manner, e.g. under X11 where no XInitThreads() call
+ * is issued before any other X11 usage. This is the current situation for e.g. Webstart or Applets.
+ */
+public class X11JAWTToolkitLock implements ToolkitLock {
+    long displayHandle;
+
+    public X11JAWTToolkitLock(long displayHandle) {
+        this.displayHandle = displayHandle;
+    }
+
+    public final void lock() {
+        if(TRACE_LOCK) { System.err.println("X11JAWTToolkitLock.lock()"); }
+        JAWTUtil.lockToolkit();
+        X11Util.XLockDisplay(displayHandle);
+    }
+
+    public final void unlock() {
+        if(TRACE_LOCK) { System.err.println("X11JAWTToolkitLock.unlock()"); }
+        X11Util.XUnlockDisplay(displayHandle);
+        JAWTUtil.unlockToolkit();
+    }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
new file mode 100644
index 0000000..2319d62
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package jogamp.nativewindow.jawt.x11;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.NativeWindow;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.nativewindow.awt.AWTGraphicsDevice;
+import javax.media.nativewindow.util.Point;
+
+import jogamp.nativewindow.jawt.JAWT;
+import jogamp.nativewindow.jawt.JAWTFactory;
+import jogamp.nativewindow.jawt.JAWTWindow;
+import jogamp.nativewindow.jawt.JAWT_DrawingSurface;
+import jogamp.nativewindow.jawt.JAWT_DrawingSurfaceInfo;
+import jogamp.nativewindow.x11.X11Util;
+
+public class X11JAWTWindow extends JAWTWindow {
+
+  public X11JAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+    super(comp, config);
+  }
+
+  protected void validateNative() throws NativeWindowException {
+    AWTGraphicsDevice awtDevice = (AWTGraphicsDevice) config.getScreen().getDevice();
+
+    if(awtDevice.getHandle() != 0) {
+        // subtype and handle set already, done
+        return;
+    }
+
+    long displayHandle = 0;
+    
+    // first try a pre-existing attached native configuration, ie native X11GraphicsDevice
+    AbstractGraphicsConfiguration aconfig = (null!=config) ? config.getNativeGraphicsConfiguration() : null;
+    AbstractGraphicsScreen ascreen = (null!=aconfig) ? aconfig.getScreen() : null;
+    AbstractGraphicsDevice adevice = (null!=ascreen) ? ascreen.getDevice() : null; // X11GraphicsDevice
+    if(null!=adevice) {
+        displayHandle = adevice.getHandle();
+    }
+
+    if(0 == displayHandle) {
+        displayHandle = X11SunJDKReflection.graphicsDeviceGetDisplay(awtDevice.getGraphicsDevice());
+    }
+    if(0==displayHandle) {
+        throw new InternalError("X11JAWTWindow: No X11 Display handle available");
+    }
+    awtDevice.setSubType(NativeWindowFactory.TYPE_X11, displayHandle);
+  }
+
+  protected int lockSurfaceImpl() throws NativeWindowException {
+    int ret = NativeWindow.LOCK_SUCCESS;
+    ds = JAWT.getJAWT().GetDrawingSurface(component);
+    if (ds == null) {
+      // Widget not yet realized
+      unlockSurfaceImpl();
+      return LOCK_SURFACE_NOT_READY;
+    }
+    int res = ds.Lock();
+    dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
+    if (!dsLocked) {
+      unlockSurfaceImpl();
+      throw new NativeWindowException("Unable to lock surface");
+    }
+    // See whether the surface changed and if so destroy the old
+    // OpenGL context so it will be recreated (NOTE: removeNotify
+    // should handle this case, but it may be possible that race
+    // conditions can cause this code to be triggered -- should test
+    // more)
+    if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
+      ret = LOCK_SURFACE_CHANGED;
+    }
+    dsi = ds.GetDrawingSurfaceInfo();
+    if (dsi == null) {
+      unlockSurfaceImpl();
+      return LOCK_SURFACE_NOT_READY;
+    }
+    x11dsi = (JAWT_X11DrawingSurfaceInfo) dsi.platformInfo();
+    if (x11dsi == null) {
+      unlockSurfaceImpl();
+      return LOCK_SURFACE_NOT_READY;
+    }
+    drawable = x11dsi.getDrawable();
+    if (drawable == 0) {
+      unlockSurfaceImpl();
+      return LOCK_SURFACE_NOT_READY;
+    } else {
+      updateBounds(dsi.getBounds());
+    }
+    return ret;
+  }
+
+  protected void unlockSurfaceImpl() throws NativeWindowException {
+    if(null!=ds) {
+        if (null!=dsi) {
+            ds.FreeDrawingSurfaceInfo(dsi);
+        }
+        if (dsLocked) {
+            ds.Unlock();
+        }
+        JAWT.getJAWT().FreeDrawingSurface(ds);
+    }
+    ds = null;
+    dsi = null;
+    x11dsi = null;
+  }
+
+  protected Point getLocationOnScreenImpl(int x, int y) {
+    return X11Util.GetRelativeLocation( getDisplayHandle(), getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
+  }
+  
+  // Variables for lockSurface/unlockSurface
+  private JAWT_DrawingSurface ds;
+  private boolean dsLocked;
+  private JAWT_DrawingSurfaceInfo dsi;
+  private JAWT_X11DrawingSurfaceInfo x11dsi;
+  
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
new file mode 100644
index 0000000..b576b0c
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.nativewindow.jawt.x11;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.awt.AWTGraphicsConfiguration;
+
+/** This class encapsulates the reflection routines necessary to peek
+    inside a few data structures in the AWT implementation on X11 for
+    the purposes of correctly enumerating the available visuals. */
+
+public class X11SunJDKReflection {
+  private static Class   x11GraphicsDeviceClass;
+  private static Method  x11GraphicsDeviceGetDisplayMethod;
+  private static Class   x11GraphicsConfigClass;
+  private static Method  x11GraphicsConfigGetVisualMethod;
+  private static boolean initted;
+
+  static {
+    AccessController.doPrivileged(new PrivilegedAction() {
+        public Object run() {
+          try {
+            x11GraphicsDeviceClass = Class.forName("sun.awt.X11GraphicsDevice");
+            x11GraphicsDeviceGetDisplayMethod = x11GraphicsDeviceClass.getDeclaredMethod("getDisplay", new Class[] {});
+            x11GraphicsDeviceGetDisplayMethod.setAccessible(true);
+
+            x11GraphicsConfigClass = Class.forName("sun.awt.X11GraphicsConfig");
+            x11GraphicsConfigGetVisualMethod = x11GraphicsConfigClass.getDeclaredMethod("getVisual", new Class[] {});
+            x11GraphicsConfigGetVisualMethod.setAccessible(true);
+            initted = true;
+          } catch (Exception e) {
+            // Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
+          }
+          return null;
+        }
+      });
+  }
+
+  public static long graphicsDeviceGetDisplay(GraphicsDevice device) {
+    if (!initted) {
+      return 0;
+    }
+
+    try {
+      return ((Long) x11GraphicsDeviceGetDisplayMethod.invoke(device, (Object[])null)).longValue();
+    } catch (Exception e) {
+      return 0;
+    }
+  }
+
+  public static int graphicsConfigurationGetVisualID(AbstractGraphicsConfiguration config) {
+      try {
+          if (config instanceof AWTGraphicsConfiguration) {
+              return graphicsConfigurationGetVisualID(((AWTGraphicsConfiguration) config).getGraphicsConfiguration());
+          }
+          return 0;
+      } catch (Exception e) {
+          return 0;
+      }
+  }
+
+  public static int graphicsConfigurationGetVisualID(GraphicsConfiguration config) {
+    if (!initted) {
+      return 0;
+    }
+
+    try {
+      return ((Integer) x11GraphicsConfigGetVisualMethod.invoke(config, (Object[])null)).intValue();
+    } catch (Exception e) {
+      return 0;
+    }
+  }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/swt/SWTAccessor.java b/src/nativewindow/classes/jogamp/nativewindow/swt/SWTAccessor.java
new file mode 100644
index 0000000..d1f5efc
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/swt/SWTAccessor.java
@@ -0,0 +1,240 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.nativewindow.swt;
+
+import com.jogamp.common.os.Platform;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import org.eclipse.swt.graphics.GCData;
+import org.eclipse.swt.widgets.Control;
+
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.nativewindow.windows.WindowsGraphicsDevice;
+import javax.media.nativewindow.x11.X11GraphicsDevice;
+import com.jogamp.common.util.ReflectionUtil;
+import javax.media.nativewindow.macosx.MacOSXGraphicsDevice;
+
+public class SWTAccessor {
+    static final Field swt_control_handle;
+    static final boolean swt_uses_long_handles;
+    
+    // X11/GTK, Windows/GDI, ..
+    static final String str_handle = "handle";
+    
+    // OSX/Cocoa
+    static final String str_view = "view";  // OSX
+    static final String str_id = "id";    // OSX
+    // static final String str_NSView = "org.eclipse.swt.internal.cocoa.NSView";
+    
+    static final Method swt_control_internal_new_GC;
+    static final Method swt_control_internal_dispose_GC;
+    static final String str_internal_new_GC = "internal_new_GC";
+    static final String str_internal_dispose_GC = "internal_dispose_GC";
+
+    static final String str_OS_gtk_class = "org.eclipse.swt.internal.gtk.OS";
+    static final Class OS_gtk_class;
+    static final Method OS_gtk_widget_realize;
+    static final Method OS_gtk_widget_unrealize;
+    static final Method OS_GTK_WIDGET_WINDOW;
+    static final Method OS_gdk_x11_drawable_get_xdisplay;
+    static final Method OS_gdk_x11_drawable_get_xid;    
+    static final String str_gtk_widget_realize = "gtk_widget_realize";
+    static final String str_gtk_widget_unrealize = "gtk_widget_unrealize";
+    static final String str_GTK_WIDGET_WINDOW = "GTK_WIDGET_WINDOW";
+    static final String str_gdk_x11_drawable_get_xdisplay = "gdk_x11_drawable_get_xdisplay";
+    static final String str_gdk_x11_drawable_get_xid = "gdk_x11_drawable_get_xid";
+    
+    static {
+        Field f = null;
+        
+        if(NativeWindowFactory.TYPE_MACOSX != NativeWindowFactory.getNativeWindowType(false) ) {
+            try {
+                f = Control.class.getField(str_handle);
+            } catch (Exception ex) {
+                throw new NativeWindowException(ex);
+            }
+        }        
+        swt_control_handle = f; // maybe null !
+        
+        boolean ulh;
+        if (null != swt_control_handle) {
+            ulh = swt_control_handle.getGenericType().toString().equals(long.class.toString());
+        } else {
+            ulh = Platform.is64Bit();
+        }
+        swt_uses_long_handles = ulh;
+        // System.err.println("SWT long handles: " + swt_uses_long_handles);
+        // System.err.println("Platform 64bit: "+Platform.is64Bit());
+        
+        Method m=null;
+        try {
+            m = ReflectionUtil.getMethod(Control.class, str_internal_new_GC, new Class[] { GCData.class });
+        } catch (Exception ex) {
+            throw new NativeWindowException(ex);
+        }
+        swt_control_internal_new_GC = m;
+        
+        try {
+            if(swt_uses_long_handles) {
+                m = Control.class.getDeclaredMethod(str_internal_dispose_GC, new Class[] { long.class, GCData.class });            
+            } else {
+                m = Control.class.getDeclaredMethod(str_internal_dispose_GC, new Class[] { int.class, GCData.class });                
+            }
+        } catch (NoSuchMethodException ex) {
+            throw new NativeWindowException(ex);
+        }
+        swt_control_internal_dispose_GC = m;
+
+        Class c=null;                
+        Method m1=null, m2=null, m3=null, m4=null, m5=null;
+        Class handleType = swt_uses_long_handles  ? long.class : int.class ;
+        if( NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(false) ) {
+            try {
+                c = ReflectionUtil.getClass(str_OS_gtk_class, false, SWTAccessor.class.getClassLoader());
+                m1 = c.getDeclaredMethod(str_gtk_widget_realize, handleType);        
+                m2 = c.getDeclaredMethod(str_gtk_widget_unrealize, handleType);
+                m3 = c.getDeclaredMethod(str_GTK_WIDGET_WINDOW, handleType);
+                m4 = c.getDeclaredMethod(str_gdk_x11_drawable_get_xdisplay, handleType);
+                m5 = c.getDeclaredMethod(str_gdk_x11_drawable_get_xid, handleType);
+            } catch (Exception ex) { throw new NativeWindowException(ex); }
+        }
+        OS_gtk_class = c;
+        OS_gtk_widget_realize = m1;
+        OS_gtk_widget_unrealize = m2;
+        OS_GTK_WIDGET_WINDOW = m3;
+        OS_gdk_x11_drawable_get_xdisplay = m4;
+        OS_gdk_x11_drawable_get_xid = m5;
+    }
+
+    static Object getIntOrLong(long arg) {
+        if(swt_uses_long_handles) {
+            return new Long(arg);
+        }
+        return new Integer((int) arg);
+    }
+    
+    static void callStaticMethodL2V(Method m, long arg) {        
+        ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg) });
+    }
+    
+    static long callStaticMethodL2L(Method m, long arg) {
+        Object o = ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg) });
+        if(o instanceof Number) {
+            return ((Number)o).longValue();
+        } else {
+            throw new InternalError("SWT method "+m.getName()+" didn't return int or long but "+o.getClass());
+        }
+    }
+        
+    public static boolean isUsingLongHandles() {
+        return swt_uses_long_handles;
+    }
+
+    public static long getHandle(Control swtControl) {
+        long h = 0;
+        if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false) ) {
+            try {
+                Field fView = Control.class.getField(str_view);
+                Object view = fView.get(swtControl);
+                Field fId = view.getClass().getField(str_id);
+                return fId.getLong(view);
+            } catch (Exception ex) {
+                throw new NativeWindowException(ex);
+            }            
+        }
+        
+        try {
+            h = swt_control_handle.getLong(swtControl);
+        } catch (Exception ex) {
+            throw new NativeWindowException(ex);
+        }
+        return h;
+    }
+
+    public static void setRealized(Control swtControl, boolean realize) {
+        long handle = getHandle(swtControl);
+        
+        if(null != OS_gtk_class) {
+            if(realize) {
+                callStaticMethodL2V(OS_gtk_widget_realize, handle);
+            } else {
+                callStaticMethodL2V(OS_gtk_widget_unrealize, handle);
+            }
+        }
+    }
+    
+    public static AbstractGraphicsDevice getDevice(Control swtControl) {
+        long handle = getHandle(swtControl);
+        if( null != OS_gtk_class ) {
+            long widgedHandle = callStaticMethodL2L(OS_GTK_WIDGET_WINDOW, handle);
+            long displayHandle = callStaticMethodL2L(OS_gdk_x11_drawable_get_xdisplay, widgedHandle);
+            return new X11GraphicsDevice(displayHandle, AbstractGraphicsDevice.DEFAULT_UNIT);
+        }
+        if( NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(false) ) {
+            return new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
+        }
+        if( NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false) ) {
+            return new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+        }
+        throw new UnsupportedOperationException("n/a for this windowing system: "+NativeWindowFactory.getNativeWindowType(false));
+    }
+    
+    public static long getWindowHandle(Control swtControl) {
+        long handle = getHandle(swtControl);        
+        if( null != OS_gtk_class ) {
+            long widgedHandle = callStaticMethodL2L(OS_GTK_WIDGET_WINDOW, handle);
+            return callStaticMethodL2L(OS_gdk_x11_drawable_get_xid, widgedHandle);
+        }
+        if( NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(false) ||
+            NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false) ) {
+            return handle;
+        }
+        throw new UnsupportedOperationException("n/a for this windowing system: "+NativeWindowFactory.getNativeWindowType(false));
+    }
+    
+    public static long newGC(Control swtControl, GCData gcData) {
+        Object o = ReflectionUtil.callMethod(swtControl, swt_control_internal_new_GC, new Object[] { gcData });
+        if(o instanceof Number) {
+            return ((Number)o).longValue();
+        } else {
+            throw new InternalError("SWT internal_new_GC did not return int or long but "+o.getClass());
+        }
+    }
+
+    public static void disposeGC(Control swtControl, long gc, GCData gcData) {
+        if(swt_uses_long_handles) {
+            ReflectionUtil.callMethod(swtControl, swt_control_internal_dispose_GC, new Object[] { new Long(gc), gcData });
+        }  else {
+            ReflectionUtil.callMethod(swtControl, swt_control_internal_dispose_GC, new Object[] { new Integer((int)gc), gcData });
+        }
+    }
+    
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
new file mode 100644
index 0000000..68cf8af
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
@@ -0,0 +1,87 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.nativewindow.windows;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.NativeWindowException;
+
+import javax.media.nativewindow.ProxySurface;
+
+/**
+ * GDI Surface implementation which wraps an existing window handle
+ * allowing the use of HDC via lockSurface()/unlockSurface() protocol.
+ * The latter will get and release the HDC.
+ * The size via getWidth()/getHeight() is invalid.
+ */
+public class GDISurface extends ProxySurface {
+  protected long windowHandle;
+  protected long surfaceHandle;
+
+  public GDISurface(AbstractGraphicsConfiguration cfg, long windowHandle) {
+    super(cfg);
+    if(0 == windowHandle) {
+        throw new NativeWindowException("Error hwnd 0, werr: "+GDI.GetLastError());
+    }
+    this.windowHandle=windowHandle;
+  }
+
+  protected final void invalidateImpl() {
+    windowHandle=0;
+    surfaceHandle=0;
+  }
+
+  protected int lockSurfaceImpl() {
+    if (0 != surfaceHandle) {
+        throw new InternalError("surface not released");
+    }
+    surfaceHandle = GDI.GetDC(windowHandle);
+    return (0 != surfaceHandle) ? LOCK_SUCCESS : LOCK_SURFACE_NOT_READY;
+  }
+
+  protected void unlockSurfaceImpl() {
+    if (0 == surfaceHandle) {
+        throw new InternalError("surface not acquired");
+    }
+    GDI.ReleaseDC(windowHandle, surfaceHandle);
+    surfaceHandle=0;
+  }
+
+  public long getSurfaceHandle() {
+    return surfaceHandle;
+  }
+
+  public String toString() {
+    return "GDISurface[config "+config+
+                ", displayHandle 0x"+Long.toHexString(getDisplayHandle())+
+                ", windowHandle 0x"+Long.toHexString(windowHandle)+
+                ", surfaceHandle 0x"+Long.toHexString(getSurfaceHandle())+
+                ", size "+getWidth()+"x"+getHeight()+"]";
+  }
+
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
new file mode 100644
index 0000000..afb3daf
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.nativewindow.windows;
+
+public class RegisteredClass {
+    long hInstance;
+    String className;
+
+    RegisteredClass(long hInst, String name) {
+        hInstance = hInst;
+        className = name;
+    }
+
+    public final long getHandle() { return hInstance; }
+    public final String getName() { return className; }
+
+    @Override
+    public final String toString() { return "RegisteredClass[handle 0x"+Long.toHexString(hInstance)+", "+className+"]"; }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
new file mode 100644
index 0000000..15e0a67
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
@@ -0,0 +1,133 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.nativewindow.windows;
+
+import jogamp.nativewindow.Debug;
+import java.util.ArrayList;
+import javax.media.nativewindow.NativeWindowException;
+
+public class RegisteredClassFactory {
+    static final boolean DEBUG = Debug.debug("RegisteredClass");
+    private static ArrayList sharedClasses = new ArrayList();
+    private String classBaseName;
+    long wndProc;
+
+    private RegisteredClass sharedClass = null;
+    private int classIter = 0;
+    private int sharedRefCount = 0;
+    private Object sync = new Object();
+
+    /**
+     * Intended for a JVM shutdown hook, hence little synchronization
+     */
+    public static void shutdownSharedClasses() {
+        synchronized(sharedClasses) {
+            for(int i=0; i<sharedClasses.size(); i++) {
+                RegisteredClass sc = (RegisteredClass) sharedClasses.get(i);
+                GDI.DestroyWindowClass(sc.getHandle(), sc.getName());
+                if(DEBUG) {
+                  System.err.println("RegisteredClassFactory shutdownSharedClasses "+i+"/"+sharedClasses.size()+": "+sc);
+                }
+            }
+            sharedClasses.clear();
+        }
+    }
+
+    public RegisteredClassFactory(String classBaseName, long wndProc) {
+        this.classBaseName = classBaseName;
+        this.wndProc = wndProc;
+    }
+
+    public RegisteredClass getSharedClass() throws NativeWindowException {
+      synchronized(sync) {
+          if( 0 == sharedRefCount ) {
+              if( null != sharedClass ) {
+                  throw new InternalError("Error ("+sharedRefCount+"): SharedClass not null: "+sharedClass);
+              }
+              long hInstance = GDI.GetApplicationHandle();
+              if( 0 == hInstance ) {
+                  throw new NativeWindowException("Error: Null ModuleHandle for Application");
+              }
+              String clazzName = null;
+              boolean registered = false;
+              while ( !registered && Integer.MAX_VALUE >= classIter ) {
+                  // Retry with next clazz name, this could happen if more than one JVM is running
+                  clazzName = classBaseName + classIter;
+                  classIter++;
+                  registered = GDI.CreateWindowClass(hInstance, clazzName, wndProc);
+              }
+              if( !registered ) {
+                  throw new NativeWindowException("Error: Could not create WindowClass: "+clazzName);
+              }
+              sharedClass = new RegisteredClass(hInstance, clazzName);
+              synchronized(sharedClasses) {
+                  sharedClasses.add(sharedClass);
+              }
+              if(DEBUG) {
+                  System.err.println("RegisteredClassFactory getSharedClass ("+sharedRefCount+") initialized: "+sharedClass);
+              }
+          } else if ( null == sharedClass ) {
+              throw new InternalError("Error ("+sharedRefCount+"): SharedClass is null");
+          }
+          sharedRefCount++;
+      }
+      return sharedClass;
+    }
+
+    public void releaseSharedClass() {
+      synchronized(sync) {
+          if( 0 == sharedRefCount ) {
+              if( null != sharedClass ) {
+                  throw new InternalError("Error ("+sharedRefCount+"): SharedClass not null: "+sharedClass);
+              }
+              return;
+          }
+          sharedRefCount--;
+          if( null == sharedClass ) {
+              throw new InternalError("Error ("+sharedRefCount+"): SharedClass is null");
+          }
+          if( 0 == sharedRefCount ) {
+              GDI.DestroyWindowClass(sharedClass.getHandle(), sharedClass.getName());
+              synchronized(sharedClasses) {
+                  sharedClasses.remove(sharedClass);
+              }
+              if(DEBUG) {
+                  System.err.println("RegisteredClassFactory releaseSharedClass ("+sharedRefCount+") released: "+sharedClass);
+              }
+              sharedClass = null;
+              sharedRefCount = 0;
+              classIter = 0;
+          }
+      }
+    }
+
+    public int getSharedRefCount() {
+        return sharedRefCount;
+    }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
new file mode 100644
index 0000000..b669bce
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.nativewindow.x11;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+
+public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactory {
+    protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
+        CapabilitiesImmutable  capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen)
+        throws IllegalArgumentException, NativeWindowException {
+
+        if(!(screen instanceof X11GraphicsScreen)) {
+            throw new NativeWindowException("Only valid X11GraphicsScreen are allowed");
+        }
+        return new X11GraphicsConfiguration((X11GraphicsScreen)screen,  capsChosen, capsRequested, getXVisualInfo(screen, capsChosen));
+    }
+
+    public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, long visualID)
+    {
+        XVisualInfo xvi_temp = XVisualInfo.create();
+        xvi_temp.setVisualid(visualID);
+        xvi_temp.setScreen(screen.getIndex());
+        int num[] = { -1 };
+        long display = screen.getDevice().getHandle();
+
+        XVisualInfo[] xvis = X11Util.XGetVisualInfo(display, X11Lib.VisualIDMask|X11Lib.VisualScreenMask, xvi_temp, num, 0);
+
+        if(xvis==null || num[0]<1) {
+            return null;
+        }
+
+        return XVisualInfo.create(xvis[0]);
+    }
+
+    public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, CapabilitiesImmutable capabilities)
+    {
+        XVisualInfo xv = getXVisualInfoImpl(screen, capabilities, 4 /* TrueColor */);
+        if(null!=xv) return xv;
+        return getXVisualInfoImpl(screen, capabilities, 5 /* DirectColor */);
+    }
+
+    private static XVisualInfo getXVisualInfoImpl(AbstractGraphicsScreen screen, CapabilitiesImmutable capabilities, int c_class)
+    {
+        XVisualInfo ret = null;
+        int[] num = { -1 };
+
+        XVisualInfo vinfo_template = XVisualInfo.create();
+        vinfo_template.setScreen(screen.getIndex());
+        vinfo_template.setC_class(c_class);
+        long display = screen.getDevice().getHandle();
+
+        XVisualInfo[] vinfos = X11Util.XGetVisualInfo(display, X11Lib.VisualScreenMask, vinfo_template, num, 0);
+        XVisualInfo best=null;
+        int rdepth = capabilities.getRedBits() + capabilities.getGreenBits() + capabilities.getBlueBits() + capabilities.getAlphaBits();
+        for (int i = 0; vinfos!=null && i < num[0]; i++) {
+            if ( best == null || 
+                 best.getDepth() < vinfos[i].getDepth() )
+            {
+                best = vinfos[i];
+                if(rdepth <= best.getDepth())
+                    break;
+            }
+        }
+        if ( null!=best && ( rdepth <= best.getDepth() || 24 == best.getDepth()) ) {
+            ret = XVisualInfo.create(best);
+        }
+        best = null;
+
+        return ret;
+    }
+}
+
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11ToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11ToolkitLock.java
new file mode 100644
index 0000000..fb0aff1
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11ToolkitLock.java
@@ -0,0 +1,55 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.nativewindow.x11;
+
+import javax.media.nativewindow.ToolkitLock;
+
+/**
+ * Implementing a recursive {@link javax.media.nativewindow.ToolkitLock}
+ * utilizing {@link X11Util#XLockDisplay(long)}.
+ * <br>
+ * This strategy should not be used in case XInitThreads() is being used,
+ * or a higher level toolkit lock is required, ie AWT lock.
+ */
+public class X11ToolkitLock implements ToolkitLock {
+    long displayHandle;
+
+    public X11ToolkitLock(long displayHandle) {
+        this.displayHandle = displayHandle;
+    }
+
+    public final void lock() {
+        if(TRACE_LOCK) { System.err.println("X11ToolkitLock.lock()"); }
+        X11Util.XLockDisplay(displayHandle);
+    }
+
+    public final void unlock() {
+        if(TRACE_LOCK) { System.err.println("X11ToolkitLock.unlock()"); }
+        X11Util.XUnlockDisplay(displayHandle);
+    }
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
new file mode 100644
index 0000000..26da463
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
@@ -0,0 +1,612 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package jogamp.nativewindow.x11;
+
+import com.jogamp.common.util.LongObjectHashMap;
+import jogamp.nativewindow.Debug;
+import jogamp.nativewindow.NWJNILibLoader;
+
+import javax.media.nativewindow.*;
+
+import java.nio.Buffer;
+import java.nio.IntBuffer;
+import java.nio.ShortBuffer;
+import java.security.AccessController;
+import java.util.ArrayList;
+import java.util.List;
+import javax.media.nativewindow.util.Point;
+
+/**
+ * Contains a thread safe X11 utility to retrieve display connections.
+ */
+public class X11Util {
+    private static final boolean DEBUG = Debug.debug("X11Util");
+    private static final boolean TRACE_DISPLAY_LIFECYCLE = Debug.getBooleanProperty("nativewindow.debug.X11Util.TraceDisplayLifecycle", true, AccessController.getContext());
+
+    private static volatile String nullDisplayName = null;
+    private static boolean isFirstX11ActionOnProcess = false;
+    private static boolean isInit = false;
+
+    private static int setX11ErrorHandlerRecCount = 0;
+    private static Object setX11ErrorHandlerLock = new Object();
+
+    public static synchronized void initSingleton(boolean firstX11ActionOnProcess) {
+        if(!isInit) {
+            NWJNILibLoader.loadNativeWindow("x11");
+
+            /**
+             * Always issue XInitThreads() since we have independent
+             * off-thread created Display connections able to utilize multithreading, ie NEWT */
+            initialize0( true );
+            // initialize0( firstX11ActionOnProcess );
+            isFirstX11ActionOnProcess = firstX11ActionOnProcess;
+
+            if(DEBUG) {
+                System.out.println("X11Util.isFirstX11ActionOnProcess: "+isFirstX11ActionOnProcess);
+            }
+            isInit = true;
+        }
+    }
+
+    public static void setX11ErrorHandler(boolean onoff, boolean quiet) {
+        synchronized(setX11ErrorHandlerLock) {
+            if(onoff) {
+                if(0==setX11ErrorHandlerRecCount) {
+                    setX11ErrorHandler0(true, quiet);
+                }
+                setX11ErrorHandlerRecCount++;
+            } else {
+                if(0 >= setX11ErrorHandlerRecCount) {
+                    throw new InternalError();
+                }
+                setX11ErrorHandlerRecCount--;
+                if(0==setX11ErrorHandlerRecCount) {
+                    setX11ErrorHandler0(false, false);
+                }
+            }
+        }
+    }
+
+    public static boolean isFirstX11ActionOnProcess() {
+        return isFirstX11ActionOnProcess;
+    }
+
+    public static void lockDefaultToolkit(long dpyHandle) {
+        NativeWindowFactory.getDefaultToolkitLock().lock();
+        if(!isFirstX11ActionOnProcess) {
+            X11Util.XLockDisplay(dpyHandle);
+        }
+    }
+
+    public static void unlockDefaultToolkit(long dpyHandle) {
+        if(!isFirstX11ActionOnProcess) {
+            X11Util.XUnlockDisplay(dpyHandle);
+        }
+        NativeWindowFactory.getDefaultToolkitLock().unlock();
+    }
+
+    public static String getNullDisplayName() {
+        if(null==nullDisplayName) { // volatile: ok
+            synchronized(X11Util.class) {
+                if(null==nullDisplayName) {
+                    NativeWindowFactory.getDefaultToolkitLock().lock();
+                    try {
+                        long dpy = X11Lib.XOpenDisplay(null);
+                        nullDisplayName = X11Lib.XDisplayString(dpy);
+                        X11Lib.XCloseDisplay(dpy);
+                    } finally {
+                        NativeWindowFactory.getDefaultToolkitLock().unlock();
+                    }
+                    if(DEBUG) {
+                        System.out.println("X11 Display(NULL) <"+nullDisplayName+">");
+                    }
+                }
+            }
+        }
+        return nullDisplayName;
+    }
+
+    private X11Util() {}
+
+    // not exactly thread safe, but good enough for our purpose,
+    // which is to tag a NamedDisplay uncloseable after creation.
+    private static Object globalLock = new Object(); 
+    private static LongObjectHashMap globalNamedDisplayMap = new LongObjectHashMap();
+    private static List openDisplayList = new ArrayList();
+    private static List pendingDisplayList = new ArrayList();
+
+    public static class NamedDisplay {
+        String name;
+        long   handle;
+        int    refCount;
+        boolean unCloseable;
+        Throwable creationStack;
+
+        protected NamedDisplay(String name, long handle) {
+            this.name=name;
+            this.handle=handle;
+            this.refCount=1;
+            this.unCloseable=false;
+            if(DEBUG) {
+                this.creationStack=new Throwable("NamedDisplay Created at:");
+            } else {
+                this.creationStack=null;
+            }
+        }
+
+        public final String getName() { return name; }
+        public final long   getHandle() { return handle; }
+        public final int    getRefCount() { return refCount; }
+
+        public final void setUncloseable(boolean v) { unCloseable = v; }
+        public final boolean isUncloseable() { return unCloseable; }
+
+        public final Throwable getCreationStack() { return creationStack; }
+
+        @Override
+        public Object clone() throws CloneNotSupportedException {
+          return super.clone();
+        }
+
+        @Override
+        public String toString() {
+            return "NamedX11Display["+name+", 0x"+Long.toHexString(handle)+", refCount "+refCount+", unCloseable "+unCloseable+"]";
+        }
+    }
+
+    /** Returns the number of unclosed X11 Displays.
+     * @param realXCloseOpenAndPendingDisplays if true, {@link #closePendingDisplayConnections()} is called.
+      */
+    public static int shutdown(boolean realXCloseOpenAndPendingDisplays, boolean verbose) {
+        int num=0;
+        if(DEBUG||verbose||pendingDisplayList.size() > 0) {
+            String msg = "X11Util.Display: Shutdown (close open / pending Displays: "+realXCloseOpenAndPendingDisplays+
+                         ", open (no close attempt): "+globalNamedDisplayMap.size()+"/"+openDisplayList.size()+
+                         ", open (no close attempt and uncloseable): "+pendingDisplayList.size()+")" ;
+            if(DEBUG) {
+                Exception e = new Exception(msg);
+                e.printStackTrace();
+            } else {
+                System.err.println(msg);
+            }
+            if( openDisplayList.size() > 0) {
+                X11Util.dumpOpenDisplayConnections();
+            }
+            if( pendingDisplayList.size() > 0 ) {
+                X11Util.dumpPendingDisplayConnections();
+            }
+        }
+
+        synchronized(globalLock) {
+            if(realXCloseOpenAndPendingDisplays) {
+                closePendingDisplayConnections();    
+            }
+            openDisplayList.clear();
+            pendingDisplayList.clear();
+            globalNamedDisplayMap.clear();
+        }
+        return num;
+    }
+
+    /**
+     * Closing pending Display connections in reverse order.
+     *
+     * @return number of closed Display connections
+     */
+    public static int closePendingDisplayConnections() {
+        int num=0;
+        synchronized(globalLock) {
+            if(DEBUG) {
+                System.err.println("X11Util: Closing Pending X11 Display Connections: "+pendingDisplayList.size());
+            }
+            for(int i=pendingDisplayList.size()-1; i>=0; i--) {
+                NamedDisplay ndpy = (NamedDisplay) pendingDisplayList.get(i);
+                if(DEBUG) {
+                    System.err.println("X11Util.closePendingDisplayConnections(): Closing ["+i+"]: "+ndpy);
+                }
+                XCloseDisplay(ndpy.getHandle());
+                num++;
+            }
+        }
+        return num;
+    }
+
+    public static int getOpenDisplayConnectionNumber() {
+        synchronized(globalLock) {
+            return openDisplayList.size();
+        }
+    }
+        
+    public static void dumpOpenDisplayConnections() {
+        synchronized(globalLock) {
+            System.err.println("X11Util: Open X11 Display Connections: "+openDisplayList.size());
+            for(int i=0; i<pendingDisplayList.size(); i++) {
+                NamedDisplay ndpy = (NamedDisplay) openDisplayList.get(i);
+                System.err.println("X11Util: ["+i+"]: "+ndpy);
+                if(null!=ndpy) {
+                    Throwable t = ndpy.getCreationStack();
+                    if(null!=t) {
+                        t.printStackTrace();
+                    }
+                }
+            }
+        }
+    }
+
+    public static int getPendingDisplayConnectionNumber() {
+        synchronized(globalLock) {
+            return pendingDisplayList.size();
+        }
+    }
+
+    public static void dumpPendingDisplayConnections() {
+        synchronized(globalLock) {
+            System.err.println("X11Util: Pending X11 Display Connections: "+pendingDisplayList.size());
+            for(int i=0; i<pendingDisplayList.size(); i++) {
+                NamedDisplay ndpy = (NamedDisplay) pendingDisplayList.get(i);
+                System.err.println("X11Util: ["+i+"]: "+ndpy);
+                if(null!=ndpy) {
+                    Throwable t = ndpy.getCreationStack();
+                    if(null!=t) {
+                        t.printStackTrace();
+                    }
+                }
+            }
+        }
+    }
+
+    public static boolean markDisplayUncloseable(long handle) {
+        NamedDisplay ndpy;
+        synchronized(globalLock) {
+            ndpy = (NamedDisplay) globalNamedDisplayMap.get(handle);
+        }
+        if( null != ndpy ) {
+            ndpy.setUncloseable(true);
+            return true;
+        }
+        return false;
+    }
+
+    /** Returns this created named display. */
+    public static long createDisplay(String name) {
+        name = validateDisplayName(name);
+        long dpy = XOpenDisplay(name);
+        if(0==dpy) {
+            throw new NativeWindowException("X11Util.Display: Unable to create a display("+name+") connection. Thread "+Thread.currentThread().getName());
+        }
+        // if you like to debug and synchronize X11 commands ..
+        // setSynchronizeDisplay(dpy, true);
+        NamedDisplay namedDpy = new NamedDisplay(name, dpy);
+        synchronized(globalLock) {
+            globalNamedDisplayMap.put(dpy, namedDpy);
+            openDisplayList.add(namedDpy);
+            pendingDisplayList.add(namedDpy);
+        }
+        if(DEBUG) {
+            Exception e = new Exception("X11Util.Display: Created new "+namedDpy+". Thread "+Thread.currentThread().getName());
+            e.printStackTrace();
+        }
+        return namedDpy.getHandle();
+    }
+
+    public static void closeDisplay(long handle) {
+        NamedDisplay namedDpy;
+
+        synchronized(globalLock) {
+            namedDpy = (NamedDisplay) globalNamedDisplayMap.remove(handle);
+            if(namedDpy!=null) {
+                if(!openDisplayList.remove(namedDpy)) { throw new RuntimeException("Internal: "+namedDpy); }
+            }
+        }
+        if(null==namedDpy) {
+            X11Util.dumpPendingDisplayConnections();
+            throw new RuntimeException("X11Util.Display: Display(0x"+Long.toHexString(handle)+") with given handle is not mapped. Thread "+Thread.currentThread().getName());
+        }
+        if(namedDpy.getHandle()!=handle) {
+            X11Util.dumpPendingDisplayConnections();
+            throw new RuntimeException("X11Util.Display: Display(0x"+Long.toHexString(handle)+") Mapping error: "+namedDpy+". Thread "+Thread.currentThread().getName());
+        }
+
+        if(DEBUG) {
+            Exception e = new Exception("X11Util.Display: Closing new "+namedDpy+". Thread "+Thread.currentThread().getName());
+            e.printStackTrace();
+        }
+
+        if(!namedDpy.isUncloseable()) {
+            synchronized(globalLock) {
+                if(!pendingDisplayList.remove(namedDpy)) { throw new RuntimeException("Internal: "+namedDpy); }
+            }
+            XCloseDisplay(namedDpy.getHandle());
+        }
+    }
+
+    public static NamedDisplay getNamedDisplay(long handle) {
+        synchronized(globalLock) {
+            return (NamedDisplay) globalNamedDisplayMap.get(handle);
+        }
+    }
+
+    /** 
+     * @return If name is null, it returns the previous queried NULL display name,
+     * otherwise the name. */
+    public static String validateDisplayName(String name) {
+        return ( null == name || AbstractGraphicsDevice.DEFAULT_CONNECTION.equals(name) ) ? getNullDisplayName() : name ;
+    }
+
+    public static String validateDisplayName(String name, long handle) {
+        if( ( null==name || AbstractGraphicsDevice.DEFAULT_CONNECTION.equals(name) ) && 0!=handle) {
+            name = XDisplayString(handle);
+        }
+        return validateDisplayName(name);
+    }
+
+    /*******************************
+     **
+     ** Locked X11Lib wrapped functions
+     **
+     *******************************/
+
+    public static long XOpenDisplay(String arg0) {
+        NativeWindowFactory.getDefaultToolkitLock().lock();
+        try {
+            long handle = X11Lib.XOpenDisplay(arg0);
+            if(TRACE_DISPLAY_LIFECYCLE) {
+                Throwable t = new Throwable(Thread.currentThread()+" - X11Util.XOpenDisplay("+arg0+") 0x"+Long.toHexString(handle));
+                t.printStackTrace();
+            }
+            return handle;
+        } finally {
+            NativeWindowFactory.getDefaultToolkitLock().unlock();
+        }
+    }
+
+    public static int XCloseDisplay(long display) {
+        NativeWindowFactory.getDefaultToolkitLock().lock();
+        try {
+            if(TRACE_DISPLAY_LIFECYCLE) {
+                Throwable t = new Throwable(Thread.currentThread()+" - X11Util.XCloseDisplay() 0x"+Long.toHexString(display));
+                t.printStackTrace();
+            }
+            return X11Lib.XCloseDisplay(display);
+        } finally {
+            NativeWindowFactory.getDefaultToolkitLock().unlock();
+        }
+    }
+
+    public static int XFree(Buffer arg0)  {
+        NativeWindowFactory.getDefaultToolkitLock().lock();
+        try {
+            return X11Lib.XFree(arg0);
+        } finally {
+            NativeWindowFactory.getDefaultToolkitLock().unlock();
+        }
+    }
+
+    public static int XSync(long display, boolean discard) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XSync(display, discard);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static void XSynchronize(long display, boolean onoff) {
+        lockDefaultToolkit(display);
+        try {
+            X11Lib.XSynchronize(display, onoff);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static boolean XineramaEnabled(long display) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XineramaEnabled(display);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static int DefaultScreen(long display) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.DefaultScreen(display);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static long RootWindow(long display, int screen_number) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.RootWindow(display, screen_number);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static long XCreatePixmap(long display, long arg1, int arg2, int arg3, int arg4) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XCreatePixmap(display, arg1, arg2, arg3, arg4);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static String XDisplayString(long display) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XDisplayString(display);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static int XFlush(long display) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XFlush(display);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static int XFreePixmap(long display, long arg1) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XFreePixmap(display, arg1);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static long DefaultVisualID(long display, int screen) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.DefaultVisualID(display, screen);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static long CreateDummyWindow(long display, int screen_index, long visualID, int width, int height) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.CreateDummyWindow(display, screen_index, visualID, width, height);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static void DestroyDummyWindow(long display, long window) {
+        lockDefaultToolkit(display);
+        try {
+            X11Lib.DestroyDummyWindow(display, window);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static Point GetRelativeLocation(long display, int screen_index, long src_win, long dest_win, int src_x, int src_y) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.GetRelativeLocation(display, screen_index, src_win, dest_win, src_x, src_y);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static XVisualInfo[] XGetVisualInfo(long display, long arg1, XVisualInfo arg2, int[] arg3, int arg3_offset) {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XGetVisualInfo(display, arg1, arg2, arg3, arg3_offset);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static boolean XF86VidModeGetGammaRamp(long display, int screen, int size, ShortBuffer red_array, ShortBuffer green_array, ShortBuffer blue_array)  {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XF86VidModeGetGammaRamp(display, screen, size, red_array, green_array, blue_array);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static boolean XF86VidModeGetGammaRamp(long display, int screen, int size, short[] red_array, int red_array_offset, short[] green_array, int green_array_offset, short[] blue_array, int blue_array_offset)  {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XF86VidModeGetGammaRamp(display, screen, size, red_array, red_array_offset, green_array, green_array_offset, blue_array, blue_array_offset);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static boolean XF86VidModeGetGammaRampSize(long display, int screen, IntBuffer size)  {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XF86VidModeGetGammaRampSize(display, screen, size);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static boolean XF86VidModeGetGammaRampSize(long display, int screen, int[] size, int size_offset)  {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XF86VidModeGetGammaRampSize(display, screen, size, size_offset);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static boolean XF86VidModeSetGammaRamp(long display, int screen, int size, ShortBuffer red_array, ShortBuffer green_array, ShortBuffer blue_array)  {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XF86VidModeSetGammaRamp(display, screen, size, red_array, green_array, blue_array);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static boolean XF86VidModeSetGammaRamp(long display, int screen, int size, short[] red_array, int red_array_offset, short[] green_array, int green_array_offset, short[] blue_array, int blue_array_offset)  {
+        lockDefaultToolkit(display);
+        try {
+            return X11Lib.XF86VidModeSetGammaRamp(display, screen, size, red_array, red_array_offset, green_array, green_array_offset, blue_array, blue_array_offset);
+        } finally {
+            unlockDefaultToolkit(display);
+        }
+    }
+
+    public static void XLockDisplay(long handle) {
+        if(ToolkitLock.TRACE_LOCK) {
+            System.out.println("+++ X11 Display Lock get 0x"+Long.toHexString(handle));
+        }
+        X11Lib.XLockDisplay(handle);
+    }
+
+    public static void XUnlockDisplay(long handle) {
+        if(ToolkitLock.TRACE_LOCK) {
+            System.out.println("--- X11 Display Lock rel 0x"+Long.toHexString(handle));
+        }
+        X11Lib.XUnlockDisplay(handle);
+    }
+
+    private static native void initialize0(boolean firstUIActionOnProcess);
+    private static native void setX11ErrorHandler0(boolean onoff, boolean quiet);
+}
diff --git a/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c b/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c
index a0422fa..470f03a 100644
--- a/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c
+++ b/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c
@@ -50,7 +50,7 @@
 #endif
 
 JNIEXPORT jobject JNICALL
-Java_com_jogamp_nativewindow_impl_jawt_JAWT_1DrawingSurfaceInfo_platformInfo0(JNIEnv* env, jobject unused, jobject jthis0) {
+Java_jogamp_nativewindow_jawt_JAWT_1DrawingSurfaceInfo_platformInfo0(JNIEnv* env, jobject unused, jobject jthis0) {
   JAWT_DrawingSurfaceInfo* dsi;
   dsi = (*env)->GetDirectBufferAddress(env, jthis0);
   if (dsi == NULL) {
diff --git a/src/nativewindow/native/NativewindowCommon.c b/src/nativewindow/native/NativewindowCommon.c
new file mode 100644
index 0000000..e357045
--- /dev/null
+++ b/src/nativewindow/native/NativewindowCommon.c
@@ -0,0 +1,57 @@
+
+#include "NativewindowCommon.h"
+
+static const char * const ClazzNameRuntimeException = "java/lang/RuntimeException";
+static jclass    runtimeExceptionClz=NULL;
+
+void NativewindowCommon_FatalError(JNIEnv *env, const char* msg, ...)
+{
+    char buffer[512];
+    va_list ap;
+
+    va_start(ap, msg);
+    vsnprintf(buffer, sizeof(buffer), msg, ap);
+    va_end(ap);
+
+    fprintf(stderr, "%s\n", buffer);
+    (*env)->FatalError(env, buffer);
+}
+
+void NativewindowCommon_throwNewRuntimeException(JNIEnv *env, const char* msg, ...)
+{
+    char buffer[512];
+    va_list ap;
+
+    va_start(ap, msg);
+    vsnprintf(buffer, sizeof(buffer), msg, ap);
+    va_end(ap);
+
+    (*env)->ThrowNew(env, runtimeExceptionClz, buffer);
+}
+
+int NativewindowCommon_init(JNIEnv *env) {
+    if(NULL==runtimeExceptionClz) {
+        jclass c = (*env)->FindClass(env, ClazzNameRuntimeException);
+        if(NULL==c) {
+            NativewindowCommon_FatalError(env, "Nativewindow: can't find %s", ClazzNameRuntimeException);
+        }
+        runtimeExceptionClz = (jclass)(*env)->NewGlobalRef(env, c);
+        (*env)->DeleteLocalRef(env, c);
+        if(NULL==runtimeExceptionClz) {
+            NativewindowCommon_FatalError(env, "Nativewindow: can't use %s", ClazzNameRuntimeException);
+        }
+        return 1;
+    }
+    return 0;
+}
+
+jchar* NativewindowCommon_GetNullTerminatedStringChars(JNIEnv* env, jstring str)
+{
+    jchar* strChars = NULL;
+    strChars = calloc((*env)->GetStringLength(env, str) + 1, sizeof(jchar));
+    if (strChars != NULL) {
+        (*env)->GetStringRegion(env, str, 0, (*env)->GetStringLength(env, str), strChars);
+    }
+    return strChars;
+}
+
diff --git a/src/nativewindow/native/NativewindowCommon.h b/src/nativewindow/native/NativewindowCommon.h
new file mode 100644
index 0000000..5dc5deb
--- /dev/null
+++ b/src/nativewindow/native/NativewindowCommon.h
@@ -0,0 +1,15 @@
+
+#ifndef NATIVEWINDOW_COMMON_H
+#define NATIVEWINDOW_COMMON_H 1
+
+#include <jni.h>
+#include <stdlib.h>
+
+int NativewindowCommon_init(JNIEnv *env);
+
+jchar* NativewindowCommon_GetNullTerminatedStringChars(JNIEnv* env, jstring str);
+
+void NativewindowCommon_FatalError(JNIEnv *env, const char* msg, ...);
+void NativewindowCommon_throwNewRuntimeException(JNIEnv *env, const char* msg, ...);
+
+#endif
diff --git a/src/nativewindow/native/windows/GDImisc.c b/src/nativewindow/native/windows/GDImisc.c
index 427e15d..9bead17 100644
--- a/src/nativewindow/native/windows/GDImisc.c
+++ b/src/nativewindow/native/windows/GDImisc.c
@@ -29,7 +29,8 @@
 
 #include <stdio.h>
 
-#include "com_jogamp_nativewindow_impl_windows_GDI.h"
+#include "NativewindowCommon.h"
+#include "jogamp_nativewindow_windows_GDI.h"
 
 // #define VERBOSE_ON 1
 
@@ -39,19 +40,6 @@
     #define DBG_PRINT(args...)
 #endif
 
-static void _FatalError(JNIEnv *env, const char* msg, ...)
-{
-    char buffer[512];
-    va_list ap;
-
-    va_start(ap, msg);
-    vsnprintf(buffer, sizeof(buffer), msg, ap);
-    va_end(ap);
-
-    fprintf(stderr, "%s\n", buffer);
-    (*env)->FatalError(env, buffer);
-}
-
 static const char * const ClazzNamePoint = "javax/media/nativewindow/util/Point";
 static const char * const ClazzAnyCstrName = "<init>";
 static const char * const ClazzNamePointCstrSignature = "(II)V";
@@ -59,82 +47,184 @@ static const char * const ClazzNamePointCstrSignature = "(II)V";
 static jclass pointClz = NULL;
 static jmethodID pointCstr = NULL;
 
-#define NATIVEWINDOW_DUMMY_WINDOW_NAME "__nativewindow_dummy_window"
-static ATOM nativewindowClass = 0;
+HINSTANCE GetApplicationHandle() {
+    return GetModuleHandle(NULL);
+}
 
-LRESULT CALLBACK DummyWndProc( HWND   hWnd, UINT   uMsg, WPARAM wParam, LPARAM lParam) {
-  return DefWindowProc(hWnd,uMsg,wParam,lParam);
+/*   Java->C glue code:
+ *   Java package: jogamp.nativewindow.windows.GDI
+ *    Java method: boolean CreateWindowClass(long hInstance, java.lang.String clazzName, long wndProc)
+ *     C function: BOOL CreateWindowClass(HANDLE hInstance, LPCSTR clazzName, HANDLE wndProc);
+ */
+JNIEXPORT jboolean JNICALL
+Java_jogamp_nativewindow_windows_GDI_CreateWindowClass
+    (JNIEnv *env, jclass _unused, jlong jHInstance, jstring jClazzName, jlong wndProc) 
+{
+    HINSTANCE hInstance = (HINSTANCE) (intptr_t) jHInstance;
+    const TCHAR* clazzName = NULL;
+    WNDCLASS  wc;
+    jboolean res;
+
+#ifdef UNICODE
+    clazzName = NewtCommon_GetNullTerminatedStringChars(env, jClazzName);
+#else
+    clazzName = (*env)->GetStringUTFChars(env, jClazzName, NULL);
+#endif
+
+    ZeroMemory( &wc, sizeof( wc ) );
+    if( GetClassInfo( hInstance,  clazzName, &wc ) ) {
+        // registered already
+        res = JNI_TRUE;
+    } else {
+        // register now
+        ZeroMemory( &wc, sizeof( wc ) );
+        wc.style = CS_HREDRAW | CS_VREDRAW ;
+        wc.lpfnWndProc = (WNDPROC) (intptr_t) wndProc;
+        wc.cbClsExtra = 0;
+        wc.cbWndExtra = 0;
+        wc.hInstance = hInstance;
+        wc.hIcon = NULL;
+        wc.hCursor = LoadCursor( NULL, IDC_ARROW);
+        wc.hbrBackground = NULL; // no background paint - GetStockObject(BLACK_BRUSH);
+        wc.lpszMenuName = NULL;
+        wc.lpszClassName = clazzName;
+        res = ( 0 != RegisterClass( &wc ) ) ? JNI_TRUE : JNI_FALSE ;
+    }
+
+#ifdef UNICODE
+    free((void*) clazzName);
+#else
+    (*env)->ReleaseStringUTFChars(env, jClazzName, clazzName);
+#endif
+
+    return res;
 }
 
-HWND CreateDummyWindow0(HINSTANCE hInstance, int x, int y, int width, int height ) {
-  DWORD     dwExStyle;
-  DWORD     dwStyle;
-  HWND      hWnd;
-
-  dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
-  dwStyle = WS_OVERLAPPEDWINDOW;
-  if( !(hWnd=CreateWindowEx( dwExStyle,
-                             NATIVEWINDOW_DUMMY_WINDOW_NAME,
-                             NATIVEWINDOW_DUMMY_WINDOW_NAME,
-                             dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
-                             x, y, width, height,
-                             NULL, NULL, hInstance, NULL ) ) ) {
-    return( 0 );
-  }
-  return( hWnd );
+/*   Java->C glue code:
+ *   Java package: jogamp.nativewindow.windows.GDI
+ *    Java method: boolean DestroyWindowClass(long hInstance, java.lang.String className)
+ *     C function: BOOL DestroyWindowClass(HANDLE hInstance, LPCSTR className);
+ */
+JNIEXPORT jboolean JNICALL
+Java_jogamp_nativewindow_windows_GDI_DestroyWindowClass
+    (JNIEnv *env, jclass _unused, jlong jHInstance, jstring jClazzName) 
+{
+    HINSTANCE hInstance = (HINSTANCE) (intptr_t) jHInstance;
+    const TCHAR* clazzName = NULL;
+    jboolean res;
+
+#ifdef UNICODE
+    clazzName = NewtCommon_GetNullTerminatedStringChars(env, jClazzName);
+#else
+    clazzName = (*env)->GetStringUTFChars(env, jClazzName, NULL);
+#endif
+
+    res = ( 0 != UnregisterClass( clazzName, hInstance ) ) ? JNI_TRUE : JNI_FALSE ;
+
+#ifdef UNICODE
+    free((void*) clazzName);
+#else
+    (*env)->ReleaseStringUTFChars(env, jClazzName, clazzName);
+#endif
+
+    return res;
 }
 
+
+/*   Java->C glue code:
+ *   Java package: jogamp.nativewindow.windows.GDI
+ *    Java method: long CreateDummyWindow0(long hInstance, java.lang.String className, java.lang.String windowName, int x, int y, int width, int height)
+ *     C function: HANDLE CreateDummyWindow0(HANDLE hInstance, LPCSTR className, LPCSTR windowName, int x, int y, int width, int height);
+ */
+JNIEXPORT jlong JNICALL
+Java_jogamp_nativewindow_windows_GDI_CreateDummyWindow0
+    (JNIEnv *env, jclass _unused, jlong jHInstance, jstring jWndClassName, jstring jWndName, jint x, jint y, jint width, jint height) 
+{
+    HINSTANCE hInstance = (HINSTANCE) (intptr_t) jHInstance;
+    const TCHAR* wndClassName = NULL;
+    const TCHAR* wndName = NULL;
+    DWORD     dwExStyle;
+    DWORD     dwStyle;
+    HWND      hWnd;
+
+#ifdef UNICODE
+    wndClassName = NewtCommon_GetNullTerminatedStringChars(env, jWndClassName);
+    wndName = NewtCommon_GetNullTerminatedStringChars(env, jWndName);
+#else
+    wndClassName = (*env)->GetStringUTFChars(env, jWndClassName, NULL);
+    wndName = (*env)->GetStringUTFChars(env, jWndName, NULL);
+#endif
+
+    dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
+    dwStyle = WS_OVERLAPPEDWINDOW;
+
+    hWnd = CreateWindowEx( dwExStyle,
+                           wndClassName,
+                           wndName,
+                           dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
+                           x, y, width, height,
+                           NULL, NULL, hInstance, NULL );
+
+#ifdef UNICODE
+    free((void*) wndClassName);
+    free((void*) wndName);
+#else
+    (*env)->ReleaseStringUTFChars(env, jWndClassName, wndClassName);
+    (*env)->ReleaseStringUTFChars(env, jWndName, wndName);
+#endif
+
+    return (jlong) (intptr_t) hWnd;
+}
+
+
 /*
- * Class:     com_jogamp_nativewindow_impl_windows_GDI
+ * Class:     jogamp_nativewindow_windows_GDI
  * Method:    initIDs0
  * Signature: ()Z
  */
-JNIEXPORT jlong JNICALL Java_com_jogamp_nativewindow_impl_windows_GDI_initIDs0
+JNIEXPORT jboolean JNICALL Java_jogamp_nativewindow_windows_GDI_initIDs0
   (JNIEnv *env, jclass clazz)
 {
-    if(NULL==pointClz) {
+    if(NativewindowCommon_init(env)) {
         jclass c = (*env)->FindClass(env, ClazzNamePoint);
         if(NULL==c) {
-            _FatalError(env, "FatalError com_jogamp_nativewindow_impl_windows_GDI: can't find %s", ClazzNamePoint);
+            NativewindowCommon_FatalError(env, "FatalError jogamp_nativewindow_windows_GDI: can't find %s", ClazzNamePoint);
         }
         pointClz = (jclass)(*env)->NewGlobalRef(env, c);
         (*env)->DeleteLocalRef(env, c);
         if(NULL==pointClz) {
-            _FatalError(env, "FatalError com_jogamp_nativewindow_impl_windows_GDI: can't use %s", ClazzNamePoint);
+            NativewindowCommon_FatalError(env, "FatalError jogamp_nativewindow_windows_GDI: can't use %s", ClazzNamePoint);
         }
         pointCstr = (*env)->GetMethodID(env, pointClz, ClazzAnyCstrName, ClazzNamePointCstrSignature);
         if(NULL==pointCstr) {
-            _FatalError(env, "FatalError com_jogamp_nativewindow_impl_windows_GDI: can't fetch %s.%s %s",
+            NativewindowCommon_FatalError(env, "FatalError jogamp_nativewindow_windows_GDI: can't fetch %s.%s %s",
                 ClazzNamePoint, ClazzAnyCstrName, ClazzNamePointCstrSignature);
         }
     }
-    HINSTANCE hInstance = GetModuleHandle(NULL);
-    if( !nativewindowClass ) {
-        WNDCLASS  wc;
-        ZeroMemory( &wc, sizeof( wc ) );
-        wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
-        wc.lpfnWndProc = (WNDPROC) DummyWndProc;
-        wc.cbClsExtra = 0;
-        wc.cbWndExtra = 0;
-        wc.hInstance = hInstance;
-        wc.hIcon = NULL;
-        wc.hCursor = NULL;
-        wc.hbrBackground = NULL;
-        wc.lpszMenuName = NULL;
-        wc.lpszClassName = NATIVEWINDOW_DUMMY_WINDOW_NAME;
-        if( !(nativewindowClass = RegisterClass( &wc )) ) {
-          _FatalError(env, "FatalError com_jogamp_nativewindow_impl_windows_GDI: RegisterClass Failed: %d", GetLastError() );
-        }
-    }
-    return (jlong) hInstance;
+    return JNI_TRUE;
+}
+
+LRESULT CALLBACK DummyWndProc( HWND   hWnd, UINT   uMsg, WPARAM wParam, LPARAM lParam) {
+  return DefWindowProc(hWnd,uMsg,wParam,lParam);
+}
+
+/*
+ * Class:     jogamp_nativewindow_windows_GDI
+ * Method:    getDummyWndProc0
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_jogamp_nativewindow_windows_GDI_getDummyWndProc0
+  (JNIEnv *env, jclass clazz)
+{
+    return (jlong) (intptr_t) DummyWndProc;
 }
 
 /*
- * Class:     com_jogamp_nativewindow_impl_windows_GDI
+ * Class:     jogamp_nativewindow_windows_GDI
  * Method:    GetRelativeLocation0
  * Signature: (JJII)Ljavax/media/nativewindow/util/Point;
  */
-JNIEXPORT jobject JNICALL Java_com_jogamp_nativewindow_impl_windows_GDI_GetRelativeLocation0
+JNIEXPORT jobject JNICALL Java_jogamp_nativewindow_windows_GDI_GetRelativeLocation0
   (JNIEnv *env, jclass unused, jlong jsrc_win, jlong jdest_win, jint src_x, jint src_y)
 {
     HWND src_win = (HWND) (intptr_t) jsrc_win;
diff --git a/src/nativewindow/native/x11/Xmisc.c b/src/nativewindow/native/x11/Xmisc.c
index 91292fd..1ced0ff 100644
--- a/src/nativewindow/native/x11/Xmisc.c
+++ b/src/nativewindow/native/x11/Xmisc.c
@@ -80,7 +80,8 @@ Bool XF86VidModeSetGammaRamp(
 #define RTLD_DEFAULT NULL
 #endif
 
-#include "com_jogamp_nativewindow_impl_x11_X11Lib.h"
+#include "NativewindowCommon.h"
+#include "jogamp_nativewindow_x11_X11Lib.h"
 
 // #define VERBOSE_ON 1
 
@@ -93,107 +94,66 @@ Bool XF86VidModeSetGammaRamp(
 /* Need to pull this in as we don't have a stub header for it */
 extern Bool XineramaEnabled(Display* display);
 
-static void _FatalError(JNIEnv *env, const char* msg, ...)
-{
-    char buffer[512];
-    va_list ap;
-
-    va_start(ap, msg);
-    vsnprintf(buffer, sizeof(buffer), msg, ap);
-    va_end(ap);
-
-    fprintf(stderr, "%s\n", buffer);
-    (*env)->FatalError(env, buffer);
-}
-
 static const char * const ClazzNameBuffers = "com/jogamp/common/nio/Buffers";
 static const char * const ClazzNameBuffersStaticCstrName = "copyByteBuffer";
 static const char * const ClazzNameBuffersStaticCstrSignature = "(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;";
 static const char * const ClazzNameByteBuffer = "java/nio/ByteBuffer";
-static const char * const ClazzNameRuntimeException = "java/lang/RuntimeException";
 static const char * const ClazzNamePoint = "javax/media/nativewindow/util/Point";
 static const char * const ClazzAnyCstrName = "<init>";
 static const char * const ClazzNamePointCstrSignature = "(II)V";
 static jclass clazzBuffers = NULL;
 static jmethodID cstrBuffers = NULL;
 static jclass clazzByteBuffer = NULL;
-static jclass clazzRuntimeException=NULL;
 static jclass pointClz = NULL;
 static jmethodID pointCstr = NULL;
 
 static void _initClazzAccess(JNIEnv *env) {
     jclass c;
 
-    if(NULL!=clazzRuntimeException) return ;
-
-    c = (*env)->FindClass(env, ClazzNameRuntimeException);
-    if(NULL==c) {
-        _FatalError(env, "FatalError Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't find %s", ClazzNameRuntimeException);
-    }
-    clazzRuntimeException = (jclass)(*env)->NewGlobalRef(env, c);
-    (*env)->DeleteLocalRef(env, c);
-    if(NULL==clazzRuntimeException) {
-        _FatalError(env, "FatalError Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't use %s", ClazzNameRuntimeException);
-    }
+    if(!NativewindowCommon_init(env)) return;
 
     c = (*env)->FindClass(env, ClazzNameBuffers);
     if(NULL==c) {
-        _FatalError(env, "FatalError Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't find %s", ClazzNameBuffers);
+        NativewindowCommon_FatalError(env, "FatalError Java_jogamp_nativewindow_x11_X11Lib: can't find %s", ClazzNameBuffers);
     }
     clazzBuffers = (jclass)(*env)->NewGlobalRef(env, c);
     (*env)->DeleteLocalRef(env, c);
     if(NULL==clazzBuffers) {
-        _FatalError(env, "FatalError Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't use %s", ClazzNameBuffers);
+        NativewindowCommon_FatalError(env, "FatalError Java_jogamp_nativewindow_x11_X11Lib: can't use %s", ClazzNameBuffers);
     }
     c = (*env)->FindClass(env, ClazzNameByteBuffer);
     if(NULL==c) {
-        _FatalError(env, "FatalError Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't find %s", ClazzNameByteBuffer);
+        NativewindowCommon_FatalError(env, "FatalError Java_jogamp_nativewindow_x11_X11Lib: can't find %s", ClazzNameByteBuffer);
     }
     clazzByteBuffer = (jclass)(*env)->NewGlobalRef(env, c);
     (*env)->DeleteLocalRef(env, c);
     if(NULL==c) {
-        _FatalError(env, "FatalError Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't use %s", ClazzNameByteBuffer);
+        NativewindowCommon_FatalError(env, "FatalError Java_jogamp_nativewindow_x11_X11Lib: can't use %s", ClazzNameByteBuffer);
     }
 
     cstrBuffers = (*env)->GetStaticMethodID(env, clazzBuffers, 
                             ClazzNameBuffersStaticCstrName, ClazzNameBuffersStaticCstrSignature);
     if(NULL==cstrBuffers) {
-        _FatalError(env, "FatalError Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't create %s.%s %s",
+        NativewindowCommon_FatalError(env, "FatalError Java_jogamp_nativewindow_x11_X11Lib: can't create %s.%s %s",
             ClazzNameBuffers, ClazzNameBuffersStaticCstrName, ClazzNameBuffersStaticCstrSignature);
     }
 
     c = (*env)->FindClass(env, ClazzNamePoint);
     if(NULL==c) {
-        _FatalError(env, "FatalError Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't find %s", ClazzNamePoint);
+        NativewindowCommon_FatalError(env, "FatalError Java_jogamp_nativewindow_x11_X11Lib: can't find %s", ClazzNamePoint);
     }
     pointClz = (jclass)(*env)->NewGlobalRef(env, c);
     (*env)->DeleteLocalRef(env, c);
     if(NULL==pointClz) {
-        _FatalError(env, "FatalError Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't use %s", ClazzNamePoint);
+        NativewindowCommon_FatalError(env, "FatalError Java_jogamp_nativewindow_x11_X11Lib: can't use %s", ClazzNamePoint);
     }
     pointCstr = (*env)->GetMethodID(env, pointClz, ClazzAnyCstrName, ClazzNamePointCstrSignature);
     if(NULL==pointCstr) {
-        _FatalError(env, "FatalError Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't fetch %s.%s %s",
+        NativewindowCommon_FatalError(env, "FatalError Java_jogamp_nativewindow_x11_X11Lib: can't fetch %s.%s %s",
             ClazzNamePoint, ClazzAnyCstrName, ClazzNamePointCstrSignature);
     }
 }
 
-static void _throwNewRuntimeException(Display * unlockDisplay, JNIEnv *env, const char* msg, ...)
-{
-    char buffer[512];
-    va_list ap;
-
-    if(NULL!=unlockDisplay) {
-        XUnlockDisplay(unlockDisplay);
-    }
-
-    va_start(ap, msg);
-    vsnprintf(buffer, sizeof(buffer), msg, ap);
-    va_end(ap);
-
-    (*env)->ThrowNew(env, clazzRuntimeException, buffer);
-}
-
 static JNIEnv * x11ErrorHandlerJNIEnv = NULL;
 static XErrorHandler origErrorHandler = NULL ;
 static int errorHandlerBlocked = 0 ;
@@ -208,7 +168,7 @@ static int x11ErrorHandler(Display *dpy, XErrorEvent *e)
     // Since the X11 Error may happen anytime, a exception could mess up the JVM completely.
     // Experienced this for remote displays issuing non supported commands, eg. glXCreateContextAttribsARB(..)
     //
-    _throwNewRuntimeException(NULL, x11ErrorHandlerJNIEnv, "Info: Nativewindow X11 Error: Display %p, Code 0x%X, errno %s", 
+    NativewindowCommon_throwNewRuntimeException(x11ErrorHandlerJNIEnv, "Info: Nativewindow X11 Error: Display %p, Code 0x%X, errno %s", 
         dpy, e->error_code, strerror(errno));
 #endif
 
@@ -256,7 +216,7 @@ static XIOErrorHandler origIOErrorHandler = NULL;
 static int x11IOErrorHandler(Display *dpy)
 {
     fprintf(stderr, "Nativewindow X11 IOError: Display %p (%s): %s\n", dpy, XDisplayName(NULL), strerror(errno));
-    // _FatalError(x11ErrorHandlerJNIEnv, "Nativewindow X11 IOError: Display %p (%s): %s", dpy, XDisplayName(NULL), strerror(errno));
+    // NativewindowCommon_FatalError(x11ErrorHandlerJNIEnv, "Nativewindow X11 IOError: Display %p (%s): %s", dpy, XDisplayName(NULL), strerror(errno));
     if(NULL!=origIOErrorHandler) {
         origIOErrorHandler(dpy);
     }
@@ -278,7 +238,7 @@ static void x11IOErrorHandlerEnable(int onoff, JNIEnv * env) {
 static int _initialized=0;
 
 JNIEXPORT void JNICALL 
-Java_com_jogamp_nativewindow_impl_x11_X11Util_initialize0(JNIEnv *env, jclass _unused, jboolean firstUIActionOnProcess) {
+Java_jogamp_nativewindow_x11_X11Util_initialize0(JNIEnv *env, jclass _unused, jboolean firstUIActionOnProcess) {
     if(0==_initialized) {
         if( JNI_TRUE == firstUIActionOnProcess ) {
             if( 0 == XInitThreads() ) {
@@ -297,17 +257,17 @@ Java_com_jogamp_nativewindow_impl_x11_X11Util_initialize0(JNIEnv *env, jclass _u
 }
 
 JNIEXPORT void JNICALL 
-Java_com_jogamp_nativewindow_impl_x11_X11Util_setX11ErrorHandler0(JNIEnv *env, jclass _unused, jboolean onoff, jboolean quiet) {
+Java_jogamp_nativewindow_x11_X11Util_setX11ErrorHandler0(JNIEnv *env, jclass _unused, jboolean onoff, jboolean quiet) {
   x11ErrorHandlerEnableBlocking(env, ( JNI_TRUE == onoff ) ? 1 : 0, ( JNI_TRUE == quiet ) ? 1 : 0);
 }
 
 /*   Java->C glue code:
- *   Java package: com.jogamp.nativewindow.impl.x11.X11Lib
+ *   Java package: jogamp.nativewindow.x11.X11Lib
  *    Java method: XVisualInfo XGetVisualInfo(long arg0, long arg1, XVisualInfo arg2, java.nio.IntBuffer arg3)
  *     C function: XVisualInfo *  XGetVisualInfo(Display * , long, XVisualInfo * , int * );
  */
 JNIEXPORT jobject JNICALL
-Java_com_jogamp_nativewindow_impl_x11_X11Lib_XGetVisualInfo1__JJLjava_nio_ByteBuffer_2Ljava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong arg0, jlong arg1, jobject arg2, jobject arg3, jint arg3_byte_offset) {
+Java_jogamp_nativewindow_x11_X11Lib_XGetVisualInfo1__JJLjava_nio_ByteBuffer_2Ljava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong arg0, jlong arg1, jobject arg2, jobject arg3, jint arg3_byte_offset) {
   XVisualInfo * _ptr2 = NULL;
   int * _ptr3 = NULL;
   XVisualInfo *  _res;
@@ -315,7 +275,7 @@ Java_com_jogamp_nativewindow_impl_x11_X11Lib_XGetVisualInfo1__JJLjava_nio_ByteBu
   jobject jbyteSource;
   jobject jbyteCopy;
     if(0==arg0) {
-        _FatalError(env, "invalid display connection..");
+        NativewindowCommon_FatalError(env, "invalid display connection..");
     }
     if (arg2 != NULL) {
         _ptr2 = (XVisualInfo *) (((char*) (*env)->GetDirectBufferAddress(env, arg2)) + 0);
@@ -341,10 +301,10 @@ Java_com_jogamp_nativewindow_impl_x11_X11Lib_XGetVisualInfo1__JJLjava_nio_ByteBu
 }
 
 JNIEXPORT jlong JNICALL 
-Java_com_jogamp_nativewindow_impl_x11_X11Lib_DefaultVisualID(JNIEnv *env, jclass _unused, jlong display, jint screen) {
+Java_jogamp_nativewindow_x11_X11Lib_DefaultVisualID(JNIEnv *env, jclass _unused, jlong display, jint screen) {
   jlong r;
     if(0==display) {
-        _FatalError(env, "invalid display connection..");
+        NativewindowCommon_FatalError(env, "invalid display connection..");
     }
   x11ErrorHandlerEnable((Display *) (intptr_t) display, 1, env);
   r = (jlong) XVisualIDFromVisual( DefaultVisual( (Display*) (intptr_t) display, screen ) );
@@ -353,41 +313,41 @@ Java_com_jogamp_nativewindow_impl_x11_X11Lib_DefaultVisualID(JNIEnv *env, jclass
 }
 
 /*   Java->C glue code:
- *   Java package: com.jogamp.nativewindow.impl.x11.X11Lib
+ *   Java package: jogamp.nativewindow.x11.X11Lib
  *    Java method: void XLockDisplay(long display)
  *     C function: void XLockDisplay(Display *  display);
  */
 JNIEXPORT void JNICALL 
-Java_com_jogamp_nativewindow_impl_x11_X11Lib_XLockDisplay__J(JNIEnv *env, jclass _unused, jlong display) {
+Java_jogamp_nativewindow_x11_X11Lib_XLockDisplay__J(JNIEnv *env, jclass _unused, jlong display) {
   if(0==display) {
-      _FatalError(env, "invalid display connection..");
+      NativewindowCommon_FatalError(env, "invalid display connection..");
   }
   XLockDisplay((Display *) (intptr_t) display);
 }
 
 /*   Java->C glue code:
- *   Java package: com.jogamp.nativewindow.impl.x11.X11Lib
+ *   Java package: jogamp.nativewindow.x11.X11Lib
  *    Java method: void XUnlockDisplay(long display)
  *     C function: void XUnlockDisplay(Display *  display);
  */
 JNIEXPORT void JNICALL 
-Java_com_jogamp_nativewindow_impl_x11_X11Lib_XUnlockDisplay__J(JNIEnv *env, jclass _unused, jlong display) {
+Java_jogamp_nativewindow_x11_X11Lib_XUnlockDisplay__J(JNIEnv *env, jclass _unused, jlong display) {
   if(0==display) {
-      _FatalError(env, "invalid display connection..");
+      NativewindowCommon_FatalError(env, "invalid display connection..");
   }
   XUnlockDisplay((Display *) (intptr_t) display);
 }
 
 /*   Java->C glue code:
- *   Java package: com.jogamp.nativewindow.impl.x11.X11Lib
+ *   Java package: jogamp.nativewindow.x11.X11Lib
  *    Java method: int XCloseDisplay(long display)
  *     C function: int XCloseDisplay(Display *  display);
  */
 JNIEXPORT jint JNICALL 
-Java_com_jogamp_nativewindow_impl_x11_X11Lib_XCloseDisplay__J(JNIEnv *env, jclass _unused, jlong display) {
+Java_jogamp_nativewindow_x11_X11Lib_XCloseDisplay__J(JNIEnv *env, jclass _unused, jlong display) {
   int _res;
   if(0==display) {
-      _FatalError(env, "invalid display connection..");
+      NativewindowCommon_FatalError(env, "invalid display connection..");
   }
   x11ErrorHandlerEnable((Display *) (intptr_t) display, 1, env);
   _res = XCloseDisplay((Display *) (intptr_t) display);
@@ -396,12 +356,12 @@ Java_com_jogamp_nativewindow_impl_x11_X11Lib_XCloseDisplay__J(JNIEnv *env, jclas
 }
 
 /*
- * Class:     com_jogamp_nativewindow_impl_x11_X11Lib
+ * Class:     jogamp_nativewindow_x11_X11Lib
  * Method:    CreateDummyWindow
- * Signature: (JIJ)J
+ * Signature: (JIJII)J
  */
-JNIEXPORT jlong JNICALL Java_com_jogamp_nativewindow_impl_x11_X11Lib_CreateDummyWindow
-  (JNIEnv *env, jclass unused, jlong display, jint screen_index, jlong visualID)
+JNIEXPORT jlong JNICALL Java_jogamp_nativewindow_x11_X11Lib_CreateDummyWindow
+  (JNIEnv *env, jclass unused, jlong display, jint screen_index, jlong visualID, jint width, jint height)
 {
     Display * dpy  = (Display *)(intptr_t)display;
     int       scrn_idx = (int)screen_index;
@@ -420,12 +380,12 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_nativewindow_impl_x11_X11Lib_CreateDummy
     Screen* scrn;
 
     if(NULL==dpy) {
-        _FatalError(env, "invalid display connection..");
+        NativewindowCommon_FatalError(env, "invalid display connection..");
         return 0;
     }
 
     if(visualID<0) {
-        _throwNewRuntimeException(NULL, env, "invalid VisualID ..");
+        NativewindowCommon_throwNewRuntimeException(env, "invalid VisualID ..");
         return 0;
     }
 
@@ -450,7 +410,7 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_nativewindow_impl_x11_X11Lib_CreateDummy
     if (visual==NULL)
     { 
         x11ErrorHandlerEnable(dpy, 0, env);
-        _throwNewRuntimeException(dpy, env, "could not query Visual by given VisualID, bail out!");
+        NativewindowCommon_throwNewRuntimeException(env, "could not query Visual by given VisualID, bail out!");
         return 0;
     } 
 
@@ -463,17 +423,16 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_nativewindow_impl_x11_X11Lib_CreateDummy
         windowParent = XRootWindowOfScreen(scrn);
     }
 
-    attrMask  = ( CWBackingStore | CWBackingPlanes | CWBackingPixel | CWBackPixel | 
+    attrMask  = ( CWBackingStore | CWBackingPlanes | CWBackingPixel | CWBackPixmap | 
                   CWBorderPixel | CWColormap | CWOverrideRedirect ) ;
 
     memset(&xswa, 0, sizeof(xswa));
     xswa.override_redirect = False; // use the window manager, always
     xswa.border_pixel = 0;
-    xswa.background_pixel = 0;
+    xswa.background_pixmap = None;
     xswa.backing_store=NotUseful; /* NotUseful, WhenMapped, Always */
     xswa.backing_planes=0;        /* planes to be preserved if possible */
     xswa.backing_pixel=0;         /* value to use in restoring planes */
-    xswa.event_mask = 0 ;         /* no events */
 
     xswa.colormap = XCreateColormap(dpy,
                                     XRootWindow(dpy, scrn_idx),
@@ -483,7 +442,7 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_nativewindow_impl_x11_X11Lib_CreateDummy
     window = XCreateWindow(dpy,
                            windowParent,
                            0, 0,
-                           64, 64,
+                           width, height,
                            0, // border width
                            depth,
                            InputOutput,
@@ -505,18 +464,18 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_nativewindow_impl_x11_X11Lib_CreateDummy
 
 
 /*
- * Class:     com_jogamp_nativewindow_impl_x11_X11Lib
+ * Class:     jogamp_nativewindow_x11_X11Lib
  * Method:    DestroyDummyWindow
  * Signature: (JJ)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_nativewindow_impl_x11_X11Lib_DestroyDummyWindow
+JNIEXPORT void JNICALL Java_jogamp_nativewindow_x11_X11Lib_DestroyDummyWindow
   (JNIEnv *env, jclass unused, jlong display, jlong window)
 {
     Display * dpy = (Display *)(intptr_t)display;
     Window      w = (Window) window;
 
     if(NULL==dpy) {
-        _throwNewRuntimeException(NULL, env, "invalid display connection..");
+        NativewindowCommon_throwNewRuntimeException(env, "invalid display connection..");
         return;
     }
 
@@ -528,11 +487,11 @@ JNIEXPORT void JNICALL Java_com_jogamp_nativewindow_impl_x11_X11Lib_DestroyDummy
 }
 
 /*
- * Class:     com_jogamp_nativewindow_impl_x11_X11Lib
+ * Class:     jogamp_nativewindow_x11_X11Lib
  * Method:    GetRelativeLocation
  * Signature: (JIJJII)Ljavax/media/nativewindow/util/Point;
  */
-JNIEXPORT jobject JNICALL Java_com_jogamp_nativewindow_impl_x11_X11Lib_GetRelativeLocation0
+JNIEXPORT jobject JNICALL Java_jogamp_nativewindow_x11_X11Lib_GetRelativeLocation0
   (JNIEnv *env, jclass unused, jlong jdisplay, jint screen_index, jlong jsrc_win, jlong jdest_win, jint src_x, jint src_y)
 {
     Display * dpy = (Display *) (intptr_t) jdisplay;
diff --git a/src/newt/classes/com/jogamp/newt/Display.java b/src/newt/classes/com/jogamp/newt/Display.java
index 3e5c0c2..f879449 100644
--- a/src/newt/classes/com/jogamp/newt/Display.java
+++ b/src/newt/classes/com/jogamp/newt/Display.java
@@ -29,8 +29,8 @@
 package com.jogamp.newt;
 
 import com.jogamp.newt.util.EDTUtil;
-import com.jogamp.newt.impl.Debug;
-import com.jogamp.newt.impl.DisplayImpl;
+import jogamp.newt.Debug;
+import jogamp.newt.DisplayImpl;
 
 import java.util.*;
 
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java
index 3b83678..4b7eedc 100644
--- a/src/newt/classes/com/jogamp/newt/NewtFactory.java
+++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java
@@ -37,10 +37,10 @@ package com.jogamp.newt;
 import javax.media.nativewindow.*;
 import com.jogamp.common.jvm.JVMUtil;
 import com.jogamp.newt.event.WindowEvent;
-import com.jogamp.newt.impl.DisplayImpl;
-import com.jogamp.newt.impl.ScreenImpl;
-import com.jogamp.newt.impl.WindowImpl;
-import com.jogamp.newt.impl.Debug;
+import jogamp.newt.DisplayImpl;
+import jogamp.newt.ScreenImpl;
+import jogamp.newt.WindowImpl;
+import jogamp.newt.Debug;
 
 public class NewtFactory {
     public static final boolean DEBUG_IMPLEMENTATION = Debug.debug("Window");
diff --git a/src/newt/classes/com/jogamp/newt/NewtVersion.java b/src/newt/classes/com/jogamp/newt/NewtVersion.java
index aee67c4..961ffdf 100644
--- a/src/newt/classes/com/jogamp/newt/NewtVersion.java
+++ b/src/newt/classes/com/jogamp/newt/NewtVersion.java
@@ -28,8 +28,10 @@
  
 package com.jogamp.newt;
 
+import com.jogamp.common.GlueGenVersion;
 import com.jogamp.common.util.JogampVersion;
 import com.jogamp.common.util.VersionUtil;
+import com.jogamp.nativewindow.NativeWindowVersion;
 import java.util.jar.Manifest;
 
 public class NewtVersion extends JogampVersion {
@@ -41,7 +43,7 @@ public class NewtVersion extends JogampVersion {
     }
 
     public static NewtVersion getInstance() {
-        if(null == jogampCommonVersionInfo) {
+        if(null == jogampCommonVersionInfo) { // volatile: ok
             synchronized(NewtVersion.class) {
                 if( null == jogampCommonVersionInfo ) {
                     final String packageName = "com.jogamp.newt";
@@ -55,6 +57,8 @@ public class NewtVersion extends JogampVersion {
 
     public static void main(String args[]) {
         System.err.println(VersionUtil.getPlatformInfo());
+        System.err.println(GlueGenVersion.getInstance());
+        System.err.println(NativeWindowVersion.getInstance());
         System.err.println(NewtVersion.getInstance());
     }
 }
diff --git a/src/newt/classes/com/jogamp/newt/Screen.java b/src/newt/classes/com/jogamp/newt/Screen.java
index bf8c6f0..fec3613 100644
--- a/src/newt/classes/com/jogamp/newt/Screen.java
+++ b/src/newt/classes/com/jogamp/newt/Screen.java
@@ -28,7 +28,7 @@
 package com.jogamp.newt;
 
 import com.jogamp.newt.event.ScreenModeListener;
-import com.jogamp.newt.impl.Debug;
+import jogamp.newt.Debug;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java
index 99db471..b78f7a9 100644
--- a/src/newt/classes/com/jogamp/newt/Window.java
+++ b/src/newt/classes/com/jogamp/newt/Window.java
@@ -31,18 +31,19 @@ package com.jogamp.newt;
 import com.jogamp.newt.event.WindowListener;
 import com.jogamp.newt.event.KeyListener;
 import com.jogamp.newt.event.MouseListener;
-import com.jogamp.newt.impl.Debug;
+import jogamp.newt.Debug;
 import javax.media.nativewindow.CapabilitiesChooser;
 import javax.media.nativewindow.CapabilitiesImmutable;
 import javax.media.nativewindow.NativeWindow;
 import javax.media.nativewindow.SurfaceUpdatedListener;
+import javax.media.nativewindow.WindowClosingProtocol;
 import javax.media.nativewindow.util.Insets;
 
 /**
  * Specifying the public Window functionality for the
  * using a Window and for shadowing one like {@link com.jogamp.newt.opengl.GLWindow}.
  */
-public interface Window extends NativeWindow {
+public interface Window extends NativeWindow, WindowClosingProtocol {
     public static final boolean DEBUG_MOUSE_EVENT = Debug.debug("Window.MouseEvent");
     public static final boolean DEBUG_KEY_EVENT = Debug.debug("Window.KeyEvent");
     public static final boolean DEBUG_WINDOW_EVENT = Debug.debug("Window.WindowEvent");
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index a0ab5f9..0eda5c2 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -38,21 +38,36 @@ import java.awt.EventQueue;
 import java.awt.Graphics;
 import java.awt.KeyboardFocusManager;
 
-import javax.media.nativewindow.*;
+import javax.media.nativewindow.NativeWindow;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.WindowClosingProtocol;
+import javax.media.nativewindow.awt.AWTWindowClosingProtocol;
+import jogamp.nativewindow.awt.AWTMisc;
 
 import com.jogamp.newt.event.awt.AWTAdapter;
 import com.jogamp.newt.event.awt.AWTParentWindowAdapter;
 import com.jogamp.newt.event.WindowEvent;
 import com.jogamp.newt.Window;
-import com.jogamp.newt.impl.Debug;
+import com.jogamp.newt.event.WindowAdapter;
+import com.jogamp.newt.event.WindowListener;
+import jogamp.newt.Debug;
+import javax.swing.MenuSelectionManager;
 
-public class NewtCanvasAWT extends java.awt.Canvas {
+public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProtocol {
     public static final boolean DEBUG = Debug.debug("Window");
 
     NativeWindow nativeWindow = null;
     Window newtChild = null;
+    int newtChildCloseOp;
     AWTAdapter awtAdapter = null;
 
+    private AWTWindowClosingProtocol awtWindowClosingProtocol =
+          new AWTWindowClosingProtocol(this, new Runnable() {
+                public void run() {
+                    NewtCanvasAWT.this.destroy();
+                }
+            });
+
     /**
      * Instantiates a NewtCanvas without a NEWT child.<br>
      */
@@ -97,12 +112,19 @@ public class NewtCanvasAWT extends java.awt.Canvas {
     }
     FocusAction focusAction = new FocusAction();
     
+    WindowListener clearAWTMenusOnNewtFocus = new WindowAdapter() {
+          @Override
+          public void windowGainedFocus(WindowEvent arg0) {
+                  MenuSelectionManager.defaultManager().clearSelectedPath();
+          }
+    };
+
     /** sets a new NEWT child, provoking reparenting on the NEWT level. */
     public NewtCanvasAWT setNEWTChild(Window child) {
         if(newtChild!=child) {
             newtChild = child;
             if(null!=nativeWindow) {
-                java.awt.Container cont = getContainer(this);
+                java.awt.Container cont = AWTMisc.getContainer(this);
                 // reparent right away, addNotify has been called already
                 reparentWindow( (null!=newtChild) ? true : false, cont );
             }
@@ -119,30 +141,52 @@ public class NewtCanvasAWT extends java.awt.Canvas {
      * or {@link #addNotify()} hasn't been called yet.*/
     public NativeWindow getNativeWindow() { return nativeWindow; }
 
-    void setWindowAdapter(boolean attach) {
+    public int getDefaultCloseOperation() {
+        return awtWindowClosingProtocol.getDefaultCloseOperation();
+    }
+
+    public int setDefaultCloseOperation(int op) {
+        return awtWindowClosingProtocol.setDefaultCloseOperation(op);
+    }
+
+    void configureNewtChild(boolean attach) {
         if(null!=awtAdapter) {
           awtAdapter.removeFrom(this);
           awtAdapter=null;
         }
-        if(attach && null!=newtChild) {
-            awtAdapter = new AWTParentWindowAdapter(newtChild).addTo(this);
-        }
-    }
-
-    static java.awt.Container getContainer(java.awt.Component comp) {
-        while( null != comp ) {
-        	if( comp instanceof java.awt.Container ) {
-        		return (java.awt.Container) comp;
+        if( null != newtChild ) {
+            if(attach) {
+                awtAdapter = new AWTParentWindowAdapter(newtChild).addTo(this);
+                if(newtChild.isValid()) {
+                    newtChild.addWindowListener(clearAWTMenusOnNewtFocus);
+                }
+                newtChild.setFocusAction(focusAction); // enable AWT focus traversal
+                newtChildCloseOp = newtChild.setDefaultCloseOperation(WindowClosingProtocol.DO_NOTHING_ON_CLOSE);
+                awtWindowClosingProtocol.addClosingListenerOneShot();
+            } else {
+                if(newtChild.isValid()) {
+                    newtChild.removeWindowListener(clearAWTMenusOnNewtFocus);
+                }
+                newtChild.setFocusAction(null);
+                newtChild.setDefaultCloseOperation(newtChildCloseOp);
+                awtWindowClosingProtocol.removeClosingListener();
             }
-            comp = comp.getParent();
         }
-        return null;
     }
 
+    @Override
     public void addNotify() {
+
+        // before native peer is valid: X11
+        disableBackgroundErase();
+
+        // creates the native peer
         super.addNotify();
+
+        // after native peer is valid: Windows
         disableBackgroundErase();
-        java.awt.Container cont = getContainer(this);
+
+        java.awt.Container cont = AWTMisc.getContainer(this);
         if(DEBUG) {
             // if ( isShowing() == false ) -> Container was not visible yet.
             // if ( isShowing() == true  ) -> Container is already visible.
@@ -152,8 +196,9 @@ public class NewtCanvasAWT extends java.awt.Canvas {
         reparentWindow(true, cont);
     }
 
+    @Override
     public void removeNotify() {
-        java.awt.Container cont = getContainer(this);
+        java.awt.Container cont = AWTMisc.getContainer(this);
         if(DEBUG) {
             System.err.println("NewtCanvasAWT.removeNotify: "+newtChild+", from "+cont);
         }
@@ -179,13 +224,12 @@ public class NewtCanvasAWT extends java.awt.Canvas {
               newtChild.setSize(w, h);
               newtChild.reparentWindow(nativeWindow);
               newtChild.setVisible(true);
-              setWindowAdapter(true);
+              configureNewtChild(true);
               newtChild.sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout to listener
               newtChild.windowRepaint(0, 0, w, h);
-              newtChild.setFocusAction(focusAction); // enable AWT focus traversal
           }
       } else {
-          setWindowAdapter(false);
+          configureNewtChild(false);
           nativeWindow = null;
           newtChild.setVisible(false);
           newtChild.reparentWindow(null);
@@ -205,10 +249,11 @@ public class NewtCanvasAWT extends java.awt.Canvas {
      */
     public final void destroy() {
         if(null!=newtChild) {
-            java.awt.Container cont = getContainer(this);
+            java.awt.Container cont = AWTMisc.getContainer(this);
             if(DEBUG) {
                 System.err.println("NewtCanvasAWT.destroy(): "+newtChild+", from "+cont);
             }
+            configureNewtChild(false);
             nativeWindow = null;
             newtChild.setVisible(false);
             newtChild.reparentWindow(null);
@@ -220,12 +265,16 @@ public class NewtCanvasAWT extends java.awt.Canvas {
         }
     }
 
+    @Override
     public void paint(Graphics g) {
+        awtWindowClosingProtocol.addClosingListenerOneShot();
         if(null!=newtChild) {
             newtChild.windowRepaint(0, 0, getWidth(), getHeight());
         }
     }
+    @Override
     public void update(Graphics g) {
+        awtWindowClosingProtocol.addClosingListenerOneShot();
         if(null!=newtChild) {
             newtChild.windowRepaint(0, 0, getWidth(), getHeight());
         }
@@ -243,11 +292,13 @@ public class NewtCanvasAWT extends java.awt.Canvas {
         }
     }
 
+    @Override
     public void requestFocus() {
         requestFocusAWTParent();
         requestFocusNEWTChild();
     }
 
+    @Override
     public boolean requestFocus(boolean temporary) {
         boolean res = super.requestFocus(temporary);
         if(res) {
@@ -256,6 +307,7 @@ public class NewtCanvasAWT extends java.awt.Canvas {
         return res;
     }
 
+    @Override
     public boolean requestFocusInWindow() {
         boolean res = super.requestFocusInWindow();
         if(res) {
@@ -264,6 +316,7 @@ public class NewtCanvasAWT extends java.awt.Canvas {
         return res;
     }
 
+    @Override
     public boolean requestFocusInWindow(boolean temporary) {
         boolean res = super.requestFocusInWindow(temporary);
         if(res) {
@@ -304,13 +357,20 @@ public class NewtCanvasAWT extends java.awt.Canvas {
       } catch (Exception e) {
       }
       disableBackgroundEraseInitialized = true;
+      if(DEBUG) {
+        System.err.println("NewtCanvasAWT: TK disableBackgroundErase method found: "+
+                (null!=disableBackgroundEraseMethod));
+      }
     }
     if (disableBackgroundEraseMethod != null) {
+      Throwable t=null;
       try {
         disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
       } catch (Exception e) {
-        // FIXME: workaround for 6504460 (incorrect backport of 6333613 in 5.0u10)
-        // throw new GLException(e);
+        t = e;
+      }
+      if(DEBUG) {
+        System.err.println("NewtCanvasAWT: TK disableBackgroundErase error: "+t);
       }
     }
   }
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtFactoryAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtFactoryAWT.java
index cd03454..e1370f0 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtFactoryAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtFactoryAWT.java
@@ -34,7 +34,7 @@ import javax.media.nativewindow.*;
 import javax.media.nativewindow.awt.*;
 
 import com.jogamp.newt.NewtFactory;
-import com.jogamp.newt.impl.Debug;
+import jogamp.newt.Debug;
 
 public class NewtFactoryAWT extends NewtFactory {
   public static final boolean DEBUG_IMPLEMENTATION = Debug.debug("Window");
@@ -43,7 +43,7 @@ public class NewtFactoryAWT extends NewtFactory {
    * Wraps an AWT component into a {@link javax.media.nativewindow.NativeWindow} utilizing the {@link javax.media.nativewindow.NativeWindowFactory},<br>
    * using a configuration agnostic dummy {@link javax.media.nativewindow.DefaultGraphicsConfiguration}.<br>
    * <p>
-   * The actual wrapping implementation is {@link com.jogamp.nativewindow.impl.jawt.JAWTWindow}.<br></p>
+   * The actual wrapping implementation is {@link jogamp.nativewindow.jawt.JAWTWindow}.<br></p>
    * <p>
    * Purpose of this wrapping is to access the AWT window handle,<br>
    * not to actually render into it.<br>
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
index 852f77f..2c3fd9c 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
@@ -51,7 +51,7 @@ public class KeyEvent extends InputEvent
 
  public String toString() {
     return "KeyEvent["+getEventTypeString(getEventType())+
-                     ", code "+keyCode+"("+toHexString(keyCode)+"), char <"+keyChar+"> ("+toHexString((int)keyChar)+"), isActionKey "+isActionKey()+", "+super.toString()+"]";
+                     ", code "+keyCode+"("+toHexString(keyCode)+"), char '"+keyChar+"' ("+toHexString((int)keyChar)+"), isActionKey "+isActionKey()+", "+super.toString()+"]";
  }
 
  public static String getEventTypeString(int type) {
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
index 88b165a..8542820 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
@@ -52,6 +52,10 @@ public class TraceWindowAdapter implements WindowListener {
         System.err.println(e);
         if(null!=downstream) { downstream.windowDestroyNotify(e); }
     }
+    public void windowDestroyed(WindowEvent e) {
+        System.err.println(e);
+        if(null!=downstream) { downstream.windowDestroyed(e); }
+    }
     public void windowGainedFocus(WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowGainedFocus(e); }
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
index a1ad43a..b9e487e 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
@@ -36,6 +36,8 @@ public abstract class WindowAdapter implements WindowListener
     }
     public void windowDestroyNotify(WindowEvent e) {
     }
+    public void windowDestroyed(WindowEvent e) {
+    }
     public void windowGainedFocus(WindowEvent e) {
     }
     public void windowLostFocus(WindowEvent e) {
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
index 2742e0d..f3d62d8 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
@@ -46,6 +46,7 @@ public class WindowEvent extends NEWTEvent {
     public static final int EVENT_WINDOW_GAINED_FOCUS = 103;
     public static final int EVENT_WINDOW_LOST_FOCUS = 104;
     public static final int EVENT_WINDOW_REPAINT = 105;
+    public static final int EVENT_WINDOW_DESTROYED = 106;
 
     public WindowEvent(int eventType, Object source, long when) {
         super(eventType, source, when);
@@ -54,11 +55,12 @@ public class WindowEvent extends NEWTEvent {
     public static String getEventTypeString(int type) {
         switch(type) {
             case EVENT_WINDOW_RESIZED: return "WINDOW_RESIZED";
-            case EVENT_WINDOW_MOVED:   return "WINDOW_MOVED";
-            case EVENT_WINDOW_DESTROY_NOTIFY:   return "EVENT_WINDOW_DESTROY_NOTIFY";
-            case EVENT_WINDOW_GAINED_FOCUS:   return "EVENT_WINDOW_GAINED_FOCUS";
-            case EVENT_WINDOW_LOST_FOCUS:   return "EVENT_WINDOW_LOST_FOCUS";
-            case EVENT_WINDOW_REPAINT:   return "EVENT_WINDOW_REPAINT";
+            case EVENT_WINDOW_MOVED: return "WINDOW_MOVED";
+            case EVENT_WINDOW_DESTROY_NOTIFY: return "EVENT_WINDOW_DESTROY_NOTIFY";
+            case EVENT_WINDOW_GAINED_FOCUS: return "EVENT_WINDOW_GAINED_FOCUS";
+            case EVENT_WINDOW_LOST_FOCUS: return "EVENT_WINDOW_LOST_FOCUS";
+            case EVENT_WINDOW_REPAINT: return "EVENT_WINDOW_REPAINT";
+            case EVENT_WINDOW_DESTROYED: return "EVENT_WINDOW_DESTROYED";
             default: return "unknown (" + type + ")";
         }
     }
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowListener.java b/src/newt/classes/com/jogamp/newt/event/WindowListener.java
index 0d201a2..e841a06 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowListener.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowListener.java
@@ -44,6 +44,9 @@ public interface WindowListener extends NEWTEventListener {
     /** Window will be destroyed. Release of resources is recommended. */
     public void windowDestroyNotify(WindowEvent e);
 
+    /** Window has been destroyed.*/
+    public void windowDestroyed(WindowEvent e);
+
     /** Window gained focus. */
     public void windowGainedFocus(WindowEvent e);
 
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java
index c136946..e240026 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java
@@ -28,7 +28,7 @@
  
 package com.jogamp.newt.event.awt;
 
-import com.jogamp.newt.impl.Debug;
+import jogamp.newt.Debug;
 
 /**
  * Convenient adapter forwarding AWT events to NEWT via the event listener model.<br>
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTNewtEventFactory.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTNewtEventFactory.java
index 8e33285..20c0d15 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTNewtEventFactory.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTNewtEventFactory.java
@@ -39,7 +39,7 @@ class AWTNewtEventFactory {
         map.setKeyNotFoundValue(-1);
         // n/a map.put(java.awt.event.WindowEvent.WINDOW_OPENED, com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_OPENED);
         map.put(java.awt.event.WindowEvent.WINDOW_CLOSING, com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
-        // n/a map.put(java.awt.event.WindowEvent.WINDOW_CLOSED, com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_CLOSED);
+        map.put(java.awt.event.WindowEvent.WINDOW_CLOSED, com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_DESTROYED);
         // n/a map.put(java.awt.event.WindowEvent.WINDOW_ICONIFIED, com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_ICONIFIED);
         // n/a map.put(java.awt.event.WindowEvent.WINDOW_DEICONIFIED, com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_DEICONIFIED);
         map.put(java.awt.event.WindowEvent.WINDOW_ACTIVATED, com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_GAINED_FOCUS);
diff --git a/src/newt/classes/com/jogamp/newt/impl/Debug.java b/src/newt/classes/com/jogamp/newt/impl/Debug.java
deleted file mode 100644
index 62c261d..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/Debug.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.newt.impl;
-
-import java.security.*;
-
-/** Helper routines for logging and debugging. */
-
-public class Debug {
-  // Some common properties
-  private static boolean verbose;
-  private static boolean debugAll;
-  private static AccessControlContext localACC;
-  
-  static {
-    localACC=AccessController.getContext();
-    verbose = isPropertyDefined("newt.verbose", true);
-    debugAll = isPropertyDefined("newt.debug", true);
-    if (verbose) {
-       Package p = Package.getPackage("com.jogamp.newt");
-       System.err.println("NEWT specification version " + p.getSpecificationVersion());
-       System.err.println("NEWT implementation version " + p.getImplementationVersion());
-       System.err.println("NEWT implementation vendor " + p.getImplementationVendor());
-    }
-  }
-
-  static int getIntProperty(final String property, final boolean jnlpAlias) {
-      return getIntProperty(property, jnlpAlias, localACC);
-  }
-
-  public static int getIntProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    int i=0;
-    try {
-        Integer iv = Integer.valueOf(Debug.getProperty(property, jnlpAlias, acc));
-        i = iv.intValue();
-    } catch (NumberFormatException nfe) {}
-    return i;
-  }
-
-  static boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
-    return getBooleanProperty(property, jnlpAlias, localACC);
-  }
-
-  public static boolean getBooleanProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    Boolean b = Boolean.valueOf(Debug.getProperty(property, jnlpAlias, acc));
-    return b.booleanValue();
-  }
-
-  static boolean isPropertyDefined(final String property, final boolean jnlpAlias) {
-    return isPropertyDefined(property, jnlpAlias, localACC);
-  }
-
-  public static boolean isPropertyDefined(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    return (Debug.getProperty(property, jnlpAlias, acc) != null) ? true : false;
-  }
-
-  static String getProperty(final String property, final boolean jnlpAlias) {
-    return getProperty(property, jnlpAlias, localACC);
-  }
-
-  public static String getProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
-    String s=null;
-    if(null!=acc && acc.equals(localACC)) {
-        s = (String) AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() {
-              String val=null;
-              try {
-                  val = System.getProperty(property);
-              } catch (Exception e) {}
-              if(null==val && jnlpAlias && !property.startsWith(jnlp_prefix)) {
-                  try {
-                      val = System.getProperty(jnlp_prefix + property);
-                  } catch (Exception e) {}
-              }
-              return val;
-            }
-          });
-    } else {
-        try {
-            s = System.getProperty(property);
-        } catch (Exception e) {}
-        if(null==s && jnlpAlias && !property.startsWith(jnlp_prefix)) {
-            try {
-                s = System.getProperty(jnlp_prefix + property);
-            } catch (Exception e) {}
-        }
-    }
-    return s;
-  }
-  public static final String jnlp_prefix = "jnlp." ;
-
-  public static boolean verbose() {
-    return verbose;
-  }
-
-  public static boolean debugAll() {
-    return debugAll;
-  }
-
-  public static boolean debug(String subcomponent) {
-    return debugAll() || isPropertyDefined("newt.debug." + subcomponent, true);
-  }
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/DefaultEDTUtil.java b/src/newt/classes/com/jogamp/newt/impl/DefaultEDTUtil.java
deleted file mode 100644
index 7a2a0c9..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/DefaultEDTUtil.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.newt.impl;
-
-import com.jogamp.common.util.RunnableTask;
-import com.jogamp.newt.util.EDTUtil;
-import java.util.*;
-import javax.media.nativewindow.NativeWindowException;
-
-public class DefaultEDTUtil implements EDTUtil {
-    public static final boolean DEBUG = Debug.debug("EDT");
-
-    private ThreadGroup threadGroup; 
-    private EventDispatchThread edt = null;
-    private Object edtLock = new Object(); // locking the EDT start/stop state
-    private String name;
-    int start_iter=0;
-    private Runnable dispatchMessages;
-
-    public DefaultEDTUtil(ThreadGroup tg, String name, Runnable dispatchMessages) {
-        this.threadGroup = tg;
-        this.name=new String(Thread.currentThread().getName()+"-"+name+"-EDT-");
-        this.dispatchMessages=dispatchMessages;
-        this.edt = new EventDispatchThread(threadGroup, name);
-        this.edt.setDaemon(true); // don't stop JVM from shutdown ..
-    }
-
-    public final void reset() {
-        synchronized(edtLock) { 
-            waitUntilStopped();
-            if(DEBUG) {
-                if(edt.tasks.size()>0) {
-                    String msg = Thread.currentThread()+": EDT reset, remaining tasks: "+edt.tasks.size()+" - "+edt;
-                    System.err.println(msg);
-                    // Throwable t = new Throwable(msg);
-                    // t.printStackTrace();
-                }
-                System.err.println(Thread.currentThread()+": EDT reset - edt: "+edt);
-            }
-            this.edt = new EventDispatchThread(threadGroup, name);
-            this.edt.setDaemon(true); // don't stop JVM from shutdown ..
-        }
-    }
-
-    public final void start() {
-        synchronized(edtLock) { 
-            if(!edt.isRunning() && !edt.shouldStop) {
-                if(edt.isAlive()) {
-                    throw new RuntimeException("EDT Thread.isAlive(): true, isRunning: "+edt.isRunning()+", edt: "+edt+", tasks: "+edt.tasks.size());
-                }
-                start_iter++;
-                edt.setName(name+start_iter);
-                edt.shouldStop = false;
-                if(DEBUG) {
-                    String msg = Thread.currentThread()+": EDT START - edt: "+edt;
-                    System.err.println(msg);
-                    // Throwable t = new Throwable(msg);
-                    // t.printStackTrace();
-                }
-                edt.start();
-            }
-        }
-    }
-
-    public final boolean isCurrentThreadEDT() {
-        return edt == Thread.currentThread();
-    }
-
-    public final boolean isRunning() {
-        return edt.isRunning() ;
-    }
-
-    public final void invokeStop(Runnable task) {
-        invokeImpl(true, task, true);
-    }
-
-    public final void invoke(boolean wait, Runnable task) {
-        invokeImpl(wait, task, false);
-    }
-
-    private final void invokeImpl(boolean wait, Runnable task, boolean stop) {
-        if(task == null) {
-            throw new RuntimeException("Null Runnable");
-        }
-        Throwable throwable = null;
-        RunnableTask rTask = null;
-        Object rTaskLock = new Object();
-        synchronized(rTaskLock) { // lock the optional task execution
-            synchronized(edtLock) { // lock the EDT status
-                if( edt.shouldStop ) {
-                    // drop task ..
-                    if(DEBUG) {
-                        Throwable t = new Throwable("Warning: EDT about (1) to stop, won't enqueue new task: "+edt);
-                        t.printStackTrace();
-                    }
-                    return; 
-                }
-                // Exception ee = new Exception("XXX stop: "+stop+", tasks: "+edt.tasks.size()+", task: "+task);
-                // ee.printStackTrace();
-                if(stop) {
-                    edt.shouldStop = true;
-                    if(DEBUG) {
-                        String msg = Thread.currentThread()+": EDT signal STOP (on edt: "+isCurrentThreadEDT()+") - edt: "+edt;
-                        System.err.println(msg);
-                        // Throwable t = new Throwable(msg);
-                        // t.printStackTrace();
-                    }
-                }
-                if( isCurrentThreadEDT() ) {
-                    task.run();
-                    wait = false; // running in same thread (EDT) -> no wait
-                    if(stop && edt.tasks.size()>0) {
-                        String msg = "Warning: EDT about (2) to stop, having remaining tasks: "+edt.tasks.size()+" - "+edt;
-                        if(DEBUG) {
-                            Throwable t = new Throwable(msg);
-                            t.printStackTrace();
-                        } else {
-                            System.err.println(msg);
-                        }
-                    }
-                } else {
-                    synchronized(edt.tasks) {
-                        start(); // start if not started yet and !shouldStop
-                        wait = wait && edt.isRunning();
-                        rTask = new RunnableTask(task,
-                                                 wait ? rTaskLock : null,
-                                                 true /* always catch and report Exceptions, don't disturb EDT */);
-                        if(stop) {
-                            rTask.setAttachment(new Boolean(true)); // mark final task
-                        }
-                        // append task ..
-                        edt.tasks.add(rTask);
-                        edt.tasks.notifyAll();
-                    }
-                }
-            }
-            if( wait ) {
-                try {
-                    rTaskLock.wait(); // free lock, allow execution of rTask
-                } catch (InterruptedException ie) {
-                    throwable = ie;
-                }
-                if(null==throwable) {
-                    throwable = rTask.getThrowable();
-                }
-                if(null!=throwable) {
-                    if(throwable instanceof NativeWindowException) {
-                        throw (NativeWindowException)throwable;
-                    }
-                    throw new RuntimeException(throwable);
-                }
-            }
-        }
-        if(DEBUG && stop) {
-            System.err.println(Thread.currentThread()+": EDT signal STOP X edt: "+edt);
-        }
-    }
-
-    public void waitUntilIdle() {
-        if(edt.isRunning() && edt != Thread.currentThread()) {
-            synchronized(edt.tasks) {
-                while(edt.isRunning() && edt.tasks.size()>0) {
-                    try {
-                        edt.tasks.notifyAll();
-                        edt.tasks.wait();
-                    } catch (InterruptedException e) {
-                        e.printStackTrace();
-                    }
-                }
-            }
-        }
-    }
-
-    public void waitUntilStopped() {
-        if(edt.isRunning() && edt != Thread.currentThread() ) {
-            synchronized(edtLock) {
-                if(edt.isRunning() && edt != Thread.currentThread() ) {
-                    while(edt.isRunning()) {
-                        try {
-                            edtLock.wait();
-                        } catch (InterruptedException e) {
-                            e.printStackTrace();
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    class EventDispatchThread extends Thread {
-        volatile boolean shouldStop = false;
-        volatile boolean isRunning = false;
-        ArrayList tasks = new ArrayList(); // one shot tasks
-
-        public EventDispatchThread(ThreadGroup tg, String name) {
-            super(tg, name);
-        }
-
-        public final boolean isRunning() {
-            return isRunning;
-        }
-
-        public void start() throws IllegalThreadStateException {
-            isRunning = true;
-            super.start();
-        }
-
-        /** 
-         * Utilizing locking only on tasks and its execution,
-         * not for event dispatching.
-         */
-        public void run() {
-            if(DEBUG) {
-                System.err.println(getName()+": EDT run() START "+ getName());
-            }
-            RuntimeException error = null;
-            try {
-                do {
-                    // event dispatch
-                    if(!shouldStop) {
-                        dispatchMessages.run();
-                    }
-                    // wait and work on tasks
-                    RunnableTask task = null;
-                    synchronized(tasks) {
-                        // wait for tasks
-                        if(!shouldStop && tasks.size()==0) {
-                            try {
-                                tasks.wait(defaultEDTPollGranularity);
-                            } catch (InterruptedException e) {
-                                e.printStackTrace();
-                            }
-                        }
-                        // execute one task, if available
-                        if(tasks.size()>0) {
-                            task = (RunnableTask) tasks.remove(0);
-                            tasks.notifyAll();
-                        }
-                    }
-                    if(null!=task) {
-                        // Exceptions are always catched, see RunnableTask creation above
-                        task.run();
-                    }
-                } while(!shouldStop) ;
-            } catch (Throwable t) {
-                // handle errors ..
-                shouldStop = true;
-                if(t instanceof RuntimeException) {
-                    error = (RuntimeException) t;
-                } else {
-                    error = new RuntimeException("Within EDT", t);
-                }
-            } finally {
-                if(DEBUG) {
-                    RunnableTask rt = ( tasks.size() > 0 ) ? (RunnableTask) tasks.get(0) : null ;
-                    System.err.println(getName()+": EDT run() END "+ getName()+", tasks: "+tasks.size()+", "+rt+", "+error); 
-                }
-                synchronized(edtLock) {
-                    if(null==error) {
-                        synchronized(tasks) {
-                            // drain remaining tasks (stop not on EDT), 
-                            // while having tasks and no previous-task, or previous-task is non final
-                            RunnableTask task = null;
-                            while ( ( null == task || task.getAttachment() == null ) && tasks.size() > 0 ) {
-                                task = ( RunnableTask ) tasks.remove(0);
-                                task.run();
-                                tasks.notifyAll();
-                            }
-                            if(DEBUG) {
-                                if(null!=task && task.getAttachment()==null) {
-                                    Throwable t = new Throwable("Warning: EDT exit: Last task Not Final: "+tasks.size()+", "+task+" - "+edt);
-                                    t.printStackTrace();
-                                } else if(tasks.size()>0) {
-                                    Throwable t = new Throwable("Warning: EDT exit: Remaining tasks Post Final: "+tasks.size());
-                                    t.printStackTrace();
-                                }
-                            }
-                        }
-                    }
-                    isRunning = !shouldStop;
-                    if(!isRunning) {
-                        edtLock.notifyAll();
-                    }
-                }
-                if(DEBUG) {
-                    System.err.println(getName()+": EDT run() EXIT "+ getName()+", "+error);
-                }
-                if(null!=error) {
-                    throw error;
-                }
-            }
-        }
-    }
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/DisplayImpl.java b/src/newt/classes/com/jogamp/newt/impl/DisplayImpl.java
deleted file mode 100644
index 2af01c2..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/DisplayImpl.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl;
-
-import com.jogamp.newt.Display;
-import com.jogamp.newt.NewtFactory;
-import com.jogamp.newt.event.NEWTEvent;
-import com.jogamp.newt.event.NEWTEventConsumer;
-import com.jogamp.newt.impl.event.NEWTEventTask;
-import com.jogamp.newt.util.EDTUtil;
-import com.jogamp.newt.util.MainThread;
-import java.util.ArrayList;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.NativeWindowFactory;
-
-public abstract class DisplayImpl extends Display {
-    public static final boolean DEBUG_TEST_EDT_MAINTHREAD = Debug.isPropertyDefined("newt.test.EDTMainThread", true); // JAU EDT Test ..
-
-    private static int serialno = 1;
-
-    private static Class getDisplayClass(String type) 
-        throws ClassNotFoundException 
-    {
-        Class displayClass = NewtFactory.getCustomClass(type, "Display");
-        if(null==displayClass) {
-            if (NativeWindowFactory.TYPE_EGL.equals(type)) {
-                displayClass = Class.forName("com.jogamp.newt.impl.opengl.kd.KDDisplay");
-            } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
-                displayClass = Class.forName("com.jogamp.newt.impl.windows.WindowsDisplay");
-            } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
-                displayClass = Class.forName("com.jogamp.newt.impl.macosx.MacDisplay");
-            } else if (NativeWindowFactory.TYPE_X11.equals(type)) {
-                displayClass = Class.forName("com.jogamp.newt.impl.x11.X11Display");
-            } else if (NativeWindowFactory.TYPE_AWT.equals(type)) {
-                displayClass = Class.forName("com.jogamp.newt.impl.awt.AWTDisplay");
-            } else {
-                throw new RuntimeException("Unknown display type \"" + type + "\"");
-            }
-        }
-        return displayClass;
-    }
-
-    /** Make sure to reuse a Display with the same name */
-    public static Display create(String type, String name, final long handle, boolean reuse) {
-        try {
-            Class displayClass = getDisplayClass(type);
-            DisplayImpl display = (DisplayImpl) displayClass.newInstance();
-            name = display.validateDisplayName(name, handle);
-            synchronized(displayList) {
-                if(reuse) {
-                    Display display0 = Display.getLastDisplayOf(type, name, -1);
-                    if(null != display0) {
-                        if(DEBUG) {
-                            System.err.println("Display.create() REUSE: "+display0+" "+getThreadName());
-                        }
-                        return display0;
-                    }
-                }
-                display.name = name;
-                display.type=type;
-                display.destroyWhenUnused=false;
-                display.refCount=0;
-                display.id = serialno++;
-                display.fqname = getFQName(display.type, display.name, display.id);
-                display.hashCode = display.fqname.hashCode();
-                displayList.add(display);
-            }
-            display.createEDTUtil();
-            if(DEBUG) {
-                System.err.println("Display.create() NEW: "+display+" "+getThreadName());
-            }
-            return display;
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public int hashCode() {
-        return hashCode;
-    }
-
-    public  synchronized final void createNative()
-        throws NativeWindowException
-    {
-        if(null==aDevice) {
-            if(DEBUG) {
-                System.err.println("Display.createNative() START ("+getThreadName()+", "+this+")");
-            }
-            final DisplayImpl f_dpy = this;
-            try {
-                runOnEDTIfAvail(true, new Runnable() {
-                    public void run() {
-                        f_dpy.createNativeImpl();
-                    }});
-            } catch (Throwable t) {
-                throw new NativeWindowException(t);
-            }
-            if(null==aDevice) {
-                throw new NativeWindowException("Display.createNative() failed to instanciate an AbstractGraphicsDevice");
-            }
-            if(DEBUG) {
-                System.err.println("Display.createNative() END ("+getThreadName()+", "+this+")");
-            }
-            synchronized(displayList) {
-                displaysActive++;
-            }
-        }
-    }
-
-    protected boolean shallRunOnEDT() { 
-        return true; 
-    }
-
-    protected void createEDTUtil() {
-        if(NewtFactory.useEDT()) {
-            if ( ! DEBUG_TEST_EDT_MAINTHREAD ) {
-                Thread current = Thread.currentThread();
-                edtUtil = new DefaultEDTUtil(current.getThreadGroup(), "Display-"+getFQName(), dispatchMessagesRunnable);
-            } else {
-                // Begin JAU EDT Test ..
-                MainThread.addPumpMessage(this, dispatchMessagesRunnable); 
-                edtUtil = MainThread.getSingleton();
-                // End JAU EDT Test ..
-            }
-            if(DEBUG) {
-                System.err.println("Display.createNative("+getFQName()+") Create EDTUtil: "+edtUtil.getClass().getName());
-            }
-        }
-    }
-
-    public final EDTUtil getEDTUtil() {
-        return edtUtil;
-    }
-
-    private void stopEDT(final Runnable task) {
-        if( shallRunOnEDT() && null!=edtUtil ) {
-            edtUtil.invokeStop(task);
-        } else {
-            task.run();
-        }
-    }
-
-    public void runOnEDTIfAvail(boolean wait, final Runnable task) {
-        if( shallRunOnEDT() && null!=edtUtil ) {
-            edtUtil.invoke(wait, task);
-        } else {
-            task.run();
-        }
-    }
-
-    public boolean validateEDT() {
-        if(0==refCount && null==aDevice && null != edtUtil && edtUtil.isRunning()) {
-            stopEDT( new Runnable() {
-                public void run() {
-                    // nop
-                }
-            } );
-            edtUtil.waitUntilStopped();
-            edtUtil.reset();
-            return true;
-        }
-        return false;
-    }
-
-    public synchronized final void destroy() {
-        if(DEBUG) {
-            dumpDisplayList("Display.destroy("+getFQName()+") BEGIN");
-        }
-        synchronized(displayList) {
-            displayList.remove(this);
-            if(0 < displaysActive) {
-                displaysActive--;
-            }
-        }
-        if(DEBUG) {
-            System.err.println("Display.destroy(): "+this+" "+getThreadName());
-        }
-        final AbstractGraphicsDevice f_aDevice = aDevice;
-        final DisplayImpl f_dpy = this;
-        stopEDT( new Runnable() {
-            public void run() {
-                if ( null != f_aDevice ) {
-                    f_dpy.closeNativeImpl();
-                }
-            }
-        } );
-        if(null!=edtUtil) {
-            if ( DEBUG_TEST_EDT_MAINTHREAD ) {
-                MainThread.removePumpMessage(this); // JAU EDT Test ..
-            }
-            edtUtil.waitUntilStopped();
-            edtUtil.reset();
-        }
-        aDevice = null;
-        refCount=0;
-        if(DEBUG) {
-            dumpDisplayList("Display.destroy("+getFQName()+") END");
-        }
-    }
-
-    public synchronized final int addReference() {
-        if(DEBUG) {
-            System.err.println("Display.addReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount+1));
-        }
-        if ( 0 == refCount ) {
-            createNative();
-        }
-        if(null == aDevice) {
-            throw new NativeWindowException ("Display.addReference() (refCount "+refCount+") null AbstractGraphicsDevice");
-        }
-        return refCount++;
-    }
-
-
-    public synchronized final int removeReference() {
-        if(DEBUG) {
-            System.err.println("Display.removeReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount-1));
-        }
-        refCount--; // could become < 0, in case of manual destruction without actual creation/addReference
-        if(0>=refCount) {
-            destroy();
-            refCount=0; // fix < 0
-        }
-        return refCount;
-    }
-
-    public synchronized final int getReferenceCount() {
-        return refCount;
-    }
-
-    protected abstract void createNativeImpl();
-    protected abstract void closeNativeImpl();
-
-    public final int getId() {
-        return id;
-    }
-
-    public final String getType() {
-        return type;
-    }
-
-    public final String getName() {
-        return name;
-    }
-
-    public final String getFQName() {
-        return fqname;
-    }
-
-    public static final String nilString = "nil" ;
-
-    public String validateDisplayName(String name, long handle) {
-        if(null==name && 0!=handle) {
-            name="wrapping-"+toHexString(handle);
-        }
-        return ( null == name ) ? nilString : name ;
-    }
-
-    private static final String getFQName(String type, String name, int id) {
-        if(null==type) type=nilString;
-        if(null==name) name=nilString;
-        StringBuffer sb = new StringBuffer();
-        sb.append(type);
-        sb.append("_");
-        sb.append(name);
-        sb.append("-");
-        sb.append(id);
-        return sb.toString().intern();
-    }
-
-    public final long getHandle() {
-        if(null!=aDevice) {
-            return aDevice.getHandle();
-        }
-        return 0;
-    }
-
-    public final AbstractGraphicsDevice getGraphicsDevice() {
-        return aDevice;
-    }
-
-    public final boolean isNativeValid() {
-        return null != aDevice;
-    }
-
-    public boolean isEDTRunning() {
-        if(null!=edtUtil) {
-            return edtUtil.isRunning();
-        }
-        return false;
-    }
-
-    public String toString() {
-        return "NEWT-Display["+getFQName()+", refCount "+refCount+", hasEDT "+(null!=edtUtil)+", edtRunning "+isEDTRunning()+", "+aDevice+"]";
-    }
-
-    protected abstract void dispatchMessagesNative();
-
-    private Object eventsLock = new Object();
-    private ArrayList/*<NEWTEvent>*/ events = new ArrayList();
-
-    class DispatchMessagesRunnable implements Runnable {
-        public void run() {
-            DisplayImpl.this.dispatchMessages();
-        }
-    }
-    DispatchMessagesRunnable dispatchMessagesRunnable = new DispatchMessagesRunnable();
-
-    public void dispatchMessages() {
-        // System.err.println("Display.dispatchMessages() 0 "+this+" "+getThreadName());
-        if(0==refCount) return; // no screens 
-        if(null==getGraphicsDevice()) return; // no native device
-
-        ArrayList/*<NEWTEvent>*/ _events = null;
-
-        if(events.size()>0) {
-            // swap events list to free ASAP
-            synchronized(eventsLock) {
-                if(events.size()>0) {
-                    _events = events;
-                    events = new ArrayList();
-                }
-                eventsLock.notifyAll();
-            }
-            if( null != _events ) {
-                for (int i=0; i < _events.size(); i++) {
-                    NEWTEventTask eventTask = (NEWTEventTask) _events.get(i);
-                    NEWTEvent event = eventTask.get();
-                    Object source = event.getSource();
-                    if(source instanceof NEWTEventConsumer) {
-                        NEWTEventConsumer consumer = (NEWTEventConsumer) source ;
-                        if(!consumer.consumeEvent(event)) {
-                            enqueueEvent(false, event);
-                        }
-                    } else {
-                        throw new RuntimeException("Event source not NEWT: "+source.getClass().getName()+", "+source);
-                    }
-                    eventTask.notifyIssuer();
-                }
-            }
-        }
-
-        // System.err.println("Display.dispatchMessages() NATIVE "+this+" "+getThreadName());
-        dispatchMessagesNative();
-    }
-
-    public void enqueueEvent(boolean wait, NEWTEvent e) {
-        if(!isEDTRunning()) {
-            // oops .. we are already dead
-            if(DEBUG) {
-                Throwable t = new Throwable("Warning: EDT already stopped: wait:="+wait+", "+e);
-                t.printStackTrace();
-            }
-            return;
-        }
-        Object lock = new Object();
-        NEWTEventTask eTask = new NEWTEventTask(e, wait?lock:null);
-        synchronized(lock) {
-            synchronized(eventsLock) {
-                events.add(eTask);
-                eventsLock.notifyAll();
-            }
-            if( wait ) {
-                try {
-                    lock.wait();
-                } catch (InterruptedException ie) {
-                    throw new RuntimeException(ie);
-                }
-            }
-        }
-    }
-
-    protected EDTUtil edtUtil = null;
-    protected int id;
-    protected String name;
-    protected String type;
-    protected String fqname;
-    protected int hashCode;
-    protected int refCount; // number of Display references by Screen
-    protected boolean destroyWhenUnused;
-    protected AbstractGraphicsDevice aDevice;
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/NEWTJNILibLoader.java b/src/newt/classes/com/jogamp/newt/impl/NEWTJNILibLoader.java
deleted file mode 100644
index a4d234f..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/NEWTJNILibLoader.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- * 
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package com.jogamp.newt.impl;
-
-// FIXME: refactor Java SE dependencies
-//import java.awt.Toolkit;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.HashSet;
-import com.jogamp.common.jvm.JNILibLoaderBase;
-
-public class NEWTJNILibLoader extends JNILibLoaderBase {
-  
-  public static void loadNEWT() {
-    AccessController.doPrivileged(new PrivilegedAction() {
-      public Object run() {
-        loadLibrary("newt", null, true);
-        return null;
-      }
-    });
-  }
-
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/OffscreenWindow.java b/src/newt/classes/com/jogamp/newt/impl/OffscreenWindow.java
deleted file mode 100644
index 44aa9b4..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/OffscreenWindow.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl;
-
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.util.Point;
-
-public class OffscreenWindow extends WindowImpl implements SurfaceChangeable {
-
-    long surfaceHandle = 0;
-
-    public OffscreenWindow() {
-    }
-
-    static long nextWindowHandle = 0x100; // start here - a marker
-
-    protected void createNativeImpl() {
-        if(0!=getParentWindowHandle()) {
-            throw new NativeWindowException("OffscreenWindow does not support window parenting");
-        }
-        if(capsRequested.isOnscreen()) {
-            throw new NativeWindowException("Capabilities is onscreen");
-        }
-        AbstractGraphicsScreen aScreen = getScreen().getGraphicsScreen();
-        config = GraphicsConfigurationFactory.getFactory(aScreen.getDevice()).chooseGraphicsConfiguration(
-                capsRequested, capsRequested, capabilitiesChooser, aScreen);
-        if (config == null) {
-            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
-        }
-
-        synchronized(OffscreenWindow.class) {
-            setWindowHandle(nextWindowHandle++);
-        }
-    }
-
-    protected void closeNativeImpl() {
-        // nop
-    }
-
-    protected void invalidate(boolean unrecoverable) {
-        super.invalidate(unrecoverable);
-        surfaceHandle = 0;
-    }
-
-    public synchronized void destroy() {
-        super.destroy();
-        surfaceHandle = 0;
-    }
-
-    public void setSurfaceHandle(long handle) {
-        surfaceHandle = handle ;
-    }
-
-    public long getSurfaceHandle() {
-        return surfaceHandle;
-    }
-
-    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
-        sizeChanged(width, height, false);
-        visibleChanged(visible);
-    }
-
-    protected void requestFocusImpl(boolean reparented) {
-    }
-
-    public void setSize(int width, int height) {
-        if(!visible) {
-            sizeChanged(width, height, false);
-        }
-    }
-    public void setPosition(int x, int y) {
-        // nop
-    }
-    public boolean setFullscreen(boolean fullscreen) {
-        // nop
-        return false;
-    }
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, boolean parentChange, int fullScreenChange, int decorationChange) {
-        shouldNotCallThis();
-        return false;
-    }
-
-    public Point getLocationOnScreen(Point storage) {
-     if(null!=storage) {
-        storage.setX(0);
-        storage.setY(0);
-        return storage;
-     }
-     return new Point(0,0);
-    }
-
-    protected Point getLocationOnScreenImpl(int x, int y) {
-        return new Point(x,y);
-    }
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/ScreenImpl.java b/src/newt/classes/com/jogamp/newt/impl/ScreenImpl.java
deleted file mode 100644
index 071122a..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/ScreenImpl.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl;
-
-import com.jogamp.common.util.ArrayHashSet;
-import com.jogamp.common.util.IntIntHashMap;
-import com.jogamp.newt.Display;
-import com.jogamp.newt.NewtFactory;
-import com.jogamp.newt.Screen;
-import com.jogamp.newt.ScreenMode;
-import com.jogamp.newt.event.ScreenModeListener;
-import com.jogamp.newt.util.ScreenModeUtil;
-
-import javax.media.nativewindow.*;
-
-import java.security.*;
-import java.util.ArrayList;
-import java.util.List;
-
-public abstract class ScreenImpl extends Screen implements ScreenModeListener {
-    protected static final boolean DEBUG_TEST_SCREENMODE_DISABLED = Debug.isPropertyDefined("newt.test.Screen.disableScreenMode", true);
-
-    protected DisplayImpl display;
-    protected int screen_idx;
-    protected String fqname;
-    protected int hashCode;
-    protected AbstractGraphicsScreen aScreen;
-    protected int refCount; // number of Screen references by Window
-    protected int width=-1, height=-1; // detected values: set using setScreenSize
-    protected static int usrWidth=-1, usrHeight=-1; // property values: newt.ws.swidth and newt.ws.sheight
-    private static AccessControlContext localACC = AccessController.getContext();
-    private List/*<ScreenModeListener>*/ referencedScreenModeListener = new ArrayList();
-    long t0; // creationTime
-
-    private static Class getScreenClass(String type) 
-    throws ClassNotFoundException 
-    {
-        Class screenClass = NewtFactory.getCustomClass(type, "Screen");
-        if(null==screenClass) {
-            if (NativeWindowFactory.TYPE_EGL.equals(type)) {
-                screenClass = Class.forName("com.jogamp.newt.impl.opengl.kd.KDScreen");
-            } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
-                screenClass = Class.forName("com.jogamp.newt.impl.windows.WindowsScreen");
-            } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
-                screenClass = Class.forName("com.jogamp.newt.impl.macosx.MacScreen");
-            } else if (NativeWindowFactory.TYPE_X11.equals(type)) {
-                screenClass = Class.forName("com.jogamp.newt.impl.x11.X11Screen");
-            } else if (NativeWindowFactory.TYPE_AWT.equals(type)) {
-                screenClass = Class.forName("com.jogamp.newt.impl.awt.AWTScreen");
-            } else {
-                throw new RuntimeException("Unknown window type \"" + type + "\"");
-            }
-        }
-        return screenClass;
-    }
-
-    public static Screen create(Display display, final int idx) {
-        try {
-            if(usrWidth<0 || usrHeight<0) {
-                synchronized (Screen.class) {
-                    if(usrWidth<0 || usrHeight<0) {
-                        usrWidth  = Debug.getIntProperty("newt.ws.swidth", true, localACC);
-                        usrHeight = Debug.getIntProperty("newt.ws.sheight", true, localACC);
-                        if(usrWidth>0 || usrHeight>0) {
-                            System.err.println("User screen size "+usrWidth+"x"+usrHeight);
-                        }
-                    }
-                }
-            }
-            synchronized(screenList) {
-                {
-                    Screen screen0 = ScreenImpl.getLastScreenOf(display, idx, -1);
-                    if(null != screen0) {
-                        if(DEBUG) {
-                            System.err.println("Screen.create() REUSE: "+screen0+" "+Display.getThreadName());
-                        }
-                        return screen0;
-                    }
-                }
-                Class screenClass = getScreenClass(display.getType());
-                ScreenImpl screen  = (ScreenImpl) screenClass.newInstance();
-                screen.display = (DisplayImpl) display;
-                screen.screen_idx = idx;
-                screen.fqname = (display.getFQName()+idx).intern();
-                screen.hashCode = screen.fqname.hashCode();
-                screenList.add(screen);
-                if(DEBUG) {
-                    System.err.println("Screen.create() NEW: "+screen+" "+Display.getThreadName());
-                }
-                return screen;
-            }            
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public int hashCode() {
-        return hashCode;
-    }
-
-    public synchronized final void createNative()
-            throws NativeWindowException
-    {
-        if(null == aScreen) {
-            if(DEBUG) {
-                System.err.println("Screen.createNative() START ("+DisplayImpl.getThreadName()+", "+this+")");
-            }
-            t0 = System.currentTimeMillis();
-            display.addReference();
-            createNativeImpl();
-            if(null == aScreen) {
-                throw new NativeWindowException("Screen.createNative() failed to instanciate an AbstractGraphicsScreen");
-            }
-            if(DEBUG) {
-                System.err.println("Screen.createNative() END ("+DisplayImpl.getThreadName()+", "+this+")");
-            }
-            synchronized(screenList) {
-                screensActive++;
-            }
-        }
-        initScreenModeStatus();
-    }
-
-    public synchronized final void destroy() {
-        releaseScreenModeStatus();
-
-        synchronized(screenList) {
-            screenList.remove(this);
-            if(0 < screensActive) {
-                screensActive--;
-            }
-        }
-
-        if ( null != aScreen ) {
-            closeNativeImpl();
-            aScreen = null;
-        }
-        refCount = 0;
-        display.removeReference();
-    }
-
-    public synchronized final int addReference() throws NativeWindowException {
-        if(DEBUG) {
-            System.err.println("Screen.addReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount+1));
-        }
-        if ( 0 == refCount ) {
-            createNative();
-        }
-        if(null == aScreen) {
-            throw new NativeWindowException("Screen.addReference() (refCount "+refCount+") null AbstractGraphicsScreen");
-        }
-        return ++refCount;
-    }
-
-    public synchronized final int removeReference() {
-        if(DEBUG) {
-            String msg = "Screen.removeReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount-1);
-            // Throwable t = new Throwable(msg);
-            // t.printStackTrace();
-            System.err.println(msg);
-        }
-        refCount--; // could become < 0, in case of manual destruction without actual creation/addReference
-        if(0>=refCount) {
-            destroy();
-            refCount=0; // fix < 0
-        }
-        return refCount;
-    }
-
-    public synchronized final int getReferenceCount() {
-        return refCount;
-    }
-
-    protected abstract void createNativeImpl();
-    protected abstract void closeNativeImpl();
-
-    public final String getFQName() {
-        return fqname;
-    }
-
-    protected void setScreenSize(int w, int h) {
-        System.err.println("Detected screen size "+w+"x"+h);
-        width=w; height=h;
-    }
-
-    public final Display getDisplay() {
-        return display;
-    }
-
-    public final int getIndex() {
-        return screen_idx;
-    }
-
-    public final AbstractGraphicsScreen getGraphicsScreen() {
-        return aScreen;
-    }
-
-    public final boolean isNativeValid() {
-        return null != aScreen;
-    }
-
-    public final int getWidth() {
-        return (usrWidth>0) ? usrWidth : (width>0) ? width : 480;
-    }
-
-    public final int getHeight() {
-        return (usrHeight>0) ? usrHeight : (height>0) ? height : 480;
-    }
-
-    public String toString() {
-        return "NEWT-Screen["+getFQName()+", idx "+screen_idx+", refCount "+refCount+", "+getWidth()+"x"+getHeight()+", "+aScreen+", "+display+"]";
-    }
-
-    public final List/*<ScreenMode>*/ getScreenModes() {
-        ArrayHashSet screenModes = getScreenModesOrig();
-        if(null != screenModes && 0 < screenModes.size()) {
-            return screenModes.toArrayList();
-        }
-        return null;
-    }
-
-    public ScreenMode getOriginalScreenMode() {
-        ScreenModeStatus sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
-        return ( null != sms ) ? sms.getOriginalScreenMode() : null ;
-    }
-
-    public ScreenMode getCurrentScreenMode() {
-        ScreenMode smU = null;
-        ScreenModeStatus sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
-        if(null != sms) {
-            ScreenMode sm0 = ( DEBUG_TEST_SCREENMODE_DISABLED ) ? null : getCurrentScreenModeImpl();
-            if(null == sm0) {
-                return null;
-            }
-            sms.lock();
-            try {
-                smU = (ScreenMode) sms.getScreenModes().get(sm0); // unify via value hash
-                if(null == smU) {
-                    throw new RuntimeException(sm0+" could not be hashed from ScreenMode list");
-                }
-
-                // if mode has changed somehow, update it ..
-                if( sms.getCurrentScreenMode().hashCode() != smU.hashCode() ) {
-                    sms.fireScreenModeChanged(smU, true);
-                }
-            } finally {
-                sms.unlock();
-            }
-        }
-        return smU;
-    }
-
-    public boolean setCurrentScreenMode(ScreenMode screenMode) {
-        ScreenMode smU = (ScreenMode) getScreenModesOrig().get(screenMode); // unify via value hash
-        ScreenModeStatus sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
-        if(null!=sms) {
-            sms.lock();
-            try {
-                if(DEBUG) {
-                    System.err.println("Screen.setCurrentScreenMode ("+(System.currentTimeMillis()-t0)+"): 0.0 "+screenMode);
-                }
-
-                sms.fireScreenModeChangeNotify(smU);
-
-                if(DEBUG) {
-                    System.err.println("Screen.setCurrentScreenMode ("+(System.currentTimeMillis()-t0)+"): 0.1 "+screenMode);
-                }
-
-                boolean success = setCurrentScreenModeImpl(smU);
-                if(success) {
-                    setScreenSize(screenMode.getMonitorMode().getSurfaceSize().getResolution().getWidth(),
-                                  screenMode.getMonitorMode().getSurfaceSize().getResolution().getHeight());
-                }
-
-                if(DEBUG) {
-                    System.err.println("Screen.setCurrentScreenMode ("+(System.currentTimeMillis()-t0)+"): X.0 "+screenMode+", success: "+success);
-                }
-
-                sms.fireScreenModeChanged(smU, success);
-
-                if(DEBUG) {
-                    System.err.println("Screen.setCurrentScreenMode ("+(System.currentTimeMillis()-t0)+"): X.X "+screenMode+", success: "+success);
-                }
-
-                return success;
-            } finally {
-                sms.unlock();
-            }
-        }
-        return false;
-    }
-
-    public void screenModeChangeNotify(ScreenMode sm) {
-        for(int i=0; i<referencedScreenModeListener.size(); i++) {
-            ((ScreenModeListener)referencedScreenModeListener.get(i)).screenModeChangeNotify(sm);
-        }
-    }
-
-    public void screenModeChanged(ScreenMode sm, boolean success) {
-        for(int i=0; i<referencedScreenModeListener.size(); i++) {
-            ((ScreenModeListener)referencedScreenModeListener.get(i)).screenModeChanged(sm, success);
-        }
-    }
-
-    public synchronized final void addScreenModeListener(ScreenModeListener sml) {
-        referencedScreenModeListener.add(sml);
-    }
-
-    public synchronized final void removeScreenModeListener(ScreenModeListener sml) {
-        referencedScreenModeListener.remove(sml);
-    }
-
-    /** ScreenModeStatus bridge to native implementation */
-    protected final ArrayHashSet getScreenModesOrig() {
-        ScreenModeStatus sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
-        if(null!=sms) {
-            return sms.getScreenModes();
-        }
-        return null;
-    }
-
-    /** ScreenModeStatus bridge to native implementation */
-    protected final IntIntHashMap getScreenModesIdx2NativeIdx() {
-        ScreenModeStatus sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
-        if(null!=sms) {
-            return sms.getScreenModesIdx2NativeIdx();
-        }
-        return null;
-    }
-
-    /**
-     * To be implemented by the native specification.<br>
-     * Is called within a thread safe environment.<br>
-     * Is called only to collect the ScreenModes, usually at startup setting up modes.<br>
-     * <br>
-     * <b>WARNING</b>: must be synchronized with {@link com.jogamp.newt.util.ScreenModeUtil#NUM_SCREEN_MODE_PROPERTIES},
-     * ie {@link com.jogamp.newt.util.ScreenModeUtil#streamIn(com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, int[], int)}<br>
-     * <br>
-     * <b>Note</b>: Additional 1st element is native mode id.
-     */
-    protected int[] getScreenModeFirstImpl() {
-        return null;
-    }
-
-    /**
-     * To be implemented by the native specification.<br>
-     * Is called within a thread safe environment.<br>
-     * Is called only to collect the ScreenModes, usually at startup setting up modes.<br>
-     * <br>
-     * <b>WARNING</b>: must be synchronized with {@link com.jogamp.newt.util.ScreenModeUtil#NUM_SCREEN_MODE_PROPERTIES},
-     * ie {@link com.jogamp.newt.util.ScreenModeUtil#streamIn(com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, int[], int)}<br>
-     * <br>
-     * <b>Note</b>: Additional 1st element is native mode id.
-     */
-    protected int[] getScreenModeNextImpl() {
-        return null;
-    }
-
-    /**
-     * To be implemented by the native specification.<br>
-     * Is called within a thread safe environment.<br>
-     */
-    protected ScreenMode getCurrentScreenModeImpl() {
-        return null;
-    }
-
-    /**
-     * To be implemented by the native specification.<br>
-     * Is called within a thread safe environment.<br>
-     */
-    protected boolean setCurrentScreenModeImpl(ScreenMode screenMode) {
-        return false;
-    }
-
-    private void initScreenModeStatus() {
-        ScreenModeStatus sms;
-        ScreenModeStatus.lockScreenModeStatus();
-        try {
-            sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
-            if(null==sms) {                
-                IntIntHashMap screenModesIdx2NativeIdx = new IntIntHashMap();
-
-                ArrayHashSet screenModes = collectNativeScreenModes(screenModesIdx2NativeIdx);
-                sms = new ScreenModeStatus(screenModes, screenModesIdx2NativeIdx);
-                if(null!=screenModes && screenModes.size()>0) {
-                    ScreenMode originalScreenMode = ( DEBUG_TEST_SCREENMODE_DISABLED ) ? null : getCurrentScreenModeImpl();
-                    if(null != originalScreenMode) {
-                        ScreenMode originalScreenMode0 = (ScreenMode) screenModes.get(originalScreenMode); // unify via value hash
-                        if(null == originalScreenMode0) {
-                            throw new RuntimeException(originalScreenMode+" could not be hashed from ScreenMode list");
-                        }
-                        sms.setOriginalScreenMode(originalScreenMode0);
-                    }
-                }
-                ScreenModeStatus.mapScreenModeStatus(this.getFQName(), sms);
-            }
-            sms.addListener(this);
-        } finally {
-            ScreenModeStatus.unlockScreenModeStatus();
-        }
-    }
-
-    /** ignores bpp < 15 */
-    private ArrayHashSet collectNativeScreenModes(IntIntHashMap screenModesIdx2NativeId) {
-        ArrayHashSet resolutionPool  = new ArrayHashSet();
-        ArrayHashSet surfaceSizePool = new ArrayHashSet();
-        ArrayHashSet screenSizeMMPool = new ArrayHashSet();
-        ArrayHashSet monitorModePool = new ArrayHashSet();
-        ArrayHashSet screenModePool = null;
-
-        screenModePool = new ArrayHashSet();
-
-        int[] smProps = null;
-        int num = 0;
-        final int idxBpp =   1 // native mode
-                           + 1 // count
-                           + ScreenModeUtil.NUM_RESOLUTION_PROPERTIES
-                           + ScreenModeUtil.NUM_SURFACE_SIZE_PROPERTIES
-                           - 1 ; // index 0 based
-        do {
-            if(DEBUG_TEST_SCREENMODE_DISABLED) {
-                smProps = null;
-            } else if(0 == num) {
-                smProps = getScreenModeFirstImpl();
-            } else {
-                smProps = getScreenModeNextImpl();
-            }
-            if(null != smProps && 0 < smProps.length && smProps[idxBpp] >= 15) {
-                int nativeId = smProps[0];
-                int screenModeIdx = ScreenModeUtil.streamIn(resolutionPool, surfaceSizePool, screenSizeMMPool,
-                                                            monitorModePool, screenModePool, smProps, 1);
-                if(screenModeIdx >= 0) {
-                    screenModesIdx2NativeId.put(screenModeIdx, nativeId);
-                }
-            }
-            num++;
-        } while ( null != smProps && 0 < smProps.length );
-
-        if(DEBUG) {
-            System.err.println("ScreenImpl.collectNativeScreenModes: ScreenMode number  : "+screenModePool.size());
-            System.err.println("ScreenImpl.collectNativeScreenModes: MonitorMode number : "+monitorModePool.size());
-            System.err.println("ScreenImpl.collectNativeScreenModes: ScreenSizeMM number: "+screenSizeMMPool.size());
-            System.err.println("ScreenImpl.collectNativeScreenModes: SurfaceSize number : "+surfaceSizePool.size());
-            System.err.println("ScreenImpl.collectNativeScreenModes: Resolution number  : "+resolutionPool.size());
-        }
-
-        return screenModePool;
-    }
-
-    private void releaseScreenModeStatus() {
-        ScreenModeStatus sms;
-        ScreenModeStatus.lockScreenModeStatus();
-        try {
-            sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
-            if(null != sms) {
-                sms.lock();
-                try {
-                    if(0 == sms.removeListener(this)) {
-                        if(!sms.isOriginalMode()) {
-                            setCurrentScreenMode(sms.getOriginalScreenMode());
-                        }
-                        ScreenModeStatus.unmapScreenModeStatus(this.getFQName());
-                    }
-                } finally {
-                    sms.unlock();
-                }
-            }            
-        } finally {
-            ScreenModeStatus.unlockScreenModeStatus();
-        }
-    }
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/ScreenModeStatus.java b/src/newt/classes/com/jogamp/newt/impl/ScreenModeStatus.java
deleted file mode 100644
index 3ca9b63..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/ScreenModeStatus.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.newt.impl;
-
-import com.jogamp.common.util.ArrayHashSet;
-import com.jogamp.common.util.IntIntHashMap;
-import com.jogamp.common.util.locks.RecursiveLock;
-import com.jogamp.newt.Screen;
-import com.jogamp.newt.ScreenMode;
-import com.jogamp.newt.event.ScreenModeListener;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-public class ScreenModeStatus {
-    private static boolean DEBUG = Screen.DEBUG;
-
-    private RecursiveLock lock = new RecursiveLock();
-    private ArrayHashSet/*<ScreenMode>*/ screenModes;
-    private IntIntHashMap screenModesIdx2NativeIdx;
-    private ScreenMode currentScreenMode;
-    private ScreenMode originalScreenMode;
-    private ArrayList/*<ScreenModeChangeListener>*/ listener = new ArrayList();
-
-    private static HashMap screenFQN2ScreenModeStatus = new HashMap();
-    private static RecursiveLock screen2ScreenModeStatusLock = new RecursiveLock();
-
-    protected static void mapScreenModeStatus(String screenFQN, ScreenModeStatus sms) {
-        screen2ScreenModeStatusLock.lock();
-        try {
-            ScreenModeStatus _sms = (ScreenModeStatus) screenFQN2ScreenModeStatus.get(screenFQN);
-            if( null != _sms ) {
-                throw new RuntimeException("ScreenModeStatus "+_sms+" already mapped to "+screenFQN);
-            }
-            screenFQN2ScreenModeStatus.put(screenFQN, sms);
-            if(DEBUG) {
-                System.err.println("ScreenModeStatus.map "+screenFQN+" -> "+sms);
-            }
-        } finally {
-            screen2ScreenModeStatusLock.unlock();
-        }
-    }
-
-    /**
-     * @param screen the prev user
-     * @return true if mapping is empty, ie no more usage of the mapped ScreenModeStatus
-     */
-    protected static void unmapScreenModeStatus(String screenFQN) {
-        screen2ScreenModeStatusLock.lock();
-        try {
-            ScreenModeStatus sms = (ScreenModeStatus) screenFQN2ScreenModeStatus.remove(screenFQN);
-            if(DEBUG) {
-                System.err.println("ScreenModeStatus.unmap "+screenFQN+" -> "+sms);
-            }
-        } finally {
-            screen2ScreenModeStatusLock.unlock();
-        }
-    }
-
-    protected static ScreenModeStatus getScreenModeStatus(String screenFQN) {
-        screen2ScreenModeStatusLock.lock();
-        try {
-            return (ScreenModeStatus) screenFQN2ScreenModeStatus.get(screenFQN);
-        } finally {
-            screen2ScreenModeStatusLock.unlock();
-        }
-    }
-
-    protected static void lockScreenModeStatus() {
-        screen2ScreenModeStatusLock.lock();
-    }
-
-    protected static void unlockScreenModeStatus() {
-        screen2ScreenModeStatusLock.unlock();
-    }
-    
-    public ScreenModeStatus(ArrayHashSet/*<ScreenMode>*/ screenModes,
-                            IntIntHashMap screenModesIdx2NativeIdx) {
-        this.screenModes = screenModes;
-        this.screenModesIdx2NativeIdx = screenModesIdx2NativeIdx;
-    }
-
-    protected final void setOriginalScreenMode(ScreenMode originalScreenMode) {
-        this.originalScreenMode = originalScreenMode;
-        this.currentScreenMode = originalScreenMode;
-    }
-
-    public final ScreenMode getOriginalScreenMode() {
-        return originalScreenMode;
-    }
-
-    public final ScreenMode getCurrentScreenMode() {
-        lock();
-        try {
-            return currentScreenMode;
-        } finally {
-            unlock();
-        }
-    }
-
-    public final boolean isOriginalMode() {
-        lock();
-        try {
-            if(null != currentScreenMode && null != originalScreenMode) {
-                return currentScreenMode.hashCode() == originalScreenMode.hashCode();
-            }
-            return true;
-        } finally {
-            unlock();
-        }
-    }
-
-    protected final ArrayHashSet/*<ScreenMode>*/ getScreenModes() {
-        return screenModes;
-    }
-
-    protected final IntIntHashMap getScreenModesIdx2NativeIdx() {
-        return screenModesIdx2NativeIdx;
-    }
-
-    protected final int addListener(ScreenModeListener l) {
-        lock();
-        try {
-            listener.add(l);
-            if(DEBUG) {
-                System.err.println("ScreenModeStatus.addListener (size: "+listener.size()+"): "+l);
-            }
-            return listener.size();
-        } finally {
-            unlock();
-        }
-    }
-
-    protected final int removeListener(ScreenModeListener l) {
-        lock();
-        try {
-            if(!listener.remove(l)) {
-                throw new RuntimeException("ScreenModeListener "+l+" not contained");
-            }
-            if(DEBUG) {
-                System.err.println("ScreenModeStatus.removeListener (size: "+listener.size()+"): "+l);
-            }
-            return listener.size();
-        } finally {
-            unlock();
-        }
-    }
-
-    protected final void fireScreenModeChangeNotify(ScreenMode desiredScreenMode) {
-        lock();
-        try {
-            for(int i=0; i<listener.size(); i++) {
-                ((ScreenModeListener)listener.get(i)).screenModeChangeNotify(desiredScreenMode);
-            }
-        } finally {
-            unlock();
-        }
-    }
-
-    protected void fireScreenModeChanged(ScreenMode currentScreenMode, boolean success) {
-        lock();
-        try {
-            if(success) {
-                this.currentScreenMode = currentScreenMode;
-            }
-            for(int i=0; i<listener.size(); i++) {
-                ((ScreenModeListener)listener.get(i)).screenModeChanged(currentScreenMode, success);
-            }
-        } finally {
-            unlock();
-        }
-    }
-
-    protected final void lock() throws RuntimeException {
-        lock.lock();
-    }
-
-    protected final void unlock() throws RuntimeException {
-        lock.unlock();
-    }
-
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java b/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java
deleted file mode 100644
index fd5c1b6..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java
+++ /dev/null
@@ -1,2205 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
-   Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl;
-
-import com.jogamp.common.util.ReflectionUtil;
-import com.jogamp.newt.NewtFactory;
-import com.jogamp.newt.Display;
-import com.jogamp.newt.Screen;
-import com.jogamp.newt.Window;
-import com.jogamp.common.util.locks.RecursiveLock;
-import com.jogamp.newt.ScreenMode;
-import com.jogamp.newt.event.KeyEvent;
-import com.jogamp.newt.event.KeyListener;
-import com.jogamp.newt.event.MouseEvent;
-import com.jogamp.newt.event.MouseListener;
-import com.jogamp.newt.event.NEWTEvent;
-import com.jogamp.newt.event.NEWTEventConsumer;
-import com.jogamp.newt.event.ScreenModeListener;
-import com.jogamp.newt.event.WindowEvent;
-import com.jogamp.newt.event.WindowListener;
-import com.jogamp.newt.event.WindowUpdateEvent;
-
-import java.util.ArrayList;
-import java.lang.reflect.Method;
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
-import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.CapabilitiesChooser;
-import javax.media.nativewindow.CapabilitiesImmutable;
-import javax.media.nativewindow.NativeSurface;
-import javax.media.nativewindow.NativeWindow;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.NativeWindowFactory;
-import javax.media.nativewindow.SurfaceUpdatedListener;
-import javax.media.nativewindow.util.DimensionReadOnly;
-import javax.media.nativewindow.util.Insets;
-import javax.media.nativewindow.util.Point;
-import javax.media.nativewindow.util.Rectangle;
-
-public abstract class WindowImpl implements Window, NEWTEventConsumer
-{
-    public static final boolean DEBUG_TEST_REPARENT_INCOMPATIBLE = Debug.isPropertyDefined("newt.test.Window.reparent.incompatible", true);
-    
-    private RecursiveLock windowLock = new RecursiveLock();
-    private long   windowHandle;
-    private ScreenImpl screen;
-    private boolean screenReferenceAdded = false;
-    private NativeWindow parentWindow;
-    private long parentWindowHandle;
-    protected AbstractGraphicsConfiguration config;
-    protected CapabilitiesImmutable capsRequested;
-    protected CapabilitiesChooser capabilitiesChooser = null; // default null -> default
-    protected boolean fullscreen, visible, hasFocus;
-    protected int width, height, x, y;
-    protected int nfs_width, nfs_height, nfs_x, nfs_y; // non fullscreen dimensions ..
-    protected String title = "Newt Window";
-    protected boolean undecorated = false;
-    private LifecycleHook lifecycleHook = null;
-
-    private DestroyAction destroyAction = new DestroyAction();
-    private boolean handleDestroyNotify = true;
-
-    private ReparentActionRecreate reparentActionRecreate = new ReparentActionRecreate();
-
-    private RequestFocusAction requestFocusAction = new RequestFocusAction();
-    private FocusRunnable focusAction = null;
-
-    private Object surfaceUpdatedListenersLock = new Object();
-    private ArrayList surfaceUpdatedListeners;
-
-    private Object childWindowsLock = new Object();
-    private ArrayList childWindows;
-
-    private ArrayList mouseListeners;
-    private int  mouseButtonPressed;  // current pressed mouse button number
-    private long lastMousePressed;    // last time when a mouse button was pressed
-    private int  lastMouseClickCount; // last mouse button click count
-
-    private ArrayList keyListeners;
-
-    private ArrayList windowListeners;
-    private boolean repaintQueued = false;
-
-    ScreenModeListenerImpl screenModeListenerImpl = new ScreenModeListenerImpl();
-
-    private void initializeStates() {
-        invalidate(true);
-
-        childWindows = new ArrayList();
-        surfaceUpdatedListeners = new ArrayList();
-        windowListeners =  new ArrayList();
-        mouseListeners = new ArrayList();
-
-        mouseButtonPressed = 0; // current pressed mouse button number
-        lastMousePressed = 0; // last time when a mouse button was pressed
-        lastMouseClickCount = 0; // last mouse button click count
-        keyListeners = new ArrayList();
-    }
-
-    // Workaround for initialization order problems on Mac OS X
-    // between native Newt and (apparently) Fmod -- if Fmod is
-    // initialized first then the connection to the window server
-    // breaks, leading to errors from deep within the AppKit
-    public static void init(String type) {
-        if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
-            try {
-                getWindowClass(type);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    //
-    // Construction Methods
-    //
-
-    private static Class getWindowClass(String type)
-        throws ClassNotFoundException
-    {
-        Class windowClass = NewtFactory.getCustomClass(type, "Window");
-        if(null==windowClass) {
-            if (NativeWindowFactory.TYPE_EGL.equals(type)) {
-                windowClass = Class.forName("com.jogamp.newt.impl.opengl.kd.KDWindow");
-            } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
-                windowClass = Class.forName("com.jogamp.newt.impl.windows.WindowsWindow");
-            } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
-                windowClass = Class.forName("com.jogamp.newt.impl.macosx.MacWindow");
-            } else if (NativeWindowFactory.TYPE_X11.equals(type)) {
-                windowClass = Class.forName("com.jogamp.newt.impl.x11.X11Window");
-            } else if (NativeWindowFactory.TYPE_AWT.equals(type)) {
-                windowClass = Class.forName("com.jogamp.newt.impl.awt.AWTWindow");
-            } else {
-                throw new NativeWindowException("Unknown window type \"" + type + "\"");
-            }
-        }
-        return windowClass;
-    }
-
-    public static WindowImpl create(NativeWindow parentWindow, long parentWindowHandle, Screen screen, CapabilitiesImmutable caps) {
-        try {
-            Class windowClass;
-            if(caps.isOnscreen()) {
-                windowClass = getWindowClass(screen.getDisplay().getType());
-            } else {
-                windowClass = OffscreenWindow.class;
-            }
-            WindowImpl window = (WindowImpl) windowClass.newInstance();
-            window.initializeStates();
-            window.parentWindow = parentWindow;
-            window.parentWindowHandle = parentWindowHandle;
-            window.screen = (ScreenImpl) screen;
-            window.capsRequested = (CapabilitiesImmutable) caps.cloneMutable();
-            window.setUndecorated(0!=parentWindowHandle);
-            return window;
-        } catch (Throwable t) {
-            t.printStackTrace();
-            throw new NativeWindowException(t);
-        }
-    }
-
-    public static WindowImpl create(Object[] cstrArguments, Screen screen, CapabilitiesImmutable caps) {
-        try {
-            Class windowClass = getWindowClass(screen.getDisplay().getType());
-            Class[] cstrArgumentTypes = getCustomConstructorArgumentTypes(windowClass);
-            if(null==cstrArgumentTypes) {
-                throw new NativeWindowException("WindowClass "+windowClass+" doesn't support custom arguments in constructor");
-            }
-            int argsChecked = verifyConstructorArgumentTypes(cstrArgumentTypes, cstrArguments);
-            if ( argsChecked < cstrArguments.length ) {
-                throw new NativeWindowException("WindowClass "+windowClass+" constructor mismatch at argument #"+argsChecked+"; Constructor: "+getTypeStrList(cstrArgumentTypes)+", arguments: "+getArgsStrList(cstrArguments));
-            }
-            WindowImpl window = (WindowImpl) ReflectionUtil.createInstance( windowClass, cstrArgumentTypes, cstrArguments ) ;
-            window.initializeStates();
-            window.screen = (ScreenImpl) screen;
-            window.capsRequested = (CapabilitiesImmutable) caps.cloneMutable();
-            return window;
-        } catch (Throwable t) {
-            throw new NativeWindowException(t);
-        }
-    }
-
-    public static interface LifecycleHook {
-        /**
-         * Reset of internal state counter, ie totalFrames, etc.
-         * Called from EDT while window is locked.
-         */
-        public abstract void resetCounter();
-
-        /** 
-         * Invoked after Window setVisible, 
-         * allows allocating resources depending on the native Window.
-         * Called from EDT while window is locked.
-         */
-        void setVisibleActionPost(boolean visible, boolean nativeWindowCreated);
-
-        /** 
-         * Invoked before Window destroy action, 
-         * allows releasing of resources depending on the native Window.<br>
-         * Surface not locked yet.<br>
-         * Called not necessarily from EDT.
-         */
-        void destroyActionPreLock();
-
-        /**
-         * Invoked before Window destroy action,
-         * allows releasing of resources depending on the native Window.<br>
-         * Surface locked.<br>
-         * Called from EDT while window is locked.
-         */
-        void destroyActionInLock();
-
-        /**
-         * Invoked after destruction from Window's invalidate method.<br>
-         * Called while window is locked.
-         * @param unrecoverable
-         */
-        void invalidate(boolean unrecoverable);
-
-        /**
-         * Invoked for expensive modifications, ie while reparenting and ScreenMode change.<br>
-         * No lock is hold when invoked.<br>
-         *
-         * @return true is paused, otherwise false. If true {@link #resumeRenderingAction()} shall be issued.
-         *
-         * @see #resumeRenderingAction()
-         */
-        boolean pauseRenderingAction();
-
-        /**
-         * Invoked for expensive modifications, ie while reparenting and ScreenMode change.
-         * No lock is hold when invoked.<br>
-         *
-         * @see #pauseRenderingAction()
-         */
-        void resumeRenderingAction();
-    }
-
-    private boolean createNative() {
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("Window.createNative() START ("+getThreadName()+", "+this+")");
-        }
-        if( null != parentWindow && 
-            NativeSurface.LOCK_SURFACE_NOT_READY >= parentWindow.lockSurface() ) {
-                throw new NativeWindowException("Parent surface lock: not ready: "+parentWindow);
-        }
-        try {
-            if(validateParentWindowHandle()) {
-                if(screenReferenceAdded) {
-                    throw new InternalError("XXX");
-                }
-                screen.addReference();
-                screenReferenceAdded = true;
-                createNativeImpl();
-                setVisibleImpl(true, x, y, width, height);
-                screen.addScreenModeListener(screenModeListenerImpl);
-            }
-        } finally {
-            if(null!=parentWindow) {
-                parentWindow.unlockSurface();
-            }
-        }
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("Window.createNative() END ("+getThreadName()+", "+this+")");
-        }
-        return 0 != windowHandle ;
-    }
-
-    private void removeScreenReference() {
-        if(screenReferenceAdded) {
-            // be nice, probably already called recursive via
-            //   closeAndInvalidate() -> closeNativeIml() -> .. -> windowDestroyed() -> closeAndInvalidate() !
-            // or via reparentWindow .. etc
-            screenReferenceAdded = false;
-            screen.removeReference();
-        }
-    }
-
-    private void closeAndInvalidate() {
-        windowLock.lock();
-        try {
-            if( null != screen ) {
-                if( 0 != windowHandle ) {
-                    screen.removeScreenModeListener(screenModeListenerImpl);
-                    closeNativeImpl();
-                    removeScreenReference();
-                }
-                Display dpy = screen.getDisplay();
-                if(null != dpy) {
-                    dpy.validateEDT();
-                }
-            }
-            invalidate(false);
-        } finally {
-            windowLock.unlock();
-        }
-    }
-
-    private boolean validateParentWindowHandle() {
-        if(null!=parentWindow) {
-            parentWindowHandle = getNativeWindowHandle(parentWindow);
-            return 0 != parentWindowHandle ;
-        }
-        return true;
-    }
-
-    private static long getNativeWindowHandle(NativeWindow nativeWindow) {
-        long handle = 0;
-        if(null!=nativeWindow) {
-            boolean wasLocked = false;
-            if( NativeSurface.LOCK_SURFACE_NOT_READY < nativeWindow.lockSurface() ) {
-                wasLocked = true;
-                try {
-                    handle = nativeWindow.getWindowHandle();
-                    if(0==handle) {
-                        throw new NativeWindowException("Parent native window handle is NULL, after succesful locking: "+nativeWindow);
-                    }
-                } catch (NativeWindowException nwe) {
-                    if(DEBUG_IMPLEMENTATION) {
-                        System.err.println("Window.getNativeWindowHandle: not successful yet: "+nwe);
-                    }
-                } finally {
-                    nativeWindow.unlockSurface();
-                }
-            }
-            if(DEBUG_IMPLEMENTATION) {
-                System.err.println("Window.getNativeWindowHandle: locked "+wasLocked+", "+nativeWindow);
-            }
-        }
-        return handle;
-    }
-
-
-    //----------------------------------------------------------------------
-    // NativeSurface: Native implementation
-    //
-
-    protected int lockSurfaceImpl() { return LOCK_SUCCESS; }
-
-    protected void unlockSurfaceImpl() { }
-
-    //----------------------------------------------------------------------
-    // Window: Native implementation
-    //
-
-    /** 
-     * The native implementation must set the native windowHandle.<br>
-     *
-     * The implementation should invoke the referenced java state callbacks
-     * to notify this Java object of state changes.
-     * 
-     * @see #windowDestroyNotify()
-     * @see #focusChanged(boolean)
-     * @see #visibleChanged(boolean)
-     * @see #sizeChanged(int,int)
-     * @see #positionChanged(int,int)
-     * @see #windowDestroyNotify()
-     */
-    protected abstract void createNativeImpl();
-
-    protected abstract void closeNativeImpl();
-
-    /** 
-     * The native implementation must invoke {@link #focusChanged(boolean)}
-     * to change the focus state, if <code>force == false</code>. 
-     * This may happen asynchronous within {@link #TIMEOUT_NATIVEWINDOW}.
-     * 
-     * @param force if true, bypass {@link #focusChanged(boolean)} and force focus request
-     */
-    protected abstract void requestFocusImpl(boolean force);
-
-    /** 
-     * The native implementation must invoke {@link #visibleChanged(boolean)}
-     * to change the visibility state. This may happen asynchronous within 
-     * {@link #TIMEOUT_NATIVEWINDOW}.
-     */
-    protected abstract void setVisibleImpl(boolean visible, int x, int y, int width, int height);
-
-    /**
-     * The native implementation should invoke the referenced java state callbacks
-     * to notify this Java object of state changes.
-     * 
-     * @param x -1 if no position change requested, otherwise greater than zero
-     * @param y -1 if no position change requested, otherwise greater than zero
-     * @param width -1 if no size change requested, otherwise greater than zero
-     * @param height -1 if no size change requested, otherwise greater than zero
-     * @param parentChange true if reparenting requested, otherwise false
-     * @param fullScreenChange 0 if unchanged, -1 fullscreen off, 1 fullscreen on
-     * @param decorationChange 0 if unchanged, -1 undecorated, 1 decorated
-     *
-     * @see #sizeChanged(int,int)
-     * @see #positionChanged(int,int)
-     */
-    protected abstract boolean reconfigureWindowImpl(int x, int y, int width, int height, 
-                                                     boolean parentChange, int fullScreenChange, int decorationChange);
-
-    protected void setTitleImpl(String title) {}
-
-    /**
-     * Return screen coordinates of the given coordinates
-     * or null, in which case a NativeWindow traversal shall being used
-     * as demonstrated in {@link #getLocationOnScreen(javax.media.nativewindow.util.Point)}.
-     *
-     * @return if not null, the screen location of the given coordinates
-     */
-    protected abstract Point getLocationOnScreenImpl(int x, int y);
-
-    //----------------------------------------------------------------------
-    // NativeSurface
-    //
-
-    public final int lockSurface() {
-        int res = LOCK_SURFACE_NOT_READY;
-        windowLock.lock();
-
-        if(isNativeValid()) {
-            AbstractGraphicsDevice adevice = screen.getDisplay().getGraphicsDevice();
-            adevice.lock();
-            try {
-                res = lockSurfaceImpl();
-            } finally {
-                if( LOCK_SURFACE_NOT_READY == res ) {
-                    adevice.unlock();
-                }
-            }
-        }
-        if( LOCK_SURFACE_NOT_READY == res ) {
-            windowLock.unlock();
-        }
-
-        return res;
-    }
-
-    public final void unlockSurface() {
-        // may throw RuntimeException if not locked
-        windowLock.validateLocked();
-
-        try {
-            unlockSurfaceImpl();
-        } finally {
-            screen.getDisplay().getGraphicsDevice().unlock();
-        }
-        windowLock.unlock();
-    }
-
-    public final boolean isSurfaceLockedByOtherThread() {
-        return windowLock.isLockedByOtherThread();
-    }
-
-    public final boolean isSurfaceLocked() {
-        return windowLock.isLocked();
-    }
-
-    public final Thread getSurfaceLockOwner() {
-        return windowLock.getOwner();
-    }
-
-    public long getSurfaceHandle() {
-        return windowHandle; // default: return window handle
-    }
-
-    public boolean surfaceSwap() {
-        return false;
-    }
-
-    public AbstractGraphicsConfiguration getGraphicsConfiguration() {
-        return config;
-    }
-
-    public final long getDisplayHandle() {
-        return getScreen().getDisplay().getHandle();
-    }
-
-    public final int  getScreenIndex() {
-        return getScreen().getIndex();
-    }
-
-    //----------------------------------------------------------------------
-    // NativeWindow
-    //
-
-    // public final void destroy() - see below
-
-    public final NativeWindow getParent() {
-        return parentWindow;
-    }
-
-    public final long getWindowHandle() {
-        return windowHandle;
-    }
-
-    public Point getLocationOnScreen(Point storage) {
-        if(isNativeValid()) {
-            Point d;
-            windowLock.lock();
-            try {
-                d = getLocationOnScreenImpl(0, 0);
-            } finally {
-                windowLock.unlock();
-            }
-            if(null!=d) {
-                if(null!=storage) {
-                    storage.translate(d.getX(),d.getY());
-                    return storage;
-                }
-                return d;
-            }
-            // fall through intended ..
-        }
-
-        if(null!=storage) {
-            storage.translate(getX(),getY());
-        } else {
-            storage = new Point(getX(),getY());
-        }
-        if(null!=parentWindow) {
-            // traverse through parent list ..
-            parentWindow.getLocationOnScreen(storage);
-        }
-        return storage;
-    }
-
-    //----------------------------------------------------------------------
-    // Window
-    //
-
-    public final boolean isNativeValid() {
-        return null != getScreen() && 0 != getWindowHandle() ;
-    }
-
-    public final boolean isValid() {
-        return null != getScreen() ;
-    }
-
-    public final Screen getScreen() {
-        return screen;
-    }
-
-    class VisibleAction implements Runnable {
-        boolean visible;
-        boolean nativeWindowCreated;
-        boolean madeVisible;
-
-        public VisibleAction (boolean visible) {
-            this.visible = visible;
-            this.nativeWindowCreated = false;
-            this.madeVisible = false;
-        }
-
-        public final boolean getNativeWindowCreated() { return nativeWindowCreated; }
-        public final boolean getBecameVisible() { return madeVisible; }
-        public final boolean getChanged() { return nativeWindowCreated || madeVisible; }
-
-        public void run() {
-            windowLock.lock();
-            try {
-                if(DEBUG_IMPLEMENTATION) {
-                    String msg = new String("Window setVisible: START ("+getThreadName()+") "+x+"/"+y+" "+width+"x"+height+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible: "+WindowImpl.this.visible+" -> "+visible+", parentWindowHandle "+toHexString(WindowImpl.this.parentWindowHandle)+", parentWindow "+(null!=WindowImpl.this.parentWindow)/*+", "+this*/);
-                    System.err.println(msg);
-                }
-
-                if(null!=lifecycleHook) {
-                    lifecycleHook.resetCounter();
-                }
-
-                if(!visible && childWindows.size()>0) {
-                  synchronized(childWindowsLock) {
-                    for(int i = 0; i < childWindows.size(); i++ ) {
-                        NativeWindow nw = (NativeWindow) childWindows.get(i);
-                        if(nw instanceof WindowImpl) {
-                            ((WindowImpl)nw).setVisible(false);
-                        }
-                    }
-                  }
-                }
-                if(0==windowHandle && visible) {
-                    if( 0<width*height ) {
-                        nativeWindowCreated = createNative();
-                        WindowImpl.this.waitForVisible(visible, true);
-                        madeVisible = visible;
-                    }
-                } else if(WindowImpl.this.visible != visible) {
-                    if(0 != windowHandle) {
-                        setVisibleImpl(visible, x, y, width, height);
-                        WindowImpl.this.waitForVisible(visible, true);
-                        madeVisible = visible;
-                    }
-                }
-
-                if(null!=lifecycleHook) {
-                    lifecycleHook.setVisibleActionPost(visible, nativeWindowCreated);
-                }
-
-                if(0!=windowHandle && visible && childWindows.size()>0) {
-                  synchronized(childWindowsLock) {
-                    for(int i = 0; i < childWindows.size(); i++ ) {
-                        NativeWindow nw = (NativeWindow) childWindows.get(i);
-                        if(nw instanceof WindowImpl) {
-                            ((WindowImpl)nw).setVisible(true);
-                        }
-                    }
-                  }
-                }
-                if(DEBUG_IMPLEMENTATION) {
-                    System.err.println("Window setVisible: END ("+getThreadName()+") "+x+"/"+y+" "+width+"x"+height+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible: "+WindowImpl.this.visible+", nativeWindowCreated: "+nativeWindowCreated+", madeVisible: "+madeVisible);
-                }
-            } finally {
-                windowLock.unlock();
-            }
-            if( getChanged() ) {
-                sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
-            }
-        }
-    }
-
-    public void setVisible(boolean visible) {
-        if(isValid()) {
-            if( 0==windowHandle && visible && 0>=width*height ) {
-                // fast-path: not realized yet, make visible, but zero size
-                return;
-            }
-            VisibleAction visibleAction = new VisibleAction(visible);
-            runOnEDTIfAvail(true, visibleAction);
-        }
-    }
-
-    class SetSizeActionImpl implements Runnable {
-        int visibleAction = 0; // 1 invisible, 2 visible (create)
-        int width, height;
-
-        public int getVisibleAction() { 
-            return visibleAction;
-        }
-        public SetSizeActionImpl(int w, int h) {
-            width = w;
-            height = h;
-        }
-        public void run() {
-            windowLock.lock();
-            try {
-                if ( !fullscreen && ( width != WindowImpl.this.width || WindowImpl.this.height != height ) ) {
-                    if(DEBUG_IMPLEMENTATION) {
-                        String msg = new String("Window setSize: START "+WindowImpl.this.width+"x"+WindowImpl.this.height+" -> "+width+"x"+height+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible "+visible);
-                        System.err.println(msg);
-                    }
-                    if ( 0 != windowHandle && 0>=width*height && visible ) {
-                        visibleAction=1; // invisible
-                        WindowImpl.this.width = 0;
-                        WindowImpl.this.height = 0;
-                    } else if ( 0 == windowHandle && 0<width*height && visible ) {
-                        visibleAction = 2; // visible (create)
-                        WindowImpl.this.width = width;
-                        WindowImpl.this.height = height;
-                    } else if ( 0 != windowHandle ) {
-                        // this width/height will be set by windowChanged, called by the native implementation
-                        reconfigureWindowImpl(x, y, width, height, false, 0, 0);
-                    } else {
-                        WindowImpl.this.width = width;
-                        WindowImpl.this.height = height;
-                    }
-                    if(DEBUG_IMPLEMENTATION) {
-                        System.err.println("Window setSize: END "+WindowImpl.this.width+"x"+WindowImpl.this.height+", visibleAction "+visibleAction);
-                    }
-                }
-            } finally {
-                windowLock.unlock();
-            }
-        }
-    }
-
-    public void setSize(int width, int height) {
-        if(isValid()) {
-            SetSizeActionImpl setSizeAction = new SetSizeActionImpl(width, height);
-            runOnEDTIfAvail(true, setSizeAction);
-            switch(setSizeAction.getVisibleAction()) {
-                case 1: setVisible(false); break;
-                case 2: setVisible(true); break;
-            }
-        }
-    }
-
-    class DestroyAction implements Runnable {
-        public void run() {
-            windowLock.lock();
-            try {
-                if( !isValid() ) {
-                    return; // nop
-                }
-
-                // Childs first ..
-                synchronized(childWindowsLock) {
-                  if(childWindows.size()>0) {
-                    // avoid ConcurrentModificationException: parent -> child -> parent.removeChild(this)
-                    ArrayList clonedChildWindows = (ArrayList) childWindows.clone();
-                    while( clonedChildWindows.size() > 0 ) {
-                      NativeWindow nw = (NativeWindow) clonedChildWindows.remove(0);
-                      if(nw instanceof WindowImpl) {
-                          ((WindowImpl)nw).sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
-                          ((WindowImpl)nw).destroy();
-                      } else {
-                          nw.destroy();
-                      }
-                    }
-                  }
-                }
-
-                if(null!=lifecycleHook) {
-                    lifecycleHook.destroyActionInLock();
-                }
-
-                closeAndInvalidate();
-
-                if(DEBUG_IMPLEMENTATION) {
-                    System.err.println("Window.destroy() END "+getThreadName()/*+", "+WindowImpl.this*/);
-                }
-            } finally {
-                windowLock.unlock();
-            }
-        }
-    }
-
-    public void destroy() {
-        if( isValid() ) {
-            if(DEBUG_IMPLEMENTATION) {
-                String msg = new String("Window.destroy() START "+getThreadName()/*+", "+this*/);
-                System.err.println(msg);
-                //Exception ee = new Exception(msg);
-                //ee.printStackTrace();
-            }
-            boolean animatorPaused = false;
-            if(null!=lifecycleHook) {
-                animatorPaused = lifecycleHook.pauseRenderingAction();
-            }
-            if(null!=lifecycleHook) {
-                lifecycleHook.destroyActionPreLock();
-            }
-            runOnEDTIfAvail(true, destroyAction);
-            if(animatorPaused) {
-                lifecycleHook.resumeRenderingAction();
-            }
-        }
-    }
-
-    public final void invalidate() {
-        destroy();
-        invalidate(true);
-    }
-
-    /**
-     * @param unrecoverable If true, all states, size, position, parent handles,
-     * reference to it's Screen are reset.
-     * Otherwise you can recreate the window, via <code>setVisible(true)</code>.
-     * @see #invalidate()
-     * @see #destroy()
-     * @see #destroy(boolean)
-     */
-    protected void invalidate(boolean unrecoverable) {
-        windowLock.lock();
-        try {
-            if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
-                String msg = new String("!!! Window Invalidate(unrecoverable: "+unrecoverable+") "+getThreadName());
-                System.err.println(msg);
-                // Throwable t = new Throwable(msg);
-                // t.printStackTrace();
-            }
-
-            // Childs first ..
-            synchronized(childWindowsLock) {
-              // avoid ConcurrentModificationException: parent -> child -> parent.removeChild(this)
-              if(null!=childWindows && childWindows.size()>0) {
-                ArrayList clonedChildWindows = (ArrayList) childWindows.clone();
-                while( clonedChildWindows.size() > 0 ) {
-                  NativeWindow nw = (NativeWindow) clonedChildWindows.remove(0);
-                  if(nw instanceof WindowImpl) {
-                      ((WindowImpl)nw).invalidate(unrecoverable);
-                  }
-                }
-              }
-            }
-
-            if(null!=lifecycleHook) {
-                lifecycleHook.invalidate(unrecoverable);
-            }
-
-            windowHandle = 0;
-            visible = false;
-            fullscreen = false;
-            hasFocus = false;
-
-            if(unrecoverable) {
-                if(null!=parentWindow && parentWindow instanceof Window) {
-                    ((Window)parentWindow).removeChild(WindowImpl.this);
-                }
-                screen = null;
-
-                synchronized(childWindowsLock) {
-                    childWindows = null;
-                }
-                synchronized(surfaceUpdatedListenersLock) {
-                    surfaceUpdatedListeners = null;
-                }
-                windowListeners = null;
-                mouseListeners = null;
-                keyListeners = null;
-
-                parentWindowHandle = 0;
-                parentWindow = null;
-                capsRequested = null;
-                lifecycleHook = null;
-
-                // Default position and dimension will be re-set immediately by user
-                width  = 128;
-                height = 128;
-                x=0;
-                y=0;
-            }
-        } finally {
-            windowLock.unlock();
-        }
-    }
-
-    class ReparentActionImpl implements Runnable, ReparentAction {
-        NativeWindow newParentWindow;
-        boolean forceDestroyCreate;
-        int reparentAction;
-
-        public ReparentActionImpl(NativeWindow newParentWindow, boolean forceDestroyCreate) {
-            this.newParentWindow = newParentWindow;
-            this.forceDestroyCreate = forceDestroyCreate;
-            this.reparentAction = -1; // ensure it's set
-        }
-
-        public final int getStrategy() {
-            return reparentAction;
-        }
-
-        private final void setScreen(ScreenImpl newScreen) {
-            WindowImpl.this.removeScreenReference();
-            screen = newScreen;
-        }
-
-        public void run() {
-            boolean wasVisible;
-
-            // mirror pos/size so native change notification can get overwritten
-            int x = WindowImpl.this.x;
-            int y = WindowImpl.this.y;
-            int width = WindowImpl.this.width;
-            int height = WindowImpl.this.height;
-
-            windowLock.lock();
-            try {
-                wasVisible = isVisible();
-
-                Window newParentWindowNEWT = null;
-                if(newParentWindow instanceof Window) {
-                    newParentWindowNEWT = (Window) newParentWindow;
-                }
-
-                long newParentWindowHandle = 0 ;
-
-                if(DEBUG_IMPLEMENTATION) {
-                    System.err.println("Window.reparent: START ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle)+", visible "+wasVisible+", old parentWindow: "+Display.hashCodeNullSafe(parentWindow)+", new parentWindow: "+Display.hashCodeNullSafe(newParentWindow)+", forceDestroyCreate "+forceDestroyCreate+", DEBUG_TEST_REPARENT_INCOMPATIBLE "+DEBUG_TEST_REPARENT_INCOMPATIBLE+" "+x+"/"+y+" "+width+"x"+height);
-                }
-
-                if(null!=lifecycleHook) {
-                    lifecycleHook.resetCounter();
-                }
-
-                if(null!=newParentWindow) {
-                    // reset position to 0/0 within parent space
-                    x = 0;
-                    y = 0;
-
-                    // refit if size is bigger than parent
-                    if( width > newParentWindow.getWidth() ) {
-                        width = newParentWindow.getWidth();
-                    }
-                    if( height > newParentWindow.getHeight() ) {
-                        height = newParentWindow.getHeight();
-                    }
-
-                    // Case: Child Window
-                    newParentWindowHandle = getNativeWindowHandle(newParentWindow);
-                    if(0 == newParentWindowHandle) {
-                        // Case: Parent's native window not realized yet
-                        if(null==newParentWindowNEWT) {
-                            throw new NativeWindowException("Reparenting with non NEWT Window type only available after it's realized: "+newParentWindow);
-                        }
-                        // Destroy this window and use parent's Screen.
-                        // It may be created properly when the parent is made visible.
-                        destroy();
-                        setScreen( (ScreenImpl) newParentWindowNEWT.getScreen() );
-                        reparentAction = ACTION_NATIVE_CREATION_PENDING;
-                    } else if(newParentWindow != getParent()) {
-                        // Case: Parent's native window realized and changed
-                        if( !isNativeValid() ) {
-                            // May create a new compatible Screen/Display and
-                            // mark it for creation.
-                            if(null!=newParentWindowNEWT) {
-                                setScreen( (ScreenImpl) newParentWindowNEWT.getScreen() );
-                            } else {
-                                Screen newScreen = NewtFactory.createCompatibleScreen(newParentWindow, getScreen());
-                                if( getScreen() != newScreen ) {
-                                    // auto destroy on-the-fly created Screen/Display
-                                    setScreen( (ScreenImpl) newScreen );
-                                }
-                            }
-                            if( 0<width*height ) {
-                                reparentAction = ACTION_NATIVE_CREATION;
-                            } else {
-                                reparentAction = ACTION_NATIVE_CREATION_PENDING;
-                            }
-                        } else if ( DEBUG_TEST_REPARENT_INCOMPATIBLE || forceDestroyCreate ||
-                                    !NewtFactory.isScreenCompatible(newParentWindow, getScreen()) ) {
-                            // Destroy this window, may create a new compatible Screen/Display,
-                            // and mark it for creation.
-                            destroy();
-                            if(null!=newParentWindowNEWT) {
-                                setScreen( (ScreenImpl) newParentWindowNEWT.getScreen() );
-                            } else {
-                                setScreen( (ScreenImpl) NewtFactory.createCompatibleScreen(newParentWindow, getScreen()) );
-                            }
-                            reparentAction = ACTION_NATIVE_CREATION;
-                        } else {
-                            // Mark it for native reparenting
-                            reparentAction = ACTION_NATIVE_REPARENTING;
-                        }
-                    } else {
-                        // Case: Parent's native window realized and not changed
-                        reparentAction = ACTION_UNCHANGED;
-                    }
-                } else {
-                    if( null != parentWindow ) {
-                        // child -> top
-                        // put client to current parent+child position
-                        Point p = getLocationOnScreen(null);
-                        x = p.getX();
-                        y = p.getY();
-                    }
-
-                    // Case: Top Window
-                    if( 0 == getParentWindowHandle() ) {
-                        // Already Top Window
-                        reparentAction = ACTION_UNCHANGED;
-                    } else if( !isNativeValid() || DEBUG_TEST_REPARENT_INCOMPATIBLE || forceDestroyCreate ) {
-                        // Destroy this window and mark it for [pending] creation.
-                        destroy();
-                        if( 0<width*height ) {
-                            reparentAction = ACTION_NATIVE_CREATION;
-                        } else {
-                            reparentAction = ACTION_NATIVE_CREATION_PENDING;
-                        }
-                    } else {
-                        // Mark it for native reparenting
-                        reparentAction = ACTION_NATIVE_REPARENTING;
-                    }
-                }
-                parentWindowHandle = newParentWindowHandle;
-
-                if ( ACTION_UNCHANGED > reparentAction ) {
-                    throw new NativeWindowException("Internal Error: reparentAction not set");
-                }
-
-                if( ACTION_UNCHANGED == reparentAction ) {
-                    if(DEBUG_IMPLEMENTATION) {
-                        System.err.println("Window.reparent: NO CHANGE ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" new parentWindowHandle "+toHexString(newParentWindowHandle)+", visible "+wasVisible);
-                    }
-                    return;
-                }
-
-                if(DEBUG_IMPLEMENTATION) {
-                    System.err.println("Window.reparent: ACTION ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" new parentWindowHandle "+toHexString(newParentWindowHandle)+", reparentAction "+reparentAction+", visible "+wasVisible);
-                }
-
-                // rearrange window tree
-                if(null!=parentWindow && parentWindow instanceof Window) {
-                    ((Window)parentWindow).removeChild(WindowImpl.this);
-                }
-                parentWindow = newParentWindow;
-                if(parentWindow instanceof Window) {
-                    ((Window)parentWindow).addChild(WindowImpl.this);
-                }
-
-                if( ACTION_NATIVE_CREATION_PENDING == reparentAction ) {
-                    return;
-                }
-
-                if( ACTION_NATIVE_REPARENTING == reparentAction ) {
-                    DisplayImpl display = (DisplayImpl) screen.getDisplay();
-                    display.dispatchMessagesNative(); // status up2date
-                    if(wasVisible) {
-                        setVisibleImpl(false, x, y, width, height);
-                        WindowImpl.this.waitForVisible(false, true);
-                    }
-
-                    // Lock parentWindow only during reparenting (attempt)
-                    NativeWindow parentWindowLocked = null;
-                    if( null != parentWindow ) {
-                        parentWindowLocked = parentWindow;
-                        if( NativeSurface.LOCK_SURFACE_NOT_READY >= parentWindowLocked.lockSurface() ) {
-                            throw new NativeWindowException("Parent surface lock: not ready: "+parentWindow);
-                        }
-                    }
-                    boolean ok = false;
-                    try {
-                        // write back mirrored values, to be able to detect satisfaction
-                        WindowImpl.this.x = x;
-                        WindowImpl.this.y = y;
-                        WindowImpl.this.width = width;
-                        WindowImpl.this.height = height;
-                        ok = reconfigureWindowImpl(x, y, width, height, true, 0, isUndecorated()?-1:1);
-                    } finally {
-                        if(null!=parentWindowLocked) {
-                            parentWindowLocked.unlockSurface();
-                        }
-                    }
-
-                    // set visible again, and revalidate 'ok',
-                    // since it has been experience that in some cases the reparented window gets hidden
-                    if(ok) {
-                        display.dispatchMessagesNative(); // status up2date
-                        if(wasVisible) {
-                            setVisibleImpl(true, x, y, width, height);
-                            ok = WindowImpl.this.waitForVisible(true, false);
-                            display.dispatchMessagesNative(); // status up2date
-                            if( ok &&
-                                ( WindowImpl.this.x != x ||
-                                  WindowImpl.this.y != y ||
-                                  WindowImpl.this.width != width ||
-                                  WindowImpl.this.height != height ) )
-                            {
-                                if(DEBUG_IMPLEMENTATION) {
-                                    System.err.println("Window.reparent (reconfig)");
-                                }
-                                // reset pos/size .. due to some native impl flakyness
-                                reconfigureWindowImpl(x, y, width, height, false, 0, 0);
-                                display.dispatchMessagesNative(); // status up2date
-                                WindowImpl.this.waitForVisible(true, false);
-                                display.dispatchMessagesNative(); // status up2date
-                            }
-                        }
-                    }
-
-                    if(ok) {
-                        if(wasVisible) {
-                            requestFocusImpl(true);
-                            display.dispatchMessagesNative(); // status up2date
-                        }
-                    } else {
-                        // native reparent failed -> try creation
-                        if(DEBUG_IMPLEMENTATION) {
-                            System.err.println("Window.reparent: native reparenting failed ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle)+" -> "+toHexString(newParentWindowHandle)+" - Trying recreation");
-                        }
-                        destroy();
-                        reparentAction = ACTION_NATIVE_CREATION ;
-                    }
-                }
-
-                // write back mirrored values, ensuring persitence
-                // and not relying on native messaging
-                WindowImpl.this.x = x;
-                WindowImpl.this.y = y;
-                WindowImpl.this.width = width;
-                WindowImpl.this.height = height;
-
-                if(DEBUG_IMPLEMENTATION) {
-                    System.err.println("Window.reparentWindow: END ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+x+"/"+y+" "+width+"x"+height);
-                }
-            } finally {
-                windowLock.unlock();
-            }
-
-            if(wasVisible) {
-                switch (reparentAction) {
-                    case ACTION_NATIVE_REPARENTING:
-                        // trigger a resize/relayout and repaint to listener
-                        sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
-                        break;
-
-                    case ACTION_NATIVE_CREATION:
-                        // This may run on the Display/Screen connection,
-                        // hence a new EDT task
-                        runOnEDTIfAvail(true, reparentActionRecreate);
-                        break;
-                }
-            }
-        }
-    }
-
-    class ReparentActionRecreate implements Runnable {
-        public void run() {
-            windowLock.lock();
-            try {
-                visible = true;
-                if(DEBUG_IMPLEMENTATION) {
-                    System.err.println("Window.reparentWindow: ReparentActionRecreate ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+Display.hashCodeNullSafe(parentWindow));
-                }
-                setVisible(true); // native creation
-            } finally {
-                windowLock.unlock();
-            }
-        }
-    }
-
-    public final int reparentWindow(NativeWindow newParent) {
-        return reparentWindow(newParent, false);
-    }
-
-    public int reparentWindow(NativeWindow newParent, boolean forceDestroyCreate) {
-        int reparentActionStrategy = ReparentAction.ACTION_INVALID;
-        if(isValid()) {
-            boolean animatorPaused = false;
-            if(null!=lifecycleHook) {
-                animatorPaused = lifecycleHook.pauseRenderingAction();
-            }
-            try {
-                ReparentActionImpl reparentAction = new ReparentActionImpl(newParent, forceDestroyCreate);
-                runOnEDTIfAvail(true, reparentAction);
-                reparentActionStrategy = reparentAction.getStrategy();
-            } finally {
-                if(animatorPaused) {
-                    lifecycleHook.resumeRenderingAction();
-                }
-            }
-        }
-        return reparentActionStrategy;
-    }
-
-    public CapabilitiesChooser setCapabilitiesChooser(CapabilitiesChooser chooser) {
-        CapabilitiesChooser old = this.capabilitiesChooser;
-        this.capabilitiesChooser = chooser;
-        return old;
-    }
-
-    public final CapabilitiesImmutable getChosenCapabilities() {
-        return config.getNativeGraphicsConfiguration().getChosenCapabilities();
-    }
-
-    public final CapabilitiesImmutable getRequestedCapabilities() {
-        return capsRequested;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        if (title == null) {
-            title = "";
-        }
-        this.title = title;
-        if(0 != getWindowHandle()) {
-            setTitleImpl(title);
-        }
-    }
-
-    class DecorationActionImpl implements Runnable {
-        boolean undecorated;
-
-        public DecorationActionImpl(boolean undecorated) {
-            this.undecorated = undecorated;
-        }
-
-        public void run() {
-            windowLock.lock();
-            try {
-                if(!fullscreen && isNativeValid() && WindowImpl.this.undecorated != undecorated) {
-                    WindowImpl.this.undecorated = undecorated;
-                    // mirror pos/size so native change notification can get overwritten
-                    int x = WindowImpl.this.x;
-                    int y = WindowImpl.this.y;
-                    int width = WindowImpl.this.width;
-                    int height = WindowImpl.this.height;
-
-                    if( 0 != windowHandle ) {
-                        DisplayImpl display = (DisplayImpl) screen.getDisplay();
-                        display.dispatchMessagesNative(); // status up2date
-                        boolean wasVisible = isVisible();
-                        setVisibleImpl(false, x, y, width, height);
-                        WindowImpl.this.waitForVisible(false, true);
-                        display.dispatchMessagesNative(); // status up2date
-                        reconfigureWindowImpl(x, y, width, height, false, 0, undecorated?-1:1);
-                        display.dispatchMessagesNative(); // status up2date
-                        if(wasVisible) {
-                            setVisibleImpl(true, x, y, width, height);
-                            WindowImpl.this.waitForVisible(true, true);
-                            display.dispatchMessagesNative(); // status up2date
-                            if( WindowImpl.this.x != x ||
-                                WindowImpl.this.y != y ||
-                                WindowImpl.this.width != width ||
-                                WindowImpl.this.height != height ) 
-                            {
-                                // reset pos/size .. due to some native impl flakyness
-                                reconfigureWindowImpl(x, y, width, height, false, 0, 0);
-                                display.dispatchMessagesNative(); // status up2date
-                            }
-                            requestFocusImpl(true);
-                            display.dispatchMessagesNative(); // status up2date
-                        }
-                    }
-                }
-            } finally {
-                windowLock.unlock();
-            }
-        }
-    }
-
-    public void setUndecorated(boolean value) {
-        if(isValid()) {
-            DecorationActionImpl decorationAction = new DecorationActionImpl(value);
-            runOnEDTIfAvail(true, decorationAction);
-            sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
-        }
-    }
-
-    public boolean isUndecorated() {
-        return 0 != parentWindowHandle || undecorated || fullscreen ;
-    }
-
-    public void requestFocus() {
-        enqueueRequestFocus(true);
-    }
-
-    public boolean hasFocus() {
-        return hasFocus;
-    }
-
-    public Insets getInsets() {
-        return new Insets(0,0,0,0);
-    }
-
-    public final int getWidth() {
-        return width;
-    }
-
-    public final int getHeight() {
-        return height;
-    }
-
-    public final int getX() {
-        return x;
-    }
-
-    public final int getY() {
-        return y;
-    }
-
-    public final boolean isVisible() {
-        return visible;
-    }
-
-    public final boolean isFullscreen() {
-        return fullscreen;
-    }
-
-
-    //----------------------------------------------------------------------
-    // Window
-    //
-
-    /**
-     * If the implementation is capable of detecting a device change
-     * return true and clear the status/reason of the change.
-     */
-    public boolean hasDeviceChanged() {
-        return false;
-    }
-
-    public LifecycleHook getLifecycleHook() {
-        return lifecycleHook;
-    }
-
-    public LifecycleHook setLifecycleHook(LifecycleHook hook) {
-        LifecycleHook old = lifecycleHook;
-        lifecycleHook = hook;
-        return old;
-    }
-
-    /** If this Window actually wraps one from another toolkit such as
-        the AWT, this will return a non-null value. */
-    public Object getWrappedWindow() {
-        return null;
-    }
-
-    /**
-     * If set to true, the default value, this NEWT Window implementation will
-     * handle the destruction (ie {@link #destroy()} call) within {@link #windowDestroyNotify()} implementation.<br>
-     * If set to false, it's up to the caller/owner to handle destruction within {@link #windowDestroyNotify()}.
-     */
-    public void setHandleDestroyNotify(boolean b) {
-        handleDestroyNotify = b;
-    }
-
-    //----------------------------------------------------------------------
-    // WindowImpl
-    //
-
-    protected final long getParentWindowHandle() {
-        return parentWindowHandle;
-    }
-
-    public String toString() {
-        StringBuffer sb = new StringBuffer();
-
-        sb.append(getClass().getName()+"[Config "+config+
-                    "\n, "+screen+
-                    "\n, ParentWindow "+parentWindow+
-                    "\n, ParentWindowHandle "+toHexString(parentWindowHandle)+
-                    "\n, WindowHandle "+toHexString(getWindowHandle())+
-                    "\n, SurfaceHandle "+toHexString(getSurfaceHandle())+ " (lockedExt "+isSurfaceLockedByOtherThread()+")"+
-                    "\n, Pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+
-                    "\n, Visible "+isVisible()+
-                    "\n, Undecorated "+undecorated+
-                    "\n, Fullscreen "+fullscreen+
-                    "\n, WrappedWindow "+getWrappedWindow()+
-                    "\n, ChildWindows "+childWindows.size());
-
-        sb.append(", SurfaceUpdatedListeners num "+surfaceUpdatedListeners.size()+" [");
-        for (int i = 0; i < surfaceUpdatedListeners.size(); i++ ) {
-          sb.append(surfaceUpdatedListeners.get(i)+", ");
-        }
-        sb.append("], WindowListeners num "+windowListeners.size()+" [");
-        for (int i = 0; i < windowListeners.size(); i++ ) {
-          sb.append(windowListeners.get(i)+", ");
-        }
-        sb.append("], MouseListeners num "+mouseListeners.size()+" [");
-        for (int i = 0; i < mouseListeners.size(); i++ ) {
-          sb.append(mouseListeners.get(i)+", ");
-        }
-        sb.append("], KeyListeners num "+keyListeners.size()+" [");
-        for (int i = 0; i < keyListeners.size(); i++ ) {
-          sb.append(keyListeners.get(i)+", ");
-        }
-        sb.append("] ]");
-        return sb.toString();
-    }
-
-    protected final void setWindowHandle(long handle) {
-        windowHandle = handle;
-    }
-
-    public void runOnEDTIfAvail(boolean wait, final Runnable task) {
-        Screen screen = getScreen();
-        if(null==screen) {
-            throw new RuntimeException("Null screen of inner class: "+this);
-        }
-        DisplayImpl d = (DisplayImpl) screen.getDisplay();
-        d.runOnEDTIfAvail(wait, task);
-    }
-
-    class RequestFocusAction implements Runnable {
-        public void run() {
-            if(DEBUG_IMPLEMENTATION) {
-                System.err.println("Window.RequestFocusAction: ("+getThreadName()+"): "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
-            }
-            WindowImpl.this.requestFocusImpl(false);
-        }
-    }
-
-    protected void enqueueRequestFocus(boolean wait) {
-        runOnEDTIfAvail(wait, requestFocusAction);
-    }
-
-    /** 
-     * May set to a {@link FocusRunnable}, {@link FocusRunnable#run()} before Newt requests the native focus.
-     * This allows notifying a covered window toolkit like AWT that the focus is requested,
-     * hence focus traversal can be made transparent.
-     */
-    public void setFocusAction(FocusRunnable focusAction) {
-        this.focusAction = focusAction;
-    }
-    protected boolean focusAction() {
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("Window.focusAction() START - "+getThreadName()+", focusAction: "+focusAction+" - windowHandle "+toHexString(getWindowHandle()));
-        }
-        boolean res;
-        if(null!=focusAction) {
-            res = focusAction.run();
-        } else {
-            res = false;
-        }
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("Window.focusAction() END - "+getThreadName()+", focusAction: "+focusAction+" - windowHandle "+toHexString(getWindowHandle())+", res: "+res);
-        }
-        return res;
-    }
-
-    class SetPositionActionImpl implements Runnable {
-        int x, y;
-
-        public SetPositionActionImpl(int x, int y) {
-            this.x = x;
-            this.y = y;
-        }
-        public void run() {
-            windowLock.lock();
-            try {
-                if(DEBUG_IMPLEMENTATION) {
-                    System.err.println("Window setPosition: "+WindowImpl.this.x+"/"+WindowImpl.this.y+" -> "+x+"/"+y+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle));
-                }
-                if ( WindowImpl.this.x != x || WindowImpl.this.y != y ) {
-                    if(!fullscreen) {
-                        if(0!=windowHandle) {
-                            // this.x/this.y will be set by windowChanged, called by the native implementation
-                            reconfigureWindowImpl(x, y, -1, -1, false, 0, 0);
-                        } else {
-                            WindowImpl.this.x = x;
-                            WindowImpl.this.y = y;
-                        }
-                    }
-                }
-            } finally {
-                windowLock.unlock();
-            }
-        }
-    }
-
-    public void setPosition(int x, int y) {
-        if(isValid()) {
-            SetPositionActionImpl setPositionAction = new SetPositionActionImpl(x, y);
-            runOnEDTIfAvail(true, setPositionAction);
-        }
-    }
-
-    class FullScreenActionImpl implements Runnable {
-        boolean fullscreen;
-
-        public FullScreenActionImpl (boolean fullscreen) {
-            this.fullscreen = fullscreen;
-        }
-
-        public void run() {
-            windowLock.lock();
-            try {
-                if(isNativeValid() && WindowImpl.this.fullscreen != fullscreen) {
-                    int x,y,w,h;
-                    WindowImpl.this.fullscreen = fullscreen;
-                    if(fullscreen) {
-                        x = 0; y = 0;
-                        w = screen.getWidth();
-                        h = screen.getHeight();
-                        nfs_width = width;
-                        nfs_height = height;
-                        nfs_x = x;
-                        nfs_y = y;
-                    } else {
-                        x = nfs_x;
-                        y = nfs_y;
-                        w = nfs_width;
-                        h = nfs_height;
-                    }
-                    if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
-                        System.err.println("Window fs: "+fullscreen+" "+x+"/"+y+" "+w+"x"+h+", "+isUndecorated()+", "+screen);
-                    }
-
-                    DisplayImpl display = (DisplayImpl) screen.getDisplay();
-                    display.dispatchMessagesNative(); // status up2date
-                    boolean wasVisible = isVisible();
-                    setVisibleImpl(false, x, y, width, height);
-                    WindowImpl.this.waitForVisible(false, true);
-                    display.dispatchMessagesNative(); // status up2date
-
-                    // write back mirrored values, to be able to detect satisfaction
-                    WindowImpl.this.x = x;
-                    WindowImpl.this.y = y;
-                    WindowImpl.this.width = w;
-                    WindowImpl.this.height = h;
-                    reconfigureWindowImpl(x, y, w, h, getParentWindowHandle()!=0, fullscreen?1:-1, isUndecorated()?-1:1);
-                    display.dispatchMessagesNative(); // status up2date
-
-                    if(wasVisible) {
-                        setVisibleImpl(true, x, y, width, height);
-                        boolean ok = WindowImpl.this.waitForVisible(true, true, Screen.SCREEN_MODE_CHANGE_TIMEOUT);
-                        display.dispatchMessagesNative(); // status up2date
-                        if( ok &&
-                            ( WindowImpl.this.x != x ||
-                              WindowImpl.this.y != y ||
-                              WindowImpl.this.width != w ||
-                              WindowImpl.this.height != h ) )
-                        {
-                            if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
-                                System.err.println("Window fs (reconfig): "+x+"/"+y+" "+w+"x"+h+", "+screen);
-                            }
-                            // reset pos/size .. due to some native impl flakyness
-                            reconfigureWindowImpl(x, y, width, height, false, 0, 0);
-                            display.dispatchMessagesNative(); // status up2date
-                        }
-                        requestFocusImpl(true);
-                        display.dispatchMessagesNative(); // status up2date
-                        if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
-                            System.err.println("Window fs done");
-                        }
-                    }
-                }
-            } finally {
-                windowLock.unlock();
-            }
-        }
-    }
-
-    public boolean setFullscreen(boolean fullscreen) {
-        if(isValid()) {
-            FullScreenActionImpl fullScreenAction = new FullScreenActionImpl(fullscreen);
-            runOnEDTIfAvail(true, fullScreenAction);
-            sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
-        }
-        return this.fullscreen;
-    }
-
-    class ScreenModeListenerImpl implements ScreenModeListener {
-        boolean animatorPaused = false;
-
-        public void screenModeChangeNotify(ScreenMode sm) {
-            if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
-                System.err.println("Window.screenModeChangeNotify: "+sm);
-            }
-
-            if(null!=lifecycleHook) {
-                animatorPaused = lifecycleHook.pauseRenderingAction();
-            }
-        }
-
-        public void screenModeChanged(ScreenMode sm, boolean success) {
-            if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
-                System.err.println("Window.screenModeChanged: "+sm+", success: "+success);
-            }
-
-            if(success) {
-                DimensionReadOnly screenSize = sm.getMonitorMode().getSurfaceSize().getResolution();
-                if ( getHeight() > screenSize.getHeight()  ||
-                     getWidth() > screenSize.getWidth() ) {
-                    setSize(screenSize.getWidth(), screenSize.getHeight());
-                }
-            }
-
-            if(animatorPaused) {
-                lifecycleHook.resumeRenderingAction();
-            }
-            sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // Child Window Management
-    // 
-
-    public final void removeChild(NativeWindow win) {
-        synchronized(childWindowsLock) {
-            childWindows.remove(win);
-        }
-    }
-
-    public final void addChild(NativeWindow win) {
-        if (win == null) {
-            return;
-        }
-        synchronized(childWindowsLock) {
-            childWindows.add(win);
-        }
-    }
-
-    //----------------------------------------------------------------------
-    // Generic Event Support
-    //
-    private void doEvent(boolean enqueue, boolean wait, com.jogamp.newt.event.NEWTEvent event) {
-        boolean done = false;
-
-        if(!enqueue) {
-            done = consumeEvent(event);
-            wait = done; // don't wait if event can't be consumed now
-        }
-
-        if(!done) {
-            enqueueEvent(wait, event);
-        }
-    }
-
-    public void enqueueEvent(boolean wait, com.jogamp.newt.event.NEWTEvent event) {
-        if(isValid()) {
-            ((DisplayImpl)getScreen().getDisplay()).enqueueEvent(wait, event);
-        }
-    }
-
-    public boolean consumeEvent(NEWTEvent e) {
-        switch(e.getEventType()) {
-            // special repaint treatment
-            case WindowEvent.EVENT_WINDOW_REPAINT:
-                // queue repaint event in case surface is locked, ie in operation
-                if( isSurfaceLocked() ) {
-                    // make sure only one repaint event is queued
-                    if(!repaintQueued) {
-                        repaintQueued=true;
-                        if(DEBUG_IMPLEMENTATION) {
-                            System.err.println("Window.consumeEvent: queued "+e);
-                            // Exception ee = new Exception("Window.windowRepaint: "+e);
-                            // ee.printStackTrace();
-                        }
-                        return false;
-                    }
-                    return true;
-                }
-                repaintQueued=false; // no repaint event queued
-                break;
-
-            // common treatment
-            case WindowEvent.EVENT_WINDOW_RESIZED:
-                // queue event in case surface is locked, ie in operation
-                if( isSurfaceLocked() ) {
-                    if(DEBUG_IMPLEMENTATION) {
-                        System.err.println("Window.consumeEvent: queued "+e);
-                        // Exception ee = new Exception("Window.windowRepaint: "+e);
-                        // ee.printStackTrace();
-                    }
-                    return false;
-                }
-                break;
-            default:
-                break;
-        }
-        if(e instanceof WindowEvent) {
-            consumeWindowEvent((WindowEvent)e);
-        } else if(e instanceof KeyEvent) {
-            consumeKeyEvent((KeyEvent)e);
-        } else if(e instanceof MouseEvent) {
-            consumeMouseEvent((MouseEvent)e);
-        } else {
-            throw new NativeWindowException("Unexpected NEWTEvent type " + e);
-        }
-        return true;
-    }
-
-    //
-    // SurfaceUpdatedListener Support
-    //
-
-    public void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
-        addSurfaceUpdatedListener(-1, l);
-    }
-
-    public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) 
-        throws IndexOutOfBoundsException
-    {
-        if(l == null) {
-            return;
-        }
-        synchronized(surfaceUpdatedListenersLock) {
-            if(0>index) { 
-                index = surfaceUpdatedListeners.size(); 
-            }
-            surfaceUpdatedListeners.add(index, l);
-        }
-    }
-
-    public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
-        if (l == null) {
-            return;
-        }
-        synchronized(surfaceUpdatedListenersLock) {
-            surfaceUpdatedListeners.remove(l);
-        }
-    }
-
-    public void removeAllSurfaceUpdatedListener() {
-        synchronized(surfaceUpdatedListenersLock) {
-            surfaceUpdatedListeners = new ArrayList();
-        }
-    }
-
-    public SurfaceUpdatedListener getSurfaceUpdatedListener(int index) {
-        synchronized(surfaceUpdatedListenersLock) {
-            if(0>index) { 
-                index = surfaceUpdatedListeners.size()-1; 
-            }
-            return (SurfaceUpdatedListener) surfaceUpdatedListeners.get(index);
-        }
-    }
-
-    public SurfaceUpdatedListener[] getSurfaceUpdatedListeners() {
-        synchronized(surfaceUpdatedListenersLock) {
-            return (SurfaceUpdatedListener[]) surfaceUpdatedListeners.toArray();
-        }
-    }
-
-    public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
-        synchronized(surfaceUpdatedListenersLock) {
-          for(int i = 0; i < surfaceUpdatedListeners.size(); i++ ) {
-            SurfaceUpdatedListener l = (SurfaceUpdatedListener) surfaceUpdatedListeners.get(i);
-            l.surfaceUpdated(updater, ns, when);
-          }
-        }
-    }
-
-    //
-    // MouseListener/Event Support
-    //
-    public void sendMouseEvent(int eventType, int modifiers,
-                               int x, int y, int button, int rotation) {
-        doMouseEvent(false, false, eventType, modifiers, x, y, button, rotation);
-    }
-    public void enqueueMouseEvent(boolean wait, int eventType, int modifiers,
-                                  int x, int y, int button, int rotation) {
-        doMouseEvent(true, wait, eventType, modifiers, x, y, button, rotation);
-    }
-    private void doMouseEvent(boolean enqueue, boolean wait, int eventType, int modifiers,
-                              int x, int y, int button, int rotation) {
-        if(x<0||y<0||x>=width||y>=height) {
-            return; // .. invalid ..
-        }
-        if(DEBUG_MOUSE_EVENT) {
-            System.err.println("doMouseEvent: enqueue"+enqueue+", wait "+wait+", "+MouseEvent.getEventTypeString(eventType)+
-                               ", mod "+modifiers+", pos "+x+"/"+y+", button "+button);
-        }
-        if(button<0||button>MouseEvent.BUTTON_NUMBER) {
-            throw new NativeWindowException("Invalid mouse button number" + button);
-        }
-        long when = System.currentTimeMillis();
-        MouseEvent eClicked = null;
-        MouseEvent e = null;
-
-        if(MouseEvent.EVENT_MOUSE_PRESSED==eventType) {
-            if(when-lastMousePressed<MouseEvent.getClickTimeout()) {
-                lastMouseClickCount++;
-            } else {
-                lastMouseClickCount=1;
-            }
-            lastMousePressed=when;
-            mouseButtonPressed=button;
-            e = new MouseEvent(eventType, this, when,
-                               modifiers, x, y, lastMouseClickCount, button, 0);
-        } else if(MouseEvent.EVENT_MOUSE_RELEASED==eventType) {
-            e = new MouseEvent(eventType, this, when,
-                               modifiers, x, y, lastMouseClickCount, button, 0);
-            if(when-lastMousePressed<MouseEvent.getClickTimeout()) {
-                eClicked = new MouseEvent(MouseEvent.EVENT_MOUSE_CLICKED, this, when,
-                                          modifiers, x, y, lastMouseClickCount, button, 0);
-            } else {
-                lastMouseClickCount=0;
-                lastMousePressed=0;
-            }
-            mouseButtonPressed=0;
-        } else if(MouseEvent.EVENT_MOUSE_MOVED==eventType) {
-            if (mouseButtonPressed>0) {
-                e = new MouseEvent(MouseEvent.EVENT_MOUSE_DRAGGED, this, when,
-                                   modifiers, x, y, 1, mouseButtonPressed, 0);
-            } else {
-                e = new MouseEvent(eventType, this, when,
-                                   modifiers, x, y, 0, button, 0);
-            }
-        } else if(MouseEvent.EVENT_MOUSE_WHEEL_MOVED==eventType) {
-            e = new MouseEvent(eventType, this, when, modifiers, x, y, 0, button, rotation);
-        } else {
-            e = new MouseEvent(eventType, this, when, modifiers, x, y, 0, button, 0);
-        }
-        doEvent(enqueue, wait, e);
-        if(null!=eClicked) {
-            if(DEBUG_MOUSE_EVENT) {
-                System.err.println("doMouseEvent: synthesized MOUSE_CLICKED event");
-            }
-            doEvent(enqueue, wait, eClicked);
-        }
-    }
-
-
-    public void addMouseListener(MouseListener l) {
-        addMouseListener(-1, l);
-    }
-
-    public void addMouseListener(int index, MouseListener l) {
-        if(l == null) {
-            return;
-        }
-        ArrayList clonedListeners = (ArrayList) mouseListeners.clone();
-        if(0>index) { 
-            index = clonedListeners.size(); 
-        }
-        clonedListeners.add(index, l);
-        mouseListeners = clonedListeners;
-    }
-
-    public void removeMouseListener(MouseListener l) {
-        if (l == null) {
-            return;
-        }
-        ArrayList clonedListeners = (ArrayList) mouseListeners.clone();
-        clonedListeners.remove(l);
-        mouseListeners = clonedListeners;
-    }
-
-    public MouseListener getMouseListener(int index) {
-        ArrayList clonedListeners = (ArrayList) mouseListeners.clone();
-        if(0>index) { 
-            index = clonedListeners.size()-1; 
-        }
-        return (MouseListener) clonedListeners.get(index);
-    }
-
-    public MouseListener[] getMouseListeners() {
-        return (MouseListener[]) mouseListeners.toArray();
-    }
-
-    protected void consumeMouseEvent(MouseEvent e) {
-        if(DEBUG_MOUSE_EVENT) {
-            System.err.println("consumeMouseEvent: event:         "+e);
-        }
-
-        for(int i = 0; i < mouseListeners.size(); i++ ) {
-            MouseListener l = (MouseListener) mouseListeners.get(i);
-            switch(e.getEventType()) {
-                case MouseEvent.EVENT_MOUSE_CLICKED:
-                    l.mouseClicked(e);
-                    break;
-                case MouseEvent.EVENT_MOUSE_ENTERED:
-                    l.mouseEntered(e);
-                    break;
-                case MouseEvent.EVENT_MOUSE_EXITED:
-                    l.mouseExited(e);
-                    break;
-                case MouseEvent.EVENT_MOUSE_PRESSED:
-                    l.mousePressed(e);
-                    break;
-                case MouseEvent.EVENT_MOUSE_RELEASED:
-                    l.mouseReleased(e);
-                    break;
-                case MouseEvent.EVENT_MOUSE_MOVED:
-                    l.mouseMoved(e);
-                    break;
-                case MouseEvent.EVENT_MOUSE_DRAGGED:
-                    l.mouseDragged(e);
-                    break;
-                case MouseEvent.EVENT_MOUSE_WHEEL_MOVED:
-                    l.mouseWheelMoved(e);
-                    break;
-                default:
-                    throw new NativeWindowException("Unexpected mouse event type " + e.getEventType());
-            }
-        }
-    }
-
-    //
-    // KeyListener/Event Support
-    //
-
-    public void sendKeyEvent(int eventType, int modifiers, int keyCode, char keyChar) {
-        consumeKeyEvent(new KeyEvent(eventType, this, System.currentTimeMillis(), modifiers, keyCode, keyChar) );
-    }
-
-    public void enqueueKeyEvent(boolean wait, int eventType, int modifiers, int keyCode, char keyChar) {
-        enqueueEvent(wait, new KeyEvent(eventType, this, System.currentTimeMillis(), modifiers, keyCode, keyChar) );
-    }
-
-    public void addKeyListener(KeyListener l) {
-        addKeyListener(-1, l);
-    }
-
-    public void addKeyListener(int index, KeyListener l) {
-        if(l == null) {
-            return;
-        }
-        ArrayList clonedListeners = (ArrayList) keyListeners.clone();
-        if(0>index) { 
-            index = clonedListeners.size();
-        }
-        clonedListeners.add(index, l);
-        keyListeners = clonedListeners;
-    }
-
-    public void removeKeyListener(KeyListener l) {
-        if (l == null) {
-            return;
-        }
-        ArrayList clonedListeners = (ArrayList) keyListeners.clone();
-        clonedListeners.remove(l);
-        keyListeners = clonedListeners;
-    }
-
-    public KeyListener getKeyListener(int index) {
-        ArrayList clonedListeners = (ArrayList) keyListeners.clone();
-        if(0>index) { 
-            index = clonedListeners.size()-1;
-        }
-        return (KeyListener) clonedListeners.get(index);
-    }
-
-    public KeyListener[] getKeyListeners() {
-        return (KeyListener[]) keyListeners.toArray();
-    }
-
-    protected void consumeKeyEvent(KeyEvent e) {
-        if(DEBUG_KEY_EVENT) {
-            System.err.println("consumeKeyEvent: "+e);
-        }
-        for(int i = 0; i < keyListeners.size(); i++ ) {
-            KeyListener l = (KeyListener) keyListeners.get(i);
-            switch(e.getEventType()) {
-                case KeyEvent.EVENT_KEY_PRESSED:
-                    l.keyPressed(e);
-                    break;
-                case KeyEvent.EVENT_KEY_RELEASED:
-                    l.keyReleased(e);
-                    break;
-                case KeyEvent.EVENT_KEY_TYPED:
-                    l.keyTyped(e);
-                    break;
-                default:
-                    throw new NativeWindowException("Unexpected key event type " + e.getEventType());
-            }
-        }
-    }
-
-    //
-    // WindowListener/Event Support
-    //
-    public void sendWindowEvent(int eventType) {
-        consumeWindowEvent( new WindowEvent(eventType, this, System.currentTimeMillis()) );
-    }
-
-    public void enqueueWindowEvent(boolean wait, int eventType) {
-        enqueueEvent( wait, new WindowEvent(eventType, this, System.currentTimeMillis()) );
-    }
-
-    public void addWindowListener(WindowListener l) {
-        addWindowListener(-1, l);
-    }
-
-    public void addWindowListener(int index, WindowListener l) 
-        throws IndexOutOfBoundsException
-    {
-        if(l == null) {
-            return;
-        }
-        ArrayList clonedListeners = (ArrayList) windowListeners.clone();
-        if(0>index) { 
-            index = clonedListeners.size(); 
-        }
-        clonedListeners.add(index, l);
-        windowListeners = clonedListeners;
-    }
-
-    public final void removeWindowListener(WindowListener l) {
-        if (l == null) {
-            return;
-        }
-        ArrayList clonedListeners = (ArrayList) windowListeners.clone();
-        clonedListeners.remove(l);
-        windowListeners = clonedListeners;
-    }
-
-    public WindowListener getWindowListener(int index) {
-        ArrayList clonedListeners = (ArrayList) windowListeners.clone();
-        if(0>index) { 
-            index = clonedListeners.size()-1; 
-        }
-        return (WindowListener) clonedListeners.get(index);
-    }
-
-    public WindowListener[] getWindowListeners() {
-        return (WindowListener[]) windowListeners.toArray();
-    }
-
-    protected void consumeWindowEvent(WindowEvent e) {
-        if(DEBUG_WINDOW_EVENT) {
-            System.err.println("consumeWindowEvent: "+e+", visible "+isVisible()+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
-        }
-        for(int i = 0; i < windowListeners.size(); i++ ) {
-            WindowListener l = (WindowListener) windowListeners.get(i);
-            switch(e.getEventType()) {
-                case WindowEvent.EVENT_WINDOW_RESIZED:
-                    l.windowResized(e);
-                    break;
-                case WindowEvent.EVENT_WINDOW_MOVED:
-                    l.windowMoved(e);
-                    break;
-                case WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY:
-                    l.windowDestroyNotify(e);
-                    break;
-                case WindowEvent.EVENT_WINDOW_GAINED_FOCUS:
-                    l.windowGainedFocus(e);
-                    break;
-                case WindowEvent.EVENT_WINDOW_LOST_FOCUS:
-                    l.windowLostFocus(e);
-                    break;
-                case WindowEvent.EVENT_WINDOW_REPAINT:
-                    l.windowRepaint((WindowUpdateEvent)e);
-                    break;
-                default:
-                    throw 
-                        new NativeWindowException("Unexpected window event type "
-                                                  + e.getEventType());
-            }
-        }
-    }
-
-    /**
-     * @param focusGained
-     */
-    protected void focusChanged(boolean focusGained) {
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("Window.focusChanged: ("+getThreadName()+"): "+this.hasFocus+" -> "+focusGained+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
-        }
-        hasFocus = focusGained;
-        if (focusGained) {
-            sendWindowEvent(WindowEvent.EVENT_WINDOW_GAINED_FOCUS);
-        } else {
-            sendWindowEvent(WindowEvent.EVENT_WINDOW_LOST_FOCUS);
-        }
-    }
-
-    protected void visibleChanged(boolean visible) {
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("Window.visibleChanged ("+getThreadName()+"): "+this.visible+" -> "+visible+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
-        }
-        this.visible = visible ;
-    }
-
-    private boolean waitForVisible(boolean visible, boolean failFast) {
-        return waitForVisible(visible, failFast, TIMEOUT_NATIVEWINDOW);
-    }
-
-    private boolean waitForVisible(boolean visible, boolean failFast, long timeOut) {
-        DisplayImpl display = (DisplayImpl) screen.getDisplay();
-        for(long sleep = timeOut; 0<sleep && this.visible != visible; sleep-=10 ) {
-            display.dispatchMessagesNative(); // status up2date
-            try {
-                Thread.sleep(10);
-            } catch (InterruptedException ie) {}
-            sleep -=10;
-        }
-        if(this.visible != visible) {
-            if(failFast) {
-                throw new NativeWindowException("Visibility not reached as requested within "+timeOut+"ms : requested "+visible+", is "+this.visible);
-            } else if (DEBUG_IMPLEMENTATION) {
-                System.err.println("******* Visibility not reached as requested within "+timeOut+"ms : requested "+visible+", is "+this.visible);
-            }
-        }
-        return this.visible == visible;
-    }
-
-    protected void sizeChanged(int newWidth, int newHeight, boolean force) {
-        if(force || width != newWidth || height != newHeight) {
-            if(DEBUG_IMPLEMENTATION) {
-                System.err.println("Window.sizeChanged: ("+getThreadName()+"): force "+force+", "+width+"x"+height+" -> "+newWidth+"x"+newHeight+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
-            }
-            width = newWidth;
-            height = newHeight;
-            if(isNativeValid()) {
-                sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
-            }
-        }
-    }
-
-    protected void positionChanged(int newX, int newY) {
-        if( 0==parentWindowHandle && ( x != newX || y != newY ) ) {
-            if(DEBUG_IMPLEMENTATION) {
-                System.err.println("Window.positionChanged: ("+getThreadName()+"): "+x+"/"+y+" -> "+newX+"/"+newY+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
-            }
-            x = newX;
-            y = newY;
-            sendWindowEvent(WindowEvent.EVENT_WINDOW_MOVED);
-        }
-    }
-
-    protected void windowDestroyNotify() {
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("Window.windowDestroyNotify START "+getThreadName());
-        }
-
-        enqueueWindowEvent(false, WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
-
-        if(handleDestroyNotify && isValid()) {
-            destroy();
-        }
-
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("Window.windowDestroyeNotify END "+getThreadName());
-        }
-    }
-
-    protected void windowDestroyed() {
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("Window.windowDestroyed "+getThreadName());
-        }
-        closeAndInvalidate();
-    }
-
-    public void windowRepaint(int x, int y, int width, int height) {
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("Window.windowRepaint "+getThreadName()+" - "+x+"/"+y+" "+width+"x"+height);
-            // Exception ee = new Exception("Window.windowRepaint: "+" - "+x+"/"+y+" "+width+"x"+height);
-            // ee.printStackTrace();
-        }
-
-        if(isNativeValid()) {
-            if(0>width) {
-                width=this.width;
-            }
-            if(0>height) {
-                height=this.height;
-            }
-
-            NEWTEvent e = new WindowUpdateEvent(WindowEvent.EVENT_WINDOW_REPAINT, this, System.currentTimeMillis(),
-                                                new Rectangle(x, y, width, height));
-            doEvent(false, false, e);
-        }
-    }
-
-    protected int getWindowLockRecursionCount() {
-        return windowLock.getRecursionCount();
-    }
-
-    //
-    // Reflection helper ..
-    //
-
-    private static Class[] getCustomConstructorArgumentTypes(Class windowClass) {
-        Class[] argTypes = null;
-        try {
-            Method m = windowClass.getDeclaredMethod("getCustomConstructorArgumentTypes", new Class[] {});
-            argTypes = (Class[]) m.invoke(null, null);
-        } catch (Throwable t) {}
-        return argTypes;
-    }
-
-    private static int verifyConstructorArgumentTypes(Class[] types, Object[] args) {
-        if(types.length != args.length) {
-            return -1;
-        }
-        for(int i=0; i<args.length; i++) {
-            if(!types[i].isInstance(args[i])) {
-                return i;
-            }
-        }
-        return args.length;
-    }
-
-    private static String getArgsStrList(Object[] args) {
-        StringBuffer sb = new StringBuffer();
-        for(int i=0; i<args.length; i++) {
-            sb.append(args[i].getClass());
-            if(i<args.length) {
-                sb.append(", ");
-            }
-        }
-        return sb.toString();
-    }
-
-    private static String getTypeStrList(Class[] types) {
-        StringBuffer sb = new StringBuffer();
-        for(int i=0; i<types.length; i++) {
-            sb.append(types[i]);
-            if(i<types.length) {
-                sb.append(", ");
-            }
-        }
-        return sb.toString();
-    }
-
-    protected final void shouldNotCallThis() {
-        throw new NativeWindowException("Should not call this");
-    }
-    
-    public static String getThreadName() {
-        return Display.getThreadName();
-    }
-
-    public static String toHexString(int hex) {
-        return Display.toHexString(hex);
-    }
-
-    public static String toHexString(long hex) {
-        return Display.toHexString(hex);
-    }
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/awt/AWTCanvas.java b/src/newt/classes/com/jogamp/newt/impl/awt/AWTCanvas.java
deleted file mode 100644
index f17e530..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/awt/AWTCanvas.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.awt;
-
-import com.jogamp.newt.Window;
-
-import java.awt.Canvas;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsConfiguration;
-
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.awt.*;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-public class AWTCanvas extends Canvas {
-  private GraphicsDevice device;
-  private GraphicsConfiguration chosen;
-  private AWTGraphicsConfiguration awtConfig;
-
-  private CapabilitiesChooser chooser=null;
-  private CapabilitiesImmutable capabilities;
-
-  private boolean displayConfigChanged=false;
-
-  public AWTCanvas(CapabilitiesImmutable capabilities, CapabilitiesChooser chooser) {
-    super();
-
-    if(null==capabilities) {
-        throw new NativeWindowException("Capabilities null");
-    }
-    this.capabilities=capabilities;
-    this.chooser=chooser;
-  }
-
-  public AWTGraphicsConfiguration getAWTGraphicsConfiguration() {
-    return awtConfig;
-  }
-
-  public boolean hasDeviceChanged() {
-    boolean res = displayConfigChanged;
-    displayConfigChanged=false;
-    return res;
-  }
-
-  public void addNotify() {
-    super.addNotify();
-
-    disableBackgroundErase();
-
-    GraphicsConfiguration gc = super.getGraphicsConfiguration();
-    if(null!=gc) {
-        device = gc.getDevice();
-    }
-
-    /*
-     * Save the chosen capabilities for use in getGraphicsConfiguration().
-     */
-    awtConfig = chooseGraphicsConfiguration(capabilities, capabilities, chooser, device);
-    if(Window.DEBUG_IMPLEMENTATION) {
-        Exception e = new Exception("Info: Created Config: "+awtConfig);
-        e.printStackTrace();
-    }
-    if(null!=awtConfig) {
-      // update ..
-      chosen = awtConfig.getGraphicsConfiguration();
-    }
-    if(null==awtConfig) {
-          throw new NativeWindowException("Error: AWTGraphicsConfiguration is null");
-    }
-  }
-
-  public void removeNotify() {
-      try {
-        dispose();
-      } finally {
-        super.removeNotify();
-      }
-  }
-
-  private void dispose() {
-    if(null != awtConfig) {
-        AbstractGraphicsDevice adevice = awtConfig.getNativeGraphicsConfiguration().getScreen().getDevice();
-        String adeviceMsg=null;
-        if(Window.DEBUG_IMPLEMENTATION) {
-            adeviceMsg = adevice.toString();
-        }
-        boolean closed = adevice.close();
-        if(Window.DEBUG_IMPLEMENTATION) {
-            System.err.println("AWTCanvas.dispose(): closed GraphicsDevice: "+adeviceMsg+", result: "+closed);
-        }
-    }
-  }
-
-  /**
-   * Overridden to choose a GraphicsConfiguration on a parent container's
-   * GraphicsDevice because both devices
-   */
-  public GraphicsConfiguration getGraphicsConfiguration() {
-    /*
-     * Workaround for problems with Xinerama and java.awt.Component.checkGD
-     * when adding to a container on a different graphics device than the
-     * one that this Canvas is associated with.
-     * 
-     * GC will be null unless:
-     *   - A native peer has assigned it. This means we have a native
-     *     peer, and are already comitted to a graphics configuration.
-     *   - This canvas has been added to a component hierarchy and has
-     *     an ancestor with a non-null GC, but the native peer has not
-     *     yet been created. This means we can still choose the GC on
-     *     all platforms since the peer hasn't been created.
-     */
-    final GraphicsConfiguration gc = super.getGraphicsConfiguration();
-    /*
-     * chosen is only non-null on platforms where the GLDrawableFactory
-     * returns a non-null GraphicsConfiguration (in the GLCanvas
-     * constructor).
-     * 
-     * if gc is from this Canvas' native peer then it should equal chosen,
-     * otherwise it is from an ancestor component that this Canvas is being
-     * added to, and we go into this block.
-     */
-    if (gc != null && chosen != null && !chosen.equals(gc)) {
-      /*
-       * Check for compatibility with gc. If they differ by only the
-       * device then return a new GCconfig with the super-class' GDevice
-       * (and presumably the same visual ID in Xinerama).
-       * 
-       */
-      if (!chosen.getDevice().getIDstring().equals(gc.getDevice().getIDstring())) {
-        /*
-         * Here we select a GraphicsConfiguration on the alternate
-         * device that is presumably identical to the chosen
-         * configuration, but on the other device.
-         * 
-         * Should really check to ensure that we select a configuration
-         * with the same X visual ID for Xinerama screens, otherwise the
-         * GLDrawable may have the wrong visual ID (I don't think this
-         * ever gets updated). May need to add a method to
-         * X11GLDrawableFactory to do this in a platform specific
-         * manner.
-         * 
-         * However, on platforms where we can actually get into this
-         * block, both devices should have the same visual list, and the
-         * same configuration should be selected here.
-         */
-        AWTGraphicsConfiguration config = chooseGraphicsConfiguration(
-                awtConfig.getChosenCapabilities(), awtConfig.getRequestedCapabilities(), chooser, gc.getDevice());
-        final GraphicsConfiguration compatible = (null!=config)?config.getGraphicsConfiguration():null;
-        if(Window.DEBUG_IMPLEMENTATION) {
-            Exception e = new Exception("Info: Call Stack: "+Thread.currentThread().getName());
-            e.printStackTrace();
-            System.err.println("!!! Created Config (n): HAVE    GC "+chosen);
-            System.err.println("!!! Created Config (n): THIS    GC "+gc);
-            System.err.println("!!! Created Config (n): Choosen GC "+compatible);
-            System.err.println("!!! Created Config (n): HAVE    CF "+awtConfig);
-            System.err.println("!!! Created Config (n): Choosen CF "+config);
-            System.err.println("!!! Created Config (n): EQUALS CAPS "+config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities()));
-        }
-
-        if (compatible != null) {
-          /*
-           * Save the new GC for equals test above, and to return to
-           * any outside callers of this method.
-           */
-          chosen = compatible;
-          if( !config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities())) {
-              displayConfigChanged=true;
-          } 
-          awtConfig = config;
-        }
-      }
-
-      /*
-       * If a compatible GC was not found in the block above, this will
-       * return the GC that was selected in the constructor (and might
-       * cause an exception in Component.checkGD when adding to a
-       * container, but in this case that would be the desired behavior).
-       * 
-       */
-      return chosen;
-    } else if (gc == null) {
-      /*
-       * The GC is null, which means we have no native peer, and are not
-       * part of a (realized) component hierarchy. So we return the
-       * desired visual that was selected in the constructor (possibly
-       * null).
-       */
-      return chosen;
-    }
-
-    /*
-     * Otherwise we have not explicitly selected a GC in the constructor, so
-     * just return what Canvas would have.
-     */
-    return gc;
-  }
-
-  private static AWTGraphicsConfiguration chooseGraphicsConfiguration(CapabilitiesImmutable capsChosen,
-                                                                      CapabilitiesImmutable capsRequested,
-                                                                      CapabilitiesChooser chooser,
-                                                                      GraphicsDevice device) {
-    AbstractGraphicsScreen aScreen = AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT);
-    AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
-      GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(capsChosen,
-                                                                                                   capsRequested,
-                                                                                                   chooser, aScreen);
-    if (config == null) {
-      throw new NativeWindowException("Error: Couldn't fetch AWTGraphicsConfiguration");
-    }
-
-    return config;
-  }
-
-  // Disables the AWT's erasing of this Canvas's background on Windows
-  // in Java SE 6. This internal API is not available in previous
-  // releases, but the system property
-  // -Dsun.awt.noerasebackground=true can be specified to get similar
-  // results globally in previous releases.
-  private static boolean disableBackgroundEraseInitialized;
-  private static Method  disableBackgroundEraseMethod;
-  private void disableBackgroundErase() {
-    if (!disableBackgroundEraseInitialized) {
-      try {
-        AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() {
-              try {
-                Class clazz = getToolkit().getClass();
-                while (clazz != null && disableBackgroundEraseMethod == null) {
-                  try {
-                    disableBackgroundEraseMethod =
-                      clazz.getDeclaredMethod("disableBackgroundErase",
-                                              new Class[] { Canvas.class });
-                    disableBackgroundEraseMethod.setAccessible(true);
-                  } catch (Exception e) {
-                    clazz = clazz.getSuperclass();
-                  }
-                }
-              } catch (Exception e) {
-              }
-              return null;
-            }
-          });
-      } catch (Exception e) {
-      }
-      disableBackgroundEraseInitialized = true;
-    }
-    if (disableBackgroundEraseMethod != null) {
-      try {
-        disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
-      } catch (Exception e) {
-        // FIXME: workaround for 6504460 (incorrect backport of 6333613 in 5.0u10)
-        // throw new GLException(e);
-      }
-    }
-  }
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/awt/AWTDisplay.java b/src/newt/classes/com/jogamp/newt/impl/awt/AWTDisplay.java
deleted file mode 100644
index 6f0b232..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/awt/AWTDisplay.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.awt;
-
-import java.awt.event.*;
-import com.jogamp.newt.Display;
-import com.jogamp.newt.Window;
-import com.jogamp.newt.impl.DisplayImpl;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.awt.*;
-import java.util.*;
-
-public class AWTDisplay extends DisplayImpl {
-    public AWTDisplay() {
-    }
-
-    protected void createNativeImpl() {
-        aDevice = (AWTGraphicsDevice) AWTGraphicsDevice.createDevice(null, AbstractGraphicsDevice.DEFAULT_UNIT); // default
-    }
-
-    protected void setAWTGraphicsDevice(AWTGraphicsDevice d) {
-        aDevice = d;
-    }
-
-    protected void closeNativeImpl() { }
-
-    protected boolean shallRunOnEDT() { 
-        return false; 
-    }
-    protected void dispatchMessagesNative() { /* nop */ }
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/awt/AWTScreen.java b/src/newt/classes/com/jogamp/newt/impl/awt/AWTScreen.java
deleted file mode 100644
index 5e097fd..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/awt/AWTScreen.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.awt;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.impl.ScreenImpl;
-import java.awt.DisplayMode;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.awt.*;
-
-public class AWTScreen extends ScreenImpl {
-    public AWTScreen() {
-    }
-
-    protected void createNativeImpl() {
-        aScreen = new AWTGraphicsScreen((AWTGraphicsDevice)display.getGraphicsDevice());
-        
-        DisplayMode mode = ((AWTGraphicsDevice)getDisplay().getGraphicsDevice()).getGraphicsDevice().getDisplayMode();
-        int w = mode.getWidth();
-        int h = mode.getHeight();
-        setScreenSize(w, h);
-    }
-
-    protected void setAWTGraphicsScreen(AWTGraphicsScreen s) {
-        aScreen = s;
-    }
-
-    // done by AWTWindow ..
-    protected void setScreenSize(int w, int h) {
-        super.setScreenSize(w, h);
-    }
-
-    protected void closeNativeImpl() { }
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/awt/AWTWindow.java b/src/newt/classes/com/jogamp/newt/impl/awt/AWTWindow.java
deleted file mode 100644
index ec1ae1c..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/awt/AWTWindow.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.awt;
-
-import com.jogamp.newt.event.awt.*;
-import com.jogamp.newt.util.EDTUtil;
-
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.DisplayMode;
-import java.awt.EventQueue;
-import java.awt.Frame;
-import com.jogamp.newt.impl.WindowImpl;
-import java.awt.Insets;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.awt.*;
-import javax.media.nativewindow.util.Point;
-
-/** An implementation of the Newt Window class built using the
-    AWT. This is provided for convenience of porting to platforms
-    supporting Java SE. */
-
-public class AWTWindow extends WindowImpl {
-
-    public AWTWindow() {
-        this(null);
-    }
-
-    public static Class[] getCustomConstructorArgumentTypes() {
-        return new Class[] { Container.class } ;
-    }
-
-    public AWTWindow(Container container) {
-        super();
-        title = "AWT NewtWindow";
-        this.container = container;
-        if(container instanceof Frame) {
-            frame = (Frame) container;
-        }
-    }
-
-    private boolean owningFrame;
-    private Container container = null;
-    private Frame frame = null; // same instance as container, just for impl. convenience
-    private AWTCanvas canvas;
-
-    protected void requestFocusImpl(boolean reparented) {
-        runOnEDT(true, new Runnable() {
-                public void run() {
-                    container.requestFocus();
-                }
-            });
-    }
-
-    protected void setTitleImpl(final String title) {
-        runOnEDT(true, new Runnable() {
-                public void run() {
-                    if (frame != null) {
-                        frame.setTitle(title);
-                    }
-                }
-            });
-    }
-
-    protected void createNativeImpl() {
-
-        if(0!=getParentWindowHandle()) {
-            throw new RuntimeException("Window parenting not supported in AWT, use AWTWindow(Frame) cstr for wrapping instead");
-        }
-
-        final AWTWindow awtWindow = this;
-
-        runOnEDT(true, new Runnable() {
-                public void run() {
-                    if(null==container) {
-                        frame = new Frame();
-                        container = frame;
-                        owningFrame=true;
-                    } else {
-                        owningFrame=false;
-                        width = container.getWidth();
-                        height = container.getHeight();
-                        x = container.getX();
-                        y = container.getY();
-                    }
-                    if(null!=frame) {
-                        frame.setTitle(getTitle());
-                    }
-                    container.setLayout(new BorderLayout());
-                    canvas = new AWTCanvas(capsRequested, AWTWindow.this.capabilitiesChooser);
-
-                    addWindowListener(new LocalWindowListener());
-
-                    new AWTMouseAdapter(awtWindow).addTo(canvas); // fwd all AWT Mouse events to here
-                    new AWTKeyAdapter(awtWindow).addTo(canvas); // fwd all AWT Key events to here
-
-                    // canvas.addComponentListener(listener);
-                    container.add(canvas, BorderLayout.CENTER);
-                    container.setSize(width, height);
-                    container.setLocation(x, y);
-                    new AWTWindowAdapter(awtWindow).addTo(container); // fwd all AWT Window events to here
-
-                    if(null!=frame) {
-                        frame.setUndecorated(undecorated||fullscreen);
-                    }
-                }
-            });
-        setWindowHandle(1); // just a marker ..
-    }
-
-    protected void closeNativeImpl() {
-        setWindowHandle(0); // just a marker ..
-        if(null!=container) {
-            runOnEDT(true, new Runnable() {
-                    public void run() {
-                        container.setVisible(false);
-                        container.remove(canvas);
-                        container.setEnabled(false);
-                        canvas.setEnabled(false);
-                    }
-                });
-        }
-        if(owningFrame && null!=frame) {
-            runOnEDT(true, new Runnable() {
-                    public void run() {
-                        frame.dispose();
-                        owningFrame=false;
-                        frame = null;
-                    }
-                });
-        }
-    }
-
-    public boolean hasDeviceChanged() {
-        boolean res = canvas.hasDeviceChanged();
-        if(res) {
-            config = canvas.getAWTGraphicsConfiguration();
-            if (config == null) {
-                throw new NativeWindowException("Error Device change null GraphicsConfiguration: "+this);
-            }
-            updateDeviceData();
-        }
-        return res;
-    }
-
-    protected void setVisibleImpl(final boolean visible, int x, int y, int width, int height) {
-        runOnEDT(true, new Runnable() {
-                public void run() {
-                    container.setVisible(visible);
-                }
-            });
-
-        reconfigureWindowImpl(x, y, width, height, false, 0, 0);
-        config = canvas.getAWTGraphicsConfiguration();
-
-        if (config == null) {
-            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
-        }
-
-        updateDeviceData();
-        visibleChanged(visible);
-    }
-
-    private void updateDeviceData() {
-        // propagate new info ..
-        ((AWTScreen)getScreen()).setAWTGraphicsScreen((AWTGraphicsScreen)config.getScreen());
-        ((AWTDisplay)getScreen().getDisplay()).setAWTGraphicsDevice((AWTGraphicsDevice)config.getScreen().getDevice());
-
-        DisplayMode mode = ((AWTGraphicsDevice)config.getScreen().getDevice()).getGraphicsDevice().getDisplayMode();
-        int w = mode.getWidth();
-        int h = mode.getHeight();
-        ((AWTScreen)getScreen()).setScreenSize(w, h);
-    }
-
-    public javax.media.nativewindow.util.Insets getInsets() {
-        final int insets[] = new int[] { 0, 0, 0, 0 };
-        runOnEDT(true, new Runnable() {
-                public void run() {
-                    Insets contInsets = container.getInsets();
-                    insets[0] = contInsets.top;
-                    insets[1] = contInsets.left;
-                    insets[2] = contInsets.bottom;
-                    insets[3] = contInsets.right;
-                }
-            });
-        return new javax.media.nativewindow.util.Insets(insets[0],insets[1],insets[2],insets[3]);
-    }
-
-    protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final boolean parentChange, final int fullScreenChange, final int decorationChange) {
-        /** An AWT event on setSize() would bring us in a deadlock situation, hence invokeLater() */
-        runOnEDT(false, new Runnable() {
-                public void run() {
-                    if(decorationChange!=0 && null!=frame) {
-                        if(!container.isDisplayable()) {
-                            frame.setUndecorated(isUndecorated());
-                        } else {
-                            if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
-                                System.err.println("AWTWindow can't undecorate already created frame");
-                            }
-                        }
-                    }
-                    int _x=(x>=0)?x:AWTWindow.this.x;
-                    int _y=(x>=0)?y:AWTWindow.this.y;
-                    int _w=(width>0)?width:AWTWindow.this.width;
-                    int _h=(height>0)?height:AWTWindow.this.height;
-
-                    container.setLocation(_x, _y);
-                    Insets insets = container.getInsets();
-                    container.setSize(_w + insets.left + insets.right,
-                                      _h + insets.top + insets.bottom);
-                }
-            });
-        return true;
-    }
-
-    protected Point getLocationOnScreenImpl(int x, int y) {
-        java.awt.Point ap = canvas.getLocationOnScreen();
-        ap.translate(x, y);
-        return new Point((int)(ap.getX()+0.5),(int)(ap.getY()+0.5));
-    }
-   
-    public Object getWrappedWindow() {
-        return canvas;
-    }
-
-    private void runOnEDT(boolean wait, Runnable r) {
-        EDTUtil edtUtil = getScreen().getDisplay().getEDTUtil();
-        if ( ( null != edtUtil && edtUtil.isCurrentThreadEDT() ) || EventQueue.isDispatchThread() ) {
-            r.run();
-        } else {
-            try {
-                if(wait) {
-                    EventQueue.invokeAndWait(r);
-                } else {
-                    EventQueue.invokeLater(r);
-                }
-            } catch (Exception e) {
-                throw new NativeWindowException(e);
-            }
-        }
-    }
-
-    class LocalWindowListener extends com.jogamp.newt.event.WindowAdapter { 
-        public void windowMoved(com.jogamp.newt.event.WindowEvent e) {
-            if(null!=container) {
-                x = container.getX();
-                y = container.getY();
-            }
-        }
-        public void windowResized(com.jogamp.newt.event.WindowEvent e) {
-            if(null!=canvas) {
-                width = canvas.getWidth();
-                height = canvas.getHeight();
-            }
-        }
-    }
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/event/NEWTEventTask.java b/src/newt/classes/com/jogamp/newt/impl/event/NEWTEventTask.java
deleted file mode 100644
index 1b4bce4..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/event/NEWTEventTask.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.newt.impl.event;
-
-import com.jogamp.newt.event.NEWTEvent;
-
-/**
- * Helper class to provide a NEWTEvent queue implementation with a NEWTEvent wrapper
- * which notifies after sending the event for the <code>invokeAndWait()</code> semantics.
- */
-public class NEWTEventTask {
-    NEWTEvent event;
-    Object notifyObject;
-
-    public NEWTEventTask(NEWTEvent event, Object notifyObject) {
-        this.event = event ;
-        this.notifyObject = notifyObject ;
-    }
-
-    public NEWTEvent get() { return event; }
-
-    public void notifyIssuer() {
-        if(null != notifyObject) {
-            synchronized (notifyObject) {
-                notifyObject.notifyAll();
-            }
-        }
-    }
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Display.java b/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Display.java
deleted file mode 100644
index c08f239..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Display.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.intel.gdl;
-
-import com.jogamp.newt.impl.*;
-import javax.media.nativewindow.*;
-
-public class Display extends com.jogamp.newt.impl.DisplayImpl {
-    static int initCounter = 0;
-
-    static {
-        NEWTJNILibLoader.loadNEWT();
-
-        if (!Screen.initIDs()) {
-            throw new NativeWindowException("Failed to initialize GDL Screen jmethodIDs");
-        }
-        if (!Window.initIDs()) {
-            throw new NativeWindowException("Failed to initialize GDL Window jmethodIDs");
-        }
-    }
-
-    public static void initSingleton() {
-        // just exist to ensure static init has been run
-    }
-
-
-    public Display() {
-    }
-
-    protected void createNativeImpl() {
-        synchronized(Display.class) {
-            if(0==initCounter) {
-                displayHandle = CreateDisplay();
-                if(0==displayHandle) {
-                    throw new NativeWindowException("Couldn't initialize GDL Display");
-                }
-            }
-            initCounter++;
-        }
-        aDevice = new DefaultGraphicsDevice(NativeWindowFactory.TYPE_DEFAULT, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT, displayHandle);
-    }
-
-    protected void closeNativeImpl() {
-        if(0==displayHandle) {
-            throw new NativeWindowException("displayHandle null; initCnt "+initCounter);
-        }
-        synchronized(Display.class) {
-            if(initCounter>0) {
-                initCounter--;
-                if(0==initCounter) {
-                    DestroyDisplay(displayHandle);
-                }
-            }
-        }
-    }
-
-    protected void dispatchMessagesNative() {
-        if(0!=displayHandle) {
-            DispatchMessages(displayHandle, focusedWindow);
-        }
-    }
-
-    protected void setFocus(Window focus) {
-        focusedWindow = focus;
-    }
-
-    private long displayHandle = 0;
-    private Window focusedWindow = null;
-    private native long CreateDisplay();
-    private native void DestroyDisplay(long displayHandle);
-    private native void DispatchMessages(long displayHandle, Window focusedWindow);
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Screen.java b/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Screen.java
deleted file mode 100644
index 4abee35..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Screen.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.intel.gdl;
-
-import com.jogamp.newt.impl.*;
-import javax.media.nativewindow.*;
-
-public class Screen extends com.jogamp.newt.impl.ScreenImpl {
-
-    static {
-        Display.initSingleton();
-    }
-
-    public Screen() {
-    }
-
-    protected void createNativeImpl() {
-        AbstractGraphicsDevice adevice = getDisplay().getGraphicsDevice();
-        GetScreenInfo(adevice.getHandle(), screen_idx);
-        aScreen = new DefaultGraphicsScreen(adevice, screen_idx);
-    }
-
-    protected void closeNativeImpl() { }
-
-    //----------------------------------------------------------------------
-    // Internals only
-    //
-
-    protected static native boolean initIDs();
-    private          native void GetScreenInfo(long displayHandle, int screen_idx);
-
-    // called by GetScreenInfo() ..
-    private void screenCreated(int width, int height) {
-        setScreenSize(width, height);
-    }
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Window.java b/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Window.java
deleted file mode 100644
index c9a3229..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Window.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.intel.gdl;
-
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.util.Point;
-
-public class Window extends com.jogamp.newt.impl.WindowImpl {
-    static {
-        Display.initSingleton();
-    }
-
-    public Window() {
-    }
-
-    static long nextWindowHandle = 1;
-
-    protected void createNativeImpl() {
-        if(0!=getParentWindowHandle()) {
-            throw new NativeWindowException("GDL Window does not support window parenting");
-        }
-        AbstractGraphicsScreen aScreen = getScreen().getGraphicsScreen();
-        AbstractGraphicsDevice aDevice = getScreen().getDisplay().getGraphicsDevice();
-
-        config = GraphicsConfigurationFactory.getFactory(aDevice).chooseGraphicsConfiguration(
-                capsRequested, capsRequested, capabilitiesChooser, aScreen);
-        if (config == null) {
-            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
-        }
-
-        synchronized(Window.class) {
-            setWindowHandle(nextWindowHandle++); // just a marker
-
-            surfaceHandle = CreateSurface(aDevice.getHandle(), getScreen().getWidth(), getScreen().getHeight(), x, y, width, height);
-            if (surfaceHandle == 0) {
-                throw new NativeWindowException("Error creating window");
-            }
-        }
-    }
-
-    protected void closeNativeImpl() {
-        if(0!=surfaceHandle) {
-            synchronized(Window.class) {
-                CloseSurface(getDisplayHandle(), surfaceHandle);
-            }
-            surfaceHandle = 0;
-            ((Display)getScreen().getDisplay()).setFocus(null);
-        }
-    }
-
-    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
-        reconfigureWindowImpl(x, y, width, height, false, 0, 0);
-        if(visible) {
-            ((Display)getScreen().getDisplay()).setFocus(this);
-        }
-        this.visibleChanged(visible);
-    }
-
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, boolean parentChange, int fullScreenChange, int decorationChange) {
-        Screen  screen = (Screen) getScreen();
-
-        int _x=(x>=0)?x:this.x;
-        int _y=(x>=0)?y:this.y;
-        int _w=(width>0)?width:this.width;
-        int _h=(height>0)?height:this.height;
-
-        if(_w>screen.getWidth()) {
-            _w=screen.getWidth();
-        }
-        if(_h>screen.getHeight()) {
-            _h=screen.getHeight();
-        }
-        if((_x+_w)>screen.getWidth()) {
-            _x=screen.getWidth()-_w;
-        }
-        if((_y+_h)>screen.getHeight()) {
-            _y=screen.getHeight()-_h;
-        }
-
-        if(0!=surfaceHandle) {
-            SetBounds0(surfaceHandle, getScreen().getWidth(), getScreen().getHeight(), _x, _y, _w, _h);
-        }
-
-        return true;
-    }
-
-    protected void requestFocusImpl(boolean reparented) {
-        ((Display)getScreen().getDisplay()).setFocus(this);
-    }
-
-    public final long getSurfaceHandle() {
-        return surfaceHandle;
-    }
-
-    protected Point getLocationOnScreenImpl(int x, int y) {
-        return new Point(x,y);
-    }
-
-    //----------------------------------------------------------------------
-    // Internals only
-    //
-
-    protected static native boolean initIDs();
-    private        native long CreateSurface(long displayHandle, int scrn_width, int scrn_height, int x, int y, int width, int height);
-    private        native void CloseSurface(long displayHandle, long surfaceHandle);
-    private        native void SetBounds0(long surfaceHandle, int scrn_width, int scrn_height, int x, int y, int width, int height);
-
-    private void updateBounds(int x, int y, int width, int height) {
-        this.x = x;
-        this.y = y;
-        this.width = width;
-        this.height = height;
-    }
-
-    private long   surfaceHandle;
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/macosx/MacDisplay.java b/src/newt/classes/com/jogamp/newt/impl/macosx/MacDisplay.java
deleted file mode 100644
index cf9d4f0..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/macosx/MacDisplay.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.macosx;
-
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.macosx.*;
-import com.jogamp.common.util.ReflectionUtil;
-import com.jogamp.newt.*;
-import com.jogamp.newt.impl.*;
-import com.jogamp.newt.util.EDTUtil;
-import com.jogamp.newt.util.MainThread;
-
-public class MacDisplay extends DisplayImpl {
-    static {
-        NEWTJNILibLoader.loadNEWT();
-
-        if(!initNSApplication0()) {
-            throw new NativeWindowException("Failed to initialize native Application hook");
-        }
-        if(!MacWindow.initIDs0()) {
-            throw new NativeWindowException("Failed to initialize jmethodIDs");
-        }
-        if(DEBUG) {
-            System.err.println("MacDisplay.init App and IDs OK "+Thread.currentThread().getName());
-        }
-    }
-
-    public static void initSingleton() {
-        // just exist to ensure static init has been run
-    }
-    
-    public MacDisplay() {
-    }
-
-    protected void dispatchMessagesNative() {
-        dispatchMessages0();
-    }
-    
-    protected void createNativeImpl() {
-        aDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
-    }
-
-    protected void closeNativeImpl() { }
-
-    protected void createEDTUtil() {
-        if(NewtFactory.useEDT()) {
-            final Display f_dpy = this;
-            MainThread.addPumpMessage(this, 
-                                  new Runnable() {
-                                      public void run() {
-                                          if(null!=f_dpy.getGraphicsDevice()) {
-                                              f_dpy.dispatchMessages();
-                                          } } } );
-            edtUtil = MainThread.getSingleton();
-            edtUtil.start();
-        }
-    }
-
-    protected void releaseEDTUtil() {
-        if(null!=edtUtil) { 
-            MainThread.removePumpMessage(this);
-            edtUtil.waitUntilStopped();
-            edtUtil=null;
-        }
-    }
-
-    private static native boolean initNSApplication0();
-    protected native void dispatchMessages0();
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/macosx/MacScreen.java b/src/newt/classes/com/jogamp/newt/impl/macosx/MacScreen.java
deleted file mode 100644
index f0c3883..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/macosx/MacScreen.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.macosx;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.impl.ScreenImpl;
-import javax.media.nativewindow.*;
-
-public class MacScreen extends ScreenImpl {
-    static {
-        MacDisplay.initSingleton();
-    }
-
-    public MacScreen() {
-    }
-
-    protected void createNativeImpl() {
-        aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
-        setScreenSize(getWidthImpl0(screen_idx), getHeightImpl0(screen_idx));
-    }
-
-    protected void closeNativeImpl() { }
-
-    private static native int getWidthImpl0(int scrn_idx);
-    private static native int getHeightImpl0(int scrn_idx);
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/macosx/MacWindow.java b/src/newt/classes/com/jogamp/newt/impl/macosx/MacWindow.java
deleted file mode 100644
index c01139b..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/macosx/MacWindow.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.macosx;
-
-import javax.media.nativewindow.*;
-import com.jogamp.common.util.locks.RecursiveLock;
-
-import com.jogamp.newt.event.*;
-import com.jogamp.newt.impl.*;
-import javax.media.nativewindow.util.Insets;
-import javax.media.nativewindow.util.Point;
-
-public class MacWindow extends WindowImpl {
-    
-    // Window styles
-    private static final int NSBorderlessWindowMask     = 0;
-    private static final int NSTitledWindowMask         = 1 << 0;
-    private static final int NSClosableWindowMask       = 1 << 1;
-    private static final int NSMiniaturizableWindowMask = 1 << 2;
-    private static final int NSResizableWindowMask      = 1 << 3;
-
-    // Window backing store types
-    private static final int NSBackingStoreRetained     = 0;
-    private static final int NSBackingStoreNonretained  = 1;
-    private static final int NSBackingStoreBuffered     = 2;
-
-    // Key constants handled differently on Mac OS X than other platforms
-    private static final int NSUpArrowFunctionKey        = 0xF700;
-    private static final int NSDownArrowFunctionKey      = 0xF701;
-    private static final int NSLeftArrowFunctionKey      = 0xF702;
-    private static final int NSRightArrowFunctionKey     = 0xF703;
-    private static final int NSF1FunctionKey             = 0xF704;
-    private static final int NSF2FunctionKey             = 0xF705;
-    private static final int NSF3FunctionKey             = 0xF706;
-    private static final int NSF4FunctionKey             = 0xF707;
-    private static final int NSF5FunctionKey             = 0xF708;
-    private static final int NSF6FunctionKey             = 0xF709;
-    private static final int NSF7FunctionKey             = 0xF70A;
-    private static final int NSF8FunctionKey             = 0xF70B;
-    private static final int NSF9FunctionKey             = 0xF70C;
-    private static final int NSF10FunctionKey            = 0xF70D;
-    private static final int NSF11FunctionKey            = 0xF70E;
-    private static final int NSF12FunctionKey            = 0xF70F;
-    private static final int NSF13FunctionKey            = 0xF710;
-    private static final int NSF14FunctionKey            = 0xF711;
-    private static final int NSF15FunctionKey            = 0xF712;
-    private static final int NSF16FunctionKey            = 0xF713;
-    private static final int NSF17FunctionKey            = 0xF714;
-    private static final int NSF18FunctionKey            = 0xF715;
-    private static final int NSF19FunctionKey            = 0xF716;
-    private static final int NSF20FunctionKey            = 0xF717;
-    private static final int NSF21FunctionKey            = 0xF718;
-    private static final int NSF22FunctionKey            = 0xF719;
-    private static final int NSF23FunctionKey            = 0xF71A;
-    private static final int NSF24FunctionKey            = 0xF71B;
-    private static final int NSF25FunctionKey            = 0xF71C;
-    private static final int NSF26FunctionKey            = 0xF71D;
-    private static final int NSF27FunctionKey            = 0xF71E;
-    private static final int NSF28FunctionKey            = 0xF71F;
-    private static final int NSF29FunctionKey            = 0xF720;
-    private static final int NSF30FunctionKey            = 0xF721;
-    private static final int NSF31FunctionKey            = 0xF722;
-    private static final int NSF32FunctionKey            = 0xF723;
-    private static final int NSF33FunctionKey            = 0xF724;
-    private static final int NSF34FunctionKey            = 0xF725;
-    private static final int NSF35FunctionKey            = 0xF726;
-    private static final int NSInsertFunctionKey         = 0xF727;
-    private static final int NSDeleteFunctionKey         = 0xF728;
-    private static final int NSHomeFunctionKey           = 0xF729;
-    private static final int NSBeginFunctionKey          = 0xF72A;
-    private static final int NSEndFunctionKey            = 0xF72B;
-    private static final int NSPageUpFunctionKey         = 0xF72C;
-    private static final int NSPageDownFunctionKey       = 0xF72D;
-    private static final int NSPrintScreenFunctionKey    = 0xF72E;
-    private static final int NSScrollLockFunctionKey     = 0xF72F;
-    private static final int NSPauseFunctionKey          = 0xF730;
-    private static final int NSSysReqFunctionKey         = 0xF731;
-    private static final int NSBreakFunctionKey          = 0xF732;
-    private static final int NSResetFunctionKey          = 0xF733;
-    private static final int NSStopFunctionKey           = 0xF734;
-    private static final int NSMenuFunctionKey           = 0xF735;
-    private static final int NSUserFunctionKey           = 0xF736;
-    private static final int NSSystemFunctionKey         = 0xF737;
-    private static final int NSPrintFunctionKey          = 0xF738;
-    private static final int NSClearLineFunctionKey      = 0xF739;
-    private static final int NSClearDisplayFunctionKey   = 0xF73A;
-    private static final int NSInsertLineFunctionKey     = 0xF73B;
-    private static final int NSDeleteLineFunctionKey     = 0xF73C;
-    private static final int NSInsertCharFunctionKey     = 0xF73D;
-    private static final int NSDeleteCharFunctionKey     = 0xF73E;
-    private static final int NSPrevFunctionKey           = 0xF73F;
-    private static final int NSNextFunctionKey           = 0xF740;
-    private static final int NSSelectFunctionKey         = 0xF741;
-    private static final int NSExecuteFunctionKey        = 0xF742;
-    private static final int NSUndoFunctionKey           = 0xF743;
-    private static final int NSRedoFunctionKey           = 0xF744;
-    private static final int NSFindFunctionKey           = 0xF745;
-    private static final int NSHelpFunctionKey           = 0xF746;
-    private static final int NSModeSwitchFunctionKey     = 0xF747;
-
-    private volatile long surfaceHandle;
-
-    // non fullscreen dimensions ..
-    private final Insets insets = new Insets(0,0,0,0);
-
-    static {
-        MacDisplay.initSingleton();
-    }
-
-    public MacWindow() {
-    }
-    
-    protected void createNativeImpl() {
-        config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(
-                capsRequested, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen());
-        if (config == null) {
-            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
-        }
-    }
-
-    protected void closeNativeImpl() {
-        nsViewLock.lock();
-        try {
-            if(DEBUG_IMPLEMENTATION) { System.err.println("MacWindow.CloseAction "+Thread.currentThread().getName()); }
-            if (getWindowHandle() != 0) {
-                close0(getWindowHandle());
-            }
-        } catch (Throwable t) {
-            if(DEBUG_IMPLEMENTATION) { 
-                Exception e = new Exception("Warning: closeNative failed - "+Thread.currentThread().getName(), t);
-                e.printStackTrace();
-            }
-        } finally {
-            setWindowHandle(0);
-            nsViewLock.unlock();
-        }
-        windowDestroyed(); // No OSX hook for DidClose, so do it here
-    }
-    
-    public final long getSurfaceHandle() {
-        return surfaceHandle;
-    }
-
-    public Insets getInsets() {
-        // in order to properly calculate insets we need the window to be
-        // created
-        nsViewLock.lock();
-        try {
-            createWindow(false, getX(), getY(), getWidth(), getHeight(), isFullscreen());
-            return (Insets) insets.clone();
-        } finally {
-            nsViewLock.unlock();
-        }
-    }
-
-    private RecursiveLock nsViewLock = new RecursiveLock();
-
-    protected int lockSurfaceImpl() {
-        nsViewLock.lock();
-        return LOCK_SUCCESS;
-    }
-
-    protected void unlockSurfaceImpl() {
-        nsViewLock.unlock();
-    }
-
-    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
-        nsViewLock.lock();
-        try {
-            if (visible) {
-                createWindow(false, x, y, width, height, isFullscreen());
-                if (getWindowHandle() != 0) {
-                    makeKeyAndOrderFront0(getWindowHandle());
-                }
-            } else {
-                if (getWindowHandle() != 0) {
-                    orderOut0(getWindowHandle());
-                }
-            }
-            visibleChanged(visible);
-        } finally {
-            nsViewLock.unlock();
-        }
-    }
-
-    protected void setTitleImpl(final String title) {
-        // FIXME: move nsViewLock up to window lock
-        nsViewLock.lock();
-        try {
-            setTitle0(getWindowHandle(), title);
-        } finally {
-            nsViewLock.unlock();
-        }
-    }
-
-    protected void requestFocusImpl(boolean reparented) {
-        // FIXME: move nsViewLock up to window lock
-        nsViewLock.lock();
-        try {
-            makeKey0(getWindowHandle());
-        } finally {
-            nsViewLock.unlock();
-        }
-    }
-    
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, boolean parentChange, int fullScreenChange, int decorationChange) {
-        nsViewLock.lock();
-        try {
-            if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
-                System.err.println("MacWindow reconfig: parentChange "+parentChange+", fullScreenChange "+fullScreenChange+", decorationChange "+decorationChange+" "+x+"/"+y+" "+width+"x"+height);
-            }
-            int _x=(x>=0)?x:this.x;
-            int _y=(x>=0)?y:this.y;
-            int _w=(width>0)?width:this.width;
-            int _h=(height>0)?height:this.height;
-
-            if(decorationChange!=0 || parentChange || fullScreenChange!=0) {
-                createWindow(true, _x, _y, _w, _h, fullScreenChange>0);
-                if (getWindowHandle() != 0) {
-                    makeKeyAndOrderFront0(getWindowHandle());
-                }
-            } else {
-                if(x>=0 || y>=0) {
-                    setFrameTopLeftPoint0(getParentWindowHandle(), getWindowHandle(), _x, _y);
-                }
-                if(width>0 || height>0) {
-                    setContentSize0(getWindowHandle(), _w, _h);
-                }
-            }
-        } finally {
-            nsViewLock.unlock();
-        }
-        return true;
-    }
-
-    protected Point getLocationOnScreenImpl(int x, int y) {
-        return null;
-    }
-    
-    private void insetsChanged(int left, int top, int right, int bottom) {
-        if (DEBUG_IMPLEMENTATION) {
-            System.err.println(Thread.currentThread().getName()+
-                " Insets changed to " + left + ", " + top + ", " + right + ", " + bottom);
-        }
-        if (left != -1 && top != -1 && right != -1 && bottom != -1) {
-            insets.left = left;
-            insets.top = top;
-            insets.right = right;
-            insets.bottom = bottom;
-        }
-    }
-
-    private char convertKeyChar(char keyChar) {
-        if (keyChar == '\r') {
-            // Turn these into \n
-            return '\n';
-        }
-
-        if (keyChar >= NSUpArrowFunctionKey && keyChar <= NSModeSwitchFunctionKey) {
-            switch (keyChar) {
-                case NSUpArrowFunctionKey:     return KeyEvent.VK_UP;
-                case NSDownArrowFunctionKey:   return KeyEvent.VK_DOWN;
-                case NSLeftArrowFunctionKey:   return KeyEvent.VK_LEFT;
-                case NSRightArrowFunctionKey:  return KeyEvent.VK_RIGHT;
-                case NSF1FunctionKey:          return KeyEvent.VK_F1;
-                case NSF2FunctionKey:          return KeyEvent.VK_F2;
-                case NSF3FunctionKey:          return KeyEvent.VK_F3;
-                case NSF4FunctionKey:          return KeyEvent.VK_F4;
-                case NSF5FunctionKey:          return KeyEvent.VK_F5;
-                case NSF6FunctionKey:          return KeyEvent.VK_F6;
-                case NSF7FunctionKey:          return KeyEvent.VK_F7;
-                case NSF8FunctionKey:          return KeyEvent.VK_F8;
-                case NSF9FunctionKey:          return KeyEvent.VK_F9;
-                case NSF10FunctionKey:         return KeyEvent.VK_F10;
-                case NSF11FunctionKey:         return KeyEvent.VK_F11;
-                case NSF12FunctionKey:         return KeyEvent.VK_F12;
-                case NSF13FunctionKey:         return KeyEvent.VK_F13;
-                case NSF14FunctionKey:         return KeyEvent.VK_F14;
-                case NSF15FunctionKey:         return KeyEvent.VK_F15;
-                case NSF16FunctionKey:         return KeyEvent.VK_F16;
-                case NSF17FunctionKey:         return KeyEvent.VK_F17;
-                case NSF18FunctionKey:         return KeyEvent.VK_F18;
-                case NSF19FunctionKey:         return KeyEvent.VK_F19;
-                case NSF20FunctionKey:         return KeyEvent.VK_F20;
-                case NSF21FunctionKey:         return KeyEvent.VK_F21;
-                case NSF22FunctionKey:         return KeyEvent.VK_F22;
-                case NSF23FunctionKey:         return KeyEvent.VK_F23;
-                case NSF24FunctionKey:         return KeyEvent.VK_F24;
-                case NSInsertFunctionKey:      return KeyEvent.VK_INSERT;
-                case NSDeleteFunctionKey:      return KeyEvent.VK_DELETE;
-                case NSHomeFunctionKey:        return KeyEvent.VK_HOME;
-                case NSBeginFunctionKey:       return KeyEvent.VK_BEGIN;
-                case NSEndFunctionKey:         return KeyEvent.VK_END;
-                case NSPageUpFunctionKey:      return KeyEvent.VK_PAGE_UP;
-                case NSPageDownFunctionKey:    return KeyEvent.VK_PAGE_DOWN;
-                case NSPrintScreenFunctionKey: return KeyEvent.VK_PRINTSCREEN;
-                case NSScrollLockFunctionKey:  return KeyEvent.VK_SCROLL_LOCK;
-                case NSPauseFunctionKey:       return KeyEvent.VK_PAUSE;
-                // Not handled:
-                // NSSysReqFunctionKey
-                // NSBreakFunctionKey
-                // NSResetFunctionKey
-                case NSStopFunctionKey:        return KeyEvent.VK_STOP;
-                // Not handled:
-                // NSMenuFunctionKey
-                // NSUserFunctionKey
-                // NSSystemFunctionKey
-                // NSPrintFunctionKey
-                // NSClearLineFunctionKey
-                // NSClearDisplayFunctionKey
-                // NSInsertLineFunctionKey
-                // NSDeleteLineFunctionKey
-                // NSInsertCharFunctionKey
-                // NSDeleteCharFunctionKey
-                // NSPrevFunctionKey
-                // NSNextFunctionKey
-                // NSSelectFunctionKey
-                // NSExecuteFunctionKey
-                // NSUndoFunctionKey
-                // NSRedoFunctionKey
-                // NSFindFunctionKey
-                // NSHelpFunctionKey
-                // NSModeSwitchFunctionKey
-                default: break;
-            }
-        }
-
-        // NSEvent's charactersIgnoringModifiers doesn't ignore the shift key
-        if (keyChar >= 'a' && keyChar <= 'z') {
-            return Character.toUpperCase(keyChar);
-        }
-
-        return keyChar;
-    }
-
-    public void enqueueKeyEvent(boolean wait, int eventType, int modifiers, int keyCode, char keyChar) {
-        int key = convertKeyChar(keyChar);
-        if(DEBUG_IMPLEMENTATION) System.err.println("MacWindow.enqueueKeyEvent "+Thread.currentThread().getName());
-        // Note that we send the key char for the key code on this
-        // platform -- we do not get any useful key codes out of the system
-        super.enqueueKeyEvent(wait, eventType, modifiers, key, keyChar);
-    }
-
-    private void createWindow(final boolean recreate, final int x, final int y, final int width, final int height, final boolean fullscreen) {
-
-        if(0!=getWindowHandle() && !recreate) {
-            return;
-        }
-
-        try {
-            //runOnEDTIfAvail(true, new Runnable() {
-            //    public void run() {
-                    if(0!=getWindowHandle()) {
-                        // save the view .. close the window
-                        surfaceHandle = changeContentView0(getParentWindowHandle(), getWindowHandle(), 0);
-                        if(recreate && 0==surfaceHandle) {
-                            throw new NativeWindowException("Internal Error - recreate, window but no view");
-                        }
-                        close0(getWindowHandle());
-                        setWindowHandle(0);
-                    } else {
-                        surfaceHandle = 0;
-                    }
-                    setWindowHandle(createWindow0(getParentWindowHandle(),
-                                                 x, y, width, height, fullscreen,
-                                                 (isUndecorated() ?
-                                                 NSBorderlessWindowMask :
-                                                 NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask),
-                                                 NSBackingStoreBuffered, 
-                                                 getScreen().getIndex(), surfaceHandle));
-                    if (getWindowHandle() == 0) {
-                        throw new NativeWindowException("Could create native window "+Thread.currentThread().getName()+" "+this);
-                    }
-                    surfaceHandle = contentView0(getWindowHandle());
-                    setTitle0(getWindowHandle(), getTitle());
-                    // don't make the window visible on window creation
-                    // makeKeyAndOrderFront0(windowHandle);
-             //   } } );
-        } catch (Exception ie) {
-            ie.printStackTrace();
-        }
-
-        enqueueWindowEvent(false, WindowEvent.EVENT_WINDOW_MOVED);
-        enqueueWindowEvent(false, WindowEvent.EVENT_WINDOW_RESIZED);
-        enqueueWindowEvent(false, WindowEvent.EVENT_WINDOW_GAINED_FOCUS);
-    }
-    
-    protected static native boolean initIDs0();
-    private native long createWindow0(long parentWindowHandle, int x, int y, int w, int h,
-                                     boolean fullscreen, int windowStyle,
-                                     int backingStoreType,
-                                     int screen_idx, long view);
-    private native void makeKeyAndOrderFront0(long window);
-    private native void makeKey0(long window);
-    private native void orderOut0(long window);
-    private native void close0(long window);
-    private native void setTitle0(long window, String title);
-    private native long contentView0(long window);
-    private native long changeContentView0(long parentWindowHandle, long window, long view);
-    private native void setContentSize0(long window, int w, int h);
-    private native void setFrameTopLeftPoint0(long parentWindowHandle, long window, int x, int y);
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Display.java b/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Display.java
deleted file mode 100644
index ba7fe3c..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Display.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.opengl.broadcom.egl;
-
-import com.jogamp.newt.impl.*;
-import com.jogamp.opengl.impl.egl.*;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.egl.*;
-
-public class Display extends com.jogamp.newt.impl.DisplayImpl {
-
-    static {
-        NEWTJNILibLoader.loadNEWT();
-
-        if (!Window.initIDs()) {
-            throw new NativeWindowException("Failed to initialize BCEGL Window jmethodIDs");
-        }
-    }
-
-    public static void initSingleton() {
-        // just exist to ensure static init has been run
-    }
-
-
-    public Display() {
-    }
-
-    protected void createNativeImpl() {
-        long handle = CreateDisplay(Screen.fixedWidth, Screen.fixedHeight);
-        if (handle == EGL.EGL_NO_DISPLAY) {
-            throw new NativeWindowException("BC EGL CreateDisplay failed");
-        }
-        aDevice = new EGLGraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT);
-    }
-
-    protected void closeNativeImpl() {
-        if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
-            DestroyDisplay(aDevice.getHandle());
-        }
-    }
-
-    protected void dispatchMessagesNative() {
-        // n/a .. DispatchMessages();
-    }
-
-    private native long CreateDisplay(int width, int height);
-    private native void DestroyDisplay(long dpy);
-    private native void DispatchMessages();
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Screen.java b/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Screen.java
deleted file mode 100644
index 144fe5e..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Screen.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.opengl.broadcom.egl;
-
-import javax.media.nativewindow.*;
-
-public class Screen extends com.jogamp.newt.impl.ScreenImpl {
-
-    static {
-        Display.initSingleton();
-    }
-
-
-    public Screen() {
-    }
-
-    protected void createNativeImpl() {
-        aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
-        setScreenSize(fixedWidth, fixedHeight);
-    }
-
-    protected void closeNativeImpl() { }
-
-    //----------------------------------------------------------------------
-    // Internals only
-    //
-
-    static final int fixedWidth = 1920;
-    static final int fixedHeight = 1080;
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Window.java b/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Window.java
deleted file mode 100644
index cfc5bd5..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Window.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.opengl.broadcom.egl;
-
-import com.jogamp.opengl.impl.egl.*;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.util.Point;
-import javax.media.opengl.GLCapabilitiesImmutable;
-
-public class Window extends com.jogamp.newt.impl.WindowImpl {
-    static {
-        Display.initSingleton();
-    }
-
-    public Window() {
-    }
-
-    protected void createNativeImpl() {
-        if(0!=getParentWindowHandle()) {
-            throw new RuntimeException("Window parenting not supported (yet)");
-        }
-        // query a good configuration .. even thought we drop this one 
-        // and reuse the EGLUtil choosen one later.
-        config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(
-                capsRequested, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen());
-        if (config == null) {
-            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
-        }
-        setSizeImpl(getScreen().getWidth(), getScreen().getHeight());
-
-        setWindowHandle(realizeWindow(true, width, height));
-        if (0 == getWindowHandle()) {
-            throw new NativeWindowException("Error native Window Handle is null");
-        }
-    }
-
-    protected void closeNativeImpl() {
-        if(0!=windowHandleClose) {
-            CloseWindow(getDisplayHandle(), windowHandleClose);
-        }
-    }
-
-    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
-        reconfigureWindowImpl(x, y, width, height, false, 0, 0);
-        visibleChanged(visible);
-    }
-
-    protected void requestFocusImpl(boolean reparented) { }
-
-    protected void setSizeImpl(int width, int height) {
-        if(0!=getWindowHandle()) {
-            // n/a in BroadcomEGL
-            System.err.println("BCEGL Window.setSizeImpl n/a in BroadcomEGL with realized window");
-        } else {
-            this.width = width;
-            this.height = height;
-        }
-    }
-
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, 
-                                            boolean parentChange, int fullScreenChange, int decorationChange) {
-        if(0!=getWindowHandle()) {
-            if(0!=fullScreenChange) {
-                if( fullScreenChange > 0 ) {
-                    // n/a in BroadcomEGL
-                    System.err.println("setFullscreen n/a in BroadcomEGL");
-                    return false;
-                }
-            }
-        }
-        if(width>0 || height>0) {
-            if(0!=getWindowHandle()) {
-                // n/a in BroadcomEGL
-                System.err.println("BCEGL Window.setSizeImpl n/a in BroadcomEGL with realized window");
-            } else {
-                this.width=(width>0)?width:this.width;
-                this.height=(height>0)?height:this.height;
-            }
-        }
-        if(x>=0 || y>=0) {
-            System.err.println("BCEGL Window.setPositionImpl n/a in BroadcomEGL");
-        }
-        return true;
-    }
-
-    protected Point getLocationOnScreenImpl(int x, int y) {
-        return new Point(x,y);
-    }
-
-
-    public boolean surfaceSwap() {
-        SwapWindow(getDisplayHandle(), getWindowHandle());
-        return true;
-    }
-
-    //----------------------------------------------------------------------
-    // Internals only
-    //
-
-    protected static native boolean initIDs();
-    private        native long CreateWindow(long eglDisplayHandle, boolean chromaKey, int width, int height);
-    private        native void CloseWindow(long eglDisplayHandle, long eglWindowHandle);
-    private        native void SwapWindow(long eglDisplayHandle, long eglWindowHandle);
-
-
-    private long realizeWindow(boolean chromaKey, int width, int height) {
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("BCEGL Window.realizeWindow() with: chroma "+chromaKey+", "+width+"x"+height+", "+config);
-        }
-        long handle = CreateWindow(getDisplayHandle(), chromaKey, width, height);
-        if (0 == handle) {
-            throw new NativeWindowException("Error native Window Handle is null");
-        }
-        windowHandleClose = handle;
-        return handle;
-    }
-
-    private void windowCreated(int cfgID, int width, int height) {
-        this.width = width;
-        this.height = height;
-        GLCapabilitiesImmutable capsReq = (GLCapabilitiesImmutable) config.getRequestedCapabilities();
-        config = EGLGraphicsConfiguration.create(capsReq, getScreen().getGraphicsScreen(), cfgID);
-        if (config == null) {
-            throw new NativeWindowException("Error creating EGLGraphicsConfiguration from id: "+cfgID+", "+this);
-        }
-        if(DEBUG_IMPLEMENTATION) {
-            System.err.println("BCEGL Window.windowCreated(): "+toHexString(cfgID)+", "+width+"x"+height+", "+config);
-        }
-    }
-
-    private long   windowHandleClose;
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDDisplay.java b/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDDisplay.java
deleted file mode 100644
index 8dc2dd9..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDDisplay.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.opengl.kd;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.impl.*;
-import com.jogamp.opengl.impl.egl.*;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.egl.*;
-
-public class KDDisplay extends DisplayImpl {
-
-    static {
-        NEWTJNILibLoader.loadNEWT();
-
-        if (!KDWindow.initIDs()) {
-            throw new NativeWindowException("Failed to initialize KDWindow jmethodIDs");
-        }
-    }
-
-    public static void initSingleton() {
-        // just exist to ensure static init has been run
-    }
-
-
-    public KDDisplay() {
-    }
-
-    protected void createNativeImpl() {
-        // FIXME: map name to EGL_*_DISPLAY
-        long handle = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
-        if (handle == EGL.EGL_NO_DISPLAY) {
-            throw new NativeWindowException("eglGetDisplay failed");
-        }
-        if (!EGL.eglInitialize(handle, null, null)) {
-            throw new NativeWindowException("eglInitialize failed");
-        }
-        aDevice = new EGLGraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT);
-    }
-
-    protected void closeNativeImpl() {
-        if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
-            EGL.eglTerminate(aDevice.getHandle());
-        }
-    }
-
-    protected void dispatchMessagesNative() {
-        DispatchMessages();
-    }
-
-    private native void DispatchMessages();
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDScreen.java b/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDScreen.java
deleted file mode 100644
index 1a73d0e..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDScreen.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.opengl.kd;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.impl.ScreenImpl;
-import javax.media.nativewindow.*;
-
-public class KDScreen extends ScreenImpl {
-    static {
-        KDDisplay.initSingleton();
-    }
-
-    public KDScreen() {
-    }
-
-    protected void createNativeImpl() {
-        aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
-    }
-
-    protected void closeNativeImpl() { }
-
-    // elevate access to this package ..
-    protected void setScreenSize(int w, int h) {
-        super.setScreenSize(w, h);
-    }
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDWindow.java b/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDWindow.java
deleted file mode 100644
index b49b6f7..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDWindow.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.opengl.kd;
-
-import com.jogamp.newt.impl.*;
-import com.jogamp.opengl.impl.egl.*;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.NativeWindowException;
-import javax.media.nativewindow.util.Point;
-import javax.media.opengl.GLCapabilitiesImmutable;
-
-public class KDWindow extends WindowImpl {
-    private static final String WINDOW_CLASS_NAME = "NewtWindow";
-
-    static {
-        KDDisplay.initSingleton();
-    }
-
-    public KDWindow() {
-    }
-
-    protected void createNativeImpl() {
-        if(0!=getParentWindowHandle()) {
-            throw new RuntimeException("Window parenting not supported (yet)");
-        }
-        config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(
-                capsRequested, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen());
-        if (config == null) {
-            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
-        }
-
-        GLCapabilitiesImmutable eglCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
-        int[] eglAttribs = EGLGraphicsConfiguration.GLCapabilities2AttribList(eglCaps);
-
-        eglWindowHandle = CreateWindow(getDisplayHandle(), eglAttribs);
-        if (eglWindowHandle == 0) {
-            throw new NativeWindowException("Error creating egl window: "+config);
-        }
-        setVisible0(eglWindowHandle, false);
-        setWindowHandle(RealizeWindow(eglWindowHandle));
-        if (0 == getWindowHandle()) {
-            throw new NativeWindowException("Error native Window Handle is null");
-        }
-        windowHandleClose = eglWindowHandle;
-    }
-
-    protected void closeNativeImpl() {
-        if(0!=windowHandleClose) {
-            CloseWindow(windowHandleClose, windowUserData);
-            windowUserData=0;
-        }
-    }
-
-    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
-        setVisible0(eglWindowHandle, visible);
-        reconfigureWindowImpl(x, y, width, height, false, 0, 0);
-        visibleChanged(visible);
-    }
-
-    protected void requestFocusImpl(boolean reparented) { }
-
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, 
-                                            boolean parentChange, int fullScreenChange, int decorationChange) {
-        if(0!=eglWindowHandle) {
-            if(0!=fullScreenChange) {
-                boolean fs = fullScreenChange > 0;
-                setFullScreen0(eglWindowHandle, fs);
-                if(fs) {
-                    return true;
-                }
-            }
-            // int _x=(x>=0)?x:this.x;
-            // int _y=(x>=0)?y:this.y;
-            int _w=(width>0)?width:this.width;
-            int _h=(height>0)?height:this.height;
-            if(width>0 || height>0) {
-                setSize0(eglWindowHandle, _w, _h);
-            }
-            if(x>=0 || y>=0) {
-                System.err.println("setPosition n/a in KD");
-            }
-        }
-        return true;
-    }
-
-    protected Point getLocationOnScreenImpl(int x, int y) {
-        return new Point(x,y);
-    }
-
-    //----------------------------------------------------------------------
-    // Internals only
-    //
-
-    protected static native boolean initIDs();
-    private        native long CreateWindow(long displayHandle, int[] attributes);
-    private        native long RealizeWindow(long eglWindowHandle);
-    private        native int  CloseWindow(long eglWindowHandle, long userData);
-    private        native void setVisible0(long eglWindowHandle, boolean visible);
-    private        native void setSize0(long eglWindowHandle, int width, int height);
-    private        native void setFullScreen0(long eglWindowHandle, boolean fullscreen);
-
-    private void windowCreated(long userData) {
-        windowUserData=userData;
-    }
-
-    protected void sizeChanged(int newWidth, int newHeight, boolean force) {
-        if(fullscreen) {
-            ((KDScreen)getScreen()).setScreenSize(width, height);
-        }
-        super.sizeChanged(newWidth, newHeight, force);
-    }
-
-    private long   eglWindowHandle;
-    private long   windowHandleClose;
-    private long   windowUserData;
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/windows/WindowsDisplay.java b/src/newt/classes/com/jogamp/newt/impl/windows/WindowsDisplay.java
deleted file mode 100644
index 3728592..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/windows/WindowsDisplay.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.windows;
-
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.windows.*;
-import com.jogamp.newt.*;
-import com.jogamp.newt.impl.*;
-
-public class WindowsDisplay extends DisplayImpl {
-
-    protected static final String WINDOW_CLASS_NAME = "NewtWindowClass";
-    private static int windowClassAtom;
-    private static long hInstance;
-
-    static {
-        NEWTJNILibLoader.loadNEWT();
-
-        if (!WindowsWindow.initIDs0()) {
-            throw new NativeWindowException("Failed to initialize WindowsWindow jmethodIDs");
-        }
-    }
-
-    public static void initSingleton() {
-        // just exist to ensure static init has been run
-    }
-
-
-    public WindowsDisplay() {
-    }
-
-    protected void createNativeImpl() {
-        aDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
-    }
-
-    protected void closeNativeImpl() { 
-        // Can't do .. only at application shutdown 
-        // UnregisterWindowClass0(getWindowClassAtom(), getHInstance());
-    }
-
-    protected void dispatchMessagesNative() {
-        DispatchMessages0();
-    }
-
-    protected static synchronized int getWindowClassAtom() {
-        if(0 == windowClassAtom) {
-            windowClassAtom = RegisterWindowClass0(WINDOW_CLASS_NAME, getHInstance());
-            if (0 == windowClassAtom) {
-                throw new NativeWindowException("Error while registering window class");
-            }
-        }
-        return windowClassAtom;
-    }
-
-    protected static synchronized long getHInstance() {
-        if(0 == hInstance) {
-            hInstance = LoadLibraryW0("newt");
-            if (0 == hInstance) {
-                throw new NativeWindowException("Error finding HINSTANCE for \"newt\"");
-            }
-        }
-        return hInstance;
-    }
-
-    //----------------------------------------------------------------------
-    // Internals only
-    //
-    private static native long LoadLibraryW0(String libraryName);
-    private static native int  RegisterWindowClass0(String windowClassName, long hInstance);
-    private static native void UnregisterWindowClass0(int wndClassAtom, long hInstance);
-
-    private static native void DispatchMessages0();
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/windows/WindowsScreen.java b/src/newt/classes/com/jogamp/newt/impl/windows/WindowsScreen.java
deleted file mode 100644
index e15a40e..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/windows/WindowsScreen.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-package com.jogamp.newt.impl.windows;
-
-import com.jogamp.common.util.ArrayHashSet;
-import java.util.ArrayList;
-
-import com.jogamp.newt.*;
-import com.jogamp.newt.impl.ScreenImpl;
-import com.jogamp.newt.ScreenMode;
-import com.jogamp.newt.impl.ScreenModeStatus;
-import com.jogamp.newt.util.ScreenModeUtil;
-
-import javax.media.nativewindow.*;
-
-public class WindowsScreen extends ScreenImpl {
-
-    static {
-        WindowsDisplay.initSingleton();
-    }
-
-    public WindowsScreen() {
-    }
-
-    protected void createNativeImpl() {
-        aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
-        setScreenSize(getWidthImpl0(screen_idx), getHeightImpl0(screen_idx));
-    }
-
-    protected void closeNativeImpl() {
-    }
-
-    private int[] getScreenModeIdx(int idx) {
-        int[] modeProps = getScreenMode0(screen_idx, idx);
-        if (null == modeProps || 0 == modeProps.length) {
-            return null;
-        }
-        if(modeProps.length < ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL) {
-            throw new RuntimeException("properties array too short, should be >= "+ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL+", is "+modeProps.length);
-        }
-        return modeProps;
-    }
-
-    private int nativeModeIdx;
-
-    protected int[] getScreenModeFirstImpl() {
-        nativeModeIdx = 0;
-        return getScreenModeNextImpl();
-    }
-
-    protected int[] getScreenModeNextImpl() {
-        int[] modeProps = getScreenModeIdx(nativeModeIdx);
-        if (null != modeProps && 0 < modeProps.length) {
-            nativeModeIdx++;
-            return modeProps;
-        }
-        return null;
-    }
-
-    protected ScreenMode getCurrentScreenModeImpl() {
-        int[] modeProps = getScreenModeIdx(-1);
-        if (null != modeProps && 0 < modeProps.length) {
-            return ScreenModeUtil.streamIn(modeProps, 0);
-        }
-        return null;
-    }
-
-    protected boolean setCurrentScreenModeImpl(ScreenMode sm) {
-        return setScreenMode0(screen_idx, 
-                              sm.getMonitorMode().getSurfaceSize().getResolution().getWidth(),
-                              sm.getMonitorMode().getSurfaceSize().getResolution().getHeight(),
-                              sm.getMonitorMode().getSurfaceSize().getBitsPerPixel(),
-                              sm.getMonitorMode().getRefreshRate(),
-                              sm.getRotation());
-    }
-
-    // Native calls
-    private native int getWidthImpl0(int scrn_idx);
-
-    private native int getHeightImpl0(int scrn_idx);
-
-    private native int[] getScreenMode0(int screen_index, int mode_index);
-    private native boolean setScreenMode0(int screen_index, int width, int height, int bits, int freq, int rot);
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java b/src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java
deleted file mode 100644
index d4f4f77..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.windows;
-
-import com.jogamp.nativewindow.impl.windows.GDI;
-import javax.media.nativewindow.*;
-import com.jogamp.newt.impl.WindowImpl;
-import javax.media.nativewindow.util.Insets;
-import javax.media.nativewindow.util.Point;
-
-public class WindowsWindow extends WindowImpl {
-
-    private long hmon;
-    private long hdc;
-    private long windowHandleClose;
-    private final Insets insets = new Insets(0, 0, 0, 0);
-
-    static {
-        WindowsDisplay.initSingleton();
-    }
-
-    public WindowsWindow() {
-    }
-
-    protected int lockSurfaceImpl() {
-        if( 0 != getWindowHandle() && 0 == hdc ) {
-            hdc = GetDC0(getWindowHandle());
-            hmon = MonitorFromWindow0(getWindowHandle());
-        }
-        return ( 0 != hdc ) ? LOCK_SUCCESS : LOCK_SURFACE_NOT_READY;
-    }
-
-    protected void unlockSurfaceImpl() {
-        if ( 0 != hdc && 0 != getWindowHandle() && getWindowLockRecursionCount() == 0) {
-            ReleaseDC0(getWindowHandle(), hdc);
-            hdc=0;
-        }
-    }
-
-    public final long getSurfaceHandle() {
-        return hdc;
-    }
-
-    public boolean hasDeviceChanged() {
-        if(0!=getWindowHandle()) {
-            long _hmon = MonitorFromWindow0(getWindowHandle());
-            if (hmon != _hmon) {
-                if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
-                    Exception e = new Exception("Info: Window Device Changed "+Thread.currentThread().getName()+
-                                                ", HMON "+toHexString(hmon)+" -> "+toHexString(_hmon));
-                    e.printStackTrace();
-                }
-                hmon = _hmon;
-                return true;
-            }
-        }
-        return false;
-    }
-
-    protected void createNativeImpl() {
-        WindowsScreen  screen = (WindowsScreen) getScreen();
-        WindowsDisplay display = (WindowsDisplay) screen.getDisplay();
-        config = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice()).chooseGraphicsConfiguration(
-                capsRequested, capsRequested, capabilitiesChooser, screen.getGraphicsScreen());
-        if (config == null) {
-            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
-        }
-        setWindowHandle(CreateWindow0(getParentWindowHandle(),
-                                    display.getWindowClassAtom(), display.WINDOW_CLASS_NAME, display.getHInstance(), 
-                                    0, undecorated, x, y, width, height));
-        if (getWindowHandle() == 0) {
-            throw new NativeWindowException("Error creating window");
-        }
-        windowHandleClose = getWindowHandle();
-        if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
-            Exception e = new Exception("Info: Window new window handle "+Thread.currentThread().getName()+
-                                        " (Parent HWND "+toHexString(getParentWindowHandle())+
-                                        ") : HWND "+toHexString(getWindowHandle())+", "+Thread.currentThread());
-            e.printStackTrace();
-        }
-    }
-
-    protected void closeNativeImpl() {
-        if (hdc != 0) {
-            if(windowHandleClose != 0) {
-                try {
-                    ReleaseDC0(windowHandleClose, hdc);
-                } catch (Throwable t) {
-                    if(DEBUG_IMPLEMENTATION) { 
-                        Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
-                        e.printStackTrace();
-                    }
-                }
-            }
-            hdc = 0;
-        }
-        if(windowHandleClose != 0) {
-            try {
-                DestroyWindow0(windowHandleClose);
-            } catch (Throwable t) {
-                if(DEBUG_IMPLEMENTATION) {
-                    Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
-                    e.printStackTrace();
-                }
-            } finally {
-                windowHandleClose = 0;
-            }
-        }
-    }
-
-    protected void windowDestroyed() {
-        windowHandleClose = 0;
-        super.windowDestroyed();
-    }
-
-    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
-        setVisible0(getWindowHandle(), visible, (getParentWindowHandle()==0)?true:false, x, y, width, height);
-        visibleChanged(visible);
-    }
-
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, 
-                                            boolean parentChange, int fullScreenChange, int decorationChange) {
-        reconfigureWindow0( (fullScreenChange>0)?0:getParentWindowHandle(), 
-                             getWindowHandle(), x, y, width, height, isVisible(), parentChange, fullScreenChange, decorationChange);
-        return true;
-    }
-
-    protected void requestFocusImpl(boolean force) {
-        requestFocus0(getWindowHandle(), force);
-    }
-
-    protected void setTitleImpl(final String title) {
-        setTitle0(getWindowHandle(), title);
-    }
-
-    public Insets getInsets() {
-        return (Insets)insets.clone();
-    }
-
-    protected Point getLocationOnScreenImpl(int x, int y) {
-        return GDI.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
-    }
-
-    //----------------------------------------------------------------------
-    // Internals only
-    //
-    protected static native boolean initIDs0();
-    private native long CreateWindow0(long parentWindowHandle, 
-                                            int wndClassAtom, String wndName, 
-                                            long hInstance, long visualID,
-                                            boolean isUndecorated,
-                                            int x, int y, int width, int height);
-    private native void DestroyWindow0(long windowHandle);
-    private native long GetDC0(long windowHandle);
-    private native void ReleaseDC0(long windowHandle, long hdc);
-    private native long MonitorFromWindow0(long windowHandle);
-    private native void setVisible0(long windowHandle, boolean visible, boolean top, int x, int y, int width, int height);
-    private native void reconfigureWindow0(long parentWindowHandle, long windowHandle, 
-                                                  int x, int y, int width, int height, boolean isVisible,
-                                                  boolean parentChange, int fullScreenChange, int decorationChange);
-    private static native void setTitle0(long windowHandle, String title);
-    private native void requestFocus0(long windowHandle, boolean force);
-
-    private void insetsChanged(int left, int top, int right, int bottom) {
-        if (left != -1 && top != -1 && right != -1 && bottom != -1) {
-            if (left != insets.left || top != insets.top || right != insets.right || bottom != insets.bottom) {
-                insets.left = left;
-                insets.top = top;
-                insets.right = right;
-                insets.bottom = bottom;
-                if(DEBUG_IMPLEMENTATION) {
-                    System.err.println("Window.insetsChanged: "+insets);
-                }
-            }
-        }
-    }
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/x11/X11Display.java b/src/newt/classes/com/jogamp/newt/impl/x11/X11Display.java
deleted file mode 100644
index 1aaffac..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/x11/X11Display.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.x11;
-
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.x11.*;
-import com.jogamp.newt.impl.*;
-import com.jogamp.nativewindow.impl.x11.X11Util;
-
-public class X11Display extends DisplayImpl {
-
-    static {
-        NEWTJNILibLoader.loadNEWT();
-
-        if ( !initIDs0() ) {
-            throw new NativeWindowException("Failed to initialize X11Display jmethodIDs");
-        }
-
-        if (!X11Window.initIDs0()) {
-            throw new NativeWindowException("Failed to initialize X11Window jmethodIDs");
-        }
-    }
-
-    public static void initSingleton() {
-        // just exist to ensure static init has been run
-    }
-
-
-    public X11Display() {
-    }
-
-    public String validateDisplayName(String name, long handle) {
-        return X11Util.validateDisplayName(name, handle);
-    }
-
-    protected void createNativeImpl() {
-        long handle = X11Util.createDisplay(name);
-        if( 0 == handle ) {
-            throw new RuntimeException("Error creating display: "+name);
-        }
-        try {
-            CompleteDisplay0(handle);
-        } catch(RuntimeException e) {
-            X11Util.closeDisplay(handle);
-            throw e;
-        }
-        aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, NativeWindowFactory.getNullToolkitLock());
-        // aDevice = new X11GraphicsDevice(handle, NativeWindowFactory.createDefaultToolkitLockNoAWT(NativeWindowFactory.TYPE_X11, handle));
-        // aDevice = new X11GraphicsDevice(handle);
-
-    }
-
-    protected void closeNativeImpl() {
-        X11Util.closeDisplay(getHandle());
-    }
-
-    protected void dispatchMessagesNative() {
-        long dpy = getHandle();
-        if(0!=dpy) {
-            DispatchMessages0(dpy, javaObjectAtom, windowDeleteAtom);
-        }
-    }
-
-    protected long getJavaObjectAtom() { return javaObjectAtom; }
-    protected long getWindowDeleteAtom() { return windowDeleteAtom; }
-
-    //----------------------------------------------------------------------
-    // Internals only
-    //
-    private static native boolean initIDs0();
-
-    private native void CompleteDisplay0(long handle);
-
-    private native void DispatchMessages0(long display, long javaObjectAtom, long windowDeleteAtom);
-
-    private void displayCompleted(long javaObjectAtom, long windowDeleteAtom) {
-        this.javaObjectAtom=javaObjectAtom;
-        this.windowDeleteAtom=windowDeleteAtom;
-    }
-
-    private long windowDeleteAtom;
-    private long javaObjectAtom;
-}
-
diff --git a/src/newt/classes/com/jogamp/newt/impl/x11/X11Screen.java b/src/newt/classes/com/jogamp/newt/impl/x11/X11Screen.java
deleted file mode 100644
index 5e89a99..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/x11/X11Screen.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-package com.jogamp.newt.impl.x11;
-
-import com.jogamp.nativewindow.impl.x11.X11Util;
-import com.jogamp.newt.impl.ScreenImpl;
-import com.jogamp.newt.ScreenMode;
-import com.jogamp.newt.util.ScreenModeUtil;
-import java.util.List;
-
-import javax.media.nativewindow.x11.*;
-
-public class X11Screen extends ScreenImpl {
-
-    static {
-        X11Display.initSingleton();
-    }
-
-    public X11Screen() {
-    }
-
-    protected void createNativeImpl() {
-        long handle = GetScreen0(display.getHandle(), screen_idx);
-        if (handle == 0) {
-            throw new RuntimeException("Error creating screen: " + screen_idx);
-        }
-        aScreen = new X11GraphicsScreen((X11GraphicsDevice) getDisplay().getGraphicsDevice(), screen_idx);
-        setScreenSize(getWidth0(display.getHandle(), screen_idx),
-                getHeight0(display.getHandle(), screen_idx));
-    }
-
-    protected void closeNativeImpl() {
-    }
-
-    private int[] nrotations;
-    private int nrotation_index;
-    private int nres_number;
-    private int nres_index;
-    private int[] nrates;
-    private int nrate_index;
-    private int nmode_number;
-
-    protected int[] getScreenModeFirstImpl() {
-        // initialize iterators and static data
-        nrotations = getAvailableScreenModeRotations0(display.getHandle(), screen_idx);
-        if(null==nrotations || 0==nrotations.length) {
-            return null;
-        }
-        nrotation_index = 0;
-
-        nres_number = getNumScreenModeResolutions0(display.getHandle(), screen_idx);
-        if(0==nres_number) {
-            return null;
-        }
-        nres_index = 0;
-
-        nrates = getScreenModeRates0(display.getHandle(), screen_idx, nres_index);
-        if(null==nrates || 0==nrates.length) {
-            return null;
-        }
-        nrate_index = 0;
-
-        nmode_number = 0;
-
-        return getScreenModeNextImpl();
-    }
-
-    protected int[] getScreenModeNextImpl() {
-        // assemble: w x h x bpp x f x r        
-
-        /**
-        System.err.println("******** mode: "+nmode_number);
-        System.err.println("rot  "+nrotation_index);
-        System.err.println("rate "+nrate_index);
-        System.err.println("res  "+nres_index); */
-
-        int[] res = getScreenModeResolution0(display.getHandle(), screen_idx, nres_index);
-        if(null==res || 0==res.length) {
-            return null;
-        }
-        if(0>=res[0] || 0>=res[1]) {
-            throw new InternalError("invalid resolution: "+res[0]+"x"+res[1]+" for res idx "+nres_index+"/"+nres_number);
-        }
-        int bpp = 32; // FIXME
-        int rate = nrates[nrate_index];
-        if(0>=rate) {
-            throw new InternalError("invalid rate: "+rate+" at index "+nrate_index+"/"+nrates.length);
-        }
-        int rotation = nrotations[nrotation_index];
-
-        int[] props = new int[ 1 + ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL ];
-        int i = 0;
-        props[i++] = nres_index; // use resolution index, not unique for native -> ScreenMode
-        props[i++] = 0; // set later for verification of iterator
-        props[i++] = res[0]; // width
-        props[i++] = res[1]; // height
-        props[i++] = bpp;    // bpp
-        props[i++] = res[2]; // widthmm
-        props[i++] = res[3]; // heightmm
-        props[i++] = rate;   // rate
-        props[i++] = rotation;
-        props[i - ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL] = i - 1; // count without extra element
-
-        nmode_number++;
-
-        // iteration: r -> f -> bpp -> [w x h]
-        nrotation_index++;
-        if(nrotation_index == nrotations.length) {
-            nrotation_index=0;
-            nrate_index++;
-            if(null == nrates || nrate_index == nrates.length){
-                nres_index++;
-                if(nres_index == nres_number) {
-                    // done
-                    nrates=null;
-                    nrotations=null;
-                    return null;
-                }
-
-                nrates = getScreenModeRates0(display.getHandle(), screen_idx, nres_index);
-                if(null==nrates || 0==nrates.length) {
-                    return null;
-                }
-                nrate_index = 0;
-            }
-        }
-
-        return props;
-    }
-
-    protected ScreenMode getCurrentScreenModeImpl() {
-        int resNumber = getNumScreenModeResolutions0(display.getHandle(), screen_idx);
-        if(0==resNumber) {
-            return null;
-        }
-        int resIdx = getCurrentScreenResolutionIndex0(display.getHandle(), screen_idx);
-        if(0>resIdx) {
-            return null;
-        }
-        if(resIdx>=resNumber) {
-            throw new RuntimeException("Invalid resolution index: ! "+resIdx+" < "+resNumber);
-        }
-        int[] res = getScreenModeResolution0(display.getHandle(), screen_idx, resIdx);
-        if(null==res || 0==res.length) {
-            return null;
-        }
-        if(0>=res[0] || 0>=res[1]) {
-            throw new InternalError("invalid resolution: "+res[0]+"x"+res[1]+" for res idx "+resIdx+"/"+resNumber);
-        }
-        int rate = getCurrentScreenRate0(display.getHandle(), screen_idx);
-        if(0>rate) {
-            return null;
-        }
-        int rot = getCurrentScreenRotation0(display.getHandle(), screen_idx);
-        if(0>rot) {
-            return null;
-        }
-
-        int[] props = new int[ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL];
-        int i = 0;
-        props[i++] = 0; // set later for verification of iterator
-        props[i++] = res[0]; // width
-        props[i++] = res[1]; // height
-        props[i++] = 32;     // FIXME: bpp
-        props[i++] = res[2]; // widthmm
-        props[i++] = res[3]; // heightmm
-        props[i++] = rate;   // rate
-        props[i++] = rot;
-        props[i - ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL] = i; // count
-        return ScreenModeUtil.streamIn(props, 0);
-    }
-
-    protected boolean setCurrentScreenModeImpl(ScreenMode screenMode) {
-        List screenModes = this.getScreenModesOrig();
-        int screenModeIdx = screenModes.indexOf(screenMode);
-        if(0>screenModeIdx) {
-            throw new RuntimeException("ScreenMode not element of ScreenMode list: "+screenMode);
-        }
-        int resNumber = getNumScreenModeResolutions0(display.getHandle(), screen_idx);
-        int resIdx = getScreenModesIdx2NativeIdx().get(screenModeIdx);
-        if(0>resIdx || resIdx>=resNumber) {
-            throw new RuntimeException("Invalid resolution index: ! 0 < "+resIdx+" < "+resNumber+", screenMode["+screenModeIdx+"] "+screenMode);
-        }
-
-        long dpy = X11Util.createDisplay(display.getName());
-        if( 0 == dpy ) {
-            throw new RuntimeException("Error creating display: "+display.getName());
-        }
-
-        boolean done = false;
-        long t0 = System.currentTimeMillis();
-        try {
-            int f = screenMode.getMonitorMode().getRefreshRate();
-            int r = screenMode.getRotation();
-            if( setCurrentScreenModeStart0(dpy, screen_idx, resIdx, f, r) ) {
-                while(!done && System.currentTimeMillis()-t0 < SCREEN_MODE_CHANGE_TIMEOUT) {
-                    done = setCurrentScreenModePollEnd0(dpy, screen_idx, resIdx, f, r);
-                    if(!done) {
-                        Thread.yield();
-                    }
-                }
-            }
-        } finally {
-            X11Util.closeDisplay(dpy);
-        }
-
-        if(!done) {
-            System.err.println("X11Screen.setCurrentScreenModeImpl: TO ("+SCREEN_MODE_CHANGE_TIMEOUT+") reached: "+
-                               (System.currentTimeMillis()-t0)+"ms");
-        }
-        return done;
-    }
-
-    //----------------------------------------------------------------------
-    // Internals only
-    //
-    private static native long GetScreen0(long dpy, int scrn_idx);
-
-    private static native int getWidth0(long display, int scrn_idx);
-
-    private static native int getHeight0(long display, int scrn_idx);
-
-    /** @return int[] { rot1, .. } */
-    private static native int[] getAvailableScreenModeRotations0(long display, int screen_index);
-
-    private static native int getNumScreenModeResolutions0(long display, int screen_index);
-
-    /** @return int[] { width, height, widthmm, heightmm } */
-    private static native int[] getScreenModeResolution0(long display, int screen_index, int mode_index);
-
-    private static native int[] getScreenModeRates0(long display, int screen_index, int mode_index);
-
-    private static native int getCurrentScreenResolutionIndex0(long display, int screen_index);
-    private static native int getCurrentScreenRate0(long display, int screen_index);
-    private static native int getCurrentScreenRotation0(long display, int screen_index);
-
-    /** needs own Display connection for XRANDR event handling */
-    private static native boolean setCurrentScreenModeStart0(long display, int screen_index, int mode_index, int freq, int rot);
-    private static native boolean setCurrentScreenModePollEnd0(long display, int screen_index, int mode_index, int freq, int rot);
-}
diff --git a/src/newt/classes/com/jogamp/newt/impl/x11/X11Window.java b/src/newt/classes/com/jogamp/newt/impl/x11/X11Window.java
deleted file mode 100644
index 73c6eb3..0000000
--- a/src/newt/classes/com/jogamp/newt/impl/x11/X11Window.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * 
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * 
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
- */
-
-package com.jogamp.newt.impl.x11;
-
-import com.jogamp.nativewindow.impl.x11.X11Util;
-import com.jogamp.newt.impl.WindowImpl;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.x11.*;
-import javax.media.nativewindow.util.Point;
-
-public class X11Window extends WindowImpl {
-    private static final String WINDOW_CLASS_NAME = "NewtWindow";
-
-    static {
-        X11Display.initSingleton();
-    }
-
-    public X11Window() {
-    }
-
-    protected void createNativeImpl() {
-        X11Screen screen = (X11Screen) getScreen();
-        X11Display display = (X11Display) screen.getDisplay();
-        config = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice()).chooseGraphicsConfiguration(
-                capsRequested, capsRequested, capabilitiesChooser, screen.getGraphicsScreen());
-        if (config == null) {
-            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
-        }
-        X11GraphicsConfiguration x11config = (X11GraphicsConfiguration) config;
-        long visualID = x11config.getVisualID();
-        long w = CreateWindow0(getParentWindowHandle(),
-                               display.getHandle(), screen.getIndex(), visualID, 
-                               display.getJavaObjectAtom(), display.getWindowDeleteAtom(), 
-                               x, y, width, height, isUndecorated());
-        if (w == 0) {
-            throw new NativeWindowException("Error creating window: "+w);
-        }
-        setWindowHandle(w);
-        windowHandleClose = w;
-    }
-
-    protected void closeNativeImpl() {
-        if(0!=windowHandleClose && null!=getScreen() ) {
-            X11Display display = (X11Display) getScreen().getDisplay();
-            try {
-                CloseWindow0(display.getHandle(), windowHandleClose, 
-                             display.getJavaObjectAtom(), display.getWindowDeleteAtom());
-            } catch (Throwable t) {
-                if(DEBUG_IMPLEMENTATION) { 
-                    Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
-                    e.printStackTrace();
-                }
-            } finally {
-                windowHandleClose = 0;
-            }
-        }
-    }
-
-    protected void windowDestroyed() {
-        windowHandleClose = 0;
-        super.windowDestroyed();
-    }
-
-    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
-        setVisible0(getDisplayHandle(), getWindowHandle(), visible, x, y, width, height);
-    }
-
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, 
-                                            boolean parentChange, int fullScreenChange, int decorationChange) {
-        reparentHandle=0;
-        reparentCount=0;
-        long reqNewParentHandle = ( fullScreenChange > 0 ) ? 0 : getParentWindowHandle() ;
-
-        reconfigureWindow0( getDisplayHandle(), getScreenIndex(), reqNewParentHandle, getWindowHandle(),
-                            x, y, width, height, isVisible(), parentChange, fullScreenChange, decorationChange);
-        return true;
-    }
-
-    protected void requestFocusImpl(boolean force) {
-        requestFocus0(getDisplayHandle(), getWindowHandle(), force);
-    }
-
-    protected void setTitleImpl(String title) {
-        setTitle0(getDisplayHandle(), getWindowHandle(), title);
-    }
-
-    protected Point getLocationOnScreenImpl(int x, int y) {
-        return X11Util.GetRelativeLocation( getDisplayHandle(), getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
-    }
-
-    //----------------------------------------------------------------------
-    // Internals only
-    //
-
-    protected static native boolean initIDs0();
-    private native long CreateWindow0(long parentWindowHandle, long display, int screen_index, 
-                                            long visualID, long javaObjectAtom, long windowDeleteAtom, 
-                                            int x, int y, int width, int height, boolean undecorated);
-    private native void CloseWindow0(long display, long windowHandle, long javaObjectAtom, long windowDeleteAtom);
-    private native void setVisible0(long display, long windowHandle, boolean visible, int x, int y, int width, int height);
-    private native void reconfigureWindow0(long display, int screen_index, long parentWindowHandle, long windowHandle, 
-                                                  int x, int y, int width, int height, boolean isVisible,
-                                                  boolean parentChange, int fullScreenChange, int decorationChange);
-    private native void setTitle0(long display, long windowHandle, String title);
-    private native void requestFocus0(long display, long windowHandle, boolean force);
-    private native Object getRelativeLocation0(long display, int screen_index, long src_win, long dest_win, int src_x, int src_y);
-
-    private void windowReparented(long gotParentHandle) {
-        reparentHandle = gotParentHandle;
-        reparentCount++;
-        if(DEBUG_IMPLEMENTATION) { 
-            System.err.println("******** new parent ("+reparentCount+"): " + toHexString(reparentHandle) );
-        }
-    }
-
-    private long   windowHandleClose;
-    private volatile long reparentHandle;
-    private volatile int reparentCount;
-}
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 0f96fac..efbd959 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -34,18 +34,22 @@
 
 package com.jogamp.newt.opengl;
 
+import java.util.List;
+
 import com.jogamp.common.GlueGenVersion;
 import com.jogamp.common.util.VersionUtil;
 import com.jogamp.nativewindow.NativeWindowVersion;
 import com.jogamp.newt.*;
 import com.jogamp.newt.event.*;
-import com.jogamp.newt.impl.WindowImpl;
+import jogamp.newt.WindowImpl;
+
 import javax.media.nativewindow.*;
 import javax.media.nativewindow.util.Point;
+import javax.media.nativewindow.util.Insets;
 import javax.media.opengl.*;
-import com.jogamp.opengl.impl.GLDrawableHelper;
+
+import jogamp.opengl.GLDrawableHelper;
 import com.jogamp.opengl.JoglVersion;
-import javax.media.nativewindow.util.Insets;
 
 /**
  * An implementation of {@link javax.media.opengl.GLAutoDrawable} interface,
@@ -71,38 +75,43 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
         this.window = (WindowImpl) window;
         ((WindowImpl)this.window).setHandleDestroyNotify(false);
         window.addWindowListener(new WindowAdapter() {
+                @Override
                 public void windowRepaint(WindowUpdateEvent e) {
-                    if( !GLWindow.this.window.isSurfaceLockedByOtherThread() && !GLWindow.this.helper.isExternalAnimatorAnimating() ) {
+                    if( !GLWindow.this.window.isWindowLockedByOtherThread() && !GLWindow.this.helper.isExternalAnimatorAnimating() ) {
                         display();
                     }
                 }
 
+                @Override
                 public void windowResized(WindowEvent e) {
                     sendReshape = true;
-                    if( !GLWindow.this.window.isSurfaceLockedByOtherThread() && !GLWindow.this.helper.isExternalAnimatorAnimating() ) {
+                    if( !GLWindow.this.window.isWindowLockedByOtherThread() && !GLWindow.this.helper.isExternalAnimatorAnimating() ) {
                         display();
                     }
                 }
 
+                @Override
                 public void windowDestroyNotify(WindowEvent e) {
-                    // Is an animator thread perform rendering?
-                    if (GLWindow.this.helper.isExternalAnimatorRunning()) {
-                        // Pause animations before initiating safe destroy.
-                        GLAnimatorControl ctrl = GLWindow.this.helper.getAnimator();
-                        boolean isPaused = ctrl.pause();
-                        destroy();
-                        if(isPaused) {
-                            ctrl.resume();
+                    if( DISPOSE_ON_CLOSE == GLWindow.this.getDefaultCloseOperation() ) {
+                        // Is an animator thread perform rendering?
+                        if (GLWindow.this.helper.isExternalAnimatorRunning()) {
+                            // Pause animations before initiating safe destroy.
+                            GLAnimatorControl ctrl = GLWindow.this.helper.getAnimator();
+                            boolean isPaused = ctrl.pause();
+                            destroy();
+                            if(isPaused) {
+                                ctrl.resume();
+                            }
+                        } else if (GLWindow.this.window.isWindowLockedByOtherThread()) {
+                            // Window is locked by another thread
+                            // Flag that destroy should be performed on the next
+                            // attempt to display.
+                            sendDestroy = true;
+                        } else {
+                            // Without an external thread animating or locking the
+                            // surface, we are safe.
+                            destroy ();
                         }
-                    } else if (GLWindow.this.window.isSurfaceLockedByOtherThread()) {
-                        // Surface is locked by another thread
-                        // Flag that destroy should be performed on the next
-                        // attempt to display.
-                        sendDestroy = true;
-                    } else {
-                        // Without an external thread animating or locking the
-                        // surface, we are safe.
-                        destroy ();
                     }
                 }
             });
@@ -152,6 +161,17 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
     }
 
     //----------------------------------------------------------------------
+    // WindowClosingProtocol implementation
+    //
+    public int getDefaultCloseOperation() {
+        return window.getDefaultCloseOperation();
+    }
+
+    public int setDefaultCloseOperation(int op) {
+        return window.setDefaultCloseOperation(op);
+    }
+
+    //----------------------------------------------------------------------
     // Window Access
     //
 
@@ -231,6 +251,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
         return window.isVisible();
     }
 
+    @Override
     public final String toString() {
         return "NEWT-GLWindow[ \n\tHelper: " + helper + ", \n\tDrawable: " + drawable + 
                ", \n\tContext: " + context + /** ", \n\tWindow: "+window+", \n\tFactory: "+factory+ */ "]";
@@ -283,8 +304,8 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
     // Hide methods here ..
     protected class GLLifecycleHook implements WindowImpl.LifecycleHook {
 
-        class DisposeAction implements Runnable {
-            public void run() {
+        private class DisposeAction implements Runnable {
+            public final void run() {
                 // Lock: Covered by DestroyAction ..
                 helper.dispose(GLWindow.this);
             }
@@ -297,7 +318,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
 
         public synchronized void destroyActionInLock() {
             if(Window.DEBUG_WINDOW_EVENT || Window.DEBUG_IMPLEMENTATION) {
-                String msg = new String("GLWindow.destroy() "+Thread.currentThread()+", start");
+                String msg = "GLWindow.destroy() "+Thread.currentThread()+", start";
                 System.err.println(msg);
                 //Exception e1 = new Exception(msg);
                 //e1.printStackTrace();
@@ -326,7 +347,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
 
         public synchronized void invalidate(boolean unrecoverable) {
             if(Window.DEBUG_WINDOW_EVENT || Window.DEBUG_IMPLEMENTATION) {
-                String msg = new String("GLWindow.invalidate("+unrecoverable+") "+Thread.currentThread()+", start");
+                String msg = "GLWindow.invalidate("+unrecoverable+") "+Thread.currentThread()+", start";
                 System.err.println(msg);
                 //Exception e1 = new Exception(msg);
                 //e1.printStackTrace();
@@ -349,7 +370,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
 
         public synchronized void setVisibleActionPost(boolean visible, boolean nativeWindowCreated) {
             if(Window.DEBUG_WINDOW_EVENT || Window.DEBUG_IMPLEMENTATION) {
-                String msg = new String("GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+Thread.currentThread()+", start");
+                String msg = "GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+Thread.currentThread()+", start";
                 System.err.println(msg);
                 // Exception e1 = new Exception(msg);
                 // e1.printStackTrace();
@@ -373,10 +394,10 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
                     drawable = factory.createGLDrawable(nw);
                 }
                 drawable.setRealized(true);
-                context = drawable.createContext(null);
+                context = drawable.createContext(sharedContext);
             }
             if(Window.DEBUG_WINDOW_EVENT || Window.DEBUG_IMPLEMENTATION) {
-                String msg = new String("GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+Thread.currentThread()+", fin");
+                String msg = "GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+Thread.currentThread()+", fin";
                 System.err.println(msg);
                 //Exception e1 = new Exception(msg);
                 //e1.printStackTrace();
@@ -404,6 +425,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
     // OpenGL-related methods and state
     //
 
+    private GLContext sharedContext = null;
     private GLDrawableFactory factory;
     private GLDrawable drawable;
     private GLContext context;
@@ -419,6 +441,18 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
         return factory;
     }
 
+    /**
+     * Specifies an {@link javax.media.opengl.GLContext OpenGL context} to share with.<br>
+     * At native creation, {@link #setVisible(boolean) setVisible(true)},
+     * a {@link javax.media.opengl.GLDrawable drawable} and {@link javax.media.opengl.GLContext context} is created besides the native Window itself,<br>
+     * hence you shall set the shared context before.
+     *
+     * @param sharedContext The OpenGL context shared by this GLWindow's one
+     */
+    public void setSharedContext(GLContext sharedContext) {
+        this.sharedContext = sharedContext;
+    }
+
     public void setContext(GLContext newCtx) {
         context = newCtx;
     }
@@ -545,8 +579,8 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
         }
     }
 
-    class InitAction implements Runnable {
-        public void run() {
+    private class InitAction implements Runnable {
+        public final void run() {
             // Lock: Locked Surface/Window by MakeCurrent/Release
             helper.init(GLWindow.this);
             resetCounter();
@@ -554,8 +588,8 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
     }
     private InitAction initAction = new InitAction();
 
-    class DisplayAction implements Runnable {
-        public void run() {
+    private class DisplayAction implements Runnable {
+        public final void run() {
             // Lock: Locked Surface/Window by display _and_ MakeCurrent/Release
             if (sendReshape) {
                 helper.reshape(GLWindow.this, 0, 0, getWidth(), getHeight());
@@ -618,15 +652,15 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
     }
 
     /** Reset all counter (startTime, currentTime, frame number) */
-    public synchronized void resetCounter() {
+    public final synchronized void resetCounter() {
         startTime = System.currentTimeMillis(); // overwrite startTime to real init one
         curTime   = startTime;
         lastCheck  = startTime;
         totalFrames = 0; lastFrames = 0;
     }
 
-    class SwapBuffersAction implements Runnable {
-        public void run() {
+    private class SwapBuffersAction implements Runnable {
+        public final void run() {
             drawable.swapBuffers();
         }
     }
@@ -867,9 +901,16 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
         System.err.println(VersionUtil.getPlatformInfo());
         System.err.println(GlueGenVersion.getInstance());
         System.err.println(NativeWindowVersion.getInstance());
-        System.err.print(JoglVersion.getInstance());
+        System.err.println(JoglVersion.getInstance());
         System.err.println(NewtVersion.getInstance());
-        GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault() );
+
+        GLProfile glp = GLProfile.getDefault();
+        GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+        List/*<GLCapabilitiesImmutable>*/ availCaps = factory.getAvailableCapabilities(null);
+        for(int i=0; i<availCaps.size(); i++) {
+            System.err.println(availCaps.get(i));
+        }
+        GLCapabilitiesImmutable caps = new GLCapabilities( glp );
 
         GLWindow glWindow = GLWindow.create(caps);
         glWindow.setSize(128, 128);
@@ -877,7 +918,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
         glWindow.addGLEventListener(new GLEventListener() {
             public void init(GLAutoDrawable drawable) {
                 GL gl = drawable.getGL();
-                System.err.println(JoglVersion.getInstance().toString(gl));
+                System.err.println(JoglVersion.getGLInfo(gl, null));
             }
 
             public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
diff --git a/src/newt/classes/com/jogamp/newt/util/MainThread.java b/src/newt/classes/com/jogamp/newt/util/MainThread.java
index 5b26cfb..8bb725b 100644
--- a/src/newt/classes/com/jogamp/newt/util/MainThread.java
+++ b/src/newt/classes/com/jogamp/newt/util/MainThread.java
@@ -37,16 +37,25 @@
 
 package com.jogamp.newt.util;
 
-import java.util.*;
 import java.lang.reflect.Method;
 import java.lang.reflect.InvocationTargetException;
-import java.security.*;
-
-import javax.media.nativewindow.*;
-
-import com.jogamp.common.util.*;
-import com.jogamp.newt.*;
-import com.jogamp.newt.impl.*;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import javax.media.nativewindow.NativeWindowFactory;
+
+import com.jogamp.common.util.ReflectionUtil;
+import com.jogamp.common.util.RunnableTask;
+import com.jogamp.newt.Display;
+import jogamp.newt.Debug;
+import jogamp.newt.NEWTJNILibLoader;
+import jogamp.newt.awt.AWTEDTUtil;
 
 /**
  * NEWT Utility class MainThread<P>
@@ -82,37 +91,32 @@ import com.jogamp.newt.impl.*;
  * Which starts 4 threads, each with a window and OpenGL rendering.<br>
  */
 public class MainThread implements EDTUtil {
-    private static AccessControlContext localACC = AccessController.getContext();
+    private static final AccessControlContext localACC = AccessController.getContext();
     public static final boolean  MAIN_THREAD_CRITERIA = ( !NativeWindowFactory.isAWTAvailable() &&
                                                            NativeWindowFactory.TYPE_MACOSX.equals(NativeWindowFactory.getNativeWindowType(false)) 
                                                         ) || Debug.getBooleanProperty("newt.MainThread.force", true, localACC);
 
     protected static final boolean DEBUG = Debug.debug("MainThread");
 
-    private static MainThread singletonMainThread = new MainThread(); // one singleton MainThread
+    private static final MainThread singletonMainThread = new MainThread(); // one singleton MainThread
 
     private static boolean isExit=false;
     private static volatile boolean isRunning=false;
-    private static Object taskWorkerLock=new Object();
+    private static final Object taskWorkerLock=new Object();
     private static boolean shouldStop;
     private static ArrayList tasks;
     private static Thread mainThread;
 
     private static Timer pumpMessagesTimer=null;
     private static TimerTask pumpMessagesTimerTask=null;
-    private static Map/*<Display, Runnable>*/ pumpMessageDisplayMap = new HashMap();
+    private static final Map/*<Display, Runnable>*/ pumpMessageDisplayMap = new HashMap();
 
     private static boolean useMainThread = false;
-    private static Class cAWTEventQueue=null;
-    private static Method mAWTInvokeAndWait=null;
-    private static Method mAWTInvokeLater=null;
-    private static Method mAWTIsDispatchThread=null;
 
     static class MainAction extends Thread {
         private String mainClassName;
         private String[] mainClassArgs;
 
-        private Class mainClass;
         private Method mainClassMain;
 
         public MainAction(String mainClassName, String[] mainClassArgs) {
@@ -120,6 +124,7 @@ public class MainThread implements EDTUtil {
             this.mainClassArgs=mainClassArgs;
         }
 
+        @Override
         public void run() {
             if ( useMainThread ) {
                 // we have to start first to provide the service ..
@@ -181,7 +186,7 @@ public class MainThread implements EDTUtil {
         mainAction = new MainAction(mainClassName, mainClassArgs);
 
         if(NativeWindowFactory.TYPE_MACOSX.equals(NativeWindowFactory.getNativeWindowType(false))) {
-            ReflectionUtil.callStaticMethod("com.jogamp.newt.impl.macosx.MacDisplay", "initSingleton", 
+            ReflectionUtil.callStaticMethod("jogamp.newt.macosx.MacDisplay", "initSingleton", 
                 null, null, MainThread.class.getClassLoader());
         }
 
@@ -201,7 +206,7 @@ public class MainThread implements EDTUtil {
         }
     }
 
-    public static final MainThread getSingleton() {
+    public static MainThread getSingleton() {
         return singletonMainThread;
     }
 
@@ -215,55 +220,46 @@ public class MainThread implements EDTUtil {
         if ( useMainThread ) {
             return; // error ?
         }
-        if(null == pumpMessagesTimer) {
-            synchronized (MainThread.class) {
-                if(null == pumpMessagesTimer) {
-                    pumpMessagesTimer = new Timer();
-                    pumpMessagesTimerTask = new TimerTask() {
-                        public void run() {
-                            synchronized(pumpMessageDisplayMap) {
-                                for(Iterator i = pumpMessageDisplayMap.values().iterator(); i.hasNext(); ) {
-                                    ((Runnable) i.next()).run();
-                                }
+        synchronized (pumpMessageDisplayMap) {
+            if(null == pumpMessagesTimer) {
+                pumpMessagesTimer = new Timer();
+                pumpMessagesTimerTask = new TimerTask() {
+                    public void run() {
+                        synchronized(pumpMessageDisplayMap) {
+                            for(Iterator i = pumpMessageDisplayMap.values().iterator(); i.hasNext(); ) {
+                                ((Runnable) i.next()).run();
                             }
                         }
-                    };
-                    pumpMessagesTimer.scheduleAtFixedRate(pumpMessagesTimerTask, 0, defaultEDTPollGranularity);
-                }
+                    }
+                };
+                pumpMessagesTimer.scheduleAtFixedRate(pumpMessagesTimerTask, 0, defaultEDTPollGranularity);
             }
-        }
-        synchronized(pumpMessageDisplayMap) {
             pumpMessageDisplayMap.put(dpy, pumpMessage);
         }
     }
 
-    private void initAWTReflection() {
-        if(null == cAWTEventQueue) {
-            ClassLoader cl = MainThread.class.getClassLoader();
-            cAWTEventQueue = ReflectionUtil.getClass("java.awt.EventQueue", true, cl);
-            mAWTInvokeAndWait = ReflectionUtil.getMethod(cAWTEventQueue, "invokeAndWait", new Class[] { java.lang.Runnable.class }, cl);
-            mAWTInvokeLater = ReflectionUtil.getMethod(cAWTEventQueue, "invokeLater", new Class[] { java.lang.Runnable.class }, cl);
-            mAWTIsDispatchThread = ReflectionUtil.getMethod(cAWTEventQueue, "isDispatchThread", new Class[] { }, cl);
+    final public void reset() {
+        if(NativeWindowFactory.isAWTAvailable()) {
+            AWTEDTUtil.getSingleton().reset();
         }
-    }
-
-    public void reset() {
         // nop
     }
 
-    public void start() {
+    final public void start() {
+        if(NativeWindowFactory.isAWTAvailable()) {
+            AWTEDTUtil.getSingleton().start();
+        }
         // nop
     }
 
-    public boolean isCurrentThreadEDT() {
+    final public boolean isCurrentThreadEDT() {
         if(NativeWindowFactory.isAWTAvailable()) {
-            initAWTReflection();
-            return ((Boolean) ReflectionUtil.callMethod(null, mAWTIsDispatchThread, null) ).booleanValue();
+            return AWTEDTUtil.getSingleton().isCurrentThreadEDT();
         }
         return isRunning() && mainThread == Thread.currentThread() ;
     }
 
-    public boolean isRunning() {
+    final public boolean isRunning() {
         if( useMainThread ) {
             synchronized(taskWorkerLock) { 
                 return isRunning;
@@ -284,11 +280,11 @@ public class MainThread implements EDTUtil {
         }
     }
 
-    public void invokeStop(Runnable r) {
+    final public void invokeStop(Runnable r) {
         invokeImpl(true, r, true);
     }
 
-    public void invoke(boolean wait, Runnable r) {
+    final public void invoke(boolean wait, Runnable r) {
         invokeImpl(wait, r, false);
     }
 
@@ -298,22 +294,7 @@ public class MainThread implements EDTUtil {
         }
 
         if(NativeWindowFactory.isAWTAvailable()) {
-            initAWTReflection();
-
-            // handover to AWT MainThread ..
-            try {
-                if ( ((Boolean) ReflectionUtil.callMethod(null, mAWTIsDispatchThread, null) ).booleanValue() ) {
-                    r.run();
-                    return;
-                }
-                if(wait) {
-                    ReflectionUtil.callMethod(null, mAWTInvokeAndWait, new Object[] { r });
-                } else {
-                    ReflectionUtil.callMethod(null, mAWTInvokeLater, new Object[] { r });
-                }
-            } catch (Exception e) {
-                throw new NativeWindowException(e);
-            }
+            AWTEDTUtil.getSingleton().invokeImpl(wait, r, stop);
             return;
         }
 
@@ -355,10 +336,16 @@ public class MainThread implements EDTUtil {
         }
     }
 
-    public void waitUntilIdle() {
+    final public void waitUntilIdle() {
+        if(NativeWindowFactory.isAWTAvailable()) {
+            AWTEDTUtil.getSingleton().waitUntilIdle();
+        }
     }
 
-    public void waitUntilStopped() {
+    final public void waitUntilStopped() {
+        if(NativeWindowFactory.isAWTAvailable()) {
+            AWTEDTUtil.getSingleton().waitUntilStopped();
+        }
     }
 
     private void waitUntilRunning() {
diff --git a/src/newt/classes/jogamp/newt/Debug.java b/src/newt/classes/jogamp/newt/Debug.java
new file mode 100644
index 0000000..85fbbe7
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/Debug.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.newt;
+
+import java.security.*;
+
+/** Helper routines for logging and debugging. */
+
+public class Debug {
+  // Some common properties
+  private static boolean verbose;
+  private static boolean debugAll;
+  private static AccessControlContext localACC;
+  
+  static {
+    localACC=AccessController.getContext();
+    verbose = isPropertyDefined("newt.verbose", true);
+    debugAll = isPropertyDefined("newt.debug", true);
+    if (verbose) {
+       Package p = Package.getPackage("com.jogamp.newt");
+       System.err.println("NEWT specification version " + p.getSpecificationVersion());
+       System.err.println("NEWT implementation version " + p.getImplementationVersion());
+       System.err.println("NEWT implementation vendor " + p.getImplementationVendor());
+    }
+  }
+
+  static int getIntProperty(final String property, final boolean jnlpAlias) {
+      return getIntProperty(property, jnlpAlias, localACC);
+  }
+
+  public static int getIntProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    int i=0;
+    try {
+        Integer iv = Integer.valueOf(Debug.getProperty(property, jnlpAlias, acc));
+        i = iv.intValue();
+    } catch (NumberFormatException nfe) {}
+    return i;
+  }
+
+  static boolean getBooleanProperty(final String property, final boolean jnlpAlias) {
+    return getBooleanProperty(property, jnlpAlias, localACC);
+  }
+
+  public static boolean getBooleanProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    Boolean b = Boolean.valueOf(Debug.getProperty(property, jnlpAlias, acc));
+    return b.booleanValue();
+  }
+
+  static boolean isPropertyDefined(final String property, final boolean jnlpAlias) {
+    return isPropertyDefined(property, jnlpAlias, localACC);
+  }
+
+  public static boolean isPropertyDefined(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    return (Debug.getProperty(property, jnlpAlias, acc) != null) ? true : false;
+  }
+
+  static String getProperty(final String property, final boolean jnlpAlias) {
+    return getProperty(property, jnlpAlias, localACC);
+  }
+
+  public static String getProperty(final String property, final boolean jnlpAlias, final AccessControlContext acc) {
+    String s=null;
+    if(null!=acc && acc.equals(localACC)) {
+        s = (String) AccessController.doPrivileged(new PrivilegedAction() {
+            public Object run() {
+              String val=null;
+              try {
+                  val = System.getProperty(property);
+              } catch (Exception e) {}
+              if(null==val && jnlpAlias && !property.startsWith(jnlp_prefix)) {
+                  try {
+                      val = System.getProperty(jnlp_prefix + property);
+                  } catch (Exception e) {}
+              }
+              return val;
+            }
+          });
+    } else {
+        try {
+            s = System.getProperty(property);
+        } catch (Exception e) {}
+        if(null==s && jnlpAlias && !property.startsWith(jnlp_prefix)) {
+            try {
+                s = System.getProperty(jnlp_prefix + property);
+            } catch (Exception e) {}
+        }
+    }
+    return s;
+  }
+  public static final String jnlp_prefix = "jnlp." ;
+
+  public static boolean verbose() {
+    return verbose;
+  }
+
+  public static boolean debugAll() {
+    return debugAll;
+  }
+
+  public static boolean debug(String subcomponent) {
+    return debugAll() || isPropertyDefined("newt.debug." + subcomponent, true);
+  }
+}
diff --git a/src/newt/classes/jogamp/newt/DefaultEDTUtil.java b/src/newt/classes/jogamp/newt/DefaultEDTUtil.java
new file mode 100644
index 0000000..3b14f30
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/DefaultEDTUtil.java
@@ -0,0 +1,335 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package jogamp.newt;
+
+import java.util.ArrayList;
+import javax.media.nativewindow.NativeWindowException;
+import com.jogamp.common.util.RunnableTask;
+import com.jogamp.newt.util.EDTUtil;
+
+public class DefaultEDTUtil implements EDTUtil {
+    public static final boolean DEBUG = Debug.debug("EDT");
+
+    private ThreadGroup threadGroup; 
+    private EventDispatchThread edt = null;
+    private Object edtLock = new Object(); // locking the EDT start/stop state
+    private String name;
+    int start_iter=0;
+    private Runnable dispatchMessages;
+
+    public DefaultEDTUtil(ThreadGroup tg, String name, Runnable dispatchMessages) {
+        this.threadGroup = tg;
+        this.name=Thread.currentThread().getName()+"-"+name+"-EDT-";
+        this.dispatchMessages=dispatchMessages;
+        this.edt = new EventDispatchThread(threadGroup, name);
+        this.edt.setDaemon(true); // don't stop JVM from shutdown ..
+    }
+
+    public final void reset() {
+        synchronized(edtLock) { 
+            waitUntilStopped();
+            if(DEBUG) {
+                if(edt.tasks.size()>0) {
+                    String msg = Thread.currentThread()+": EDT reset, remaining tasks: "+edt.tasks.size()+" - "+edt;
+                    System.err.println(msg);
+                    // Throwable t = new Throwable(msg);
+                    // t.printStackTrace();
+                }
+                System.err.println(Thread.currentThread()+": EDT reset - edt: "+edt);
+            }
+            this.edt = new EventDispatchThread(threadGroup, name);
+            this.edt.setDaemon(true); // don't stop JVM from shutdown ..
+        }
+    }
+
+    public final void start() {
+        synchronized(edtLock) { 
+            if(!edt.isRunning() && !edt.shouldStop) {
+                if(edt.isAlive()) {
+                    throw new RuntimeException("EDT Thread.isAlive(): true, isRunning: "+edt.isRunning()+", edt: "+edt+", tasks: "+edt.tasks.size());
+                }
+                start_iter++;
+                edt.setName(name+start_iter);
+                edt.shouldStop = false;
+                if(DEBUG) {
+                    String msg = Thread.currentThread()+": EDT START - edt: "+edt;
+                    System.err.println(msg);
+                    // Throwable t = new Throwable(msg);
+                    // t.printStackTrace();
+                }
+                edt.start();
+            }
+        }
+    }
+
+    public final boolean isCurrentThreadEDT() {
+        return edt == Thread.currentThread();
+    }
+
+    public final boolean isRunning() {
+        return edt.isRunning() ;
+    }
+
+    public final void invokeStop(Runnable task) {
+        invokeImpl(true, task, true);
+    }
+
+    public final void invoke(boolean wait, Runnable task) {
+        invokeImpl(wait, task, false);
+    }
+
+    private void invokeImpl(boolean wait, Runnable task, boolean stop) {
+        if(task == null) {
+            throw new RuntimeException("Null Runnable");
+        }
+        Throwable throwable = null;
+        RunnableTask rTask = null;
+        Object rTaskLock = new Object();
+        synchronized(rTaskLock) { // lock the optional task execution
+            synchronized(edtLock) { // lock the EDT status
+                if( edt.shouldStop ) {
+                    // drop task ..
+                    if(DEBUG) {
+                        Throwable t = new Throwable("Warning: EDT about (1) to stop, won't enqueue new task: "+edt);
+                        t.printStackTrace();
+                    }
+                    return; 
+                }
+                // Exception ee = new Exception("XXX stop: "+stop+", tasks: "+edt.tasks.size()+", task: "+task);
+                // ee.printStackTrace();
+                if(stop) {
+                    edt.shouldStop = true;
+                    if(DEBUG) {
+                        String msg = Thread.currentThread()+": EDT signal STOP (on edt: "+isCurrentThreadEDT()+") - edt: "+edt;
+                        System.err.println(msg);
+                        // Throwable t = new Throwable(msg);
+                        // t.printStackTrace();
+                    }
+                }
+                if( isCurrentThreadEDT() ) {
+                    task.run();
+                    wait = false; // running in same thread (EDT) -> no wait
+                    if(stop && edt.tasks.size()>0) {
+                        String msg = "Warning: EDT about (2) to stop, having remaining tasks: "+edt.tasks.size()+" - "+edt;
+                        if(DEBUG) {
+                            Throwable t = new Throwable(msg);
+                            t.printStackTrace();
+                        } else {
+                            System.err.println(msg);
+                        }
+                    }
+                } else {
+                    synchronized(edt.tasks) {
+                        start(); // start if not started yet and !shouldStop
+                        wait = wait && edt.isRunning();
+                        rTask = new RunnableTask(task,
+                                                 wait ? rTaskLock : null,
+                                                 true /* always catch and report Exceptions, don't disturb EDT */);
+                        if(stop) {
+                            rTask.setAttachment(new Boolean(true)); // mark final task
+                        }
+                        // append task ..
+                        edt.tasks.add(rTask);
+                        edt.tasks.notifyAll();
+                    }
+                }
+            }
+            if( wait ) {
+                try {
+                    rTaskLock.wait(); // free lock, allow execution of rTask
+                } catch (InterruptedException ie) {
+                    throwable = ie;
+                }
+                if(null==throwable) {
+                    throwable = rTask.getThrowable();
+                }
+                if(null!=throwable) {
+                    if(throwable instanceof NativeWindowException) {
+                        throw (NativeWindowException)throwable;
+                    }
+                    throw new RuntimeException(throwable);
+                }
+            }
+        }
+        if(DEBUG && stop) {
+            System.err.println(Thread.currentThread()+": EDT signal STOP X edt: "+edt);
+        }
+    }
+
+    final public void waitUntilIdle() {
+        final EventDispatchThread _edt;
+        synchronized(edtLock) {
+            _edt = edt;
+        }
+        if(!_edt.isRunning() || _edt == Thread.currentThread()) {
+            return;
+        }
+        synchronized(_edt.tasks) {
+            while(_edt.isRunning() && _edt.tasks.size()>0) {
+                try {
+                    _edt.tasks.notifyAll();
+                    _edt.tasks.wait();
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    final public void waitUntilStopped() {
+        synchronized(edtLock) {
+            if(edt.isRunning() && edt != Thread.currentThread() ) {
+                while(edt.isRunning()) {
+                    try {
+                        edtLock.wait();
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+    }
+
+    class EventDispatchThread extends Thread {
+        volatile boolean shouldStop = false;
+        volatile boolean isRunning = false;
+        ArrayList tasks = new ArrayList(); // one shot tasks
+
+        public EventDispatchThread(ThreadGroup tg, String name) {
+            super(tg, name);
+        }
+
+        final public boolean isRunning() {
+            return isRunning;
+        }
+
+        @Override
+        final public void start() throws IllegalThreadStateException {
+            isRunning = true;
+            super.start();
+        }
+
+        /** 
+         * Utilizing locking only on tasks and its execution,
+         * not for event dispatching.
+         */
+        @Override
+        final public void run() {
+            if(DEBUG) {
+                System.err.println(getName()+": EDT run() START "+ getName());
+            }
+            RuntimeException error = null;
+            try {
+                do {
+                    // event dispatch
+                    if(!shouldStop) {
+                        dispatchMessages.run();
+                    }
+                    // wait and work on tasks
+                    RunnableTask task = null;
+                    synchronized(tasks) {
+                        // wait for tasks
+                        if(!shouldStop && tasks.size()==0) {
+                            try {
+                                tasks.wait(defaultEDTPollGranularity);
+                            } catch (InterruptedException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                        // execute one task, if available
+                        if(tasks.size()>0) {
+                            task = (RunnableTask) tasks.remove(0);
+                            tasks.notifyAll();
+                        }
+                    }
+                    if(null!=task) {
+                        // Exceptions are always catched, see RunnableTask creation above
+                        task.run();
+                    }
+                } while(!shouldStop) ;
+            } catch (Throwable t) {
+                // handle errors ..
+                shouldStop = true;
+                if(t instanceof RuntimeException) {
+                    error = (RuntimeException) t;
+                } else {
+                    error = new RuntimeException("Within EDT", t);
+                }
+            } finally {
+                if(DEBUG) {
+                    RunnableTask rt = ( tasks.size() > 0 ) ? (RunnableTask) tasks.get(0) : null ;
+                    System.err.println(getName()+": EDT run() END "+ getName()+", tasks: "+tasks.size()+", "+rt+", "+error); 
+                }
+                synchronized(edtLock) {
+                    if(null==error) {
+                        synchronized(tasks) {
+                            // drain remaining tasks (stop not on EDT), 
+                            // while having tasks and no previous-task, or previous-task is non final
+                            RunnableTask task = null;
+                            while ( ( null == task || task.getAttachment() == null ) && tasks.size() > 0 ) {
+                                task = ( RunnableTask ) tasks.remove(0);
+                                task.run();
+                                tasks.notifyAll();
+                            }
+                            if(DEBUG) {
+                                if(null!=task && task.getAttachment()==null) {
+                                    Throwable t = new Throwable("Warning: EDT exit: Last task Not Final: "+tasks.size()+", "+task+" - "+edt);
+                                    t.printStackTrace();
+                                } else if(tasks.size()>0) {
+                                    Throwable t = new Throwable("Warning: EDT exit: Remaining tasks Post Final: "+tasks.size());
+                                    t.printStackTrace();
+                                }
+                            }
+                        }
+                    }
+                    isRunning = !shouldStop;
+                    if(!isRunning) {
+                        edtLock.notifyAll();
+                    }
+                }
+                if(DEBUG) {
+                    System.err.println(getName()+": EDT run() EXIT "+ getName()+", "+error);
+                }
+                if(null!=error) {
+                    throw error;
+                }
+            }
+        }
+    }
+}
+
diff --git a/src/newt/classes/jogamp/newt/DisplayImpl.java b/src/newt/classes/jogamp/newt/DisplayImpl.java
new file mode 100644
index 0000000..299f4fb
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/DisplayImpl.java
@@ -0,0 +1,452 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt;
+
+import com.jogamp.newt.Display;
+import com.jogamp.newt.NewtFactory;
+import com.jogamp.newt.event.NEWTEvent;
+import com.jogamp.newt.event.NEWTEventConsumer;
+import jogamp.newt.event.NEWTEventTask;
+import com.jogamp.newt.util.EDTUtil;
+import com.jogamp.newt.util.MainThread;
+import java.util.ArrayList;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.NativeWindowFactory;
+
+public abstract class DisplayImpl extends Display {
+    public static final boolean DEBUG_TEST_EDT_MAINTHREAD = Debug.isPropertyDefined("newt.test.EDTMainThread", true); // JAU EDT Test ..
+
+    private static int serialno = 1;
+
+    private static Class getDisplayClass(String type) 
+        throws ClassNotFoundException 
+    {
+        Class displayClass = NewtFactory.getCustomClass(type, "Display");
+        if(null==displayClass) {
+            if (NativeWindowFactory.TYPE_EGL.equals(type)) {
+                displayClass = Class.forName("jogamp.newt.opengl.kd.KDDisplay");
+            } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
+                displayClass = Class.forName("jogamp.newt.windows.WindowsDisplay");
+            } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
+                displayClass = Class.forName("jogamp.newt.macosx.MacDisplay");
+            } else if (NativeWindowFactory.TYPE_X11.equals(type)) {
+                displayClass = Class.forName("jogamp.newt.x11.X11Display");
+            } else if (NativeWindowFactory.TYPE_AWT.equals(type)) {
+                displayClass = Class.forName("jogamp.newt.awt.AWTDisplay");
+            } else {
+                throw new RuntimeException("Unknown display type \"" + type + "\"");
+            }
+        }
+        return displayClass;
+    }
+
+    /** Make sure to reuse a Display with the same name */
+    public static Display create(String type, String name, final long handle, boolean reuse) {
+        try {
+            Class displayClass = getDisplayClass(type);
+            DisplayImpl display = (DisplayImpl) displayClass.newInstance();
+            name = display.validateDisplayName(name, handle);
+            synchronized(displayList) {
+                if(reuse) {
+                    Display display0 = Display.getLastDisplayOf(type, name, -1);
+                    if(null != display0) {
+                        if(DEBUG) {
+                            System.err.println("Display.create() REUSE: "+display0+" "+getThreadName());
+                        }
+                        return display0;
+                    }
+                }
+                display.name = name;
+                display.type=type;
+                display.destroyWhenUnused=false;
+                display.refCount=0;
+                display.id = serialno++;
+                display.fqname = getFQName(display.type, display.name, display.id);
+                display.hashCode = display.fqname.hashCode();
+                displayList.add(display);
+            }
+            display.createEDTUtil();
+            if(DEBUG) {
+                System.err.println("Display.create() NEW: "+display+" "+getThreadName());
+            }
+            return display;
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final DisplayImpl other = (DisplayImpl) obj;
+        if (this.id != other.id) {
+            return false;
+        }
+        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
+            return false;
+        }
+        if ((this.type == null) ? (other.type != null) : !this.type.equals(other.type)) {
+            return false;
+        }
+        return true;
+    }
+
+    public int hashCode() {
+        return hashCode;
+    }
+
+    public  synchronized final void createNative()
+        throws NativeWindowException
+    {
+        if(null==aDevice) {
+            if(DEBUG) {
+                System.err.println("Display.createNative() START ("+getThreadName()+", "+this+")");
+            }
+            final DisplayImpl f_dpy = this;
+            try {
+                runOnEDTIfAvail(true, new Runnable() {
+                    public void run() {
+                        f_dpy.createNativeImpl();
+                    }});
+            } catch (Throwable t) {
+                throw new NativeWindowException(t);
+            }
+            if(null==aDevice) {
+                throw new NativeWindowException("Display.createNative() failed to instanciate an AbstractGraphicsDevice");
+            }
+            if(DEBUG) {
+                System.err.println("Display.createNative() END ("+getThreadName()+", "+this+")");
+            }
+            synchronized(displayList) {
+                displaysActive++;
+            }
+        }
+    }
+
+    protected boolean shallRunOnEDT() { 
+        return true; 
+    }
+
+    protected void createEDTUtil() {
+        if(NewtFactory.useEDT()) {
+            if ( ! DEBUG_TEST_EDT_MAINTHREAD ) {
+                Thread current = Thread.currentThread();
+                edtUtil = new DefaultEDTUtil(current.getThreadGroup(), "Display-"+getFQName(), dispatchMessagesRunnable);
+            } else {
+                // Begin JAU EDT Test ..
+                MainThread.addPumpMessage(this, dispatchMessagesRunnable); 
+                edtUtil = MainThread.getSingleton();
+                // End JAU EDT Test ..
+            }
+            if(DEBUG) {
+                System.err.println("Display.createNative("+getFQName()+") Create EDTUtil: "+edtUtil.getClass().getName());
+            }
+        }
+    }
+
+    public final EDTUtil getEDTUtil() {
+        return edtUtil;
+    }
+
+    private void stopEDT(final Runnable task) {
+        if( shallRunOnEDT() && null!=edtUtil ) {
+            edtUtil.invokeStop(task);
+        } else {
+            task.run();
+        }
+    }
+
+    public void runOnEDTIfAvail(boolean wait, final Runnable task) {
+        if( shallRunOnEDT() && null!=edtUtil && !edtUtil.isCurrentThreadEDT()) {
+            edtUtil.invoke(wait, task);
+        } else {
+            task.run();
+        }
+    }
+
+    public boolean validateEDT() {
+        if(0==refCount && null==aDevice && null != edtUtil && edtUtil.isRunning()) {
+            stopEDT( new Runnable() {
+                public void run() {
+                    // nop
+                }
+            } );
+            edtUtil.waitUntilStopped();
+            edtUtil.reset();
+            return true;
+        }
+        return false;
+    }
+
+    public synchronized final void destroy() {
+        if(DEBUG) {
+            dumpDisplayList("Display.destroy("+getFQName()+") BEGIN");
+        }
+        synchronized(displayList) {
+            displayList.remove(this);
+            if(0 < displaysActive) {
+                displaysActive--;
+            }
+        }
+        if(DEBUG) {
+            System.err.println("Display.destroy(): "+this+" "+getThreadName());
+        }
+        final AbstractGraphicsDevice f_aDevice = aDevice;
+        final DisplayImpl f_dpy = this;
+        stopEDT( new Runnable() {
+            public void run() {
+                if ( null != f_aDevice ) {
+                    f_dpy.closeNativeImpl();
+                }
+            }
+        } );
+        if(null!=edtUtil) {
+            if ( DEBUG_TEST_EDT_MAINTHREAD ) {
+                MainThread.removePumpMessage(this); // JAU EDT Test ..
+            }
+            edtUtil.waitUntilStopped();
+            edtUtil.reset();
+        }
+        aDevice = null;
+        refCount=0;
+        if(DEBUG) {
+            dumpDisplayList("Display.destroy("+getFQName()+") END");
+        }
+    }
+
+    public synchronized final int addReference() {
+        if(DEBUG) {
+            System.err.println("Display.addReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount+1));
+        }
+        if ( 0 == refCount ) {
+            createNative();
+        }
+        if(null == aDevice) {
+            throw new NativeWindowException ("Display.addReference() (refCount "+refCount+") null AbstractGraphicsDevice");
+        }
+        return refCount++;
+    }
+
+
+    public synchronized final int removeReference() {
+        if(DEBUG) {
+            System.err.println("Display.removeReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount-1));
+        }
+        refCount--; // could become < 0, in case of manual destruction without actual creation/addReference
+        if(0>=refCount) {
+            destroy();
+            refCount=0; // fix < 0
+        }
+        return refCount;
+    }
+
+    public synchronized final int getReferenceCount() {
+        return refCount;
+    }
+
+    protected abstract void createNativeImpl();
+    protected abstract void closeNativeImpl();
+
+    public final int getId() {
+        return id;
+    }
+
+    public final String getType() {
+        return type;
+    }
+
+    public final String getName() {
+        return name;
+    }
+
+    public final String getFQName() {
+        return fqname;
+    }
+
+    public static final String nilString = "nil" ;
+
+    public String validateDisplayName(String name, long handle) {
+        if(null==name && 0!=handle) {
+            name="wrapping-"+toHexString(handle);
+        }
+        return ( null == name ) ? nilString : name ;
+    }
+
+    private static String getFQName(String type, String name, int id) {
+        if(null==type) type=nilString;
+        if(null==name) name=nilString;
+        StringBuilder sb = new StringBuilder();
+        sb.append(type);
+        sb.append("_");
+        sb.append(name);
+        sb.append("-");
+        sb.append(id);
+        return sb.toString().intern();
+    }
+
+    public final long getHandle() {
+        if(null!=aDevice) {
+            return aDevice.getHandle();
+        }
+        return 0;
+    }
+
+    public final AbstractGraphicsDevice getGraphicsDevice() {
+        return aDevice;
+    }
+
+    public final boolean isNativeValid() {
+        return null != aDevice;
+    }
+
+    public boolean isEDTRunning() {
+        if(null!=edtUtil) {
+            return edtUtil.isRunning();
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        return "NEWT-Display["+getFQName()+", refCount "+refCount+", hasEDT "+(null!=edtUtil)+", edtRunning "+isEDTRunning()+", "+aDevice+"]";
+    }
+
+    protected abstract void dispatchMessagesNative();
+
+    private Object eventsLock = new Object();
+    private ArrayList/*<NEWTEvent>*/ events = new ArrayList();
+    private volatile boolean haveEvents = false;
+
+    class DispatchMessagesRunnable implements Runnable {
+        public void run() {
+            DisplayImpl.this.dispatchMessages();
+        }
+    }
+    DispatchMessagesRunnable dispatchMessagesRunnable = new DispatchMessagesRunnable();
+
+    final void dispatchMessage(final NEWTEventTask eventTask) {
+        NEWTEvent event = eventTask.get();
+        Object source = event.getSource();
+        if(source instanceof NEWTEventConsumer) {
+            NEWTEventConsumer consumer = (NEWTEventConsumer) source ;
+            if(!consumer.consumeEvent(event)) {
+                // enqueue for later execution
+                enqueueEvent(false, event);
+            }
+        } else {
+            throw new RuntimeException("Event source not NEWT: "+source.getClass().getName()+", "+source);
+        }
+        eventTask.notifyIssuer();        
+    }
+    
+    public void dispatchMessages() {
+        // System.err.println("Display.dispatchMessages() 0 "+this+" "+getThreadName());
+        if(0==refCount) return; // no screens 
+        if(null==getGraphicsDevice()) return; // no native device
+
+        ArrayList/*<NEWTEvent>*/ _events = null;
+
+        if(haveEvents) { // volatile: ok
+            synchronized(eventsLock) {
+                if(haveEvents) {
+                    // swap events list to free ASAP
+                    _events = events;
+                    events = new ArrayList();
+                    haveEvents = false;
+                }
+                eventsLock.notifyAll();
+            }
+            if( null != _events ) {
+                for (int i=0; i < _events.size(); i++) {
+                    dispatchMessage((NEWTEventTask) _events.get(i));
+                }
+            }
+        }
+
+        // System.err.println("Display.dispatchMessages() NATIVE "+this+" "+getThreadName());
+        dispatchMessagesNative();
+    }
+
+    public void enqueueEvent(boolean wait, NEWTEvent e) {
+        if(!isEDTRunning()) {
+            // oops .. we are already dead
+            if(DEBUG) {
+                Throwable t = new Throwable("Warning: EDT already stopped: wait:="+wait+", "+e);
+                t.printStackTrace();
+            }
+            return;
+        }
+        
+        // can't wait if we are on EDT -> consume right away
+        if(wait && edtUtil.isCurrentThreadEDT()) {
+            dispatchMessage(new NEWTEventTask(e, null));
+            return;
+        }
+        
+        Object lock = new Object();
+        NEWTEventTask eTask = new NEWTEventTask(e, wait?lock:null);
+        synchronized(lock) {
+            synchronized(eventsLock) {
+                events.add(eTask);
+                haveEvents = true;
+                eventsLock.notifyAll();
+            }
+            if( wait ) {
+                try {
+                    lock.wait();
+                } catch (InterruptedException ie) {
+                    throw new RuntimeException(ie);
+                }
+            }
+        }
+    }
+
+    protected EDTUtil edtUtil = null;
+    protected int id;
+    protected String name;
+    protected String type;
+    protected String fqname;
+    protected int hashCode;
+    protected int refCount; // number of Display references by Screen
+    protected boolean destroyWhenUnused;
+    protected AbstractGraphicsDevice aDevice;
+}
+
diff --git a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
new file mode 100644
index 0000000..7b89398
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package jogamp.newt;
+
+// FIXME: refactor Java SE dependencies
+//import java.awt.Toolkit;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashSet;
+import com.jogamp.common.jvm.JNILibLoaderBase;
+
+public class NEWTJNILibLoader extends JNILibLoaderBase {
+  
+  public static void loadNEWT() {
+    AccessController.doPrivileged(new PrivilegedAction() {
+      public Object run() {
+        loadLibrary("newt", null, true);
+        return null;
+      }
+    });
+  }
+
+}
diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java
new file mode 100644
index 0000000..a79b1a5
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.util.Point;
+
+public class OffscreenWindow extends WindowImpl implements SurfaceChangeable {
+
+    long surfaceHandle = 0;
+
+    public OffscreenWindow() {
+    }
+
+    static long nextWindowHandle = 0x100; // start here - a marker
+
+    protected void createNativeImpl() {
+        if(0!=getParentWindowHandle()) {
+            throw new NativeWindowException("OffscreenWindow does not support window parenting");
+        }
+        if(capsRequested.isOnscreen()) {
+            throw new NativeWindowException("Capabilities is onscreen");
+        }
+        AbstractGraphicsScreen aScreen = getScreen().getGraphicsScreen();
+        config = GraphicsConfigurationFactory.getFactory(aScreen.getDevice()).chooseGraphicsConfiguration(
+                capsRequested, capsRequested, capabilitiesChooser, aScreen);
+        if (config == null) {
+            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+        }
+
+        synchronized(OffscreenWindow.class) {
+            setWindowHandle(nextWindowHandle++);
+        }
+    }
+
+    protected void closeNativeImpl() {
+        // nop
+    }
+
+    @Override
+    protected void invalidate(boolean unrecoverable) {
+        super.invalidate(unrecoverable);
+        surfaceHandle = 0;
+    }
+
+    @Override
+    public synchronized void destroy() {
+        super.destroy();
+        surfaceHandle = 0;
+    }
+
+    public void setSurfaceHandle(long handle) {
+        surfaceHandle = handle ;
+    }
+
+    @Override
+    public long getSurfaceHandle() {
+        return surfaceHandle;
+    }
+
+    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
+        sizeChanged(width, height, false);
+        visibleChanged(visible);
+    }
+
+    protected void requestFocusImpl(boolean reparented) {
+    }
+
+    @Override
+    public void setSize(int width, int height) {
+        if(!visible) {
+            sizeChanged(width, height, false);
+        }
+    }
+    @Override
+    public void setPosition(int x, int y) {
+        // nop
+    }
+    @Override
+    public boolean setFullscreen(boolean fullscreen) {
+        // nop
+        return false;
+    }
+    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, boolean parentChange, int fullScreenChange, int decorationChange) {
+        shouldNotCallThis();
+        return false;
+    }
+
+    @Override
+    public Point getLocationOnScreen(Point storage) {
+     if(null!=storage) {
+        storage.setX(0);
+        storage.setY(0);
+        return storage;
+     }
+     return new Point(0,0);
+    }
+
+    protected Point getLocationOnScreenImpl(int x, int y) {
+        return new Point(x,y);
+    }
+}
+
diff --git a/src/newt/classes/jogamp/newt/ScreenImpl.java b/src/newt/classes/jogamp/newt/ScreenImpl.java
new file mode 100644
index 0000000..065cd88
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/ScreenImpl.java
@@ -0,0 +1,524 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt;
+
+import com.jogamp.common.util.ArrayHashSet;
+import com.jogamp.common.util.IntIntHashMap;
+import com.jogamp.newt.Display;
+import com.jogamp.newt.NewtFactory;
+import com.jogamp.newt.Screen;
+import com.jogamp.newt.ScreenMode;
+import com.jogamp.newt.event.ScreenModeListener;
+import com.jogamp.newt.util.ScreenModeUtil;
+
+import javax.media.nativewindow.*;
+
+import java.security.*;
+import java.util.ArrayList;
+import java.util.List;
+
+public abstract class ScreenImpl extends Screen implements ScreenModeListener {
+    protected static final boolean DEBUG_TEST_SCREENMODE_DISABLED = Debug.isPropertyDefined("newt.test.Screen.disableScreenMode", true);
+
+    protected DisplayImpl display;
+    protected int screen_idx;
+    protected String fqname;
+    protected int hashCode;
+    protected AbstractGraphicsScreen aScreen;
+    protected int refCount; // number of Screen references by Window
+    protected int width=-1, height=-1; // detected values: set using setScreenSize
+    protected static int usrWidth=-1, usrHeight=-1; // property values: newt.ws.swidth and newt.ws.sheight
+    private static AccessControlContext localACC = AccessController.getContext();
+    private List/*<ScreenModeListener>*/ referencedScreenModeListener = new ArrayList();
+    long t0; // creationTime
+
+    private static Class getScreenClass(String type) 
+    throws ClassNotFoundException 
+    {
+        Class screenClass = NewtFactory.getCustomClass(type, "Screen");
+        if(null==screenClass) {
+            if (NativeWindowFactory.TYPE_EGL.equals(type)) {
+                screenClass = Class.forName("jogamp.newt.opengl.kd.KDScreen");
+            } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
+                screenClass = Class.forName("jogamp.newt.windows.WindowsScreen");
+            } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
+                screenClass = Class.forName("jogamp.newt.macosx.MacScreen");
+            } else if (NativeWindowFactory.TYPE_X11.equals(type)) {
+                screenClass = Class.forName("jogamp.newt.x11.X11Screen");
+            } else if (NativeWindowFactory.TYPE_AWT.equals(type)) {
+                screenClass = Class.forName("jogamp.newt.awt.AWTScreen");
+            } else {
+                throw new RuntimeException("Unknown window type \"" + type + "\"");
+            }
+        }
+        return screenClass;
+    }
+
+    public static Screen create(Display display, final int idx) {
+        try {
+            if(usrWidth<0 || usrHeight<0) {
+                synchronized (Screen.class) {
+                    if(usrWidth<0 || usrHeight<0) {
+                        usrWidth  = Debug.getIntProperty("newt.ws.swidth", true, localACC);
+                        usrHeight = Debug.getIntProperty("newt.ws.sheight", true, localACC);
+                        if(usrWidth>0 || usrHeight>0) {
+                            System.err.println("User screen size "+usrWidth+"x"+usrHeight);
+                        }
+                    }
+                }
+            }
+            synchronized(screenList) {
+                {
+                    Screen screen0 = ScreenImpl.getLastScreenOf(display, idx, -1);
+                    if(null != screen0) {
+                        if(DEBUG) {
+                            System.err.println("Screen.create() REUSE: "+screen0+" "+Display.getThreadName());
+                        }
+                        return screen0;
+                    }
+                }
+                Class screenClass = getScreenClass(display.getType());
+                ScreenImpl screen  = (ScreenImpl) screenClass.newInstance();
+                screen.display = (DisplayImpl) display;
+                screen.screen_idx = idx;
+                screen.fqname = (display.getFQName()+idx).intern();
+                screen.hashCode = screen.fqname.hashCode();
+                screenList.add(screen);
+                if(DEBUG) {
+                    System.err.println("Screen.create() NEW: "+screen+" "+Display.getThreadName());
+                }
+                return screen;
+            }            
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final ScreenImpl other = (ScreenImpl) obj;
+        if (this.display != other.display && (this.display == null || !this.display.equals(other.display))) {
+            return false;
+        }
+        if (this.screen_idx != other.screen_idx) {
+            return false;
+        }
+        return true;
+    }
+
+    public int hashCode() {
+        return hashCode;
+    }
+
+    public synchronized final void createNative()
+            throws NativeWindowException
+    {
+        if(null == aScreen) {
+            if(DEBUG) {
+                System.err.println("Screen.createNative() START ("+DisplayImpl.getThreadName()+", "+this+")");
+            }
+            t0 = System.currentTimeMillis();
+            display.addReference();
+            createNativeImpl();
+            if(null == aScreen) {
+                throw new NativeWindowException("Screen.createNative() failed to instanciate an AbstractGraphicsScreen");
+            }
+            if(DEBUG) {
+                System.err.println("Screen.createNative() END ("+DisplayImpl.getThreadName()+", "+this+")");
+            }
+            synchronized(screenList) {
+                screensActive++;
+            }
+        }
+        initScreenModeStatus();
+    }
+
+    public synchronized final void destroy() {
+        releaseScreenModeStatus();
+
+        synchronized(screenList) {
+            screenList.remove(this);
+            if(0 < screensActive) {
+                screensActive--;
+            }
+        }
+
+        if ( null != aScreen ) {
+            closeNativeImpl();
+            aScreen = null;
+        }
+        refCount = 0;
+        display.removeReference();
+    }
+
+    public synchronized final int addReference() throws NativeWindowException {
+        if(DEBUG) {
+            System.err.println("Screen.addReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount+1));
+        }
+        if ( 0 == refCount ) {
+            createNative();
+        }
+        if(null == aScreen) {
+            throw new NativeWindowException("Screen.addReference() (refCount "+refCount+") null AbstractGraphicsScreen");
+        }
+        return ++refCount;
+    }
+
+    public synchronized final int removeReference() {
+        if(DEBUG) {
+            String msg = "Screen.removeReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount-1);
+            // Throwable t = new Throwable(msg);
+            // t.printStackTrace();
+            System.err.println(msg);
+        }
+        refCount--; // could become < 0, in case of manual destruction without actual creation/addReference
+        if(0>=refCount) {
+            destroy();
+            refCount=0; // fix < 0
+        }
+        return refCount;
+    }
+
+    public synchronized final int getReferenceCount() {
+        return refCount;
+    }
+
+    protected abstract void createNativeImpl();
+    protected abstract void closeNativeImpl();
+
+    public final String getFQName() {
+        return fqname;
+    }
+
+    protected void setScreenSize(int w, int h) {
+        System.err.println("Detected screen size "+w+"x"+h);
+        width=w; height=h;
+    }
+
+    public final Display getDisplay() {
+        return display;
+    }
+
+    public final int getIndex() {
+        return screen_idx;
+    }
+
+    public final AbstractGraphicsScreen getGraphicsScreen() {
+        return aScreen;
+    }
+
+    public final boolean isNativeValid() {
+        return null != aScreen;
+    }
+
+    public final int getWidth() {
+        return (usrWidth>0) ? usrWidth : (width>0) ? width : 480;
+    }
+
+    public final int getHeight() {
+        return (usrHeight>0) ? usrHeight : (height>0) ? height : 480;
+    }
+
+    @Override
+    public String toString() {
+        return "NEWT-Screen["+getFQName()+", idx "+screen_idx+", refCount "+refCount+", "+getWidth()+"x"+getHeight()+", "+aScreen+", "+display+"]";
+    }
+
+    public final List/*<ScreenMode>*/ getScreenModes() {
+        ArrayHashSet screenModes = getScreenModesOrig();
+        if(null != screenModes && 0 < screenModes.size()) {
+            return screenModes.toArrayList();
+        }
+        return null;
+    }
+
+    public ScreenMode getOriginalScreenMode() {
+        ScreenModeStatus sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
+        return ( null != sms ) ? sms.getOriginalScreenMode() : null ;
+    }
+
+    public ScreenMode getCurrentScreenMode() {
+        ScreenMode smU = null;
+        ScreenModeStatus sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
+        if(null != sms) {
+            ScreenMode sm0 = ( DEBUG_TEST_SCREENMODE_DISABLED ) ? null : getCurrentScreenModeImpl();
+            if(null == sm0) {
+                return null;
+            }
+            sms.lock();
+            try {
+                smU = (ScreenMode) sms.getScreenModes().get(sm0); // unify via value hash
+                if(null == smU) {
+                    throw new RuntimeException(sm0+" could not be hashed from ScreenMode list");
+                }
+
+                // if mode has changed somehow, update it ..
+                if( sms.getCurrentScreenMode().hashCode() != smU.hashCode() ) {
+                    sms.fireScreenModeChanged(smU, true);
+                }
+            } finally {
+                sms.unlock();
+            }
+        }
+        return smU;
+    }
+
+    public boolean setCurrentScreenMode(ScreenMode screenMode) {
+        ScreenMode smU = (ScreenMode) getScreenModesOrig().get(screenMode); // unify via value hash
+        ScreenModeStatus sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
+        if(null!=sms) {
+            sms.lock();
+            try {
+                if(DEBUG) {
+                    System.err.println("Screen.setCurrentScreenMode ("+(System.currentTimeMillis()-t0)+"): 0.0 "+screenMode);
+                }
+
+                sms.fireScreenModeChangeNotify(smU);
+
+                if(DEBUG) {
+                    System.err.println("Screen.setCurrentScreenMode ("+(System.currentTimeMillis()-t0)+"): 0.1 "+screenMode);
+                }
+
+                boolean success = setCurrentScreenModeImpl(smU);
+                if(success) {
+                    setScreenSize(screenMode.getMonitorMode().getSurfaceSize().getResolution().getWidth(),
+                                  screenMode.getMonitorMode().getSurfaceSize().getResolution().getHeight());
+                }
+
+                if(DEBUG) {
+                    System.err.println("Screen.setCurrentScreenMode ("+(System.currentTimeMillis()-t0)+"): X.0 "+screenMode+", success: "+success);
+                }
+
+                sms.fireScreenModeChanged(smU, success);
+
+                if(DEBUG) {
+                    System.err.println("Screen.setCurrentScreenMode ("+(System.currentTimeMillis()-t0)+"): X.X "+screenMode+", success: "+success);
+                }
+
+                return success;
+            } finally {
+                sms.unlock();
+            }
+        }
+        return false;
+    }
+
+    public void screenModeChangeNotify(ScreenMode sm) {
+        for(int i=0; i<referencedScreenModeListener.size(); i++) {
+            ((ScreenModeListener)referencedScreenModeListener.get(i)).screenModeChangeNotify(sm);
+        }
+    }
+
+    public void screenModeChanged(ScreenMode sm, boolean success) {
+        for(int i=0; i<referencedScreenModeListener.size(); i++) {
+            ((ScreenModeListener)referencedScreenModeListener.get(i)).screenModeChanged(sm, success);
+        }
+    }
+
+    public synchronized final void addScreenModeListener(ScreenModeListener sml) {
+        referencedScreenModeListener.add(sml);
+    }
+
+    public synchronized final void removeScreenModeListener(ScreenModeListener sml) {
+        referencedScreenModeListener.remove(sml);
+    }
+
+    /** ScreenModeStatus bridge to native implementation */
+    protected final ArrayHashSet getScreenModesOrig() {
+        ScreenModeStatus sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
+        if(null!=sms) {
+            return sms.getScreenModes();
+        }
+        return null;
+    }
+
+    /** ScreenModeStatus bridge to native implementation */
+    protected final IntIntHashMap getScreenModesIdx2NativeIdx() {
+        ScreenModeStatus sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
+        if(null!=sms) {
+            return sms.getScreenModesIdx2NativeIdx();
+        }
+        return null;
+    }
+
+    /**
+     * To be implemented by the native specification.<br>
+     * Is called within a thread safe environment.<br>
+     * Is called only to collect the ScreenModes, usually at startup setting up modes.<br>
+     * <br>
+     * <b>WARNING</b>: must be synchronized with {@link com.jogamp.newt.util.ScreenModeUtil#NUM_SCREEN_MODE_PROPERTIES},
+     * ie {@link com.jogamp.newt.util.ScreenModeUtil#streamIn(com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, int[], int)}<br>
+     * <br>
+     * <b>Note</b>: Additional 1st element is native mode id.
+     */
+    protected int[] getScreenModeFirstImpl() {
+        return null;
+    }
+
+    /**
+     * To be implemented by the native specification.<br>
+     * Is called within a thread safe environment.<br>
+     * Is called only to collect the ScreenModes, usually at startup setting up modes.<br>
+     * <br>
+     * <b>WARNING</b>: must be synchronized with {@link com.jogamp.newt.util.ScreenModeUtil#NUM_SCREEN_MODE_PROPERTIES},
+     * ie {@link com.jogamp.newt.util.ScreenModeUtil#streamIn(com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, com.jogamp.common.util.ArrayHashSet, int[], int)}<br>
+     * <br>
+     * <b>Note</b>: Additional 1st element is native mode id.
+     */
+    protected int[] getScreenModeNextImpl() {
+        return null;
+    }
+
+    /**
+     * To be implemented by the native specification.<br>
+     * Is called within a thread safe environment.<br>
+     */
+    protected ScreenMode getCurrentScreenModeImpl() {
+        return null;
+    }
+
+    /**
+     * To be implemented by the native specification.<br>
+     * Is called within a thread safe environment.<br>
+     */
+    protected boolean setCurrentScreenModeImpl(ScreenMode screenMode) {
+        return false;
+    }
+
+    private void initScreenModeStatus() {
+        ScreenModeStatus sms;
+        ScreenModeStatus.lockScreenModeStatus();
+        try {
+            sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
+            if(null==sms) {                
+                IntIntHashMap screenModesIdx2NativeIdx = new IntIntHashMap();
+
+                ArrayHashSet screenModes = collectNativeScreenModes(screenModesIdx2NativeIdx);
+                sms = new ScreenModeStatus(screenModes, screenModesIdx2NativeIdx);
+                if(null!=screenModes && screenModes.size()>0) {
+                    ScreenMode originalScreenMode = ( DEBUG_TEST_SCREENMODE_DISABLED ) ? null : getCurrentScreenModeImpl();
+                    if(null != originalScreenMode) {
+                        ScreenMode originalScreenMode0 = (ScreenMode) screenModes.get(originalScreenMode); // unify via value hash
+                        if(null == originalScreenMode0) {
+                            throw new RuntimeException(originalScreenMode+" could not be hashed from ScreenMode list");
+                        }
+                        sms.setOriginalScreenMode(originalScreenMode0);
+                    }
+                }
+                ScreenModeStatus.mapScreenModeStatus(this.getFQName(), sms);
+            }
+            sms.addListener(this);
+        } finally {
+            ScreenModeStatus.unlockScreenModeStatus();
+        }
+    }
+
+    /** ignores bpp < 15 */
+    private ArrayHashSet collectNativeScreenModes(IntIntHashMap screenModesIdx2NativeId) {
+        ArrayHashSet resolutionPool  = new ArrayHashSet();
+        ArrayHashSet surfaceSizePool = new ArrayHashSet();
+        ArrayHashSet screenSizeMMPool = new ArrayHashSet();
+        ArrayHashSet monitorModePool = new ArrayHashSet();
+        ArrayHashSet screenModePool = null;
+
+        screenModePool = new ArrayHashSet();
+
+        int[] smProps = null;
+        int num = 0;
+        final int idxBpp =   1 // native mode
+                           + 1 // count
+                           + ScreenModeUtil.NUM_RESOLUTION_PROPERTIES
+                           + ScreenModeUtil.NUM_SURFACE_SIZE_PROPERTIES
+                           - 1 ; // index 0 based
+        do {
+            if(DEBUG_TEST_SCREENMODE_DISABLED) {
+                smProps = null;
+            } else if(0 == num) {
+                smProps = getScreenModeFirstImpl();
+            } else {
+                smProps = getScreenModeNextImpl();
+            }
+            if(null != smProps && 0 < smProps.length && smProps[idxBpp] >= 15) {
+                int nativeId = smProps[0];
+                int screenModeIdx = ScreenModeUtil.streamIn(resolutionPool, surfaceSizePool, screenSizeMMPool,
+                                                            monitorModePool, screenModePool, smProps, 1);
+                if(screenModeIdx >= 0) {
+                    screenModesIdx2NativeId.put(screenModeIdx, nativeId);
+                }
+            }
+            num++;
+        } while ( null != smProps && 0 < smProps.length );
+
+        if(DEBUG) {
+            System.err.println("ScreenImpl.collectNativeScreenModes: ScreenMode number  : "+screenModePool.size());
+            System.err.println("ScreenImpl.collectNativeScreenModes: MonitorMode number : "+monitorModePool.size());
+            System.err.println("ScreenImpl.collectNativeScreenModes: ScreenSizeMM number: "+screenSizeMMPool.size());
+            System.err.println("ScreenImpl.collectNativeScreenModes: SurfaceSize number : "+surfaceSizePool.size());
+            System.err.println("ScreenImpl.collectNativeScreenModes: Resolution number  : "+resolutionPool.size());
+        }
+
+        return screenModePool;
+    }
+
+    private void releaseScreenModeStatus() {
+        ScreenModeStatus sms;
+        ScreenModeStatus.lockScreenModeStatus();
+        try {
+            sms = ScreenModeStatus.getScreenModeStatus(this.getFQName());
+            if(null != sms) {
+                sms.lock();
+                try {
+                    if(0 == sms.removeListener(this)) {
+                        if(!sms.isOriginalMode()) {
+                            setCurrentScreenMode(sms.getOriginalScreenMode());
+                        }
+                        ScreenModeStatus.unmapScreenModeStatus(this.getFQName());
+                    }
+                } finally {
+                    sms.unlock();
+                }
+            }            
+        } finally {
+            ScreenModeStatus.unlockScreenModeStatus();
+        }
+    }
+}
+
diff --git a/src/newt/classes/jogamp/newt/ScreenModeStatus.java b/src/newt/classes/jogamp/newt/ScreenModeStatus.java
new file mode 100644
index 0000000..4d8b8b5
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/ScreenModeStatus.java
@@ -0,0 +1,207 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.newt;
+
+import com.jogamp.common.util.ArrayHashSet;
+import com.jogamp.common.util.IntIntHashMap;
+import com.jogamp.common.util.locks.RecursiveLock;
+import com.jogamp.newt.Screen;
+import com.jogamp.newt.ScreenMode;
+import com.jogamp.newt.event.ScreenModeListener;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+public class ScreenModeStatus {
+    private static boolean DEBUG = Screen.DEBUG;
+
+    private RecursiveLock lock = new RecursiveLock();
+    private ArrayHashSet/*<ScreenMode>*/ screenModes;
+    private IntIntHashMap screenModesIdx2NativeIdx;
+    private ScreenMode currentScreenMode;
+    private ScreenMode originalScreenMode;
+    private ArrayList/*<ScreenModeChangeListener>*/ listener = new ArrayList();
+
+    private static HashMap screenFQN2ScreenModeStatus = new HashMap();
+    private static RecursiveLock screen2ScreenModeStatusLock = new RecursiveLock();
+
+    protected static void mapScreenModeStatus(String screenFQN, ScreenModeStatus sms) {
+        screen2ScreenModeStatusLock.lock();
+        try {
+            ScreenModeStatus _sms = (ScreenModeStatus) screenFQN2ScreenModeStatus.get(screenFQN);
+            if( null != _sms ) {
+                throw new RuntimeException("ScreenModeStatus "+_sms+" already mapped to "+screenFQN);
+            }
+            screenFQN2ScreenModeStatus.put(screenFQN, sms);
+            if(DEBUG) {
+                System.err.println("ScreenModeStatus.map "+screenFQN+" -> "+sms);
+            }
+        } finally {
+            screen2ScreenModeStatusLock.unlock();
+        }
+    }
+
+    /**
+     * @param screen the prev user
+     * @return true if mapping is empty, ie no more usage of the mapped ScreenModeStatus
+     */
+    protected static void unmapScreenModeStatus(String screenFQN) {
+        screen2ScreenModeStatusLock.lock();
+        try {
+            ScreenModeStatus sms = (ScreenModeStatus) screenFQN2ScreenModeStatus.remove(screenFQN);
+            if(DEBUG) {
+                System.err.println("ScreenModeStatus.unmap "+screenFQN+" -> "+sms);
+            }
+        } finally {
+            screen2ScreenModeStatusLock.unlock();
+        }
+    }
+
+    protected static ScreenModeStatus getScreenModeStatus(String screenFQN) {
+        screen2ScreenModeStatusLock.lock();
+        try {
+            return (ScreenModeStatus) screenFQN2ScreenModeStatus.get(screenFQN);
+        } finally {
+            screen2ScreenModeStatusLock.unlock();
+        }
+    }
+
+    protected static void lockScreenModeStatus() {
+        screen2ScreenModeStatusLock.lock();
+    }
+
+    protected static void unlockScreenModeStatus() {
+        screen2ScreenModeStatusLock.unlock();
+    }
+    
+    public ScreenModeStatus(ArrayHashSet/*<ScreenMode>*/ screenModes,
+                            IntIntHashMap screenModesIdx2NativeIdx) {
+        this.screenModes = screenModes;
+        this.screenModesIdx2NativeIdx = screenModesIdx2NativeIdx;
+    }
+
+    protected final void setOriginalScreenMode(ScreenMode originalScreenMode) {
+        this.originalScreenMode = originalScreenMode;
+        this.currentScreenMode = originalScreenMode;
+    }
+
+    public final ScreenMode getOriginalScreenMode() {
+        return originalScreenMode;
+    }
+
+    public final ScreenMode getCurrentScreenMode() {
+        lock();
+        try {
+            return currentScreenMode;
+        } finally {
+            unlock();
+        }
+    }
+
+    public final boolean isOriginalMode() {
+        lock();
+        try {
+            if(null != currentScreenMode && null != originalScreenMode) {
+                return currentScreenMode.hashCode() == originalScreenMode.hashCode();
+            }
+            return true;
+        } finally {
+            unlock();
+        }
+    }
+
+    protected final ArrayHashSet/*<ScreenMode>*/ getScreenModes() {
+        return screenModes;
+    }
+
+    protected final IntIntHashMap getScreenModesIdx2NativeIdx() {
+        return screenModesIdx2NativeIdx;
+    }
+
+    protected final int addListener(ScreenModeListener l) {
+        lock();
+        try {
+            listener.add(l);
+            if(DEBUG) {
+                System.err.println("ScreenModeStatus.addListener (size: "+listener.size()+"): "+l);
+            }
+            return listener.size();
+        } finally {
+            unlock();
+        }
+    }
+
+    protected final int removeListener(ScreenModeListener l) {
+        lock();
+        try {
+            if(!listener.remove(l)) {
+                throw new RuntimeException("ScreenModeListener "+l+" not contained");
+            }
+            if(DEBUG) {
+                System.err.println("ScreenModeStatus.removeListener (size: "+listener.size()+"): "+l);
+            }
+            return listener.size();
+        } finally {
+            unlock();
+        }
+    }
+
+    protected final void fireScreenModeChangeNotify(ScreenMode desiredScreenMode) {
+        lock();
+        try {
+            for(int i=0; i<listener.size(); i++) {
+                ((ScreenModeListener)listener.get(i)).screenModeChangeNotify(desiredScreenMode);
+            }
+        } finally {
+            unlock();
+        }
+    }
+
+    protected void fireScreenModeChanged(ScreenMode currentScreenMode, boolean success) {
+        lock();
+        try {
+            if(success) {
+                this.currentScreenMode = currentScreenMode;
+            }
+            for(int i=0; i<listener.size(); i++) {
+                ((ScreenModeListener)listener.get(i)).screenModeChanged(currentScreenMode, success);
+            }
+        } finally {
+            unlock();
+        }
+    }
+
+    protected final void lock() throws RuntimeException {
+        lock.lock();
+    }
+
+    protected final void unlock() throws RuntimeException {
+        lock.unlock();
+    }
+
+}
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
new file mode 100644
index 0000000..cb1c0ed
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -0,0 +1,2239 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+   Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt;
+
+import java.util.ArrayList;
+import java.lang.reflect.Method;
+
+import com.jogamp.common.util.ReflectionUtil;
+import com.jogamp.newt.NewtFactory;
+import com.jogamp.newt.Display;
+import com.jogamp.newt.Screen;
+import com.jogamp.newt.Window;
+import com.jogamp.common.util.locks.RecursiveLock;
+import com.jogamp.newt.ScreenMode;
+import com.jogamp.newt.event.KeyEvent;
+import com.jogamp.newt.event.KeyListener;
+import com.jogamp.newt.event.MouseEvent;
+import com.jogamp.newt.event.MouseListener;
+import com.jogamp.newt.event.NEWTEvent;
+import com.jogamp.newt.event.NEWTEventConsumer;
+import com.jogamp.newt.event.ScreenModeListener;
+import com.jogamp.newt.event.WindowEvent;
+import com.jogamp.newt.event.WindowListener;
+import com.jogamp.newt.event.WindowUpdateEvent;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.CapabilitiesChooser;
+import javax.media.nativewindow.CapabilitiesImmutable;
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.NativeWindow;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.nativewindow.SurfaceUpdatedListener;
+import javax.media.nativewindow.util.DimensionReadOnly;
+import javax.media.nativewindow.util.Insets;
+import javax.media.nativewindow.util.Point;
+import javax.media.nativewindow.util.Rectangle;
+
+public abstract class WindowImpl implements Window, NEWTEventConsumer
+{
+    public static final boolean DEBUG_TEST_REPARENT_INCOMPATIBLE = Debug.isPropertyDefined("newt.test.Window.reparent.incompatible", true);
+    
+    private RecursiveLock windowLock = new RecursiveLock();  // Window instance wide lock
+    private RecursiveLock surfaceLock = new RecursiveLock(); // Surface only lock
+    private long   windowHandle;
+    private ScreenImpl screen;
+    private boolean screenReferenceAdded = false;
+    private NativeWindow parentWindow;
+    private long parentWindowHandle;
+    protected AbstractGraphicsConfiguration config;
+    protected CapabilitiesImmutable capsRequested;
+    protected CapabilitiesChooser capabilitiesChooser = null; // default null -> default
+    protected boolean fullscreen, visible, hasFocus;
+    protected int width, height, x, y;
+    protected int nfs_width, nfs_height, nfs_x, nfs_y; // non fullscreen dimensions ..
+    protected String title = "Newt Window";
+    protected boolean undecorated = false;
+    private LifecycleHook lifecycleHook = null;
+
+    private DestroyAction destroyAction = new DestroyAction();
+    private boolean handleDestroyNotify = true;
+
+    private ReparentActionRecreate reparentActionRecreate = new ReparentActionRecreate();
+
+    private RequestFocusAction requestFocusAction = new RequestFocusAction();
+    private FocusRunnable focusAction = null;
+
+    private Object surfaceUpdatedListenersLock = new Object();
+    private ArrayList surfaceUpdatedListeners;
+
+    private Object childWindowsLock = new Object();
+    private ArrayList childWindows;
+
+    private ArrayList mouseListeners;
+    private int  mouseButtonPressed;  // current pressed mouse button number
+    private long lastMousePressed;    // last time when a mouse button was pressed
+    private int  lastMouseClickCount; // last mouse button click count
+
+    private ArrayList keyListeners;
+
+    private ArrayList windowListeners;
+    private boolean repaintQueued = false;
+
+    ScreenModeListenerImpl screenModeListenerImpl = new ScreenModeListenerImpl();
+
+    private void initializeStates() {
+        invalidate(true);
+
+        childWindows = new ArrayList();
+        surfaceUpdatedListeners = new ArrayList();
+        windowListeners =  new ArrayList();
+        mouseListeners = new ArrayList();
+
+        mouseButtonPressed = 0; // current pressed mouse button number
+        lastMousePressed = 0; // last time when a mouse button was pressed
+        lastMouseClickCount = 0; // last mouse button click count
+        keyListeners = new ArrayList();
+    }
+
+    // Workaround for initialization order problems on Mac OS X
+    // between native Newt and (apparently) Fmod -- if Fmod is
+    // initialized first then the connection to the window server
+    // breaks, leading to errors from deep within the AppKit
+    public static void init(String type) {
+        if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
+            try {
+                getWindowClass(type);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    //
+    // Construction Methods
+    //
+
+    private static Class getWindowClass(String type)
+        throws ClassNotFoundException
+    {
+        Class windowClass = NewtFactory.getCustomClass(type, "Window");
+        if(null==windowClass) {
+            if (NativeWindowFactory.TYPE_EGL.equals(type)) {
+                windowClass = Class.forName("jogamp.newt.opengl.kd.KDWindow");
+            } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
+                windowClass = Class.forName("jogamp.newt.windows.WindowsWindow");
+            } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
+                windowClass = Class.forName("jogamp.newt.macosx.MacWindow");
+            } else if (NativeWindowFactory.TYPE_X11.equals(type)) {
+                windowClass = Class.forName("jogamp.newt.x11.X11Window");
+            } else if (NativeWindowFactory.TYPE_AWT.equals(type)) {
+                windowClass = Class.forName("jogamp.newt.awt.AWTWindow");
+            } else {
+                throw new NativeWindowException("Unknown window type \"" + type + "\"");
+            }
+        }
+        return windowClass;
+    }
+
+    public static WindowImpl create(NativeWindow parentWindow, long parentWindowHandle, Screen screen, CapabilitiesImmutable caps) {
+        try {
+            Class windowClass;
+            if(caps.isOnscreen()) {
+                windowClass = getWindowClass(screen.getDisplay().getType());
+            } else {
+                windowClass = OffscreenWindow.class;
+            }
+            WindowImpl window = (WindowImpl) windowClass.newInstance();
+            window.initializeStates();
+            window.parentWindow = parentWindow;
+            window.parentWindowHandle = parentWindowHandle;
+            window.screen = (ScreenImpl) screen;
+            window.capsRequested = (CapabilitiesImmutable) caps.cloneMutable();
+            window.setUndecorated(0!=parentWindowHandle);
+            return window;
+        } catch (Throwable t) {
+            t.printStackTrace();
+            throw new NativeWindowException(t);
+        }
+    }
+
+    public static WindowImpl create(Object[] cstrArguments, Screen screen, CapabilitiesImmutable caps) {
+        try {
+            Class windowClass = getWindowClass(screen.getDisplay().getType());
+            Class[] cstrArgumentTypes = getCustomConstructorArgumentTypes(windowClass);
+            if(null==cstrArgumentTypes) {
+                throw new NativeWindowException("WindowClass "+windowClass+" doesn't support custom arguments in constructor");
+            }
+            int argsChecked = verifyConstructorArgumentTypes(cstrArgumentTypes, cstrArguments);
+            if ( argsChecked < cstrArguments.length ) {
+                throw new NativeWindowException("WindowClass "+windowClass+" constructor mismatch at argument #"+argsChecked+"; Constructor: "+getTypeStrList(cstrArgumentTypes)+", arguments: "+getArgsStrList(cstrArguments));
+            }
+            WindowImpl window = (WindowImpl) ReflectionUtil.createInstance( windowClass, cstrArgumentTypes, cstrArguments ) ;
+            window.initializeStates();
+            window.screen = (ScreenImpl) screen;
+            window.capsRequested = (CapabilitiesImmutable) caps.cloneMutable();
+            return window;
+        } catch (Throwable t) {
+            throw new NativeWindowException(t);
+        }
+    }
+
+    public static interface LifecycleHook {
+        /**
+         * Reset of internal state counter, ie totalFrames, etc.
+         * Called from EDT while window is locked.
+         */
+        public abstract void resetCounter();
+
+        /** 
+         * Invoked after Window setVisible, 
+         * allows allocating resources depending on the native Window.
+         * Called from EDT while window is locked.
+         */
+        void setVisibleActionPost(boolean visible, boolean nativeWindowCreated);
+
+        /** 
+         * Invoked before Window destroy action, 
+         * allows releasing of resources depending on the native Window.<br>
+         * Surface not locked yet.<br>
+         * Called not necessarily from EDT.
+         */
+        void destroyActionPreLock();
+
+        /**
+         * Invoked before Window destroy action,
+         * allows releasing of resources depending on the native Window.<br>
+         * Surface locked.<br>
+         * Called from EDT while window is locked.
+         */
+        void destroyActionInLock();
+
+        /**
+         * Invoked after destruction from Window's invalidate method.<br>
+         * Called while window is locked.
+         * @param unrecoverable
+         */
+        void invalidate(boolean unrecoverable);
+
+        /**
+         * Invoked for expensive modifications, ie while reparenting and ScreenMode change.<br>
+         * No lock is hold when invoked.<br>
+         *
+         * @return true is paused, otherwise false. If true {@link #resumeRenderingAction()} shall be issued.
+         *
+         * @see #resumeRenderingAction()
+         */
+        boolean pauseRenderingAction();
+
+        /**
+         * Invoked for expensive modifications, ie while reparenting and ScreenMode change.
+         * No lock is hold when invoked.<br>
+         *
+         * @see #pauseRenderingAction()
+         */
+        void resumeRenderingAction();
+    }
+
+    private boolean createNative() {
+        if(DEBUG_IMPLEMENTATION) {
+            System.err.println("Window.createNative() START ("+getThreadName()+", "+this+")");
+        }
+        if( null != parentWindow && 
+            NativeSurface.LOCK_SURFACE_NOT_READY >= parentWindow.lockSurface() ) {
+                throw new NativeWindowException("Parent surface lock: not ready: "+parentWindow);
+        }
+        try {
+            if(validateParentWindowHandle()) {
+                if(screenReferenceAdded) {
+                    throw new InternalError("XXX");
+                }
+                screen.addReference();
+                screenReferenceAdded = true;
+                createNativeImpl();
+                setVisibleImpl(true, x, y, width, height);
+                screen.addScreenModeListener(screenModeListenerImpl);
+                setTitleImpl(title);
+            }
+        } finally {
+            if(null!=parentWindow) {
+                parentWindow.unlockSurface();
+            }
+        }
+        if(DEBUG_IMPLEMENTATION) {
+            System.err.println("Window.createNative() END ("+getThreadName()+", "+this+")");
+        }
+        return 0 != windowHandle ;
+    }
+
+    private void removeScreenReference() {
+        if(screenReferenceAdded) {
+            // be nice, probably already called recursive via
+            //   closeAndInvalidate() -> closeNativeIml() -> .. -> windowDestroyed() -> closeAndInvalidate() !
+            // or via reparentWindow .. etc
+            screenReferenceAdded = false;
+            screen.removeReference();
+        }
+    }
+
+    private void closeAndInvalidate() {
+        windowLock.lock();
+        try {
+            if( null != screen ) {
+                if( 0 != windowHandle ) {
+                    screen.removeScreenModeListener(screenModeListenerImpl);
+                    closeNativeImpl();
+                    removeScreenReference();
+                }
+                Display dpy = screen.getDisplay();
+                if(null != dpy) {
+                    dpy.validateEDT();
+                }
+            }
+            invalidate(false);
+        } finally {
+            windowLock.unlock();
+        }
+    }
+
+    private boolean validateParentWindowHandle() {
+        if(null!=parentWindow) {
+            parentWindowHandle = getNativeWindowHandle(parentWindow);
+            return 0 != parentWindowHandle ;
+        }
+        return true;
+    }
+
+    private static long getNativeWindowHandle(NativeWindow nativeWindow) {
+        long handle = 0;
+        if(null!=nativeWindow) {
+            boolean wasLocked = false;
+            if( NativeSurface.LOCK_SURFACE_NOT_READY < nativeWindow.lockSurface() ) {
+                wasLocked = true;
+                try {
+                    handle = nativeWindow.getWindowHandle();
+                    if(0==handle) {
+                        throw new NativeWindowException("Parent native window handle is NULL, after succesful locking: "+nativeWindow);
+                    }
+                } catch (NativeWindowException nwe) {
+                    if(DEBUG_IMPLEMENTATION) {
+                        System.err.println("Window.getNativeWindowHandle: not successful yet: "+nwe);
+                    }
+                } finally {
+                    nativeWindow.unlockSurface();
+                }
+            }
+            if(DEBUG_IMPLEMENTATION) {
+                System.err.println("Window.getNativeWindowHandle: locked "+wasLocked+", "+nativeWindow);
+            }
+        }
+        return handle;
+    }
+
+
+    //----------------------------------------------------------------------
+    // NativeSurface: Native implementation
+    //
+
+    protected int lockSurfaceImpl() { return LOCK_SUCCESS; }
+
+    protected void unlockSurfaceImpl() { }
+
+    //----------------------------------------------------------------------
+    // WindowClosingProtocol implementation
+    //
+    private Object closingListenerLock = new Object();
+    private int defaultCloseOperation = DISPOSE_ON_CLOSE;
+
+    public int getDefaultCloseOperation() {
+        synchronized (closingListenerLock) {
+            return defaultCloseOperation;
+        }
+    }
+
+    public int setDefaultCloseOperation(int op) {
+        synchronized (closingListenerLock) {
+            int _op = defaultCloseOperation;
+            defaultCloseOperation = op;
+            return _op;
+        }
+    }
+
+    //----------------------------------------------------------------------
+    // Window: Native implementation
+    //
+
+    /** 
+     * The native implementation must set the native windowHandle.<br>
+     *
+     * The implementation should invoke the referenced java state callbacks
+     * to notify this Java object of state changes.
+     * 
+     * @see #windowDestroyNotify()
+     * @see #focusChanged(boolean)
+     * @see #visibleChanged(boolean)
+     * @see #sizeChanged(int,int)
+     * @see #positionChanged(int,int)
+     * @see #windowDestroyNotify()
+     */
+    protected abstract void createNativeImpl();
+
+    protected abstract void closeNativeImpl();
+
+    /** 
+     * The native implementation must invoke {@link #focusChanged(boolean)}
+     * to change the focus state, if <code>force == false</code>. 
+     * This may happen asynchronous within {@link #TIMEOUT_NATIVEWINDOW}.
+     * 
+     * @param force if true, bypass {@link #focusChanged(boolean)} and force focus request
+     */
+    protected abstract void requestFocusImpl(boolean force);
+
+    /** 
+     * The native implementation must invoke {@link #visibleChanged(boolean)}
+     * to change the visibility state. This may happen asynchronous within 
+     * {@link #TIMEOUT_NATIVEWINDOW}.
+     */
+    protected abstract void setVisibleImpl(boolean visible, int x, int y, int width, int height);
+
+    /**
+     * The native implementation should invoke the referenced java state callbacks
+     * to notify this Java object of state changes.
+     * 
+     * @param x -1 if no position change requested, otherwise greater than zero
+     * @param y -1 if no position change requested, otherwise greater than zero
+     * @param width -1 if no size change requested, otherwise greater than zero
+     * @param height -1 if no size change requested, otherwise greater than zero
+     * @param parentChange true if reparenting requested, otherwise false
+     * @param fullScreenChange 0 if unchanged, -1 fullscreen off, 1 fullscreen on
+     * @param decorationChange 0 if unchanged, -1 undecorated, 1 decorated
+     *
+     * @see #sizeChanged(int,int)
+     * @see #positionChanged(int,int)
+     */
+    protected abstract boolean reconfigureWindowImpl(int x, int y, int width, int height, 
+                                                     boolean parentChange, int fullScreenChange, int decorationChange);
+
+    protected void setTitleImpl(String title) {}
+
+    /**
+     * Return screen coordinates of the given coordinates
+     * or null, in which case a NativeWindow traversal shall being used
+     * as demonstrated in {@link #getLocationOnScreen(javax.media.nativewindow.util.Point)}.
+     *
+     * @return if not null, the screen location of the given coordinates
+     */
+    protected abstract Point getLocationOnScreenImpl(int x, int y);
+
+    //----------------------------------------------------------------------
+    // NativeSurface
+    //
+
+    public final int lockSurface() {
+        windowLock.lock();
+        surfaceLock.lock();
+        int res = surfaceLock.getRecursionCount() == 0 ? LOCK_SURFACE_NOT_READY : LOCK_SUCCESS;
+
+        if ( LOCK_SURFACE_NOT_READY == res ) {
+            try {
+                if( isNativeValid() ) {
+                    final AbstractGraphicsDevice adevice = config.getScreen().getDevice();
+                    adevice.lock();
+                    try {
+                        res = lockSurfaceImpl();
+                    } finally {
+                        if (LOCK_SURFACE_NOT_READY >= res) {
+                            adevice.unlock();
+                        }
+                    }
+                }
+            } finally {
+                if (LOCK_SURFACE_NOT_READY >= res) {
+                    surfaceLock.unlock();
+                    windowLock.unlock();
+                }
+            }
+        }
+        return res;
+    }
+
+    public final void unlockSurface() {
+        surfaceLock.validateLocked();
+        windowLock.validateLocked();
+
+        if (surfaceLock.getRecursionCount() == 0) {
+            final AbstractGraphicsDevice adevice = config.getScreen().getDevice();
+            try {
+                unlockSurfaceImpl();
+            } finally {
+                adevice.unlock();
+            }
+        }
+        surfaceLock.unlock();
+        windowLock.unlock();
+    }
+
+    public final boolean isWindowLockedByOtherThread() {
+        return windowLock.isLockedByOtherThread();
+    }
+
+    public final boolean isWindowLocked() {
+        return windowLock.isLocked();
+    }
+
+    public final Thread getWindowLockOwner() {
+        return windowLock.getOwner();
+    }
+
+    public final boolean isSurfaceLockedByOtherThread() {
+        return surfaceLock.isLockedByOtherThread();
+    }
+
+    public final boolean isSurfaceLocked() {
+        return surfaceLock.isLocked();
+    }
+
+    public final Thread getSurfaceLockOwner() {
+        return surfaceLock.getOwner();
+    }
+
+    public long getSurfaceHandle() {
+        return windowHandle; // default: return window handle
+    }
+
+    public boolean surfaceSwap() {
+        return false;
+    }
+
+    public AbstractGraphicsConfiguration getGraphicsConfiguration() {
+        return config;
+    }
+
+    public final long getDisplayHandle() {
+        return getScreen().getDisplay().getHandle();
+    }
+
+    public final int  getScreenIndex() {
+        return getScreen().getIndex();
+    }
+
+    //----------------------------------------------------------------------
+    // NativeWindow
+    //
+
+    // public final void destroy() - see below
+
+    public final NativeWindow getParent() {
+        return parentWindow;
+    }
+
+    public final long getWindowHandle() {
+        return windowHandle;
+    }
+
+    public Point getLocationOnScreen(Point storage) {
+        if(isNativeValid()) {
+            Point d;
+            windowLock.lock();
+            try {
+                d = getLocationOnScreenImpl(0, 0);
+            } finally {
+                windowLock.unlock();
+            }
+            if(null!=d) {
+                if(null!=storage) {
+                    storage.translate(d.getX(),d.getY());
+                    return storage;
+                }
+                return d;
+            }
+            // fall through intended ..
+        }
+
+        if(null!=storage) {
+            storage.translate(getX(),getY());
+        } else {
+            storage = new Point(getX(),getY());
+        }
+        if(null!=parentWindow) {
+            // traverse through parent list ..
+            parentWindow.getLocationOnScreen(storage);
+        }
+        return storage;
+    }
+
+    //----------------------------------------------------------------------
+    // Window
+    //
+
+    public final boolean isNativeValid() {
+        return null != getScreen() && 0 != getWindowHandle() ;
+    }
+
+    public final boolean isValid() {
+        return null != getScreen() ;
+    }
+
+    public final Screen getScreen() {
+        return screen;
+    }
+
+    final void setVisibleActionImpl(boolean visible) {
+        boolean nativeWindowCreated = false;
+        boolean madeVisible = false;
+        
+        windowLock.lock();
+        try {
+            if(null!=lifecycleHook) {
+                lifecycleHook.resetCounter();
+            }
+
+            if(!visible && null!=childWindows && childWindows.size()>0) {
+              synchronized(childWindowsLock) {
+                for(int i = 0; i < childWindows.size(); i++ ) {
+                    NativeWindow nw = (NativeWindow) childWindows.get(i);
+                    if(nw instanceof WindowImpl) {
+                        ((WindowImpl)nw).setVisible(false);
+                    }
+                }
+              }
+            }
+            if(0==windowHandle && visible) {
+                if( 0<width*height ) {
+                    nativeWindowCreated = createNative();
+                    WindowImpl.this.waitForVisible(visible, true);
+                    madeVisible = visible;
+                }
+            } else if(WindowImpl.this.visible != visible) {
+                if(0 != windowHandle) {
+                    setVisibleImpl(visible, x, y, width, height);
+                    WindowImpl.this.waitForVisible(visible, true);
+                    madeVisible = visible;
+                }
+            }
+
+            if(null!=lifecycleHook) {
+                lifecycleHook.setVisibleActionPost(visible, nativeWindowCreated);
+            }
+
+            if(0!=windowHandle && visible && null!=childWindows && childWindows.size()>0) {
+              synchronized(childWindowsLock) {
+                for(int i = 0; i < childWindows.size(); i++ ) {
+                    NativeWindow nw = (NativeWindow) childWindows.get(i);
+                    if(nw instanceof WindowImpl) {
+                        ((WindowImpl)nw).setVisible(true);
+                    }
+                }
+              }
+            }
+            if(DEBUG_IMPLEMENTATION) {
+                System.err.println("Window setVisible: END ("+getThreadName()+") "+x+"/"+y+" "+width+"x"+height+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible: "+WindowImpl.this.visible+", nativeWindowCreated: "+nativeWindowCreated+", madeVisible: "+madeVisible);
+            }
+        } finally {
+            windowLock.unlock();
+        }
+        if( nativeWindowCreated || madeVisible ) {
+            sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
+        }        
+    }
+    
+    private class VisibleAction implements Runnable {
+        boolean visible;
+
+        private VisibleAction (boolean visible) {
+            this.visible = visible;
+        }
+
+        public final void run() {
+            setVisibleActionImpl(visible);
+        }
+    }
+
+    public void setVisible(boolean visible) {
+        if(isValid()) {
+            if( 0==windowHandle && visible && 0>=width*height ) {
+                // fast-path: not realized yet, make visible, but zero size
+                return;
+            }
+
+            if(DEBUG_IMPLEMENTATION) {
+                String msg = "Window setVisible: START ("+getThreadName()+") "+x+"/"+y+" "+width+"x"+height+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible: "+this.visible+" -> "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+(null!=parentWindow);
+                System.err.println(msg);
+                Thread.dumpStack();
+            }
+            runOnEDTIfAvail(true, new VisibleAction(visible));
+        }
+    }
+
+    private class SetSizeActionImpl implements Runnable {
+        int width, height;
+
+        private SetSizeActionImpl(int w, int h) {
+            width = w;
+            height = h;
+        }
+        public final void run() {
+            windowLock.lock();
+            try {
+                int visibleAction = 0; // 1 invisible, 2 visible (create)
+                if ( !fullscreen && ( width != WindowImpl.this.width || WindowImpl.this.height != height ) ) {
+                    if(DEBUG_IMPLEMENTATION) {
+                        String msg = "Window setSize: START "+WindowImpl.this.width+"x"+WindowImpl.this.height+" -> "+width+"x"+height+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible "+visible;
+                        System.err.println(msg);
+                    }
+                    if ( 0 != windowHandle && 0>=width*height && visible ) {
+                        visibleAction=1; // invisible
+                        WindowImpl.this.width = 0;
+                        WindowImpl.this.height = 0;
+                    } else if ( 0 == windowHandle && 0<width*height && visible ) {
+                        visibleAction = 2; // visible (create)
+                        WindowImpl.this.width = width;
+                        WindowImpl.this.height = height;
+                    } else if ( 0 != windowHandle ) {
+                        // this width/height will be set by windowChanged, called by the native implementation
+                        reconfigureWindowImpl(x, y, width, height, false, 0, 0);
+                    } else {
+                        WindowImpl.this.width = width;
+                        WindowImpl.this.height = height;
+                    }
+                    if(DEBUG_IMPLEMENTATION) {
+                        System.err.println("Window setSize: END "+WindowImpl.this.width+"x"+WindowImpl.this.height+", visibleAction "+visibleAction);
+                    }                    
+                    switch(visibleAction) {
+                        case 1: setVisibleActionImpl(false); break;
+                        case 2: setVisibleActionImpl(true); break;
+                    }
+                }
+            } finally {
+                windowLock.unlock();
+            }
+        }
+    }
+
+    public void setSize(int width, int height) {
+        if(isValid()) {
+            runOnEDTIfAvail(true, new SetSizeActionImpl(width, height));
+        }
+    }
+
+    private class DestroyAction implements Runnable {
+        public final void run() {
+            boolean animatorPaused = false;
+            if(null!=lifecycleHook) {
+                animatorPaused = lifecycleHook.pauseRenderingAction();
+            }
+            if(null!=lifecycleHook) {
+                lifecycleHook.destroyActionPreLock();
+            }
+            windowLock.lock();
+            try {
+                if( !isValid() ) {
+                    return; // nop
+                }
+
+                // Childs first ..
+                synchronized(childWindowsLock) {
+                  if(childWindows.size()>0) {
+                    // avoid ConcurrentModificationException: parent -> child -> parent.removeChild(this)
+                    ArrayList clonedChildWindows = (ArrayList) childWindows.clone();
+                    while( clonedChildWindows.size() > 0 ) {
+                      NativeWindow nw = (NativeWindow) clonedChildWindows.remove(0);
+                      if(nw instanceof WindowImpl) {
+                          ((WindowImpl)nw).sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
+                          ((WindowImpl)nw).destroy();
+                      } else {
+                          nw.destroy();
+                      }
+                    }
+                  }
+                }
+
+                if(null!=lifecycleHook) {
+                    // send synced destroy notification for proper cleanup, eg GLWindow/OpenGL
+                    lifecycleHook.destroyActionInLock();
+                }
+
+                closeAndInvalidate();
+
+                // send synced destroyed notification
+                sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROYED);
+
+                if(DEBUG_IMPLEMENTATION) {
+                    System.err.println("Window.destroy() END "+getThreadName()/*+", "+WindowImpl.this*/);
+                }
+            } finally {
+                windowLock.unlock();
+            }
+            if(animatorPaused) {
+                lifecycleHook.resumeRenderingAction();
+            }            
+        }
+    }
+
+    public void destroy() {
+        if( isValid() ) {
+            if(DEBUG_IMPLEMENTATION) {
+                String msg = "Window.destroy() START "+getThreadName();
+                System.err.println(msg);
+                //Exception ee = new Exception(msg);
+                //ee.printStackTrace();
+            }
+            runOnEDTIfAvail(true, destroyAction);
+        }
+    }
+
+    public final void invalidate() {
+        destroy();
+        invalidate(true);
+    }
+
+    /**
+     * @param unrecoverable If true, all states, size, position, parent handles,
+     * reference to it's Screen are reset.
+     * Otherwise you can recreate the window, via <code>setVisible(true)</code>.
+     * @see #invalidate()
+     * @see #destroy()
+     * @see #destroy(boolean)
+     */
+    protected void invalidate(boolean unrecoverable) {
+        windowLock.lock();
+        try {
+            if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+                String msg = "!!! Window Invalidate(unrecoverable: "+unrecoverable+") "+getThreadName();
+                System.err.println(msg);
+                // Throwable t = new Throwable(msg);
+                // t.printStackTrace();
+            }
+
+            // Childs first ..
+            synchronized(childWindowsLock) {
+              // avoid ConcurrentModificationException: parent -> child -> parent.removeChild(this)
+              if(null!=childWindows && childWindows.size()>0) {
+                ArrayList clonedChildWindows = (ArrayList) childWindows.clone();
+                while( clonedChildWindows.size() > 0 ) {
+                  NativeWindow nw = (NativeWindow) clonedChildWindows.remove(0);
+                  if(nw instanceof WindowImpl) {
+                      ((WindowImpl)nw).invalidate(unrecoverable);
+                  }
+                }
+              }
+            }
+
+            if(null!=lifecycleHook) {
+                lifecycleHook.invalidate(unrecoverable);
+            }
+
+            windowHandle = 0;
+            visible = false;
+            fullscreen = false;
+            hasFocus = false;
+
+            if(unrecoverable) {
+                if(null!=parentWindow && parentWindow instanceof Window) {
+                    ((Window)parentWindow).removeChild(WindowImpl.this);
+                }
+                screen = null;
+
+                synchronized(childWindowsLock) {
+                    childWindows = null;
+                }
+                synchronized(surfaceUpdatedListenersLock) {
+                    surfaceUpdatedListeners = null;
+                }
+                windowListeners = null;
+                mouseListeners = null;
+                keyListeners = null;
+
+                parentWindowHandle = 0;
+                parentWindow = null;
+                capsRequested = null;
+                lifecycleHook = null;
+
+                // Default position and dimension will be re-set immediately by user
+                width  = 128;
+                height = 128;
+                x=0;
+                y=0;
+            }
+        } finally {
+            windowLock.unlock();
+        }
+    }
+
+    private class ReparentActionImpl implements Runnable, ReparentAction {
+        NativeWindow newParentWindow;
+        boolean forceDestroyCreate;
+        int reparentAction;
+
+        private ReparentActionImpl(NativeWindow newParentWindow, boolean forceDestroyCreate) {
+            this.newParentWindow = newParentWindow;
+            this.forceDestroyCreate = forceDestroyCreate;
+            this.reparentAction = -1; // ensure it's set
+        }
+
+        private int getStrategy() {
+            return reparentAction;
+        }
+
+        private void setScreen(ScreenImpl newScreen) {
+            WindowImpl.this.removeScreenReference();
+            screen = newScreen;
+        }
+
+        public final void run() {
+            boolean animatorPaused = false;
+            if(null!=lifecycleHook) {
+                animatorPaused = lifecycleHook.pauseRenderingAction();
+            }
+            reparent();
+            if(animatorPaused) {
+                lifecycleHook.resumeRenderingAction();
+            }
+        }
+        
+        private void reparent() {
+            // mirror pos/size so native change notification can get overwritten
+            int x = WindowImpl.this.x;
+            int y = WindowImpl.this.y;
+            int width = WindowImpl.this.width;
+            int height = WindowImpl.this.height;
+            boolean wasVisible;
+
+            windowLock.lock();
+            try {
+                wasVisible = isVisible();
+
+                Window newParentWindowNEWT = null;
+                if(newParentWindow instanceof Window) {
+                    newParentWindowNEWT = (Window) newParentWindow;
+                }
+
+                long newParentWindowHandle = 0 ;
+
+                if(DEBUG_IMPLEMENTATION) {
+                    System.err.println("Window.reparent: START ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle)+", visible "+wasVisible+", old parentWindow: "+Display.hashCodeNullSafe(parentWindow)+", new parentWindow: "+Display.hashCodeNullSafe(newParentWindow)+", forceDestroyCreate "+forceDestroyCreate+", DEBUG_TEST_REPARENT_INCOMPATIBLE "+DEBUG_TEST_REPARENT_INCOMPATIBLE+" "+x+"/"+y+" "+width+"x"+height);
+                }
+
+                if(null!=lifecycleHook) {
+                    lifecycleHook.resetCounter();
+                }
+
+                if(null!=newParentWindow) {
+                    // reset position to 0/0 within parent space
+                    x = 0;
+                    y = 0;
+
+                    // refit if size is bigger than parent
+                    if( width > newParentWindow.getWidth() ) {
+                        width = newParentWindow.getWidth();
+                    }
+                    if( height > newParentWindow.getHeight() ) {
+                        height = newParentWindow.getHeight();
+                    }
+
+                    // Case: Child Window
+                    newParentWindowHandle = getNativeWindowHandle(newParentWindow);
+                    if(0 == newParentWindowHandle) {
+                        // Case: Parent's native window not realized yet
+                        if(null==newParentWindowNEWT) {
+                            throw new NativeWindowException("Reparenting with non NEWT Window type only available after it's realized: "+newParentWindow);
+                        }
+                        // Destroy this window and use parent's Screen.
+                        // It may be created properly when the parent is made visible.
+                        destroy();
+                        setScreen( (ScreenImpl) newParentWindowNEWT.getScreen() );
+                        reparentAction = ACTION_NATIVE_CREATION_PENDING;
+                    } else if(newParentWindow != getParent()) {
+                        // Case: Parent's native window realized and changed
+                        if( !isNativeValid() ) {
+                            // May create a new compatible Screen/Display and
+                            // mark it for creation.
+                            if(null!=newParentWindowNEWT) {
+                                setScreen( (ScreenImpl) newParentWindowNEWT.getScreen() );
+                            } else {
+                                Screen newScreen = NewtFactory.createCompatibleScreen(newParentWindow, getScreen());
+                                if( getScreen() != newScreen ) {
+                                    // auto destroy on-the-fly created Screen/Display
+                                    setScreen( (ScreenImpl) newScreen );
+                                }
+                            }
+                            if( 0<width*height ) {
+                                reparentAction = ACTION_NATIVE_CREATION;
+                            } else {
+                                reparentAction = ACTION_NATIVE_CREATION_PENDING;
+                            }
+                        } else if ( DEBUG_TEST_REPARENT_INCOMPATIBLE || forceDestroyCreate ||
+                                    !NewtFactory.isScreenCompatible(newParentWindow, getScreen()) ) {
+                            // Destroy this window, may create a new compatible Screen/Display,
+                            // and mark it for creation.
+                            destroy();
+                            if(null!=newParentWindowNEWT) {
+                                setScreen( (ScreenImpl) newParentWindowNEWT.getScreen() );
+                            } else {
+                                setScreen( (ScreenImpl) NewtFactory.createCompatibleScreen(newParentWindow, getScreen()) );
+                            }
+                            reparentAction = ACTION_NATIVE_CREATION;
+                        } else {
+                            // Mark it for native reparenting
+                            reparentAction = ACTION_NATIVE_REPARENTING;
+                        }
+                    } else {
+                        // Case: Parent's native window realized and not changed
+                        reparentAction = ACTION_UNCHANGED;
+                    }
+                } else {
+                    if( null != parentWindow ) {
+                        // child -> top
+                        // put client to current parent+child position
+                        Point p = getLocationOnScreen(null);
+                        x = p.getX();
+                        y = p.getY();
+                    }
+
+                    // Case: Top Window
+                    if( 0 == getParentWindowHandle() ) {
+                        // Already Top Window
+                        reparentAction = ACTION_UNCHANGED;
+                    } else if( !isNativeValid() || DEBUG_TEST_REPARENT_INCOMPATIBLE || forceDestroyCreate ) {
+                        // Destroy this window and mark it for [pending] creation.
+                        destroy();
+                        if( 0<width*height ) {
+                            reparentAction = ACTION_NATIVE_CREATION;
+                        } else {
+                            reparentAction = ACTION_NATIVE_CREATION_PENDING;
+                        }
+                    } else {
+                        // Mark it for native reparenting
+                        reparentAction = ACTION_NATIVE_REPARENTING;
+                    }
+                }
+                parentWindowHandle = newParentWindowHandle;
+
+                if ( ACTION_UNCHANGED > reparentAction ) {
+                    throw new NativeWindowException("Internal Error: reparentAction not set");
+                }
+
+                if( ACTION_UNCHANGED == reparentAction ) {
+                    if(DEBUG_IMPLEMENTATION) {
+                        System.err.println("Window.reparent: NO CHANGE ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" new parentWindowHandle "+toHexString(newParentWindowHandle)+", visible "+wasVisible);
+                    }
+                    return;
+                }
+
+                if(DEBUG_IMPLEMENTATION) {
+                    System.err.println("Window.reparent: ACTION ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" new parentWindowHandle "+toHexString(newParentWindowHandle)+", reparentAction "+reparentAction+", visible "+wasVisible);
+                }
+
+                // rearrange window tree
+                if(null!=parentWindow && parentWindow instanceof Window) {
+                    ((Window)parentWindow).removeChild(WindowImpl.this);
+                }
+                parentWindow = newParentWindow;
+                if(parentWindow instanceof Window) {
+                    ((Window)parentWindow).addChild(WindowImpl.this);
+                }
+
+                if( ACTION_NATIVE_CREATION_PENDING == reparentAction ) {
+                    return;
+                }
+
+                if( ACTION_NATIVE_REPARENTING == reparentAction ) {
+                    DisplayImpl display = (DisplayImpl) screen.getDisplay();
+                    display.dispatchMessagesNative(); // status up2date
+                    if(wasVisible) {
+                        setVisibleImpl(false, x, y, width, height);
+                        WindowImpl.this.waitForVisible(false, true);
+                    }
+
+                    // Lock parentWindow only during reparenting (attempt)
+                    NativeWindow parentWindowLocked = null;
+                    if( null != parentWindow ) {
+                        parentWindowLocked = parentWindow;
+                        if( NativeSurface.LOCK_SURFACE_NOT_READY >= parentWindowLocked.lockSurface() ) {
+                            throw new NativeWindowException("Parent surface lock: not ready: "+parentWindow);
+                        }
+                    }
+                    boolean ok = false;
+                    try {
+                        // write back mirrored values, to be able to detect satisfaction
+                        WindowImpl.this.x = x;
+                        WindowImpl.this.y = y;
+                        WindowImpl.this.width = width;
+                        WindowImpl.this.height = height;
+                        ok = reconfigureWindowImpl(x, y, width, height, true, 0, isUndecorated()?-1:1);
+                    } finally {
+                        if(null!=parentWindowLocked) {
+                            parentWindowLocked.unlockSurface();
+                        }
+                    }
+
+                    // set visible again, and revalidate 'ok',
+                    // since it has been experience that in some cases the reparented window gets hidden
+                    if(ok) {
+                        display.dispatchMessagesNative(); // status up2date
+                        if(wasVisible) {
+                            setVisibleImpl(true, x, y, width, height);
+                            ok = WindowImpl.this.waitForVisible(true, false);
+                            display.dispatchMessagesNative(); // status up2date
+                            if( ok &&
+                                ( WindowImpl.this.x != x ||
+                                  WindowImpl.this.y != y ||
+                                  WindowImpl.this.width != width ||
+                                  WindowImpl.this.height != height ) )
+                            {
+                                if(DEBUG_IMPLEMENTATION) {
+                                    System.err.println("Window.reparent (reconfig)");
+                                }
+                                // reset pos/size .. due to some native impl flakyness
+                                reconfigureWindowImpl(x, y, width, height, false, 0, 0);
+                                display.dispatchMessagesNative(); // status up2date
+                                WindowImpl.this.waitForVisible(true, false);
+                                display.dispatchMessagesNative(); // status up2date
+                            }
+                        }
+                    }
+
+                    if(ok) {
+                        if(wasVisible) {
+                            requestFocusImpl(true);
+                            display.dispatchMessagesNative(); // status up2date
+                        }
+                    } else {
+                        // native reparent failed -> try creation
+                        if(DEBUG_IMPLEMENTATION) {
+                            System.err.println("Window.reparent: native reparenting failed ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle)+" -> "+toHexString(newParentWindowHandle)+" - Trying recreation");
+                        }
+                        destroy();
+                        reparentAction = ACTION_NATIVE_CREATION ;
+                    }
+                }
+
+                // write back mirrored values, ensuring persitence
+                // and not relying on native messaging
+                WindowImpl.this.x = x;
+                WindowImpl.this.y = y;
+                WindowImpl.this.width = width;
+                WindowImpl.this.height = height;
+
+                if(DEBUG_IMPLEMENTATION) {
+                    System.err.println("Window.reparentWindow: END ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+x+"/"+y+" "+width+"x"+height);
+                }
+            } finally {
+                windowLock.unlock();
+            }
+
+            if(wasVisible) {
+                switch (reparentAction) {
+                    case ACTION_NATIVE_REPARENTING:
+                        // trigger a resize/relayout and repaint to listener
+                        sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
+                        break;
+
+                    case ACTION_NATIVE_CREATION:
+                        // This may run on the new Display/Screen connection, hence a new EDT task
+                        runOnEDTIfAvail(true, reparentActionRecreate);
+                        break;
+                }
+            }
+        }
+    }
+
+    private class ReparentActionRecreate implements Runnable {
+        public final void run() {
+            windowLock.lock();
+            try {
+                visible = true;
+                if(DEBUG_IMPLEMENTATION) {
+                    System.err.println("Window.reparentWindow: ReparentActionRecreate ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+Display.hashCodeNullSafe(parentWindow));
+                }
+                setVisible(true); // native creation
+            } finally {
+                windowLock.unlock();
+            }
+        }
+    }
+
+    public final int reparentWindow(NativeWindow newParent) {
+        return reparentWindow(newParent, false);
+    }
+
+    public int reparentWindow(NativeWindow newParent, boolean forceDestroyCreate) {
+        int reparentActionStrategy = ReparentAction.ACTION_INVALID;
+        if(isValid()) {
+            ReparentActionImpl reparentAction = new ReparentActionImpl(newParent, forceDestroyCreate);
+            runOnEDTIfAvail(true, reparentAction);
+            reparentActionStrategy = reparentAction.getStrategy();
+        }
+        return reparentActionStrategy;
+    }
+
+    public CapabilitiesChooser setCapabilitiesChooser(CapabilitiesChooser chooser) {
+        CapabilitiesChooser old = this.capabilitiesChooser;
+        this.capabilitiesChooser = chooser;
+        return old;
+    }
+
+    public final CapabilitiesImmutable getChosenCapabilities() {
+        return config.getNativeGraphicsConfiguration().getChosenCapabilities();
+    }
+
+    public final CapabilitiesImmutable getRequestedCapabilities() {
+        return capsRequested;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        if (title == null) {
+            title = "";
+        }
+        this.title = title;
+        if(0 != getWindowHandle()) {
+            setTitleImpl(title);
+        }
+    }
+
+    private class DecorationActionImpl implements Runnable {
+        boolean undecorated;
+
+        private DecorationActionImpl(boolean undecorated) {
+            this.undecorated = undecorated;
+        }
+
+        public final void run() {
+            windowLock.lock();
+            try {
+                if(!fullscreen && isNativeValid() && WindowImpl.this.undecorated != undecorated) {
+                    WindowImpl.this.undecorated = undecorated;
+                    // mirror pos/size so native change notification can get overwritten
+                    int x = WindowImpl.this.x;
+                    int y = WindowImpl.this.y;
+                    int width = WindowImpl.this.width;
+                    int height = WindowImpl.this.height;
+
+                    if( 0 != windowHandle ) {
+                        DisplayImpl display = (DisplayImpl) screen.getDisplay();
+                        display.dispatchMessagesNative(); // status up2date
+                        boolean wasVisible = isVisible();
+                        setVisibleImpl(false, x, y, width, height);
+                        WindowImpl.this.waitForVisible(false, true);
+                        display.dispatchMessagesNative(); // status up2date
+                        reconfigureWindowImpl(x, y, width, height, false, 0, undecorated?-1:1);
+                        display.dispatchMessagesNative(); // status up2date
+                        if(wasVisible) {
+                            setVisibleImpl(true, x, y, width, height);
+                            WindowImpl.this.waitForVisible(true, true);
+                            display.dispatchMessagesNative(); // status up2date
+                            if( WindowImpl.this.x != x ||
+                                WindowImpl.this.y != y ||
+                                WindowImpl.this.width != width ||
+                                WindowImpl.this.height != height ) 
+                            {
+                                // reset pos/size .. due to some native impl flakyness
+                                reconfigureWindowImpl(x, y, width, height, false, 0, 0);
+                                display.dispatchMessagesNative(); // status up2date
+                            }
+                            requestFocusImpl(true);
+                            display.dispatchMessagesNative(); // status up2date
+                        }
+                    }
+                }
+            } finally {
+                windowLock.unlock();
+            }
+            sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
+        }
+    }
+
+    public void setUndecorated(boolean value) {
+        if(isValid()) {
+            runOnEDTIfAvail(true, new DecorationActionImpl(value));
+        }
+    }
+
+    public boolean isUndecorated() {
+        return 0 != parentWindowHandle || undecorated || fullscreen ;
+    }
+
+    public void requestFocus() {
+        enqueueRequestFocus(true);
+    }
+
+    public boolean hasFocus() {
+        return hasFocus;
+    }
+
+    public Insets getInsets() {
+        return new Insets(0,0,0,0);
+    }
+
+    public final int getWidth() {
+        return width;
+    }
+
+    public final int getHeight() {
+        return height;
+    }
+
+    public final int getX() {
+        return x;
+    }
+
+    public final int getY() {
+        return y;
+    }
+
+    public final boolean isVisible() {
+        return visible;
+    }
+
+    public final boolean isFullscreen() {
+        return fullscreen;
+    }
+
+
+    //----------------------------------------------------------------------
+    // Window
+    //
+
+    /**
+     * If the implementation is capable of detecting a device change
+     * return true and clear the status/reason of the change.
+     */
+    public boolean hasDeviceChanged() {
+        return false;
+    }
+
+    public LifecycleHook getLifecycleHook() {
+        return lifecycleHook;
+    }
+
+    public LifecycleHook setLifecycleHook(LifecycleHook hook) {
+        LifecycleHook old = lifecycleHook;
+        lifecycleHook = hook;
+        return old;
+    }
+
+    /** If this Window actually wraps one from another toolkit such as
+        the AWT, this will return a non-null value. */
+    public Object getWrappedWindow() {
+        return null;
+    }
+
+    /**
+     * If set to true, the default value, this NEWT Window implementation will
+     * handle the destruction (ie {@link #destroy()} call) within {@link #windowDestroyNotify()} implementation.<br>
+     * If set to false, it's up to the caller/owner to handle destruction within {@link #windowDestroyNotify()}.
+     */
+    public void setHandleDestroyNotify(boolean b) {
+        handleDestroyNotify = b;
+    }
+
+    //----------------------------------------------------------------------
+    // WindowImpl
+    //
+
+    protected final long getParentWindowHandle() {
+        return parentWindowHandle;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append(getClass().getName()+"[Config "+config+
+                    "\n, "+screen+
+                    "\n, ParentWindow "+parentWindow+
+                    "\n, ParentWindowHandle "+toHexString(parentWindowHandle)+
+                    "\n, WindowHandle "+toHexString(getWindowHandle())+
+                    "\n, SurfaceHandle "+toHexString(getSurfaceHandle())+ " (lockedExt window "+isWindowLockedByOtherThread()+", surface "+isSurfaceLockedByOtherThread()+")"+
+                    "\n, Pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+
+                    "\n, Visible "+isVisible()+
+                    "\n, Undecorated "+undecorated+
+                    "\n, Fullscreen "+fullscreen+
+                    "\n, WrappedWindow "+getWrappedWindow()+
+                    "\n, ChildWindows "+childWindows.size());
+
+        sb.append(", SurfaceUpdatedListeners num "+surfaceUpdatedListeners.size()+" [");
+        for (int i = 0; i < surfaceUpdatedListeners.size(); i++ ) {
+          sb.append(surfaceUpdatedListeners.get(i)+", ");
+        }
+        sb.append("], WindowListeners num "+windowListeners.size()+" [");
+        for (int i = 0; i < windowListeners.size(); i++ ) {
+          sb.append(windowListeners.get(i)+", ");
+        }
+        sb.append("], MouseListeners num "+mouseListeners.size()+" [");
+        for (int i = 0; i < mouseListeners.size(); i++ ) {
+          sb.append(mouseListeners.get(i)+", ");
+        }
+        sb.append("], KeyListeners num "+keyListeners.size()+" [");
+        for (int i = 0; i < keyListeners.size(); i++ ) {
+          sb.append(keyListeners.get(i)+", ");
+        }
+        sb.append("] ]");
+        return sb.toString();
+    }
+
+    protected final void setWindowHandle(long handle) {
+        windowHandle = handle;
+    }
+
+    public void runOnEDTIfAvail(boolean wait, final Runnable task) {
+        Screen scrn = getScreen();
+        if(null==scrn) {
+            throw new RuntimeException("Null screen of inner class: "+this);
+        }
+        DisplayImpl d = (DisplayImpl) scrn.getDisplay();
+        d.runOnEDTIfAvail(wait, task);
+    }
+
+    private class RequestFocusAction implements Runnable {
+        public final void run() {
+            if(DEBUG_IMPLEMENTATION) {
+                System.err.println("Window.RequestFocusAction: ("+getThreadName()+"): "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
+            }
+            WindowImpl.this.requestFocusImpl(false);
+        }
+    }
+
+    protected void enqueueRequestFocus(boolean wait) {
+        runOnEDTIfAvail(wait, requestFocusAction);
+    }
+
+    /** 
+     * May set to a {@link FocusRunnable}, {@link FocusRunnable#run()} before Newt requests the native focus.
+     * This allows notifying a covered window toolkit like AWT that the focus is requested,
+     * hence focus traversal can be made transparent.
+     */
+    public void setFocusAction(FocusRunnable focusAction) {
+        this.focusAction = focusAction;
+    }
+    protected boolean focusAction() {
+        if(DEBUG_IMPLEMENTATION) {
+            System.err.println("Window.focusAction() START - "+getThreadName()+", focusAction: "+focusAction+" - windowHandle "+toHexString(getWindowHandle()));
+        }
+        boolean res;
+        if(null!=focusAction) {
+            res = focusAction.run();
+        } else {
+            res = false;
+        }
+        if(DEBUG_IMPLEMENTATION) {
+            System.err.println("Window.focusAction() END - "+getThreadName()+", focusAction: "+focusAction+" - windowHandle "+toHexString(getWindowHandle())+", res: "+res);
+        }
+        return res;
+    }
+
+    private class SetPositionActionImpl implements Runnable {
+        int x, y;
+
+        private SetPositionActionImpl(int x, int y) {
+            this.x = x;
+            this.y = y;
+        }
+        public final void run() {
+            windowLock.lock();
+            try {
+                if(DEBUG_IMPLEMENTATION) {
+                    System.err.println("Window setPosition: "+WindowImpl.this.x+"/"+WindowImpl.this.y+" -> "+x+"/"+y+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle));
+                }
+                if ( WindowImpl.this.x != x || WindowImpl.this.y != y ) {
+                    if(!fullscreen) {
+                        if(0!=windowHandle) {
+                            // this.x/this.y will be set by windowChanged, called by the native implementation
+                            reconfigureWindowImpl(x, y, -1, -1, false, 0, 0);
+                        } else {
+                            WindowImpl.this.x = x;
+                            WindowImpl.this.y = y;
+                        }
+                    }
+                }
+            } finally {
+                windowLock.unlock();
+            }
+        }
+    }
+
+    public void setPosition(int x, int y) {
+        if(isValid()) {
+            runOnEDTIfAvail(true, new SetPositionActionImpl(x, y));
+        }
+    }
+
+    private class FullScreenActionImpl implements Runnable {
+        boolean fullscreen;
+
+        private FullScreenActionImpl (boolean fullscreen) {
+            this.fullscreen = fullscreen;
+        }
+
+        public final void run() {
+            windowLock.lock();
+            try {
+                if(isNativeValid() && WindowImpl.this.fullscreen != fullscreen) {
+                    int x,y,w,h;
+                    WindowImpl.this.fullscreen = fullscreen;
+                    if(fullscreen) {
+                        x = 0; y = 0;
+                        w = screen.getWidth();
+                        h = screen.getHeight();
+                        nfs_width = width;
+                        nfs_height = height;
+                        nfs_x = x;
+                        nfs_y = y;
+                    } else {
+                        x = nfs_x;
+                        y = nfs_y;
+                        w = nfs_width;
+                        h = nfs_height;
+                    }
+                    if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+                        System.err.println("Window fs: "+fullscreen+" "+x+"/"+y+" "+w+"x"+h+", "+isUndecorated()+", "+screen);
+                    }
+
+                    DisplayImpl display = (DisplayImpl) screen.getDisplay();
+                    display.dispatchMessagesNative(); // status up2date
+                    boolean wasVisible = isVisible();
+                    setVisibleImpl(false, x, y, width, height);
+                    WindowImpl.this.waitForVisible(false, true);
+                    display.dispatchMessagesNative(); // status up2date
+
+                    // write back mirrored values, to be able to detect satisfaction
+                    WindowImpl.this.x = x;
+                    WindowImpl.this.y = y;
+                    WindowImpl.this.width = w;
+                    WindowImpl.this.height = h;
+                    reconfigureWindowImpl(x, y, w, h, getParentWindowHandle()!=0, fullscreen?1:-1, isUndecorated()?-1:1);
+                    display.dispatchMessagesNative(); // status up2date
+
+                    if(wasVisible) {
+                        setVisibleImpl(true, x, y, width, height);
+                        boolean ok = WindowImpl.this.waitForVisible(true, true, Screen.SCREEN_MODE_CHANGE_TIMEOUT);
+                        display.dispatchMessagesNative(); // status up2date
+                        if( ok &&
+                            ( WindowImpl.this.x != x ||
+                              WindowImpl.this.y != y ||
+                              WindowImpl.this.width != w ||
+                              WindowImpl.this.height != h ) )
+                        {
+                            if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+                                System.err.println("Window fs (reconfig): "+x+"/"+y+" "+w+"x"+h+", "+screen);
+                            }
+                            // reset pos/size .. due to some native impl flakyness
+                            reconfigureWindowImpl(x, y, width, height, false, 0, 0);
+                            display.dispatchMessagesNative(); // status up2date
+                        }
+                        requestFocusImpl(true);
+                        display.dispatchMessagesNative(); // status up2date
+                        if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+                            System.err.println("Window fs done");
+                        }
+                    }
+                }
+            } finally {
+                windowLock.unlock();
+            }
+            sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
+        }
+    }
+
+    public boolean setFullscreen(boolean fullscreen) {
+        if(isValid()) {
+            runOnEDTIfAvail(true, new FullScreenActionImpl(fullscreen));
+        }
+        return this.fullscreen;
+    }
+
+    private class ScreenModeListenerImpl implements ScreenModeListener {
+        boolean animatorPaused = false;
+
+        public void screenModeChangeNotify(ScreenMode sm) {
+            if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+                System.err.println("Window.screenModeChangeNotify: "+sm);
+            }
+
+            if(null!=lifecycleHook) {
+                animatorPaused = lifecycleHook.pauseRenderingAction();
+            }
+        }
+
+        public void screenModeChanged(ScreenMode sm, boolean success) {
+            if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+                System.err.println("Window.screenModeChanged: "+sm+", success: "+success);
+            }
+
+            if(success) {
+                DimensionReadOnly screenSize = sm.getMonitorMode().getSurfaceSize().getResolution();
+                if ( getHeight() > screenSize.getHeight()  ||
+                     getWidth() > screenSize.getWidth() ) {
+                    setSize(screenSize.getWidth(), screenSize.getHeight());
+                }
+            }
+
+            if(animatorPaused) {
+                lifecycleHook.resumeRenderingAction();
+            }
+            sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
+        }
+    }
+
+    //----------------------------------------------------------------------
+    // Child Window Management
+    // 
+
+    public final void removeChild(NativeWindow win) {
+        synchronized(childWindowsLock) {
+            childWindows.remove(win);
+        }
+    }
+
+    public final void addChild(NativeWindow win) {
+        if (win == null) {
+            return;
+        }
+        synchronized(childWindowsLock) {
+            childWindows.add(win);
+        }
+    }
+
+    //----------------------------------------------------------------------
+    // Generic Event Support
+    //
+    private void doEvent(boolean enqueue, boolean wait, com.jogamp.newt.event.NEWTEvent event) {
+        boolean done = false;
+
+        if(!enqueue) {
+            done = consumeEvent(event);
+            wait = done; // don't wait if event can't be consumed now
+        }
+
+        if(!done) {
+            enqueueEvent(wait, event);
+        }
+    }
+
+    public void enqueueEvent(boolean wait, com.jogamp.newt.event.NEWTEvent event) {
+        if(isValid()) {
+            ((DisplayImpl)getScreen().getDisplay()).enqueueEvent(wait, event);
+        }
+    }
+
+    public boolean consumeEvent(NEWTEvent e) {
+        switch(e.getEventType()) {
+            // special repaint treatment
+            case WindowEvent.EVENT_WINDOW_REPAINT:
+                // queue repaint event in case window is locked, ie in operation
+                if( isWindowLocked() ) {
+                    // make sure only one repaint event is queued
+                    if(!repaintQueued) {
+                        repaintQueued=true;
+                        if(DEBUG_IMPLEMENTATION) {
+                            System.err.println("Window.consumeEvent: queued "+e);
+                            // Exception ee = new Exception("Window.windowRepaint: "+e);
+                            // ee.printStackTrace();
+                        }
+                        return false;
+                    }
+                    return true;
+                }
+                repaintQueued=false; // no repaint event queued
+                break;
+
+            // common treatment
+            case WindowEvent.EVENT_WINDOW_RESIZED:
+                // queue event in case window is locked, ie in operation
+                if( isWindowLocked() ) {
+                    if(DEBUG_IMPLEMENTATION) {
+                        System.err.println("Window.consumeEvent: queued "+e);
+                        // Exception ee = new Exception("Window.windowRepaint: "+e);
+                        // ee.printStackTrace();
+                    }
+                    return false;
+                }
+                break;
+            default:
+                break;
+        }
+        if(e instanceof WindowEvent) {
+            consumeWindowEvent((WindowEvent)e);
+        } else if(e instanceof KeyEvent) {
+            consumeKeyEvent((KeyEvent)e);
+        } else if(e instanceof MouseEvent) {
+            consumeMouseEvent((MouseEvent)e);
+        } else {
+            throw new NativeWindowException("Unexpected NEWTEvent type " + e);
+        }
+        return true;
+    }
+
+    //
+    // SurfaceUpdatedListener Support
+    //
+
+    public void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+        addSurfaceUpdatedListener(-1, l);
+    }
+
+    public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) 
+        throws IndexOutOfBoundsException
+    {
+        if(l == null) {
+            return;
+        }
+        synchronized(surfaceUpdatedListenersLock) {
+            if(0>index) { 
+                index = surfaceUpdatedListeners.size(); 
+            }
+            surfaceUpdatedListeners.add(index, l);
+        }
+    }
+
+    public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+        if (l == null) {
+            return;
+        }
+        synchronized(surfaceUpdatedListenersLock) {
+            surfaceUpdatedListeners.remove(l);
+        }
+    }
+
+    public void removeAllSurfaceUpdatedListener() {
+        synchronized(surfaceUpdatedListenersLock) {
+            surfaceUpdatedListeners = new ArrayList();
+        }
+    }
+
+    public SurfaceUpdatedListener getSurfaceUpdatedListener(int index) {
+        synchronized(surfaceUpdatedListenersLock) {
+            if(0>index) { 
+                index = surfaceUpdatedListeners.size()-1; 
+            }
+            return (SurfaceUpdatedListener) surfaceUpdatedListeners.get(index);
+        }
+    }
+
+    public SurfaceUpdatedListener[] getSurfaceUpdatedListeners() {
+        synchronized(surfaceUpdatedListenersLock) {
+            return (SurfaceUpdatedListener[]) surfaceUpdatedListeners.toArray();
+        }
+    }
+
+    public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+        synchronized(surfaceUpdatedListenersLock) {
+          for(int i = 0; i < surfaceUpdatedListeners.size(); i++ ) {
+            SurfaceUpdatedListener l = (SurfaceUpdatedListener) surfaceUpdatedListeners.get(i);
+            l.surfaceUpdated(updater, ns, when);
+          }
+        }
+    }
+
+    //
+    // MouseListener/Event Support
+    //
+    public void sendMouseEvent(int eventType, int modifiers,
+                               int x, int y, int button, int rotation) {
+        doMouseEvent(false, false, eventType, modifiers, x, y, button, rotation);
+    }
+    public void enqueueMouseEvent(boolean wait, int eventType, int modifiers,
+                                  int x, int y, int button, int rotation) {
+        doMouseEvent(true, wait, eventType, modifiers, x, y, button, rotation);
+    }
+    private void doMouseEvent(boolean enqueue, boolean wait, int eventType, int modifiers,
+                              int x, int y, int button, int rotation) {
+        if(x<0||y<0||x>=width||y>=height) {
+            return; // .. invalid ..
+        }
+        if(DEBUG_MOUSE_EVENT) {
+            System.err.println("doMouseEvent: enqueue"+enqueue+", wait "+wait+", "+MouseEvent.getEventTypeString(eventType)+
+                               ", mod "+modifiers+", pos "+x+"/"+y+", button "+button);
+        }
+        if(button<0||button>MouseEvent.BUTTON_NUMBER) {
+            throw new NativeWindowException("Invalid mouse button number" + button);
+        }
+        long when = System.currentTimeMillis();
+        MouseEvent eClicked = null;
+        MouseEvent e = null;
+
+        if(MouseEvent.EVENT_MOUSE_PRESSED==eventType) {
+            if(when-lastMousePressed<MouseEvent.getClickTimeout()) {
+                lastMouseClickCount++;
+            } else {
+                lastMouseClickCount=1;
+            }
+            lastMousePressed=when;
+            mouseButtonPressed=button;
+            e = new MouseEvent(eventType, this, when,
+                               modifiers, x, y, lastMouseClickCount, button, 0);
+        } else if(MouseEvent.EVENT_MOUSE_RELEASED==eventType) {
+            e = new MouseEvent(eventType, this, when,
+                               modifiers, x, y, lastMouseClickCount, button, 0);
+            if(when-lastMousePressed<MouseEvent.getClickTimeout()) {
+                eClicked = new MouseEvent(MouseEvent.EVENT_MOUSE_CLICKED, this, when,
+                                          modifiers, x, y, lastMouseClickCount, button, 0);
+            } else {
+                lastMouseClickCount=0;
+                lastMousePressed=0;
+            }
+            mouseButtonPressed=0;
+        } else if(MouseEvent.EVENT_MOUSE_MOVED==eventType) {
+            if (mouseButtonPressed>0) {
+                e = new MouseEvent(MouseEvent.EVENT_MOUSE_DRAGGED, this, when,
+                                   modifiers, x, y, 1, mouseButtonPressed, 0);
+            } else {
+                e = new MouseEvent(eventType, this, when,
+                                   modifiers, x, y, 0, button, 0);
+            }
+        } else if(MouseEvent.EVENT_MOUSE_WHEEL_MOVED==eventType) {
+            e = new MouseEvent(eventType, this, when, modifiers, x, y, 0, button, rotation);
+        } else {
+            e = new MouseEvent(eventType, this, when, modifiers, x, y, 0, button, 0);
+        }
+        doEvent(enqueue, wait, e);
+        if(null!=eClicked) {
+            if(DEBUG_MOUSE_EVENT) {
+                System.err.println("doMouseEvent: synthesized MOUSE_CLICKED event");
+            }
+            doEvent(enqueue, wait, eClicked);
+        }
+    }
+
+
+    public void addMouseListener(MouseListener l) {
+        addMouseListener(-1, l);
+    }
+
+    public void addMouseListener(int index, MouseListener l) {
+        if(l == null) {
+            return;
+        }
+        ArrayList clonedListeners = (ArrayList) mouseListeners.clone();
+        if(0>index) { 
+            index = clonedListeners.size(); 
+        }
+        clonedListeners.add(index, l);
+        mouseListeners = clonedListeners;
+    }
+
+    public void removeMouseListener(MouseListener l) {
+        if (l == null) {
+            return;
+        }
+        ArrayList clonedListeners = (ArrayList) mouseListeners.clone();
+        clonedListeners.remove(l);
+        mouseListeners = clonedListeners;
+    }
+
+    public MouseListener getMouseListener(int index) {
+        ArrayList clonedListeners = (ArrayList) mouseListeners.clone();
+        if(0>index) { 
+            index = clonedListeners.size()-1; 
+        }
+        return (MouseListener) clonedListeners.get(index);
+    }
+
+    public MouseListener[] getMouseListeners() {
+        return (MouseListener[]) mouseListeners.toArray();
+    }
+
+    protected void consumeMouseEvent(MouseEvent e) {
+        if(DEBUG_MOUSE_EVENT) {
+            System.err.println("consumeMouseEvent: event:         "+e);
+        }
+
+        for(int i = 0; i < mouseListeners.size(); i++ ) {
+            MouseListener l = (MouseListener) mouseListeners.get(i);
+            switch(e.getEventType()) {
+                case MouseEvent.EVENT_MOUSE_CLICKED:
+                    l.mouseClicked(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_ENTERED:
+                    l.mouseEntered(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_EXITED:
+                    l.mouseExited(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_PRESSED:
+                    l.mousePressed(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_RELEASED:
+                    l.mouseReleased(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_MOVED:
+                    l.mouseMoved(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_DRAGGED:
+                    l.mouseDragged(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_WHEEL_MOVED:
+                    l.mouseWheelMoved(e);
+                    break;
+                default:
+                    throw new NativeWindowException("Unexpected mouse event type " + e.getEventType());
+            }
+        }
+    }
+
+    //
+    // KeyListener/Event Support
+    //
+
+    public void sendKeyEvent(int eventType, int modifiers, int keyCode, char keyChar) {
+        consumeKeyEvent(new KeyEvent(eventType, this, System.currentTimeMillis(), modifiers, keyCode, keyChar) );
+    }
+
+    public void enqueueKeyEvent(boolean wait, int eventType, int modifiers, int keyCode, char keyChar) {
+        enqueueEvent(wait, new KeyEvent(eventType, this, System.currentTimeMillis(), modifiers, keyCode, keyChar) );
+    }
+
+    public void addKeyListener(KeyListener l) {
+        addKeyListener(-1, l);
+    }
+
+    public void addKeyListener(int index, KeyListener l) {
+        if(l == null) {
+            return;
+        }
+        ArrayList clonedListeners = (ArrayList) keyListeners.clone();
+        if(0>index) { 
+            index = clonedListeners.size();
+        }
+        clonedListeners.add(index, l);
+        keyListeners = clonedListeners;
+    }
+
+    public void removeKeyListener(KeyListener l) {
+        if (l == null) {
+            return;
+        }
+        ArrayList clonedListeners = (ArrayList) keyListeners.clone();
+        clonedListeners.remove(l);
+        keyListeners = clonedListeners;
+    }
+
+    public KeyListener getKeyListener(int index) {
+        ArrayList clonedListeners = (ArrayList) keyListeners.clone();
+        if(0>index) { 
+            index = clonedListeners.size()-1;
+        }
+        return (KeyListener) clonedListeners.get(index);
+    }
+
+    public KeyListener[] getKeyListeners() {
+        return (KeyListener[]) keyListeners.toArray();
+    }
+
+    protected void consumeKeyEvent(KeyEvent e) {
+        if(DEBUG_KEY_EVENT) {
+            System.err.println("consumeKeyEvent: "+e);
+        }
+        for(int i = 0; i < keyListeners.size(); i++ ) {
+            KeyListener l = (KeyListener) keyListeners.get(i);
+            switch(e.getEventType()) {
+                case KeyEvent.EVENT_KEY_PRESSED:
+                    l.keyPressed(e);
+                    break;
+                case KeyEvent.EVENT_KEY_RELEASED:
+                    l.keyReleased(e);
+                    break;
+                case KeyEvent.EVENT_KEY_TYPED:
+                    l.keyTyped(e);
+                    break;
+                default:
+                    throw new NativeWindowException("Unexpected key event type " + e.getEventType());
+            }
+        }
+    }
+
+    //
+    // WindowListener/Event Support
+    //
+    public void sendWindowEvent(int eventType) {
+        consumeWindowEvent( new WindowEvent(eventType, this, System.currentTimeMillis()) );
+    }
+
+    public void enqueueWindowEvent(boolean wait, int eventType) {
+        enqueueEvent( wait, new WindowEvent(eventType, this, System.currentTimeMillis()) );
+    }
+
+    public void addWindowListener(WindowListener l) {
+        addWindowListener(-1, l);
+    }
+
+    public void addWindowListener(int index, WindowListener l) 
+        throws IndexOutOfBoundsException
+    {
+        if(l == null) {
+            return;
+        }
+        ArrayList clonedListeners = (ArrayList) windowListeners.clone();
+        if(0>index) { 
+            index = clonedListeners.size(); 
+        }
+        clonedListeners.add(index, l);
+        windowListeners = clonedListeners;
+    }
+
+    public final void removeWindowListener(WindowListener l) {
+        if (l == null) {
+            return;
+        }
+        ArrayList clonedListeners = (ArrayList) windowListeners.clone();
+        clonedListeners.remove(l);
+        windowListeners = clonedListeners;
+    }
+
+    public WindowListener getWindowListener(int index) {
+        ArrayList clonedListeners = (ArrayList) windowListeners.clone();
+        if(0>index) { 
+            index = clonedListeners.size()-1; 
+        }
+        return (WindowListener) clonedListeners.get(index);
+    }
+
+    public WindowListener[] getWindowListeners() {
+        return (WindowListener[]) windowListeners.toArray();
+    }
+
+    protected void consumeWindowEvent(WindowEvent e) {
+        if(DEBUG_WINDOW_EVENT) {
+            System.err.println("consumeWindowEvent: "+e+", visible "+isVisible()+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
+        }
+        for(int i = 0; i < windowListeners.size(); i++ ) {
+            WindowListener l = (WindowListener) windowListeners.get(i);
+            switch(e.getEventType()) {
+                case WindowEvent.EVENT_WINDOW_RESIZED:
+                    l.windowResized(e);
+                    break;
+                case WindowEvent.EVENT_WINDOW_MOVED:
+                    l.windowMoved(e);
+                    break;
+                case WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY:
+                    l.windowDestroyNotify(e);
+                    break;
+                case WindowEvent.EVENT_WINDOW_DESTROYED:
+                    l.windowDestroyed(e);
+                    break;
+                case WindowEvent.EVENT_WINDOW_GAINED_FOCUS:
+                    l.windowGainedFocus(e);
+                    break;
+                case WindowEvent.EVENT_WINDOW_LOST_FOCUS:
+                    l.windowLostFocus(e);
+                    break;
+                case WindowEvent.EVENT_WINDOW_REPAINT:
+                    l.windowRepaint((WindowUpdateEvent)e);
+                    break;
+                default:
+                    throw 
+                        new NativeWindowException("Unexpected window event type "
+                                                  + e.getEventType());
+            }
+        }
+    }
+
+    /**
+     * @param focusGained
+     */
+    protected void focusChanged(boolean focusGained) {
+        if(DEBUG_IMPLEMENTATION) {
+            System.err.println("Window.focusChanged: ("+getThreadName()+"): "+this.hasFocus+" -> "+focusGained+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
+        }
+        hasFocus = focusGained;
+        if (focusGained) {
+            sendWindowEvent(WindowEvent.EVENT_WINDOW_GAINED_FOCUS);
+        } else {
+            sendWindowEvent(WindowEvent.EVENT_WINDOW_LOST_FOCUS);
+        }
+    }
+
+    protected void visibleChanged(boolean visible) {
+        if(DEBUG_IMPLEMENTATION) {
+            System.err.println("Window.visibleChanged ("+getThreadName()+"): "+this.visible+" -> "+visible+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
+        }
+        this.visible = visible ;
+    }
+
+    private boolean waitForVisible(boolean visible, boolean failFast) {
+        return waitForVisible(visible, failFast, TIMEOUT_NATIVEWINDOW);
+    }
+
+    private boolean waitForVisible(boolean visible, boolean failFast, long timeOut) {
+        DisplayImpl display = (DisplayImpl) screen.getDisplay();
+        for(long sleep = timeOut; 0<sleep && this.visible != visible; sleep-=10 ) {
+            display.dispatchMessagesNative(); // status up2date
+            try {
+                Thread.sleep(10);
+            } catch (InterruptedException ie) {}
+            sleep -=10;
+        }
+        if(this.visible != visible) {
+            if(failFast) {
+                throw new NativeWindowException("Visibility not reached as requested within "+timeOut+"ms : requested "+visible+", is "+this.visible);
+            } else if (DEBUG_IMPLEMENTATION) {
+                System.err.println("******* Visibility not reached as requested within "+timeOut+"ms : requested "+visible+", is "+this.visible);
+            }
+        }
+        return this.visible == visible;
+    }
+
+    protected void sizeChanged(int newWidth, int newHeight, boolean force) {
+        if(force || width != newWidth || height != newHeight) {
+            if(DEBUG_IMPLEMENTATION) {
+                System.err.println("Window.sizeChanged: ("+getThreadName()+"): force "+force+", "+width+"x"+height+" -> "+newWidth+"x"+newHeight+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
+            }
+            width = newWidth;
+            height = newHeight;
+            if(isNativeValid()) {
+                sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
+            }
+        }
+    }
+
+    protected void positionChanged(int newX, int newY) {
+        if( 0==parentWindowHandle && ( x != newX || y != newY ) ) {
+            if(DEBUG_IMPLEMENTATION) {
+                System.err.println("Window.positionChanged: ("+getThreadName()+"): "+x+"/"+y+" -> "+newX+"/"+newY+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
+            }
+            x = newX;
+            y = newY;
+            sendWindowEvent(WindowEvent.EVENT_WINDOW_MOVED);
+        }
+    }
+
+    protected void windowDestroyNotify() {
+        if(DEBUG_IMPLEMENTATION) {
+            System.err.println("Window.windowDestroyNotify START "+getThreadName());
+        }
+
+        // send synced destroy notifications
+        enqueueWindowEvent(true, WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
+
+        if(handleDestroyNotify && DISPOSE_ON_CLOSE == defaultCloseOperation && isValid()) {
+            destroy();
+        }
+
+        if(DEBUG_IMPLEMENTATION) {
+            System.err.println("Window.windowDestroyeNotify END "+getThreadName());
+        }
+    }
+
+    public void windowRepaint(int x, int y, int width, int height) {
+        if(DEBUG_IMPLEMENTATION) {
+            System.err.println("Window.windowRepaint "+getThreadName()+" - "+x+"/"+y+" "+width+"x"+height);
+            // Exception ee = new Exception("Window.windowRepaint: "+" - "+x+"/"+y+" "+width+"x"+height);
+            // ee.printStackTrace();
+        }
+
+        if(isNativeValid()) {
+            if(0>width) {
+                width=this.width;
+            }
+            if(0>height) {
+                height=this.height;
+            }
+
+            NEWTEvent e = new WindowUpdateEvent(WindowEvent.EVENT_WINDOW_REPAINT, this, System.currentTimeMillis(),
+                                                new Rectangle(x, y, width, height));
+            doEvent(false, false, e);
+        }
+    }
+
+    //
+    // Reflection helper ..
+    //
+
+    private static Class[] getCustomConstructorArgumentTypes(Class windowClass) {
+        Class[] argTypes = null;
+        try {
+            Method m = windowClass.getDeclaredMethod("getCustomConstructorArgumentTypes", new Class[] {});
+            argTypes = (Class[]) m.invoke(null, (Object[])null);
+        } catch (Throwable t) {}
+        return argTypes;
+    }
+
+    private static int verifyConstructorArgumentTypes(Class[] types, Object[] args) {
+        if(types.length != args.length) {
+            return -1;
+        }
+        for(int i=0; i<args.length; i++) {
+            if(!types[i].isInstance(args[i])) {
+                return i;
+            }
+        }
+        return args.length;
+    }
+
+    private static String getArgsStrList(Object[] args) {
+        StringBuilder sb = new StringBuilder();
+        for(int i=0; i<args.length; i++) {
+            sb.append(args[i].getClass());
+            if(i<args.length) {
+                sb.append(", ");
+            }
+        }
+        return sb.toString();
+    }
+
+    private static String getTypeStrList(Class[] types) {
+        StringBuilder sb = new StringBuilder();
+        for(int i=0; i<types.length; i++) {
+            sb.append(types[i]);
+            if(i<types.length) {
+                sb.append(", ");
+            }
+        }
+        return sb.toString();
+    }
+
+    protected final void shouldNotCallThis() {
+        throw new NativeWindowException("Should not call this");
+    }
+    
+    public static String getThreadName() {
+        return Display.getThreadName();
+    }
+
+    public static String toHexString(int hex) {
+        return Display.toHexString(hex);
+    }
+
+    public static String toHexString(long hex) {
+        return Display.toHexString(hex);
+    }
+}
+
diff --git a/src/newt/classes/jogamp/newt/awt/AWTCanvas.java b/src/newt/classes/jogamp/newt/awt/AWTCanvas.java
new file mode 100644
index 0000000..01e8134
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/awt/AWTCanvas.java
@@ -0,0 +1,312 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.awt;
+
+import java.awt.Canvas;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsConfiguration;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsScreen;
+import javax.media.nativewindow.CapabilitiesChooser;
+import javax.media.nativewindow.CapabilitiesImmutable;
+import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.awt.AWTGraphicsConfiguration;
+import javax.media.nativewindow.awt.AWTGraphicsDevice;
+import javax.media.nativewindow.awt.AWTGraphicsScreen;
+import com.jogamp.newt.Window;
+
+public class AWTCanvas extends Canvas {
+  private GraphicsDevice device;
+  private GraphicsConfiguration chosen;
+  private AWTGraphicsConfiguration awtConfig;
+
+  private CapabilitiesChooser chooser=null;
+  private CapabilitiesImmutable capabilities;
+
+  private boolean displayConfigChanged=false;
+
+  public AWTCanvas(CapabilitiesImmutable capabilities, CapabilitiesChooser chooser) {
+    super();
+
+    if(null==capabilities) {
+        throw new NativeWindowException("Capabilities null");
+    }
+    this.capabilities=capabilities;
+    this.chooser=chooser;
+  }
+
+  public AWTGraphicsConfiguration getAWTGraphicsConfiguration() {
+    return awtConfig;
+  }
+
+  public boolean hasDeviceChanged() {
+    boolean res = displayConfigChanged;
+    displayConfigChanged=false;
+    return res;
+  }
+
+  public void addNotify() {
+
+    /**
+     * 'super.addNotify()' determines the GraphicsConfiguration,
+     * while calling this class's overriden 'getGraphicsConfiguration()' method
+     * after which it creates the native peer.
+     * Hence we have to set the 'awtConfig' before since it's GraphicsConfiguration
+     * is being used in getGraphicsConfiguration().
+     * This code order also allows recreation, ie re-adding the GLCanvas.
+     */
+    awtConfig = chooseGraphicsConfiguration(capabilities, capabilities, chooser, device);
+    if(Window.DEBUG_IMPLEMENTATION) {
+        Exception e = new Exception("Info: Created Config: "+awtConfig);
+        e.printStackTrace();
+    }
+    if(null==awtConfig) {
+        throw new NativeWindowException("Error: NULL AWTGraphicsConfiguration");
+    }
+    chosen = awtConfig.getGraphicsConfiguration();
+
+    // before native peer is valid: X11
+    disableBackgroundErase();
+
+    // issues getGraphicsConfiguration() and creates the native peer
+    super.addNotify();
+
+    // after native peer is valid: Windows
+    disableBackgroundErase();
+
+    GraphicsConfiguration gc = super.getGraphicsConfiguration();
+    if(null!=gc) {
+        device = gc.getDevice();
+    }
+  }
+
+  public void removeNotify() {
+      try {
+        dispose();
+      } finally {
+        super.removeNotify();
+      }
+  }
+
+  private void dispose() {
+    if(null != awtConfig) {
+        AbstractGraphicsDevice adevice = awtConfig.getNativeGraphicsConfiguration().getScreen().getDevice();
+        String adeviceMsg=null;
+        if(Window.DEBUG_IMPLEMENTATION) {
+            adeviceMsg = adevice.toString();
+        }
+        boolean closed = adevice.close();
+        if(Window.DEBUG_IMPLEMENTATION) {
+            System.err.println("AWTCanvas.dispose(): closed GraphicsDevice: "+adeviceMsg+", result: "+closed);
+        }
+    }
+  }
+
+  /**
+   * Overridden to choose a GraphicsConfiguration on a parent container's
+   * GraphicsDevice because both devices
+   */
+  public GraphicsConfiguration getGraphicsConfiguration() {
+    /*
+     * Workaround for problems with Xinerama and java.awt.Component.checkGD
+     * when adding to a container on a different graphics device than the
+     * one that this Canvas is associated with.
+     * 
+     * GC will be null unless:
+     *   - A native peer has assigned it. This means we have a native
+     *     peer, and are already comitted to a graphics configuration.
+     *   - This canvas has been added to a component hierarchy and has
+     *     an ancestor with a non-null GC, but the native peer has not
+     *     yet been created. This means we can still choose the GC on
+     *     all platforms since the peer hasn't been created.
+     */
+    final GraphicsConfiguration gc = super.getGraphicsConfiguration();
+    /*
+     * chosen is only non-null on platforms where the GLDrawableFactory
+     * returns a non-null GraphicsConfiguration (in the GLCanvas
+     * constructor).
+     * 
+     * if gc is from this Canvas' native peer then it should equal chosen,
+     * otherwise it is from an ancestor component that this Canvas is being
+     * added to, and we go into this block.
+     */
+    if (gc != null && chosen != null && !chosen.equals(gc)) {
+      /*
+       * Check for compatibility with gc. If they differ by only the
+       * device then return a new GCconfig with the super-class' GDevice
+       * (and presumably the same visual ID in Xinerama).
+       * 
+       */
+      if (!chosen.getDevice().getIDstring().equals(gc.getDevice().getIDstring())) {
+        /*
+         * Here we select a GraphicsConfiguration on the alternate
+         * device that is presumably identical to the chosen
+         * configuration, but on the other device.
+         * 
+         * Should really check to ensure that we select a configuration
+         * with the same X visual ID for Xinerama screens, otherwise the
+         * GLDrawable may have the wrong visual ID (I don't think this
+         * ever gets updated). May need to add a method to
+         * X11GLDrawableFactory to do this in a platform specific
+         * manner.
+         * 
+         * However, on platforms where we can actually get into this
+         * block, both devices should have the same visual list, and the
+         * same configuration should be selected here.
+         */
+        AWTGraphicsConfiguration config = chooseGraphicsConfiguration(
+                awtConfig.getChosenCapabilities(), awtConfig.getRequestedCapabilities(), chooser, gc.getDevice());
+        final GraphicsConfiguration compatible = (null!=config)?config.getGraphicsConfiguration():null;
+        if(Window.DEBUG_IMPLEMENTATION) {
+            Exception e = new Exception("Info: Call Stack: "+Thread.currentThread().getName());
+            e.printStackTrace();
+            System.err.println("!!! Created Config (n): HAVE    GC "+chosen);
+            System.err.println("!!! Created Config (n): THIS    GC "+gc);
+            System.err.println("!!! Created Config (n): Choosen GC "+compatible);
+            System.err.println("!!! Created Config (n): HAVE    CF "+awtConfig);
+            System.err.println("!!! Created Config (n): Choosen CF "+config);
+            System.err.println("!!! Created Config (n): EQUALS CAPS "+config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities()));
+        }
+
+        if (compatible != null) {
+          /*
+           * Save the new GC for equals test above, and to return to
+           * any outside callers of this method.
+           */
+          chosen = compatible;
+          if( !config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities())) {
+              displayConfigChanged=true;
+          } 
+          awtConfig = config;
+        }
+      }
+
+      /*
+       * If a compatible GC was not found in the block above, this will
+       * return the GC that was selected in the constructor (and might
+       * cause an exception in Component.checkGD when adding to a
+       * container, but in this case that would be the desired behavior).
+       * 
+       */
+      return chosen;
+    } else if (gc == null) {
+      /*
+       * The GC is null, which means we have no native peer, and are not
+       * part of a (realized) component hierarchy. So we return the
+       * desired visual that was selected in the constructor (possibly
+       * null).
+       */
+      return chosen;
+    }
+
+    /*
+     * Otherwise we have not explicitly selected a GC in the constructor, so
+     * just return what Canvas would have.
+     */
+    return gc;
+  }
+
+  private static AWTGraphicsConfiguration chooseGraphicsConfiguration(CapabilitiesImmutable capsChosen,
+                                                                      CapabilitiesImmutable capsRequested,
+                                                                      CapabilitiesChooser chooser,
+                                                                      GraphicsDevice device) {
+    AbstractGraphicsScreen aScreen = AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT);
+    AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
+      GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(capsChosen,
+                                                                                                   capsRequested,
+                                                                                                   chooser, aScreen);
+    if (config == null) {
+      throw new NativeWindowException("Error: Couldn't fetch AWTGraphicsConfiguration");
+    }
+
+    return config;
+  }
+
+  // Disables the AWT's erasing of this Canvas's background on Windows
+  // in Java SE 6. This internal API is not available in previous
+  // releases, but the system property
+  // -Dsun.awt.noerasebackground=true can be specified to get similar
+  // results globally in previous releases.
+  private static boolean disableBackgroundEraseInitialized;
+  private static Method  disableBackgroundEraseMethod;
+  private void disableBackgroundErase() {
+    if (!disableBackgroundEraseInitialized) {
+      try {
+        AccessController.doPrivileged(new PrivilegedAction() {
+            public Object run() {
+              try {
+                Class clazz = getToolkit().getClass();
+                while (clazz != null && disableBackgroundEraseMethod == null) {
+                  try {
+                    disableBackgroundEraseMethod =
+                      clazz.getDeclaredMethod("disableBackgroundErase",
+                                              new Class[] { Canvas.class });
+                    disableBackgroundEraseMethod.setAccessible(true);
+                  } catch (Exception e) {
+                    clazz = clazz.getSuperclass();
+                  }
+                }
+              } catch (Exception e) {
+              }
+              return null;
+            }
+          });
+      } catch (Exception e) {
+      }
+      disableBackgroundEraseInitialized = true;
+      if(Window.DEBUG_IMPLEMENTATION) {
+        System.err.println("AWTCanvas: TK disableBackgroundErase method found: "+
+                (null!=disableBackgroundEraseMethod));
+      }
+    }
+    if (disableBackgroundEraseMethod != null) {
+      Throwable t=null;
+      try {
+        disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
+      } catch (Exception e) {
+        // FIXME: workaround for 6504460 (incorrect backport of 6333613 in 5.0u10)
+        // throw new GLException(e);
+        t = e;
+      }
+      if(Window.DEBUG_IMPLEMENTATION) {
+        System.err.println("AWTCanvas: TK disableBackgroundErase error: "+t);
+      }
+    }
+  }
+}
diff --git a/src/newt/classes/jogamp/newt/awt/AWTDisplay.java b/src/newt/classes/jogamp/newt/awt/AWTDisplay.java
new file mode 100644
index 0000000..4c864c1
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/awt/AWTDisplay.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.awt;
+
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.awt.AWTGraphicsDevice;
+import com.jogamp.newt.NewtFactory;
+import jogamp.newt.DisplayImpl;
+
+public class AWTDisplay extends DisplayImpl {
+    public AWTDisplay() {
+    }
+
+    protected void createNativeImpl() {
+        aDevice = (AWTGraphicsDevice) AWTGraphicsDevice.createDevice(null, AbstractGraphicsDevice.DEFAULT_UNIT); // default
+    }
+
+    protected void setAWTGraphicsDevice(AWTGraphicsDevice d) {
+        aDevice = d;
+    }
+
+    protected void closeNativeImpl() { }
+
+    @Override
+    protected void createEDTUtil() {
+        if(NewtFactory.useEDT()) {
+            edtUtil = AWTEDTUtil.getSingleton();
+            if(DEBUG) {
+                System.err.println("AWTDisplay.createNative("+getFQName()+") Create EDTUtil: "+edtUtil.getClass().getName());
+            }
+        }
+    }
+
+    protected void dispatchMessagesNative() { /* nop */ }
+}
+
diff --git a/src/newt/classes/jogamp/newt/awt/AWTEDTUtil.java b/src/newt/classes/jogamp/newt/awt/AWTEDTUtil.java
new file mode 100644
index 0000000..7b638af
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/awt/AWTEDTUtil.java
@@ -0,0 +1,108 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.newt.awt;
+
+import java.awt.EventQueue;
+import javax.media.nativewindow.NativeWindowException;
+import com.jogamp.newt.util.EDTUtil;
+import jogamp.newt.Debug;
+
+public class AWTEDTUtil implements EDTUtil {
+    public static final boolean DEBUG = Debug.debug("EDT");
+
+    private static AWTEDTUtil singletonMainThread = new AWTEDTUtil(); // one singleton MainThread
+
+    public static AWTEDTUtil getSingleton() {
+        return singletonMainThread;
+    }
+
+    AWTEDTUtil() {
+        // package private access ..
+    }
+
+    final public void reset() {
+        // nop
+    }
+
+    final public void start() {
+        // nop
+    }
+
+    final public boolean isCurrentThreadEDT() {
+        return EventQueue.isDispatchThread();
+    }
+
+    final public boolean isRunning() {
+        return true; // AWT is always running
+    }
+
+    final public void invokeStop(Runnable r) {
+        invokeImpl(true, r, true);
+    }
+
+    final public void invoke(boolean wait, Runnable r) {
+        invokeImpl(wait, r, false);
+    }
+
+    /**
+     * Public access to provide simple dispatching from other EDTUtil implementations
+     * @param wait true if invokeLater
+     * @param r the Runnable action
+     * @param stop true if EDT shall stop (ignored with AWT)
+     */
+    final public void invokeImpl(boolean wait, Runnable r, boolean stop) {
+        if(r == null) {
+            return;
+        }
+
+        // handover to AWT MainThread ..
+        try {
+            if ( isCurrentThreadEDT() ) {
+                r.run();
+                return;
+            }
+            if(wait) {
+                EventQueue.invokeAndWait(r);
+            } else {
+                EventQueue.invokeLater(r);
+            }
+        } catch (Exception e) {
+            throw new NativeWindowException(e);
+        }
+    }
+
+    final public void waitUntilIdle() {
+    }
+
+    final public void waitUntilStopped() {
+    }
+
+}
+
+
diff --git a/src/newt/classes/jogamp/newt/awt/AWTScreen.java b/src/newt/classes/jogamp/newt/awt/AWTScreen.java
new file mode 100644
index 0000000..d059333
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/awt/AWTScreen.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.awt;
+
+import java.awt.DisplayMode;
+
+import jogamp.newt.ScreenImpl;
+import javax.media.nativewindow.awt.AWTGraphicsDevice;
+import javax.media.nativewindow.awt.AWTGraphicsScreen;
+
+public class AWTScreen extends ScreenImpl {
+    public AWTScreen() {
+    }
+
+    protected void createNativeImpl() {
+        aScreen = new AWTGraphicsScreen((AWTGraphicsDevice)display.getGraphicsDevice());
+        
+        final DisplayMode mode = ((AWTGraphicsDevice)getDisplay().getGraphicsDevice()).getGraphicsDevice().getDisplayMode();
+        if(null != mode) {
+            setScreenSize(mode.getWidth(), mode.getHeight());
+        }
+    }
+
+    protected void setAWTGraphicsScreen(AWTGraphicsScreen s) {
+        aScreen = s;
+    }
+
+    // done by AWTWindow ..
+    protected void setScreenSize(int w, int h) {
+        super.setScreenSize(w, h);
+    }
+
+    protected void closeNativeImpl() { }
+}
diff --git a/src/newt/classes/jogamp/newt/awt/AWTWindow.java b/src/newt/classes/jogamp/newt/awt/AWTWindow.java
new file mode 100644
index 0000000..b07a9e3
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/awt/AWTWindow.java
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.awt;
+
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.DisplayMode;
+import java.awt.Frame;
+import java.awt.Insets;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.awt.AWTGraphicsDevice;
+import javax.media.nativewindow.awt.AWTGraphicsScreen;
+import javax.media.nativewindow.util.Point;
+import jogamp.newt.WindowImpl;
+import com.jogamp.newt.event.awt.AWTKeyAdapter;
+import com.jogamp.newt.event.awt.AWTMouseAdapter;
+import com.jogamp.newt.event.awt.AWTWindowAdapter;
+
+/** An implementation of the Newt Window class built using the
+    AWT. This is provided for convenience of porting to platforms
+    supporting Java SE. */
+
+public class AWTWindow extends WindowImpl {
+
+    public AWTWindow() {
+        this(null);
+    }
+
+    public static Class[] getCustomConstructorArgumentTypes() {
+        return new Class[] { Container.class } ;
+    }
+
+    public AWTWindow(Container container) {
+        super();
+        title = "AWT NewtWindow";
+        this.container = container;
+        if(container instanceof Frame) {
+            frame = (Frame) container;
+        }
+    }
+
+    private boolean owningFrame;
+    private Container container = null;
+    private Frame frame = null; // same instance as container, just for impl. convenience
+    private AWTCanvas canvas;
+
+    protected void requestFocusImpl(boolean reparented) {
+        container.requestFocus();
+    }
+
+    @Override
+    protected void setTitleImpl(final String title) {
+        if (frame != null) {
+            frame.setTitle(title);
+        }
+    }
+
+    protected void createNativeImpl() {
+        if(0!=getParentWindowHandle()) {
+            throw new RuntimeException("Window parenting not supported in AWT, use AWTWindow(Frame) cstr for wrapping instead");
+        }
+
+        if(null==container) {
+            frame = new Frame();
+            container = frame;
+            owningFrame=true;
+        } else {
+            owningFrame=false;
+            width = container.getWidth();
+            height = container.getHeight();
+            x = container.getX();
+            y = container.getY();
+        }
+        if(null!=frame) {
+            frame.setTitle(getTitle());
+        }
+        container.setLayout(new BorderLayout());
+        canvas = new AWTCanvas(capsRequested, AWTWindow.this.capabilitiesChooser);
+
+        addWindowListener(new LocalWindowListener());
+
+        new AWTMouseAdapter(this).addTo(canvas); // fwd all AWT Mouse events to here
+        new AWTKeyAdapter(this).addTo(canvas); // fwd all AWT Key events to here
+
+        // canvas.addComponentListener(listener);
+        container.add(canvas, BorderLayout.CENTER);
+        container.setSize(width, height);
+        container.setLocation(x, y);
+        new AWTWindowAdapter(this).addTo(container); // fwd all AWT Window events to here
+
+        if(null!=frame) {
+            frame.setUndecorated(undecorated||fullscreen);
+        }
+
+        setWindowHandle(1); // just a marker ..
+    }
+
+    protected void closeNativeImpl() {
+        setWindowHandle(0); // just a marker ..
+        if(null!=container) {
+            container.setVisible(false);
+            container.remove(canvas);
+            container.setEnabled(false);
+            canvas.setEnabled(false);
+        }
+        if(owningFrame && null!=frame) {
+            frame.dispose();
+            owningFrame=false;
+            frame = null;
+        }
+    }
+
+    @Override
+    public boolean hasDeviceChanged() {
+        boolean res = canvas.hasDeviceChanged();
+        if(res) {
+            config = canvas.getAWTGraphicsConfiguration();
+            if (config == null) {
+                throw new NativeWindowException("Error Device change null GraphicsConfiguration: "+this);
+            }
+            updateDeviceData();
+        }
+        return res;
+    }
+
+    protected void setVisibleImpl(final boolean visible, int x, int y, int width, int height) {
+        container.setVisible(visible);
+
+        reconfigureWindowImpl(x, y, width, height, false, 0, 0);
+        config = canvas.getAWTGraphicsConfiguration();
+
+        if (config == null) {
+            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+        }
+
+        updateDeviceData();
+        visibleChanged(visible);
+    }
+
+    private void updateDeviceData() {
+        // propagate new info ..
+        ((AWTScreen)getScreen()).setAWTGraphicsScreen((AWTGraphicsScreen)config.getScreen());
+        ((AWTDisplay)getScreen().getDisplay()).setAWTGraphicsDevice((AWTGraphicsDevice)config.getScreen().getDevice());
+
+        final DisplayMode mode = ((AWTGraphicsDevice)config.getScreen().getDevice()).getGraphicsDevice().getDisplayMode();
+        if(null != mode) {
+            ((AWTScreen)getScreen()).setScreenSize(mode.getWidth(), mode.getHeight());
+        }
+        
+    }
+
+    @Override
+    public javax.media.nativewindow.util.Insets getInsets() {
+        final int insets[] = new int[] { 0, 0, 0, 0 };
+        Insets contInsets = container.getInsets();
+        insets[0] = contInsets.top;
+        insets[1] = contInsets.left;
+        insets[2] = contInsets.bottom;
+        insets[3] = contInsets.right;
+        return new javax.media.nativewindow.util.Insets(insets[0],insets[1],insets[2],insets[3]);
+    }
+
+    protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final boolean parentChange, final int fullScreenChange, final int decorationChange) {
+        if(decorationChange!=0 && null!=frame) {
+            if(!container.isDisplayable()) {
+                frame.setUndecorated(isUndecorated());
+            } else {
+                if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+                    System.err.println("AWTWindow can't undecorate already created frame");
+                }
+            }
+        }
+        int _x=(x>=0)?x:AWTWindow.this.x;
+        int _y=(x>=0)?y:AWTWindow.this.y;
+        int _w=(width>0)?width:AWTWindow.this.width;
+        int _h=(height>0)?height:AWTWindow.this.height;
+
+        container.setLocation(_x, _y);
+        Insets insets = container.getInsets();
+        container.setSize(_w + insets.left + insets.right,
+                          _h + insets.top + insets.bottom);
+        return true;
+    }
+
+    protected Point getLocationOnScreenImpl(int x, int y) {
+        java.awt.Point ap = canvas.getLocationOnScreen();
+        ap.translate(x, y);
+        return new Point((int)(ap.getX()+0.5),(int)(ap.getY()+0.5));
+    }
+   
+    @Override
+    public Object getWrappedWindow() {
+        return canvas;
+    }
+
+    class LocalWindowListener extends com.jogamp.newt.event.WindowAdapter { 
+        @Override
+        public void windowMoved(com.jogamp.newt.event.WindowEvent e) {
+            if(null!=container) {
+                x = container.getX();
+                y = container.getY();
+            }
+        }
+        @Override
+        public void windowResized(com.jogamp.newt.event.WindowEvent e) {
+            if(null!=canvas) {
+                width = canvas.getWidth();
+                height = canvas.getHeight();
+            }
+        }
+    }
+}
diff --git a/src/newt/classes/jogamp/newt/awt/opengl/VersionApplet.java b/src/newt/classes/jogamp/newt/awt/opengl/VersionApplet.java
new file mode 100644
index 0000000..18524d0
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/awt/opengl/VersionApplet.java
@@ -0,0 +1,174 @@
+package jogamp.newt.awt.opengl;
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.Frame;
+import java.awt.GridLayout;
+import java.awt.TextArea;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import java.util.List;
+
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.GL;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLEventListener;
+
+import com.jogamp.common.GlueGenVersion;
+import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.VersionUtil;
+import com.jogamp.nativewindow.NativeWindowVersion;
+import com.jogamp.newt.NewtVersion;
+import com.jogamp.opengl.JoglVersion;
+
+public class VersionApplet extends Applet {
+  static {
+    GLProfile.initSingleton(false);
+  }
+  TextArea tareaVersion;
+  TextArea tareaCaps;
+  GLCanvas canvas;
+
+  public static void main(String[] args) {
+    Frame frame = new Frame("JOGL Version Applet");
+    frame.setSize(800, 600);
+    frame.setLayout(new BorderLayout());
+
+    VersionApplet va = new VersionApplet();
+    frame.addWindowListener(new ClosingWindowAdapter(frame, va));
+
+    va.init();
+    frame.add(va, BorderLayout.CENTER);
+    frame.validate();
+        
+    frame.setVisible(true);
+    va.start();
+  }
+
+  static class ClosingWindowAdapter extends WindowAdapter {
+    Frame f;
+    VersionApplet va;
+    public ClosingWindowAdapter(Frame f, VersionApplet va) {
+        this.f = f;
+        this.va = va;
+    }
+    public void windowClosing(WindowEvent ev) {
+        f.setVisible(false);
+        va.stop();
+        va.destroy();
+        f.remove(va);
+        f.dispose();
+        System.exit(0);
+    }
+  }
+
+  private synchronized void my_init() {
+    if(null != canvas) { return; }
+
+    GLProfile glp = GLProfile.getDefault();
+    GLCapabilities glcaps = new GLCapabilities(glp);
+
+    setLayout(new BorderLayout());
+    String s;
+
+    tareaVersion = new TextArea(120, 60);
+    s = VersionUtil.getPlatformInfo().toString();
+    System.err.println(s);
+    tareaVersion.append(s);
+
+    s = GlueGenVersion.getInstance().toString();
+    System.err.println(s);
+    tareaVersion.append(s);
+
+    s = NativeWindowVersion.getInstance().toString();
+    System.err.println(s);
+    tareaVersion.append(NativeWindowVersion.getInstance().toString());
+
+    s = JoglVersion.getInstance().toString();
+    System.err.println(s);
+    tareaVersion.append(s);
+
+    s = NewtVersion.getInstance().toString();
+    System.err.println(s);
+    tareaVersion.append(s);
+
+    tareaCaps = new TextArea(120, 20);
+    GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+    List/*<GLCapabilitiesImmutable>*/ availCaps = factory.getAvailableCapabilities(null);
+    for(int i=0; i<availCaps.size(); i++) {
+        s = ((GLCapabilitiesImmutable) availCaps.get(i)).toString();
+        System.err.println(s);
+        tareaCaps.append(s);
+        tareaCaps.append(Platform.getNewline());
+    }
+
+    Container grid = new Container();
+    grid.setLayout(new GridLayout(2, 1));
+    grid.add(tareaVersion);
+    grid.add(tareaCaps);
+    add(grid, BorderLayout.CENTER);
+
+    canvas = new GLCanvas(glcaps);
+    canvas.addGLEventListener(new GLInfo());
+    canvas.setSize(10, 10);
+    add(canvas, BorderLayout.SOUTH);
+    validate();
+  }
+
+  private synchronized void my_release() {
+      if(null!=canvas) {
+          remove(canvas);
+          canvas.destroy();
+          canvas = null;
+          remove(tareaVersion);
+          tareaVersion=null;
+      }
+  }
+
+  public void init() {
+    System.err.println("VersionApplet: init() - begin");
+    my_init();
+    System.err.println("VersionApplet: init() - end");
+  }
+
+  public void start() {
+    System.err.println("VersionApplet: start() - begin");
+    System.err.println("VersionApplet: start() - end");
+  }
+
+  public void stop() {
+    System.err.println("VersionApplet: stop() - begin");
+    System.err.println("VersionApplet: stop() - end");
+  }
+
+  public void destroy() {
+    System.err.println("VersionApplet: destroy() - start");
+    my_release();
+    System.err.println("VersionApplet: destroy() - end");
+  }
+
+  class GLInfo implements GLEventListener {
+    public void init(GLAutoDrawable drawable) {
+        GL gl = drawable.getGL();
+        String s = JoglVersion.getGLInfo(gl, null).toString();
+        System.err.println(s);
+        tareaVersion.append(s);
+    }
+
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    }
+
+    public void display(GLAutoDrawable drawable) {
+    }
+
+    public void dispose(GLAutoDrawable drawable) {
+    }
+  }
+
+}
diff --git a/src/newt/classes/jogamp/newt/event/NEWTEventTask.java b/src/newt/classes/jogamp/newt/event/NEWTEventTask.java
new file mode 100644
index 0000000..fae6560
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/event/NEWTEventTask.java
@@ -0,0 +1,56 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package jogamp.newt.event;
+
+import com.jogamp.newt.event.NEWTEvent;
+
+/**
+ * Helper class to provide a NEWTEvent queue implementation with a NEWTEvent wrapper
+ * which notifies after sending the event for the <code>invokeAndWait()</code> semantics.
+ */
+public class NEWTEventTask {
+    NEWTEvent event;
+    Object notifyObject;
+
+    public NEWTEventTask(NEWTEvent event, Object notifyObject) {
+        this.event = event ;
+        this.notifyObject = notifyObject ;
+    }
+
+    public NEWTEvent get() { return event; }
+
+    public void notifyIssuer() {
+        if(null != notifyObject) {
+            synchronized (notifyObject) {
+                notifyObject.notifyAll();
+            }
+        }
+    }
+}
+
diff --git a/src/newt/classes/jogamp/newt/intel/gdl/Display.java b/src/newt/classes/jogamp/newt/intel/gdl/Display.java
new file mode 100644
index 0000000..b1afdb5
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/intel/gdl/Display.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.intel.gdl;
+
+import jogamp.newt.*;
+import javax.media.nativewindow.*;
+
+public class Display extends jogamp.newt.DisplayImpl {
+    static int initCounter = 0;
+
+    static {
+        NEWTJNILibLoader.loadNEWT();
+
+        if (!Screen.initIDs()) {
+            throw new NativeWindowException("Failed to initialize GDL Screen jmethodIDs");
+        }
+        if (!Window.initIDs()) {
+            throw new NativeWindowException("Failed to initialize GDL Window jmethodIDs");
+        }
+    }
+
+    public static void initSingleton() {
+        // just exist to ensure static init has been run
+    }
+
+
+    public Display() {
+    }
+
+    protected void createNativeImpl() {
+        synchronized(Display.class) {
+            if(0==initCounter) {
+                displayHandle = CreateDisplay();
+                if(0==displayHandle) {
+                    throw new NativeWindowException("Couldn't initialize GDL Display");
+                }
+            }
+            initCounter++;
+        }
+        aDevice = new DefaultGraphicsDevice(NativeWindowFactory.TYPE_DEFAULT, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT, displayHandle);
+    }
+
+    protected void closeNativeImpl() {
+        if(0==displayHandle) {
+            throw new NativeWindowException("displayHandle null; initCnt "+initCounter);
+        }
+        synchronized(Display.class) {
+            if(initCounter>0) {
+                initCounter--;
+                if(0==initCounter) {
+                    DestroyDisplay(displayHandle);
+                }
+            }
+        }
+    }
+
+    protected void dispatchMessagesNative() {
+        if(0!=displayHandle) {
+            DispatchMessages(displayHandle, focusedWindow);
+        }
+    }
+
+    protected void setFocus(Window focus) {
+        focusedWindow = focus;
+    }
+
+    private long displayHandle = 0;
+    private Window focusedWindow = null;
+    private native long CreateDisplay();
+    private native void DestroyDisplay(long displayHandle);
+    private native void DispatchMessages(long displayHandle, Window focusedWindow);
+}
+
diff --git a/src/newt/classes/jogamp/newt/intel/gdl/Screen.java b/src/newt/classes/jogamp/newt/intel/gdl/Screen.java
new file mode 100644
index 0000000..b351fe6
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/intel/gdl/Screen.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.intel.gdl;
+
+import jogamp.newt.*;
+import javax.media.nativewindow.*;
+
+public class Screen extends jogamp.newt.ScreenImpl {
+
+    static {
+        Display.initSingleton();
+    }
+
+    public Screen() {
+    }
+
+    protected void createNativeImpl() {
+        AbstractGraphicsDevice adevice = getDisplay().getGraphicsDevice();
+        GetScreenInfo(adevice.getHandle(), screen_idx);
+        aScreen = new DefaultGraphicsScreen(adevice, screen_idx);
+    }
+
+    protected void closeNativeImpl() { }
+
+    //----------------------------------------------------------------------
+    // Internals only
+    //
+
+    protected static native boolean initIDs();
+    private          native void GetScreenInfo(long displayHandle, int screen_idx);
+
+    // called by GetScreenInfo() ..
+    private void screenCreated(int width, int height) {
+        setScreenSize(width, height);
+    }
+}
+
diff --git a/src/newt/classes/jogamp/newt/intel/gdl/Window.java b/src/newt/classes/jogamp/newt/intel/gdl/Window.java
new file mode 100644
index 0000000..d6003be
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/intel/gdl/Window.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.intel.gdl;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.util.Point;
+
+public class Window extends jogamp.newt.WindowImpl {
+    static {
+        Display.initSingleton();
+    }
+
+    public Window() {
+    }
+
+    static long nextWindowHandle = 1;
+
+    protected void createNativeImpl() {
+        if(0!=getParentWindowHandle()) {
+            throw new NativeWindowException("GDL Window does not support window parenting");
+        }
+        AbstractGraphicsScreen aScreen = getScreen().getGraphicsScreen();
+        AbstractGraphicsDevice aDevice = getScreen().getDisplay().getGraphicsDevice();
+
+        config = GraphicsConfigurationFactory.getFactory(aDevice).chooseGraphicsConfiguration(
+                capsRequested, capsRequested, capabilitiesChooser, aScreen);
+        if (config == null) {
+            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+        }
+
+        synchronized(Window.class) {
+            setWindowHandle(nextWindowHandle++); // just a marker
+
+            surfaceHandle = CreateSurface(aDevice.getHandle(), getScreen().getWidth(), getScreen().getHeight(), x, y, width, height);
+            if (surfaceHandle == 0) {
+                throw new NativeWindowException("Error creating window");
+            }
+        }
+    }
+
+    protected void closeNativeImpl() {
+        if(0!=surfaceHandle) {
+            synchronized(Window.class) {
+                CloseSurface(getDisplayHandle(), surfaceHandle);
+            }
+            surfaceHandle = 0;
+            ((Display)getScreen().getDisplay()).setFocus(null);
+        }
+    }
+
+    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
+        reconfigureWindowImpl(x, y, width, height, false, 0, 0);
+        if(visible) {
+            ((Display)getScreen().getDisplay()).setFocus(this);
+        }
+        this.visibleChanged(visible);
+    }
+
+    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, boolean parentChange, int fullScreenChange, int decorationChange) {
+        Screen  screen = (Screen) getScreen();
+
+        int _x=(x>=0)?x:this.x;
+        int _y=(x>=0)?y:this.y;
+        int _w=(width>0)?width:this.width;
+        int _h=(height>0)?height:this.height;
+
+        if(_w>screen.getWidth()) {
+            _w=screen.getWidth();
+        }
+        if(_h>screen.getHeight()) {
+            _h=screen.getHeight();
+        }
+        if((_x+_w)>screen.getWidth()) {
+            _x=screen.getWidth()-_w;
+        }
+        if((_y+_h)>screen.getHeight()) {
+            _y=screen.getHeight()-_h;
+        }
+
+        if(0!=surfaceHandle) {
+            SetBounds0(surfaceHandle, getScreen().getWidth(), getScreen().getHeight(), _x, _y, _w, _h);
+        }
+
+        return true;
+    }
+
+    protected void requestFocusImpl(boolean reparented) {
+        ((Display)getScreen().getDisplay()).setFocus(this);
+    }
+
+    @Override
+    public final long getSurfaceHandle() {
+        return surfaceHandle;
+    }
+
+    protected Point getLocationOnScreenImpl(int x, int y) {
+        return new Point(x,y);
+    }
+
+    //----------------------------------------------------------------------
+    // Internals only
+    //
+
+    protected static native boolean initIDs();
+    private        native long CreateSurface(long displayHandle, int scrn_width, int scrn_height, int x, int y, int width, int height);
+    private        native void CloseSurface(long displayHandle, long surfaceHandle);
+    private        native void SetBounds0(long surfaceHandle, int scrn_width, int scrn_height, int x, int y, int width, int height);
+
+    private void updateBounds(int x, int y, int width, int height) {
+        this.x = x;
+        this.y = y;
+        this.width = width;
+        this.height = height;
+    }
+
+    private long   surfaceHandle;
+}
diff --git a/src/newt/classes/jogamp/newt/macosx/MacDisplay.java b/src/newt/classes/jogamp/newt/macosx/MacDisplay.java
new file mode 100644
index 0000000..49f2ff5
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/macosx/MacDisplay.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.macosx;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.macosx.*;
+import com.jogamp.newt.*;
+import jogamp.newt.*;
+import com.jogamp.newt.util.MainThread;
+
+public class MacDisplay extends DisplayImpl {
+    static {
+        NEWTJNILibLoader.loadNEWT();
+
+        if(!initNSApplication0()) {
+            throw new NativeWindowException("Failed to initialize native Application hook");
+        }
+        if(!MacWindow.initIDs0()) {
+            throw new NativeWindowException("Failed to initialize jmethodIDs");
+        }
+        if(DEBUG) {
+            System.err.println("MacDisplay.init App and IDs OK "+Thread.currentThread().getName());
+        }
+    }
+
+    public static void initSingleton() {
+        // just exist to ensure static init has been run
+    }
+    
+    public MacDisplay() {
+    }
+
+    protected void dispatchMessagesNative() {
+        dispatchMessages0();
+    }
+    
+    protected void createNativeImpl() {
+        aDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+    }
+
+    protected void closeNativeImpl() { }
+
+    @Override
+    protected void createEDTUtil() {
+        if(NewtFactory.useEDT()) {
+            final Display f_dpy = this;
+            MainThread.addPumpMessage(this, 
+                                  new Runnable() {
+                                      public void run() {
+                                          if(null!=f_dpy.getGraphicsDevice()) {
+                                              f_dpy.dispatchMessages();
+                                          } } } );
+            edtUtil = MainThread.getSingleton();
+            edtUtil.start();
+        }
+    }
+
+    protected void releaseEDTUtil() {
+        if(null!=edtUtil) { 
+            MainThread.removePumpMessage(this);
+            edtUtil.waitUntilStopped();
+            edtUtil=null;
+        }
+    }
+
+    private static native boolean initNSApplication0();
+    protected native void dispatchMessages0();
+}
+
diff --git a/src/newt/classes/jogamp/newt/macosx/MacScreen.java b/src/newt/classes/jogamp/newt/macosx/MacScreen.java
new file mode 100644
index 0000000..3002860
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/macosx/MacScreen.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.macosx;
+
+import com.jogamp.newt.*;
+import jogamp.newt.ScreenImpl;
+import javax.media.nativewindow.*;
+
+public class MacScreen extends ScreenImpl {
+    static {
+        MacDisplay.initSingleton();
+    }
+
+    public MacScreen() {
+    }
+
+    protected void createNativeImpl() {
+        aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
+        setScreenSize(getWidthImpl0(screen_idx), getHeightImpl0(screen_idx));
+    }
+
+    protected void closeNativeImpl() { }
+
+    private static native int getWidthImpl0(int scrn_idx);
+    private static native int getHeightImpl0(int scrn_idx);
+}
diff --git a/src/newt/classes/jogamp/newt/macosx/MacWindow.java b/src/newt/classes/jogamp/newt/macosx/MacWindow.java
new file mode 100644
index 0000000..a27f047
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/macosx/MacWindow.java
@@ -0,0 +1,439 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.macosx;
+
+import javax.media.nativewindow.*;
+import com.jogamp.common.util.locks.RecursiveLock;
+
+import com.jogamp.newt.event.*;
+import jogamp.newt.*;
+import javax.media.nativewindow.util.Insets;
+import javax.media.nativewindow.util.Point;
+
+public class MacWindow extends WindowImpl {
+    
+    // Window styles
+    private static final int NSBorderlessWindowMask     = 0;
+    private static final int NSTitledWindowMask         = 1 << 0;
+    private static final int NSClosableWindowMask       = 1 << 1;
+    private static final int NSMiniaturizableWindowMask = 1 << 2;
+    private static final int NSResizableWindowMask      = 1 << 3;
+
+    // Window backing store types
+    private static final int NSBackingStoreRetained     = 0;
+    private static final int NSBackingStoreNonretained  = 1;
+    private static final int NSBackingStoreBuffered     = 2;
+
+    // Key constants handled differently on Mac OS X than other platforms
+    private static final int NSUpArrowFunctionKey        = 0xF700;
+    private static final int NSDownArrowFunctionKey      = 0xF701;
+    private static final int NSLeftArrowFunctionKey      = 0xF702;
+    private static final int NSRightArrowFunctionKey     = 0xF703;
+    private static final int NSF1FunctionKey             = 0xF704;
+    private static final int NSF2FunctionKey             = 0xF705;
+    private static final int NSF3FunctionKey             = 0xF706;
+    private static final int NSF4FunctionKey             = 0xF707;
+    private static final int NSF5FunctionKey             = 0xF708;
+    private static final int NSF6FunctionKey             = 0xF709;
+    private static final int NSF7FunctionKey             = 0xF70A;
+    private static final int NSF8FunctionKey             = 0xF70B;
+    private static final int NSF9FunctionKey             = 0xF70C;
+    private static final int NSF10FunctionKey            = 0xF70D;
+    private static final int NSF11FunctionKey            = 0xF70E;
+    private static final int NSF12FunctionKey            = 0xF70F;
+    private static final int NSF13FunctionKey            = 0xF710;
+    private static final int NSF14FunctionKey            = 0xF711;
+    private static final int NSF15FunctionKey            = 0xF712;
+    private static final int NSF16FunctionKey            = 0xF713;
+    private static final int NSF17FunctionKey            = 0xF714;
+    private static final int NSF18FunctionKey            = 0xF715;
+    private static final int NSF19FunctionKey            = 0xF716;
+    private static final int NSF20FunctionKey            = 0xF717;
+    private static final int NSF21FunctionKey            = 0xF718;
+    private static final int NSF22FunctionKey            = 0xF719;
+    private static final int NSF23FunctionKey            = 0xF71A;
+    private static final int NSF24FunctionKey            = 0xF71B;
+    private static final int NSF25FunctionKey            = 0xF71C;
+    private static final int NSF26FunctionKey            = 0xF71D;
+    private static final int NSF27FunctionKey            = 0xF71E;
+    private static final int NSF28FunctionKey            = 0xF71F;
+    private static final int NSF29FunctionKey            = 0xF720;
+    private static final int NSF30FunctionKey            = 0xF721;
+    private static final int NSF31FunctionKey            = 0xF722;
+    private static final int NSF32FunctionKey            = 0xF723;
+    private static final int NSF33FunctionKey            = 0xF724;
+    private static final int NSF34FunctionKey            = 0xF725;
+    private static final int NSF35FunctionKey            = 0xF726;
+    private static final int NSInsertFunctionKey         = 0xF727;
+    private static final int NSDeleteFunctionKey         = 0xF728;
+    private static final int NSHomeFunctionKey           = 0xF729;
+    private static final int NSBeginFunctionKey          = 0xF72A;
+    private static final int NSEndFunctionKey            = 0xF72B;
+    private static final int NSPageUpFunctionKey         = 0xF72C;
+    private static final int NSPageDownFunctionKey       = 0xF72D;
+    private static final int NSPrintScreenFunctionKey    = 0xF72E;
+    private static final int NSScrollLockFunctionKey     = 0xF72F;
+    private static final int NSPauseFunctionKey          = 0xF730;
+    private static final int NSSysReqFunctionKey         = 0xF731;
+    private static final int NSBreakFunctionKey          = 0xF732;
+    private static final int NSResetFunctionKey          = 0xF733;
+    private static final int NSStopFunctionKey           = 0xF734;
+    private static final int NSMenuFunctionKey           = 0xF735;
+    private static final int NSUserFunctionKey           = 0xF736;
+    private static final int NSSystemFunctionKey         = 0xF737;
+    private static final int NSPrintFunctionKey          = 0xF738;
+    private static final int NSClearLineFunctionKey      = 0xF739;
+    private static final int NSClearDisplayFunctionKey   = 0xF73A;
+    private static final int NSInsertLineFunctionKey     = 0xF73B;
+    private static final int NSDeleteLineFunctionKey     = 0xF73C;
+    private static final int NSInsertCharFunctionKey     = 0xF73D;
+    private static final int NSDeleteCharFunctionKey     = 0xF73E;
+    private static final int NSPrevFunctionKey           = 0xF73F;
+    private static final int NSNextFunctionKey           = 0xF740;
+    private static final int NSSelectFunctionKey         = 0xF741;
+    private static final int NSExecuteFunctionKey        = 0xF742;
+    private static final int NSUndoFunctionKey           = 0xF743;
+    private static final int NSRedoFunctionKey           = 0xF744;
+    private static final int NSFindFunctionKey           = 0xF745;
+    private static final int NSHelpFunctionKey           = 0xF746;
+    private static final int NSModeSwitchFunctionKey     = 0xF747;
+
+    private volatile long surfaceHandle;
+
+    // non fullscreen dimensions ..
+    private final Insets insets = new Insets(0,0,0,0);
+
+    static {
+        MacDisplay.initSingleton();
+    }
+
+    public MacWindow() {
+    }
+    
+    protected void createNativeImpl() {
+        config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(
+                capsRequested, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen());
+        if (config == null) {
+            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+        }
+    }
+
+    protected void closeNativeImpl() {
+        nsViewLock.lock();
+        try {
+            if(DEBUG_IMPLEMENTATION) { System.err.println("MacWindow.CloseAction "+Thread.currentThread().getName()); }
+            if (getWindowHandle() != 0) {
+                close0(getWindowHandle());
+            }
+        } catch (Throwable t) {
+            if(DEBUG_IMPLEMENTATION) { 
+                Exception e = new Exception("Warning: closeNative failed - "+Thread.currentThread().getName(), t);
+                e.printStackTrace();
+            }
+        } finally {
+            setWindowHandle(0);
+            nsViewLock.unlock();
+        }
+    }
+    
+    @Override
+    public final long getSurfaceHandle() {
+        return surfaceHandle;
+    }
+
+    @Override
+    public Insets getInsets() {
+        // in order to properly calculate insets we need the window to be
+        // created
+        nsViewLock.lock();
+        try {
+            createWindow(false, getX(), getY(), getWidth(), getHeight(), isFullscreen());
+            return (Insets) insets.clone();
+        } finally {
+            nsViewLock.unlock();
+        }
+    }
+
+    private RecursiveLock nsViewLock = new RecursiveLock();
+
+    @Override
+    protected int lockSurfaceImpl() {
+        nsViewLock.lock();
+        return LOCK_SUCCESS;
+    }
+
+    @Override
+    protected void unlockSurfaceImpl() {
+        nsViewLock.unlock();
+    }
+
+    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
+        nsViewLock.lock();
+        try {
+            if (visible) {
+                createWindow(false, x, y, width, height, isFullscreen());
+                if (getWindowHandle() != 0) {
+                    makeKeyAndOrderFront0(getWindowHandle());
+                }
+            } else {
+                if (getWindowHandle() != 0) {
+                    orderOut0(getWindowHandle());
+                }
+            }
+            visibleChanged(visible);
+        } finally {
+            nsViewLock.unlock();
+        }
+    }
+
+    @Override
+    protected void setTitleImpl(final String title) {
+        // FIXME: move nsViewLock up to window lock
+        nsViewLock.lock();
+        try {
+            setTitle0(getWindowHandle(), title);
+        } finally {
+            nsViewLock.unlock();
+        }
+    }
+
+    protected void requestFocusImpl(boolean reparented) {
+        // FIXME: move nsViewLock up to window lock
+        nsViewLock.lock();
+        try {
+            makeKey0(getWindowHandle());
+        } finally {
+            nsViewLock.unlock();
+        }
+    }
+    
+    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, boolean parentChange, int fullScreenChange, int decorationChange) {
+        nsViewLock.lock();
+        try {
+            if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+                System.err.println("MacWindow reconfig: parentChange "+parentChange+", fullScreenChange "+fullScreenChange+", decorationChange "+decorationChange+" "+x+"/"+y+" "+width+"x"+height);
+            }
+            int _x=(x>=0)?x:this.x;
+            int _y=(x>=0)?y:this.y;
+            int _w=(width>0)?width:this.width;
+            int _h=(height>0)?height:this.height;
+
+            if(decorationChange!=0 || parentChange || fullScreenChange!=0) {
+                createWindow(true, _x, _y, _w, _h, fullScreenChange>0);
+                if (getWindowHandle() != 0) {
+                    makeKeyAndOrderFront0(getWindowHandle());
+                }
+            } else {
+                if(x>=0 || y>=0) {
+                    setFrameTopLeftPoint0(getParentWindowHandle(), getWindowHandle(), _x, _y);
+                }
+                if(width>0 || height>0) {
+                    setContentSize0(getWindowHandle(), _w, _h);
+                }
+            }
+        } finally {
+            nsViewLock.unlock();
+        }
+        return true;
+    }
+
+    protected Point getLocationOnScreenImpl(int x, int y) {
+        return null;
+    }
+    
+    private void insetsChanged(int left, int top, int right, int bottom) {
+        if (DEBUG_IMPLEMENTATION) {
+            System.err.println(Thread.currentThread().getName()+
+                " Insets changed to " + left + ", " + top + ", " + right + ", " + bottom);
+        }
+        if (left != -1 && top != -1 && right != -1 && bottom != -1) {
+            insets.left = left;
+            insets.top = top;
+            insets.right = right;
+            insets.bottom = bottom;
+        }
+    }
+
+    private char convertKeyChar(char keyChar) {
+        if (keyChar == '\r') {
+            // Turn these into \n
+            return '\n';
+        }
+
+        if (keyChar >= NSUpArrowFunctionKey && keyChar <= NSModeSwitchFunctionKey) {
+            switch (keyChar) {
+                case NSUpArrowFunctionKey:     return KeyEvent.VK_UP;
+                case NSDownArrowFunctionKey:   return KeyEvent.VK_DOWN;
+                case NSLeftArrowFunctionKey:   return KeyEvent.VK_LEFT;
+                case NSRightArrowFunctionKey:  return KeyEvent.VK_RIGHT;
+                case NSF1FunctionKey:          return KeyEvent.VK_F1;
+                case NSF2FunctionKey:          return KeyEvent.VK_F2;
+                case NSF3FunctionKey:          return KeyEvent.VK_F3;
+                case NSF4FunctionKey:          return KeyEvent.VK_F4;
+                case NSF5FunctionKey:          return KeyEvent.VK_F5;
+                case NSF6FunctionKey:          return KeyEvent.VK_F6;
+                case NSF7FunctionKey:          return KeyEvent.VK_F7;
+                case NSF8FunctionKey:          return KeyEvent.VK_F8;
+                case NSF9FunctionKey:          return KeyEvent.VK_F9;
+                case NSF10FunctionKey:         return KeyEvent.VK_F10;
+                case NSF11FunctionKey:         return KeyEvent.VK_F11;
+                case NSF12FunctionKey:         return KeyEvent.VK_F12;
+                case NSF13FunctionKey:         return KeyEvent.VK_F13;
+                case NSF14FunctionKey:         return KeyEvent.VK_F14;
+                case NSF15FunctionKey:         return KeyEvent.VK_F15;
+                case NSF16FunctionKey:         return KeyEvent.VK_F16;
+                case NSF17FunctionKey:         return KeyEvent.VK_F17;
+                case NSF18FunctionKey:         return KeyEvent.VK_F18;
+                case NSF19FunctionKey:         return KeyEvent.VK_F19;
+                case NSF20FunctionKey:         return KeyEvent.VK_F20;
+                case NSF21FunctionKey:         return KeyEvent.VK_F21;
+                case NSF22FunctionKey:         return KeyEvent.VK_F22;
+                case NSF23FunctionKey:         return KeyEvent.VK_F23;
+                case NSF24FunctionKey:         return KeyEvent.VK_F24;
+                case NSInsertFunctionKey:      return KeyEvent.VK_INSERT;
+                case NSDeleteFunctionKey:      return KeyEvent.VK_DELETE;
+                case NSHomeFunctionKey:        return KeyEvent.VK_HOME;
+                case NSBeginFunctionKey:       return KeyEvent.VK_BEGIN;
+                case NSEndFunctionKey:         return KeyEvent.VK_END;
+                case NSPageUpFunctionKey:      return KeyEvent.VK_PAGE_UP;
+                case NSPageDownFunctionKey:    return KeyEvent.VK_PAGE_DOWN;
+                case NSPrintScreenFunctionKey: return KeyEvent.VK_PRINTSCREEN;
+                case NSScrollLockFunctionKey:  return KeyEvent.VK_SCROLL_LOCK;
+                case NSPauseFunctionKey:       return KeyEvent.VK_PAUSE;
+                // Not handled:
+                // NSSysReqFunctionKey
+                // NSBreakFunctionKey
+                // NSResetFunctionKey
+                case NSStopFunctionKey:        return KeyEvent.VK_STOP;
+                // Not handled:
+                // NSMenuFunctionKey
+                // NSUserFunctionKey
+                // NSSystemFunctionKey
+                // NSPrintFunctionKey
+                // NSClearLineFunctionKey
+                // NSClearDisplayFunctionKey
+                // NSInsertLineFunctionKey
+                // NSDeleteLineFunctionKey
+                // NSInsertCharFunctionKey
+                // NSDeleteCharFunctionKey
+                // NSPrevFunctionKey
+                // NSNextFunctionKey
+                // NSSelectFunctionKey
+                // NSExecuteFunctionKey
+                // NSUndoFunctionKey
+                // NSRedoFunctionKey
+                // NSFindFunctionKey
+                // NSHelpFunctionKey
+                // NSModeSwitchFunctionKey
+                default: break;
+            }
+        }
+
+        // NSEvent's charactersIgnoringModifiers doesn't ignore the shift key
+        if (keyChar >= 'a' && keyChar <= 'z') {
+            return Character.toUpperCase(keyChar);
+        }
+
+        return keyChar;
+    }
+
+    @Override
+    public void enqueueKeyEvent(boolean wait, int eventType, int modifiers, int keyCode, char keyChar) {
+        int key = convertKeyChar(keyChar);
+        if(DEBUG_IMPLEMENTATION) System.err.println("MacWindow.enqueueKeyEvent "+Thread.currentThread().getName());
+        // Note that we send the key char for the key code on this
+        // platform -- we do not get any useful key codes out of the system
+        super.enqueueKeyEvent(wait, eventType, modifiers, key, keyChar);
+    }
+
+    private void createWindow(final boolean recreate, final int x, final int y, final int width, final int height, final boolean fullscreen) {
+
+        if(0!=getWindowHandle() && !recreate) {
+            return;
+        }
+
+        try {
+            //runOnEDTIfAvail(true, new Runnable() {
+            //    public void run() {
+                    if(0!=getWindowHandle()) {
+                        // save the view .. close the window
+                        surfaceHandle = changeContentView0(getParentWindowHandle(), getWindowHandle(), 0);
+                        if(recreate && 0==surfaceHandle) {
+                            throw new NativeWindowException("Internal Error - recreate, window but no view");
+                        }
+                        close0(getWindowHandle());
+                        setWindowHandle(0);
+                    } else {
+                        surfaceHandle = 0;
+                    }
+                    setWindowHandle(createWindow0(getParentWindowHandle(),
+                                                 x, y, width, height, fullscreen,
+                                                 (isUndecorated() ?
+                                                 NSBorderlessWindowMask :
+                                                 NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask),
+                                                 NSBackingStoreBuffered, 
+                                                 getScreen().getIndex(), surfaceHandle));
+                    if (getWindowHandle() == 0) {
+                        throw new NativeWindowException("Could create native window "+Thread.currentThread().getName()+" "+this);
+                    }
+                    surfaceHandle = contentView0(getWindowHandle());
+                    setTitle0(getWindowHandle(), getTitle());
+                    // don't make the window visible on window creation
+                    // makeKeyAndOrderFront0(windowHandle);
+             //   } } );
+        } catch (Exception ie) {
+            ie.printStackTrace();
+        }
+
+        enqueueWindowEvent(false, WindowEvent.EVENT_WINDOW_MOVED);
+        enqueueWindowEvent(false, WindowEvent.EVENT_WINDOW_RESIZED);
+        enqueueWindowEvent(false, WindowEvent.EVENT_WINDOW_GAINED_FOCUS);
+    }
+    
+    protected static native boolean initIDs0();
+    private native long createWindow0(long parentWindowHandle, int x, int y, int w, int h,
+                                     boolean fullscreen, int windowStyle,
+                                     int backingStoreType,
+                                     int screen_idx, long view);
+    private native void makeKeyAndOrderFront0(long window);
+    private native void makeKey0(long window);
+    private native void orderOut0(long window);
+    private native void close0(long window);
+    private native void setTitle0(long window, String title);
+    private native long contentView0(long window);
+    private native long changeContentView0(long parentWindowHandle, long window, long view);
+    private native void setContentSize0(long window, int w, int h);
+    private native void setFrameTopLeftPoint0(long parentWindowHandle, long window, int x, int y);
+}
diff --git a/src/newt/classes/jogamp/newt/opengl/broadcom/egl/Display.java b/src/newt/classes/jogamp/newt/opengl/broadcom/egl/Display.java
new file mode 100644
index 0000000..494908a
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/opengl/broadcom/egl/Display.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.opengl.broadcom.egl;
+
+import jogamp.newt.*;
+import jogamp.opengl.egl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.egl.*;
+
+public class Display extends jogamp.newt.DisplayImpl {
+
+    static {
+        NEWTJNILibLoader.loadNEWT();
+
+        if (!Window.initIDs()) {
+            throw new NativeWindowException("Failed to initialize BCEGL Window jmethodIDs");
+        }
+    }
+
+    public static void initSingleton() {
+        // just exist to ensure static init has been run
+    }
+
+
+    public Display() {
+    }
+
+    protected void createNativeImpl() {
+        long handle = CreateDisplay(Screen.fixedWidth, Screen.fixedHeight);
+        if (handle == EGL.EGL_NO_DISPLAY) {
+            throw new NativeWindowException("BC EGL CreateDisplay failed");
+        }
+        aDevice = new EGLGraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
+    }
+
+    protected void closeNativeImpl() {
+        if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
+            DestroyDisplay(aDevice.getHandle());
+        }
+    }
+
+    protected void dispatchMessagesNative() {
+        // n/a .. DispatchMessages();
+    }
+
+    private native long CreateDisplay(int width, int height);
+    private native void DestroyDisplay(long dpy);
+    private native void DispatchMessages();
+}
+
diff --git a/src/newt/classes/jogamp/newt/opengl/broadcom/egl/Screen.java b/src/newt/classes/jogamp/newt/opengl/broadcom/egl/Screen.java
new file mode 100644
index 0000000..2224f78
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/opengl/broadcom/egl/Screen.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.opengl.broadcom.egl;
+
+import javax.media.nativewindow.*;
+
+public class Screen extends jogamp.newt.ScreenImpl {
+
+    static {
+        Display.initSingleton();
+    }
+
+
+    public Screen() {
+    }
+
+    protected void createNativeImpl() {
+        aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
+        setScreenSize(fixedWidth, fixedHeight);
+    }
+
+    protected void closeNativeImpl() { }
+
+    //----------------------------------------------------------------------
+    // Internals only
+    //
+
+    static final int fixedWidth = 1920;
+    static final int fixedHeight = 1080;
+}
+
diff --git a/src/newt/classes/jogamp/newt/opengl/broadcom/egl/Window.java b/src/newt/classes/jogamp/newt/opengl/broadcom/egl/Window.java
new file mode 100644
index 0000000..9532178
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/opengl/broadcom/egl/Window.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.opengl.broadcom.egl;
+
+import jogamp.opengl.egl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.util.Point;
+import javax.media.opengl.GLCapabilitiesImmutable;
+
+public class Window extends jogamp.newt.WindowImpl {
+    static {
+        Display.initSingleton();
+    }
+
+    public Window() {
+    }
+
+    protected void createNativeImpl() {
+        if(0!=getParentWindowHandle()) {
+            throw new RuntimeException("Window parenting not supported (yet)");
+        }
+        // query a good configuration .. even thought we drop this one 
+        // and reuse the EGLUtil choosen one later.
+        config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(
+                capsRequested, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen());
+        if (config == null) {
+            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+        }
+        setSizeImpl(getScreen().getWidth(), getScreen().getHeight());
+
+        setWindowHandle(realizeWindow(true, width, height));
+        if (0 == getWindowHandle()) {
+            throw new NativeWindowException("Error native Window Handle is null");
+        }
+    }
+
+    protected void closeNativeImpl() {
+        if(0!=windowHandleClose) {
+            CloseWindow(getDisplayHandle(), windowHandleClose);
+        }
+    }
+
+    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
+        reconfigureWindowImpl(x, y, width, height, false, 0, 0);
+        visibleChanged(visible);
+    }
+
+    protected void requestFocusImpl(boolean reparented) { }
+
+    protected void setSizeImpl(int width, int height) {
+        if(0!=getWindowHandle()) {
+            // n/a in BroadcomEGL
+            System.err.println("BCEGL Window.setSizeImpl n/a in BroadcomEGL with realized window");
+        } else {
+            this.width = width;
+            this.height = height;
+        }
+    }
+
+    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, 
+                                            boolean parentChange, int fullScreenChange, int decorationChange) {
+        if(0!=getWindowHandle()) {
+            if(0!=fullScreenChange) {
+                if( fullScreenChange > 0 ) {
+                    // n/a in BroadcomEGL
+                    System.err.println("setFullscreen n/a in BroadcomEGL");
+                    return false;
+                }
+            }
+        }
+        if(width>0 || height>0) {
+            if(0!=getWindowHandle()) {
+                // n/a in BroadcomEGL
+                System.err.println("BCEGL Window.setSizeImpl n/a in BroadcomEGL with realized window");
+            } else {
+                this.width=(width>0)?width:this.width;
+                this.height=(height>0)?height:this.height;
+            }
+        }
+        if(x>=0 || y>=0) {
+            System.err.println("BCEGL Window.setPositionImpl n/a in BroadcomEGL");
+        }
+        return true;
+    }
+
+    protected Point getLocationOnScreenImpl(int x, int y) {
+        return new Point(x,y);
+    }
+
+
+    @Override
+    public boolean surfaceSwap() {
+        SwapWindow(getDisplayHandle(), getWindowHandle());
+        return true;
+    }
+
+    //----------------------------------------------------------------------
+    // Internals only
+    //
+
+    protected static native boolean initIDs();
+    private        native long CreateWindow(long eglDisplayHandle, boolean chromaKey, int width, int height);
+    private        native void CloseWindow(long eglDisplayHandle, long eglWindowHandle);
+    private        native void SwapWindow(long eglDisplayHandle, long eglWindowHandle);
+
+
+    private long realizeWindow(boolean chromaKey, int width, int height) {
+        if(DEBUG_IMPLEMENTATION) {
+            System.err.println("BCEGL Window.realizeWindow() with: chroma "+chromaKey+", "+width+"x"+height+", "+config);
+        }
+        long handle = CreateWindow(getDisplayHandle(), chromaKey, width, height);
+        if (0 == handle) {
+            throw new NativeWindowException("Error native Window Handle is null");
+        }
+        windowHandleClose = handle;
+        return handle;
+    }
+
+    private void windowCreated(int cfgID, int width, int height) {
+        this.width = width;
+        this.height = height;
+        GLCapabilitiesImmutable capsReq = (GLCapabilitiesImmutable) config.getRequestedCapabilities();
+        config = EGLGraphicsConfiguration.create(capsReq, getScreen().getGraphicsScreen(), cfgID);
+        if (config == null) {
+            throw new NativeWindowException("Error creating EGLGraphicsConfiguration from id: "+cfgID+", "+this);
+        }
+        if(DEBUG_IMPLEMENTATION) {
+            System.err.println("BCEGL Window.windowCreated(): "+toHexString(cfgID)+", "+width+"x"+height+", "+config);
+        }
+    }
+
+    private long   windowHandleClose;
+}
diff --git a/src/newt/classes/jogamp/newt/opengl/kd/KDDisplay.java b/src/newt/classes/jogamp/newt/opengl/kd/KDDisplay.java
new file mode 100644
index 0000000..c9d83a7
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/opengl/kd/KDDisplay.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.opengl.kd;
+
+import com.jogamp.newt.*;
+import jogamp.newt.*;
+import jogamp.opengl.egl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.egl.*;
+
+public class KDDisplay extends DisplayImpl {
+
+    static {
+        NEWTJNILibLoader.loadNEWT();
+
+        if (!KDWindow.initIDs()) {
+            throw new NativeWindowException("Failed to initialize KDWindow jmethodIDs");
+        }
+    }
+
+    public static void initSingleton() {
+        // just exist to ensure static init has been run
+    }
+
+
+    public KDDisplay() {
+    }
+
+    protected void createNativeImpl() {
+        // FIXME: map name to EGL_*_DISPLAY
+        long handle = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
+        if (handle == EGL.EGL_NO_DISPLAY) {
+            throw new NativeWindowException("eglGetDisplay failed");
+        }
+        if (!EGL.eglInitialize(handle, null, null)) {
+            throw new NativeWindowException("eglInitialize failed");
+        }
+        aDevice = new EGLGraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
+    }
+
+    protected void closeNativeImpl() {
+        if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
+            EGL.eglTerminate(aDevice.getHandle());
+        }
+    }
+
+    protected void dispatchMessagesNative() {
+        DispatchMessages();
+    }
+
+    private native void DispatchMessages();
+}
+
diff --git a/src/newt/classes/jogamp/newt/opengl/kd/KDScreen.java b/src/newt/classes/jogamp/newt/opengl/kd/KDScreen.java
new file mode 100644
index 0000000..2996fb1
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/opengl/kd/KDScreen.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.opengl.kd;
+
+import com.jogamp.newt.*;
+import jogamp.newt.ScreenImpl;
+import javax.media.nativewindow.*;
+
+public class KDScreen extends ScreenImpl {
+    static {
+        KDDisplay.initSingleton();
+    }
+
+    public KDScreen() {
+    }
+
+    protected void createNativeImpl() {
+        aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
+    }
+
+    protected void closeNativeImpl() { }
+
+    // elevate access to this package ..
+    protected void setScreenSize(int w, int h) {
+        super.setScreenSize(w, h);
+    }
+}
diff --git a/src/newt/classes/jogamp/newt/opengl/kd/KDWindow.java b/src/newt/classes/jogamp/newt/opengl/kd/KDWindow.java
new file mode 100644
index 0000000..9cfa13c
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/opengl/kd/KDWindow.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.opengl.kd;
+
+import jogamp.newt.*;
+import jogamp.opengl.egl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.util.Point;
+import javax.media.opengl.GLCapabilitiesImmutable;
+
+public class KDWindow extends WindowImpl {
+    private static final String WINDOW_CLASS_NAME = "NewtWindow";
+
+    static {
+        KDDisplay.initSingleton();
+    }
+
+    public KDWindow() {
+    }
+
+    protected void createNativeImpl() {
+        if(0!=getParentWindowHandle()) {
+            throw new RuntimeException("Window parenting not supported (yet)");
+        }
+        config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(
+                capsRequested, capsRequested, capabilitiesChooser, getScreen().getGraphicsScreen());
+        if (config == null) {
+            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+        }
+
+        GLCapabilitiesImmutable eglCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+        int[] eglAttribs = EGLGraphicsConfiguration.GLCapabilities2AttribList(eglCaps);
+
+        eglWindowHandle = CreateWindow(getDisplayHandle(), eglAttribs);
+        if (eglWindowHandle == 0) {
+            throw new NativeWindowException("Error creating egl window: "+config);
+        }
+        setVisible0(eglWindowHandle, false);
+        setWindowHandle(RealizeWindow(eglWindowHandle));
+        if (0 == getWindowHandle()) {
+            throw new NativeWindowException("Error native Window Handle is null");
+        }
+        windowHandleClose = eglWindowHandle;
+    }
+
+    protected void closeNativeImpl() {
+        if(0!=windowHandleClose) {
+            CloseWindow(windowHandleClose, windowUserData);
+            windowUserData=0;
+        }
+    }
+
+    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
+        setVisible0(eglWindowHandle, visible);
+        reconfigureWindowImpl(x, y, width, height, false, 0, 0);
+        visibleChanged(visible);
+    }
+
+    protected void requestFocusImpl(boolean reparented) { }
+
+    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, 
+                                            boolean parentChange, int fullScreenChange, int decorationChange) {
+        if(0!=eglWindowHandle) {
+            if(0!=fullScreenChange) {
+                boolean fs = fullScreenChange > 0;
+                setFullScreen0(eglWindowHandle, fs);
+                if(fs) {
+                    return true;
+                }
+            }
+            // int _x=(x>=0)?x:this.x;
+            // int _y=(x>=0)?y:this.y;
+            int _w=(width>0)?width:this.width;
+            int _h=(height>0)?height:this.height;
+            if(width>0 || height>0) {
+                setSize0(eglWindowHandle, _w, _h);
+            }
+            if(x>=0 || y>=0) {
+                System.err.println("setPosition n/a in KD");
+            }
+        }
+        return true;
+    }
+
+    protected Point getLocationOnScreenImpl(int x, int y) {
+        return new Point(x,y);
+    }
+
+    //----------------------------------------------------------------------
+    // Internals only
+    //
+
+    protected static native boolean initIDs();
+    private        native long CreateWindow(long displayHandle, int[] attributes);
+    private        native long RealizeWindow(long eglWindowHandle);
+    private        native int  CloseWindow(long eglWindowHandle, long userData);
+    private        native void setVisible0(long eglWindowHandle, boolean visible);
+    private        native void setSize0(long eglWindowHandle, int width, int height);
+    private        native void setFullScreen0(long eglWindowHandle, boolean fullscreen);
+
+    private void windowCreated(long userData) {
+        windowUserData=userData;
+    }
+
+    @Override
+    protected void sizeChanged(int newWidth, int newHeight, boolean force) {
+        if(fullscreen) {
+            ((KDScreen)getScreen()).setScreenSize(width, height);
+        }
+        super.sizeChanged(newWidth, newHeight, force);
+    }
+
+    private long   eglWindowHandle;
+    private long   windowHandleClose;
+    private long   windowUserData;
+}
diff --git a/src/newt/classes/jogamp/newt/windows/WindowsDisplay.java b/src/newt/classes/jogamp/newt/windows/WindowsDisplay.java
new file mode 100644
index 0000000..750c380
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/windows/WindowsDisplay.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.windows;
+
+import jogamp.nativewindow.windows.RegisteredClass;
+import jogamp.nativewindow.windows.RegisteredClassFactory;
+import jogamp.newt.DisplayImpl;
+import jogamp.newt.NEWTJNILibLoader;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.windows.WindowsGraphicsDevice;
+
+public class WindowsDisplay extends DisplayImpl {
+
+    private static final String newtClassBaseName = "_newt_clazz" ;
+    private static RegisteredClassFactory sharedClassFactory;
+
+    static {
+        NEWTJNILibLoader.loadNEWT();
+
+        if (!WindowsWindow.initIDs0()) {
+            throw new NativeWindowException("Failed to initialize WindowsWindow jmethodIDs");
+        }        
+        sharedClassFactory = new RegisteredClassFactory(newtClassBaseName, WindowsWindow.getNewtWndProc0());
+    }
+
+    public static void initSingleton() {
+        // just exist to ensure static init has been run
+    }
+
+    private RegisteredClass sharedClass;
+
+    public WindowsDisplay() {
+    }
+
+    protected void createNativeImpl() {
+        sharedClass = sharedClassFactory.getSharedClass();
+        aDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+    }
+
+    protected void closeNativeImpl() { 
+        sharedClassFactory.releaseSharedClass();
+    }
+
+    protected void dispatchMessagesNative() {
+        DispatchMessages0();
+    }
+
+    protected long getHInstance() {
+        return sharedClass.getHandle();
+    }
+
+    protected String getWindowClassName() {
+        return sharedClass.getName();
+    }
+
+    //----------------------------------------------------------------------
+    // Internals only
+    //
+    private static native void DispatchMessages0();
+}
+
diff --git a/src/newt/classes/jogamp/newt/windows/WindowsScreen.java b/src/newt/classes/jogamp/newt/windows/WindowsScreen.java
new file mode 100644
index 0000000..ea7fe8d
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/windows/WindowsScreen.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+package jogamp.newt.windows;
+
+import com.jogamp.common.util.ArrayHashSet;
+import java.util.ArrayList;
+
+import com.jogamp.newt.*;
+import jogamp.newt.ScreenImpl;
+import com.jogamp.newt.ScreenMode;
+import jogamp.newt.ScreenModeStatus;
+import com.jogamp.newt.util.ScreenModeUtil;
+
+import javax.media.nativewindow.*;
+
+public class WindowsScreen extends ScreenImpl {
+
+    static {
+        WindowsDisplay.initSingleton();
+    }
+
+    public WindowsScreen() {
+    }
+
+    protected void createNativeImpl() {
+        aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
+        setScreenSize(getWidthImpl0(screen_idx), getHeightImpl0(screen_idx));
+    }
+
+    protected void closeNativeImpl() {
+    }
+
+    private int[] getScreenModeIdx(int idx) {
+        int[] modeProps = getScreenMode0(screen_idx, idx);
+        if (null == modeProps || 0 == modeProps.length) {
+            return null;
+        }
+        if(modeProps.length < ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL) {
+            throw new RuntimeException("properties array too short, should be >= "+ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL+", is "+modeProps.length);
+        }
+        return modeProps;
+    }
+
+    private int nativeModeIdx;
+
+    protected int[] getScreenModeFirstImpl() {
+        nativeModeIdx = 0;
+        return getScreenModeNextImpl();
+    }
+
+    protected int[] getScreenModeNextImpl() {
+        int[] modeProps = getScreenModeIdx(nativeModeIdx);
+        if (null != modeProps && 0 < modeProps.length) {
+            nativeModeIdx++;
+            return modeProps;
+        }
+        return null;
+    }
+
+    protected ScreenMode getCurrentScreenModeImpl() {
+        int[] modeProps = getScreenModeIdx(-1);
+        if (null != modeProps && 0 < modeProps.length) {
+            return ScreenModeUtil.streamIn(modeProps, 0);
+        }
+        return null;
+    }
+
+    protected boolean setCurrentScreenModeImpl(ScreenMode sm) {
+        return setScreenMode0(screen_idx, 
+                              sm.getMonitorMode().getSurfaceSize().getResolution().getWidth(),
+                              sm.getMonitorMode().getSurfaceSize().getResolution().getHeight(),
+                              sm.getMonitorMode().getSurfaceSize().getBitsPerPixel(),
+                              sm.getMonitorMode().getRefreshRate(),
+                              sm.getRotation());
+    }
+
+    // Native calls
+    private native int getWidthImpl0(int scrn_idx);
+
+    private native int getHeightImpl0(int scrn_idx);
+
+    private native int[] getScreenMode0(int screen_index, int mode_index);
+    private native boolean setScreenMode0(int screen_index, int width, int height, int bits, int freq, int rot);
+}
diff --git a/src/newt/classes/jogamp/newt/windows/WindowsWindow.java b/src/newt/classes/jogamp/newt/windows/WindowsWindow.java
new file mode 100644
index 0000000..653de29
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/windows/WindowsWindow.java
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.windows;
+
+import jogamp.nativewindow.windows.GDI;
+import jogamp.newt.WindowImpl;
+import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.util.Insets;
+import javax.media.nativewindow.util.Point;
+
+public class WindowsWindow extends WindowImpl {
+
+    private long hmon;
+    private long hdc;
+    private long windowHandleClose;
+    private final Insets insets = new Insets(0, 0, 0, 0);
+
+    static {
+        WindowsDisplay.initSingleton();
+    }
+
+    public WindowsWindow() {
+    }
+
+    @Override
+    protected int lockSurfaceImpl() {
+        if (0 != hdc) {
+            throw new InternalError("surface not released");
+        }
+        hdc = GDI.GetDC(getWindowHandle());
+        hmon = MonitorFromWindow0(getWindowHandle());
+        return ( 0 != hdc ) ? LOCK_SUCCESS : LOCK_SURFACE_NOT_READY;
+    }
+
+    @Override
+    protected void unlockSurfaceImpl() {
+        if (0 == hdc) {
+            throw new InternalError("surface not acquired");
+        }
+        GDI.ReleaseDC(getWindowHandle(), hdc);
+        hdc=0;
+    }
+
+    @Override
+    public final long getSurfaceHandle() {
+        return hdc;
+    }
+
+    @Override
+    public boolean hasDeviceChanged() {
+        if(0!=getWindowHandle()) {
+            long _hmon = MonitorFromWindow0(getWindowHandle());
+            if (hmon != _hmon) {
+                if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+                    Exception e = new Exception("Info: Window Device Changed "+Thread.currentThread().getName()+
+                                                ", HMON "+toHexString(hmon)+" -> "+toHexString(_hmon));
+                    e.printStackTrace();
+                }
+                hmon = _hmon;
+                return true;
+            }
+        }
+        return false;
+    }
+
+    protected void createNativeImpl() {
+        WindowsScreen  screen = (WindowsScreen) getScreen();
+        WindowsDisplay display = (WindowsDisplay) screen.getDisplay();
+        config = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice()).chooseGraphicsConfiguration(
+                capsRequested, capsRequested, capabilitiesChooser, screen.getGraphicsScreen());
+        if (config == null) {
+            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+        }
+        setWindowHandle(CreateWindow0(display.getHInstance(), display.getWindowClassName(), display.getWindowClassName(),
+                                      getParentWindowHandle(), 0, undecorated, x, y, width, height));
+        if (getWindowHandle() == 0) {
+            throw new NativeWindowException("Error creating window");
+        }
+        windowHandleClose = getWindowHandle();
+        if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+            Exception e = new Exception("Info: Window new window handle "+Thread.currentThread().getName()+
+                                        " (Parent HWND "+toHexString(getParentWindowHandle())+
+                                        ") : HWND "+toHexString(getWindowHandle())+", "+Thread.currentThread());
+            e.printStackTrace();
+        }
+    }
+
+    protected void closeNativeImpl() {
+        if (hdc != 0) {
+            if(windowHandleClose != 0) {
+                try {
+                    GDI.ReleaseDC(windowHandleClose, hdc);
+                } catch (Throwable t) {
+                    if(DEBUG_IMPLEMENTATION) { 
+                        Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
+                        e.printStackTrace();
+                    }
+                }
+            }
+            hdc = 0;
+        }
+        if(windowHandleClose != 0) {
+            try {
+                GDI.DestroyWindow(windowHandleClose);
+            } catch (Throwable t) {
+                if(DEBUG_IMPLEMENTATION) {
+                    Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
+                    e.printStackTrace();
+                }
+            } finally {
+                windowHandleClose = 0;
+            }
+        }
+    }
+
+    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
+        setVisible0(getWindowHandle(), visible, (getParentWindowHandle()==0)?true:false, x, y, width, height);
+        visibleChanged(visible);
+    }
+
+    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, 
+                                            boolean parentChange, int fullScreenChange, int decorationChange) {
+        reconfigureWindow0( (fullScreenChange>0)?0:getParentWindowHandle(), 
+                             getWindowHandle(), x, y, width, height, isVisible(), parentChange, fullScreenChange, decorationChange);
+        return true;
+    }
+
+    protected void requestFocusImpl(boolean force) {
+        requestFocus0(getWindowHandle(), force);
+    }
+
+    @Override
+    protected void setTitleImpl(final String title) {
+        setTitle0(getWindowHandle(), title);
+    }
+
+    @Override
+    public Insets getInsets() {
+        return (Insets)insets.clone();
+    }
+
+    protected Point getLocationOnScreenImpl(int x, int y) {
+        return GDI.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
+    }
+
+    //----------------------------------------------------------------------
+    // Internals only
+    //
+    protected static native boolean initIDs0();
+    protected static native long getNewtWndProc0();
+
+    private native long CreateWindow0(long hInstance, String wndClassName, String wndName,
+                                      long parentWindowHandle, long visualID, boolean isUndecorated,
+                                      int x, int y, int width, int height);
+    private native long MonitorFromWindow0(long windowHandle);
+    private native void setVisible0(long windowHandle, boolean visible, boolean top, int x, int y, int width, int height);
+    private native void reconfigureWindow0(long parentWindowHandle, long windowHandle, 
+                                                  int x, int y, int width, int height, boolean isVisible,
+                                                  boolean parentChange, int fullScreenChange, int decorationChange);
+    private static native void setTitle0(long windowHandle, String title);
+    private native void requestFocus0(long windowHandle, boolean force);
+
+    private void insetsChanged(int left, int top, int right, int bottom) {
+        if (left != -1 && top != -1 && right != -1 && bottom != -1) {
+            if (left != insets.left || top != insets.top || right != insets.right || bottom != insets.bottom) {
+                insets.left = left;
+                insets.top = top;
+                insets.right = right;
+                insets.bottom = bottom;
+                if(DEBUG_IMPLEMENTATION) {
+                    System.err.println("Window.insetsChanged: "+insets);
+                }
+            }
+        }
+    }
+}
diff --git a/src/newt/classes/jogamp/newt/x11/X11Display.java b/src/newt/classes/jogamp/newt/x11/X11Display.java
new file mode 100644
index 0000000..d4a83ab
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/x11/X11Display.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.x11;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+import jogamp.newt.*;
+import jogamp.nativewindow.x11.X11Util;
+
+public class X11Display extends DisplayImpl {
+
+    static {
+        NEWTJNILibLoader.loadNEWT();
+
+        if ( !initIDs0() ) {
+            throw new NativeWindowException("Failed to initialize X11Display jmethodIDs");
+        }
+
+        if (!X11Window.initIDs0()) {
+            throw new NativeWindowException("Failed to initialize X11Window jmethodIDs");
+        }
+    }
+
+    public static void initSingleton() {
+        // just exist to ensure static init has been run
+    }
+
+
+    public X11Display() {
+    }
+
+    public String validateDisplayName(String name, long handle) {
+        return X11Util.validateDisplayName(name, handle);
+    }
+
+    protected void createNativeImpl() {
+        long handle = X11Util.createDisplay(name);
+        if( 0 == handle ) {
+            throw new RuntimeException("Error creating display: "+name);
+        }
+        try {
+            CompleteDisplay0(handle);
+        } catch(RuntimeException e) {
+            X11Util.closeDisplay(handle);
+            throw e;
+        }
+        aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, NativeWindowFactory.getNullToolkitLock());
+        // aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, NativeWindowFactory.createDefaultToolkitLockNoAWT(NativeWindowFactory.TYPE_X11, handle));
+        // aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT);
+    }
+
+    protected void closeNativeImpl() {
+        X11Util.closeDisplay(getHandle());
+    }
+
+    protected void dispatchMessagesNative() {
+        long dpy = getHandle();
+        if(0!=dpy) {
+            DispatchMessages0(dpy, javaObjectAtom, windowDeleteAtom);
+        }
+    }
+
+    protected long getJavaObjectAtom() { return javaObjectAtom; }
+    protected long getWindowDeleteAtom() { return windowDeleteAtom; }
+
+    //----------------------------------------------------------------------
+    // Internals only
+    //
+    private static native boolean initIDs0();
+
+    private native void CompleteDisplay0(long handle);
+
+    private native void DispatchMessages0(long display, long javaObjectAtom, long windowDeleteAtom);
+
+    private void displayCompleted(long javaObjectAtom, long windowDeleteAtom) {
+        this.javaObjectAtom=javaObjectAtom;
+        this.windowDeleteAtom=windowDeleteAtom;
+    }
+
+    private long windowDeleteAtom;
+    private long javaObjectAtom;
+}
+
diff --git a/src/newt/classes/jogamp/newt/x11/X11Screen.java b/src/newt/classes/jogamp/newt/x11/X11Screen.java
new file mode 100644
index 0000000..4788f6b
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/x11/X11Screen.java
@@ -0,0 +1,270 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+package jogamp.newt.x11;
+
+import jogamp.nativewindow.x11.X11Util;
+import jogamp.newt.ScreenImpl;
+import com.jogamp.newt.ScreenMode;
+import com.jogamp.newt.util.ScreenModeUtil;
+import java.util.List;
+
+import javax.media.nativewindow.x11.*;
+
+public class X11Screen extends ScreenImpl {
+
+    static {
+        X11Display.initSingleton();
+    }
+
+    public X11Screen() {
+    }
+
+    protected void createNativeImpl() {
+        long handle = GetScreen0(display.getHandle(), screen_idx);
+        if (handle == 0) {
+            throw new RuntimeException("Error creating screen: " + screen_idx);
+        }
+        aScreen = new X11GraphicsScreen((X11GraphicsDevice) getDisplay().getGraphicsDevice(), screen_idx);
+        setScreenSize(getWidth0(display.getHandle(), screen_idx),
+                getHeight0(display.getHandle(), screen_idx));
+    }
+
+    protected void closeNativeImpl() {
+    }
+
+    private int[] nrotations;
+    private int nrotation_index;
+    private int nres_number;
+    private int nres_index;
+    private int[] nrates;
+    private int nrate_index;
+    private int nmode_number;
+
+    protected int[] getScreenModeFirstImpl() {
+        // initialize iterators and static data
+        nrotations = getAvailableScreenModeRotations0(display.getHandle(), screen_idx);
+        if(null==nrotations || 0==nrotations.length) {
+            return null;
+        }
+        nrotation_index = 0;
+
+        nres_number = getNumScreenModeResolutions0(display.getHandle(), screen_idx);
+        if(0==nres_number) {
+            return null;
+        }
+        nres_index = 0;
+
+        nrates = getScreenModeRates0(display.getHandle(), screen_idx, nres_index);
+        if(null==nrates || 0==nrates.length) {
+            return null;
+        }
+        nrate_index = 0;
+
+        nmode_number = 0;
+
+        return getScreenModeNextImpl();
+    }
+
+    protected int[] getScreenModeNextImpl() {
+        // assemble: w x h x bpp x f x r        
+
+        /**
+        System.err.println("******** mode: "+nmode_number);
+        System.err.println("rot  "+nrotation_index);
+        System.err.println("rate "+nrate_index);
+        System.err.println("res  "+nres_index); */
+
+        int[] res = getScreenModeResolution0(display.getHandle(), screen_idx, nres_index);
+        if(null==res || 0==res.length) {
+            return null;
+        }
+        if(0>=res[0] || 0>=res[1]) {
+            throw new InternalError("invalid resolution: "+res[0]+"x"+res[1]+" for res idx "+nres_index+"/"+nres_number);
+        }
+        int bpp = 32; // FIXME
+        int rate = nrates[nrate_index];
+        if(0>=rate) {
+            throw new InternalError("invalid rate: "+rate+" at index "+nrate_index+"/"+nrates.length);
+        }
+        int rotation = nrotations[nrotation_index];
+
+        int[] props = new int[ 1 + ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL ];
+        int i = 0;
+        props[i++] = nres_index; // use resolution index, not unique for native -> ScreenMode
+        props[i++] = 0; // set later for verification of iterator
+        props[i++] = res[0]; // width
+        props[i++] = res[1]; // height
+        props[i++] = bpp;    // bpp
+        props[i++] = res[2]; // widthmm
+        props[i++] = res[3]; // heightmm
+        props[i++] = rate;   // rate
+        props[i++] = rotation;
+        props[i - ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL] = i - 1; // count without extra element
+
+        nmode_number++;
+
+        // iteration: r -> f -> bpp -> [w x h]
+        nrotation_index++;
+        if(nrotation_index == nrotations.length) {
+            nrotation_index=0;
+            nrate_index++;
+            if(null == nrates || nrate_index == nrates.length){
+                nres_index++;
+                if(nres_index == nres_number) {
+                    // done
+                    nrates=null;
+                    nrotations=null;
+                    return null;
+                }
+
+                nrates = getScreenModeRates0(display.getHandle(), screen_idx, nres_index);
+                if(null==nrates || 0==nrates.length) {
+                    return null;
+                }
+                nrate_index = 0;
+            }
+        }
+
+        return props;
+    }
+
+    protected ScreenMode getCurrentScreenModeImpl() {
+        int resNumber = getNumScreenModeResolutions0(display.getHandle(), screen_idx);
+        if(0==resNumber) {
+            return null;
+        }
+        int resIdx = getCurrentScreenResolutionIndex0(display.getHandle(), screen_idx);
+        if(0>resIdx) {
+            return null;
+        }
+        if(resIdx>=resNumber) {
+            throw new RuntimeException("Invalid resolution index: ! "+resIdx+" < "+resNumber);
+        }
+        int[] res = getScreenModeResolution0(display.getHandle(), screen_idx, resIdx);
+        if(null==res || 0==res.length) {
+            return null;
+        }
+        if(0>=res[0] || 0>=res[1]) {
+            throw new InternalError("invalid resolution: "+res[0]+"x"+res[1]+" for res idx "+resIdx+"/"+resNumber);
+        }
+        int rate = getCurrentScreenRate0(display.getHandle(), screen_idx);
+        if(0>rate) {
+            return null;
+        }
+        int rot = getCurrentScreenRotation0(display.getHandle(), screen_idx);
+        if(0>rot) {
+            return null;
+        }
+
+        int[] props = new int[ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL];
+        int i = 0;
+        props[i++] = 0; // set later for verification of iterator
+        props[i++] = res[0]; // width
+        props[i++] = res[1]; // height
+        props[i++] = 32;     // FIXME: bpp
+        props[i++] = res[2]; // widthmm
+        props[i++] = res[3]; // heightmm
+        props[i++] = rate;   // rate
+        props[i++] = rot;
+        props[i - ScreenModeUtil.NUM_SCREEN_MODE_PROPERTIES_ALL] = i; // count
+        return ScreenModeUtil.streamIn(props, 0);
+    }
+
+    protected boolean setCurrentScreenModeImpl(ScreenMode screenMode) {
+        List screenModes = this.getScreenModesOrig();
+        int screenModeIdx = screenModes.indexOf(screenMode);
+        if(0>screenModeIdx) {
+            throw new RuntimeException("ScreenMode not element of ScreenMode list: "+screenMode);
+        }
+        int resNumber = getNumScreenModeResolutions0(display.getHandle(), screen_idx);
+        int resIdx = getScreenModesIdx2NativeIdx().get(screenModeIdx);
+        if(0>resIdx || resIdx>=resNumber) {
+            throw new RuntimeException("Invalid resolution index: ! 0 < "+resIdx+" < "+resNumber+", screenMode["+screenModeIdx+"] "+screenMode);
+        }
+
+        long dpy = X11Util.createDisplay(display.getName());
+        if( 0 == dpy ) {
+            throw new RuntimeException("Error creating display: "+display.getName());
+        }
+
+        boolean done = false;
+        long t0 = System.currentTimeMillis();
+        try {
+            int f = screenMode.getMonitorMode().getRefreshRate();
+            int r = screenMode.getRotation();
+            if( setCurrentScreenModeStart0(dpy, screen_idx, resIdx, f, r) ) {
+                while(!done && System.currentTimeMillis()-t0 < SCREEN_MODE_CHANGE_TIMEOUT) {
+                    done = setCurrentScreenModePollEnd0(dpy, screen_idx, resIdx, f, r);
+                    if(!done) {
+                        Thread.yield();
+                    }
+                }
+            }
+        } finally {
+            X11Util.closeDisplay(dpy);
+        }
+
+        if(!done) {
+            System.err.println("X11Screen.setCurrentScreenModeImpl: TO ("+SCREEN_MODE_CHANGE_TIMEOUT+") reached: "+
+                               (System.currentTimeMillis()-t0)+"ms");
+        }
+        return done;
+    }
+
+    //----------------------------------------------------------------------
+    // Internals only
+    //
+    private static native long GetScreen0(long dpy, int scrn_idx);
+
+    private static native int getWidth0(long display, int scrn_idx);
+
+    private static native int getHeight0(long display, int scrn_idx);
+
+    /** @return int[] { rot1, .. } */
+    private static native int[] getAvailableScreenModeRotations0(long display, int screen_index);
+
+    private static native int getNumScreenModeResolutions0(long display, int screen_index);
+
+    /** @return int[] { width, height, widthmm, heightmm } */
+    private static native int[] getScreenModeResolution0(long display, int screen_index, int mode_index);
+
+    private static native int[] getScreenModeRates0(long display, int screen_index, int mode_index);
+
+    private static native int getCurrentScreenResolutionIndex0(long display, int screen_index);
+    private static native int getCurrentScreenRate0(long display, int screen_index);
+    private static native int getCurrentScreenRotation0(long display, int screen_index);
+
+    /** needs own Display connection for XRANDR event handling */
+    private static native boolean setCurrentScreenModeStart0(long display, int screen_index, int mode_index, int freq, int rot);
+    private static native boolean setCurrentScreenModePollEnd0(long display, int screen_index, int mode_index, int freq, int rot);
+}
diff --git a/src/newt/classes/jogamp/newt/x11/X11Window.java b/src/newt/classes/jogamp/newt/x11/X11Window.java
new file mode 100644
index 0000000..8f94556
--- /dev/null
+++ b/src/newt/classes/jogamp/newt/x11/X11Window.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ */
+
+package jogamp.newt.x11;
+
+import jogamp.nativewindow.x11.X11Util;
+import jogamp.newt.WindowImpl;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+import javax.media.nativewindow.util.Point;
+
+public class X11Window extends WindowImpl {
+    private static final String WINDOW_CLASS_NAME = "NewtWindow";
+
+    static {
+        X11Display.initSingleton();
+    }
+
+    public X11Window() {
+    }
+
+    protected void createNativeImpl() {
+        X11Screen screen = (X11Screen) getScreen();
+        X11Display display = (X11Display) screen.getDisplay();
+        config = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice()).chooseGraphicsConfiguration(
+                capsRequested, capsRequested, capabilitiesChooser, screen.getGraphicsScreen());
+        if (config == null) {
+            throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+        }
+        X11GraphicsConfiguration x11config = (X11GraphicsConfiguration) config;
+        long visualID = x11config.getVisualID();
+        long w = CreateWindow0(getParentWindowHandle(),
+                               display.getHandle(), screen.getIndex(), visualID, 
+                               display.getJavaObjectAtom(), display.getWindowDeleteAtom(), 
+                               x, y, width, height, isUndecorated());
+        if (w == 0) {
+            throw new NativeWindowException("Error creating window: "+w);
+        }
+        setWindowHandle(w);
+        windowHandleClose = w;
+    }
+
+    protected void closeNativeImpl() {
+        if(0!=windowHandleClose && null!=getScreen() ) {
+            X11Display display = (X11Display) getScreen().getDisplay();
+            try {
+                CloseWindow0(display.getHandle(), windowHandleClose, 
+                             display.getJavaObjectAtom(), display.getWindowDeleteAtom());
+            } catch (Throwable t) {
+                if(DEBUG_IMPLEMENTATION) { 
+                    Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
+                    e.printStackTrace();
+                }
+            } finally {
+                windowHandleClose = 0;
+            }
+        }
+    }
+
+    protected void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
+        setVisible0(getDisplayHandle(), getWindowHandle(), visible, x, y, width, height);
+    }
+
+    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, 
+                                            boolean parentChange, int fullScreenChange, int decorationChange) {
+        reparentHandle=0;
+        reparentCount=0;
+        long reqNewParentHandle = ( fullScreenChange > 0 ) ? 0 : getParentWindowHandle() ;
+
+        reconfigureWindow0( getDisplayHandle(), getScreenIndex(), reqNewParentHandle, getWindowHandle(),
+                            x, y, width, height, isVisible(), parentChange, fullScreenChange, decorationChange);
+        return true;
+    }
+
+    protected void requestFocusImpl(boolean force) {
+        requestFocus0(getDisplayHandle(), getWindowHandle(), force);
+    }
+
+    @Override
+    protected void setTitleImpl(String title) {
+        setTitle0(getDisplayHandle(), getWindowHandle(), title);
+    }
+
+    protected Point getLocationOnScreenImpl(int x, int y) {
+        return X11Util.GetRelativeLocation( getDisplayHandle(), getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
+    }
+
+    //----------------------------------------------------------------------
+    // Internals only
+    //
+
+    protected static native boolean initIDs0();
+    private native long CreateWindow0(long parentWindowHandle, long display, int screen_index, 
+                                            long visualID, long javaObjectAtom, long windowDeleteAtom, 
+                                            int x, int y, int width, int height, boolean undecorated);
+    private native void CloseWindow0(long display, long windowHandle, long javaObjectAtom, long windowDeleteAtom);
+    private native void setVisible0(long display, long windowHandle, boolean visible, int x, int y, int width, int height);
+    private native void reconfigureWindow0(long display, int screen_index, long parentWindowHandle, long windowHandle, 
+                                                  int x, int y, int width, int height, boolean isVisible,
+                                                  boolean parentChange, int fullScreenChange, int decorationChange);
+    private native void setTitle0(long display, long windowHandle, String title);
+    private native void requestFocus0(long display, long windowHandle, boolean force);
+    private native Object getRelativeLocation0(long display, int screen_index, long src_win, long dest_win, int src_x, int src_y);
+
+    private void windowReparented(long gotParentHandle) {
+        reparentHandle = gotParentHandle;
+        reparentCount++;
+        if(DEBUG_IMPLEMENTATION) { 
+            System.err.println("******** new parent ("+reparentCount+"): " + toHexString(reparentHandle) );
+        }
+    }
+
+    private long   windowHandleClose;
+    private volatile long reparentHandle;
+    private volatile int reparentCount;
+}
diff --git a/src/newt/native/BroadcomEGL.c b/src/newt/native/BroadcomEGL.c
index ddac0ef..0cca904 100644
--- a/src/newt/native/BroadcomEGL.c
+++ b/src/newt/native/BroadcomEGL.c
@@ -41,7 +41,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "com_jogamp_newt_impl_opengl_broadcom_egl_Window.h"
+#include "jogamp_newt_opengl_broadcom_egl_Window.h"
 
 #include "MouseEvent.h"
 #include "KeyEvent.h"
@@ -71,7 +71,7 @@ static jmethodID windowCreatedID = NULL;
  * Display
  */
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Display_DispatchMessages
+JNIEXPORT void JNICALL Java_jogamp_newt_opengl_broadcom_egl_Display_DispatchMessages
   (JNIEnv *env, jobject obj)
 {
     // FIXME: n/a
@@ -79,7 +79,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Display_Dis
     (void) obj;
 }
 
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Display_CreateDisplay
+JNIEXPORT jlong JNICALL Java_jogamp_newt_opengl_broadcom_egl_Display_CreateDisplay
   (JNIEnv *env, jobject obj, jint width, jint height)
 {
     (void) env;
@@ -93,7 +93,7 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Display_Cr
     return (jlong) (intptr_t) dpy;
 }
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Display_DestroyDisplay
+JNIEXPORT void JNICALL Java_jogamp_newt_opengl_broadcom_egl_Display_DestroyDisplay
   (JNIEnv *env, jobject obj, jlong display)
 {
     EGLDisplay dpy  = (EGLDisplay)(intptr_t)display;
@@ -110,7 +110,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Display_Des
  * Window
  */
 
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Window_initIDs
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_opengl_broadcom_egl_Window_initIDs
   (JNIEnv *env, jclass clazz)
 {
     windowCreatedID = (*env)->GetMethodID(env, clazz, "windowCreated", "(III)V");
@@ -122,7 +122,7 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Window_
     return JNI_TRUE;
 }
 
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Window_CreateWindow
+JNIEXPORT jlong JNICALL Java_jogamp_newt_opengl_broadcom_egl_Window_CreateWindow
   (JNIEnv *env, jobject obj, jlong display, jboolean chromaKey, jint width, jint height)
 {
     EGLDisplay dpy  = (EGLDisplay)(intptr_t)display;
@@ -166,7 +166,7 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Window_Cre
     return (jlong) (intptr_t) window;
 }
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Window_CloseWindow
+JNIEXPORT void JNICALL Java_jogamp_newt_opengl_broadcom_egl_Window_CloseWindow
   (JNIEnv *env, jobject obj, jlong display, jlong window)
 {
     EGLDisplay dpy  = (EGLDisplay) (intptr_t) display;
@@ -179,7 +179,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Window_Clos
     DBG_PRINT( "[CloseWindow] X\n");
 }
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_broadcom_egl_Window_SwapWindow
+JNIEXPORT void JNICALL Java_jogamp_newt_opengl_broadcom_egl_Window_SwapWindow
   (JNIEnv *env, jobject obj, jlong display, jlong window)
 {
     EGLDisplay dpy  = (EGLDisplay) (intptr_t) display;
diff --git a/src/newt/native/IntelGDL.c b/src/newt/native/IntelGDL.c
index eb6becb..953181c 100644
--- a/src/newt/native/IntelGDL.c
+++ b/src/newt/native/IntelGDL.c
@@ -37,9 +37,9 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "com_jogamp_newt_impl_intel_gdl_Display.h"
-#include "com_jogamp_newt_impl_intel_gdl_Screen.h"
-#include "com_jogamp_newt_impl_intel_gdl_Window.h"
+#include "jogamp_newt_intel_gdl_Display.h"
+#include "jogamp_newt_intel_gdl_Screen.h"
+#include "jogamp_newt_intel_gdl_Window.h"
 
 #include "MouseEvent.h"
 #include "KeyEvent.h"
@@ -122,7 +122,7 @@ static void JNI_ThrowNew(JNIEnv *env, const char *throwable, const char* message
  * Display
  */
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_intel_gdl_Display_DispatchMessages
+JNIEXPORT void JNICALL Java_jogamp_newt_intel_gdl_Display_DispatchMessages
   (JNIEnv *env, jobject obj, jlong displayHandle, jobject focusedWindow)
 {
     // FIXME: n/a
@@ -137,7 +137,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_intel_gdl_Display_DispatchMessa
     } */
 }
 
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_intel_gdl_Display_CreateDisplay
+JNIEXPORT jlong JNICALL Java_jogamp_newt_intel_gdl_Display_CreateDisplay
   (JNIEnv *env, jobject obj)
 {
     gdl_ret_t retval;
@@ -170,7 +170,7 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_intel_gdl_Display_CreateDispla
     return (jlong) (intptr_t) p_driver_info;
 }
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_intel_gdl_Display_DestroyDisplay
+JNIEXPORT void JNICALL Java_jogamp_newt_intel_gdl_Display_DestroyDisplay
   (JNIEnv *env, jobject obj, jlong displayHandle)
 {
     gdl_driver_info_t * p_driver_info = (gdl_driver_info_t *) (intptr_t) displayHandle;
@@ -189,7 +189,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_intel_gdl_Display_DestroyDispla
  * Screen
  */
 
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_intel_gdl_Screen_initIDs
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_intel_gdl_Screen_initIDs
   (JNIEnv *env, jclass clazz)
 {
     screenCreatedID = (*env)->GetMethodID(env, clazz, "screenCreated", "(II)V");
@@ -201,7 +201,7 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_intel_gdl_Screen_initIDs
     return JNI_TRUE;
 }
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_intel_gdl_Screen_GetScreenInfo
+JNIEXPORT void JNICALL Java_jogamp_newt_intel_gdl_Screen_GetScreenInfo
   (JNIEnv *env, jobject obj, jlong displayHandle, jint idx)
 {
     gdl_driver_info_t * p_driver_info = (gdl_driver_info_t *) (intptr_t) displayHandle;
@@ -233,7 +233,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_intel_gdl_Screen_GetScreenInfo
  * Window
  */
 
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_intel_gdl_Window_initIDs
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_intel_gdl_Window_initIDs
   (JNIEnv *env, jclass clazz)
 {
     updateBoundsID = (*env)->GetMethodID(env, clazz, "updateBounds", "(IIII)V");
@@ -245,7 +245,7 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_intel_gdl_Window_initIDs
     return JNI_TRUE;
 }
 
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_intel_gdl_Window_CreateSurface
+JNIEXPORT jlong JNICALL Java_jogamp_newt_intel_gdl_Window_CreateSurface
   (JNIEnv *env, jobject obj, jlong displayHandle, jint scr_width, jint scr_height, jint x, jint y, jint width, jint height) {
 
     gdl_driver_info_t * p_driver_info = (gdl_driver_info_t *) (intptr_t) displayHandle;
@@ -338,7 +338,7 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_intel_gdl_Window_CreateSurface
     return (jlong) (intptr_t) plane;
 }
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_intel_gdl_Window_CloseSurface
+JNIEXPORT void JNICALL Java_jogamp_newt_intel_gdl_Window_CloseSurface
   (JNIEnv *env, jobject obj, jlong display, jlong surface)
 {
     gdl_plane_id_t plane = (gdl_plane_id_t) (intptr_t) surface ;
@@ -347,7 +347,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_intel_gdl_Window_CloseSurface
     DBG_PRINT("[CloseSurface] plane %d\n", plane);
 }
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_intel_gdl_Window_SetBounds0
+JNIEXPORT void JNICALL Java_jogamp_newt_intel_gdl_Window_SetBounds0
   (JNIEnv *env, jobject obj, jlong surface, jint scr_width, jint scr_height, jint x, jint y, jint width, jint height) {
 
     gdl_plane_id_t plane = (gdl_plane_id_t) (intptr_t) surface ;
diff --git a/src/newt/native/KDWindow.c b/src/newt/native/KDWindow.c
index 33af4d9..be0488f 100644
--- a/src/newt/native/KDWindow.c
+++ b/src/newt/native/KDWindow.c
@@ -63,7 +63,7 @@
 
 #include <KD/kd.h>
 
-#include "com_jogamp_newt_impl_opengl_kd_KDWindow.h"
+#include "jogamp_newt_opengl_kd_KDWindow.h"
 
 #include "MouseEvent.h"
 #include "KeyEvent.h"
@@ -94,7 +94,6 @@ static jmethodID windowCreatedID = NULL;
 static jmethodID sizeChangedID = NULL;
 static jmethodID visibleChangedID = NULL;
 static jmethodID windowDestroyNotifyID = NULL;
-static jmethodID windowDestroyedID = NULL;
 static jmethodID sendMouseEventID = NULL;
 static jmethodID sendKeyEventID = NULL;
 
@@ -102,7 +101,7 @@ static jmethodID sendKeyEventID = NULL;
  * Display
  */
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDDisplay_DispatchMessages
+JNIEXPORT void JNICALL Java_jogamp_newt_opengl_kd_KDDisplay_DispatchMessages
   (JNIEnv *env, jobject obj)
 {
     const KDEvent * evt;
@@ -137,8 +136,6 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDDisplay_DispatchMes
                 {
                     DBG_PRINT( "event window close : src: %p\n", userData);
                     (*env)->CallVoidMethod(env, javaWindow, windowDestroyNotifyID);
-                    // Called by Window.java: DestroyWindow(wnd);
-                    //  (*env)->CallVoidMethod(env, javaWindow, windowDestroyedID);
                 }
                 break;
             case KD_EVENT_WINDOWPROPERTY_CHANGE:
@@ -200,7 +197,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDDisplay_DispatchMes
  * Window
  */
 
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_initIDs
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_opengl_kd_KDWindow_initIDs
   (JNIEnv *env, jclass clazz)
 {
 #ifdef VERBOSE_ON
@@ -213,14 +210,12 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_initIDs
     sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(IIZ)V");
     visibleChangedID = (*env)->GetMethodID(env, clazz, "visibleChanged", "(Z)V");
     windowDestroyNotifyID = (*env)->GetMethodID(env, clazz, "windowDestroyNotify",    "()V");
-    windowDestroyedID = (*env)->GetMethodID(env, clazz, "windowDestroyed", "()V");
     sendMouseEventID = (*env)->GetMethodID(env, clazz, "sendMouseEvent", "(IIIIII)V");
     sendKeyEventID = (*env)->GetMethodID(env, clazz, "sendKeyEvent", "(IIIC)V");
     if (windowCreatedID == NULL ||
         sizeChangedID == NULL ||
         visibleChangedID == NULL ||
         windowDestroyNotifyID == NULL ||
-        windowDestroyedID == NULL ||
         sendMouseEventID == NULL ||
         sendKeyEventID == NULL) {
         DBG_PRINT( "initIDs failed\n" );
@@ -230,7 +225,7 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_initIDs
     return JNI_TRUE;
 }
 
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_CreateWindow
+JNIEXPORT jlong JNICALL Java_jogamp_newt_opengl_kd_KDWindow_CreateWindow
   (JNIEnv *env, jobject obj, jlong display, jintArray jAttrs)
 {
     jint * attrs = NULL;
@@ -272,7 +267,7 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_CreateWindo
     return (jlong) (intptr_t) window;
 }
 
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_RealizeWindow
+JNIEXPORT jlong JNICALL Java_jogamp_newt_opengl_kd_KDWindow_RealizeWindow
   (JNIEnv *env, jobject obj, jlong window)
 {
     KDWindow *w = (KDWindow*) (intptr_t) window;
@@ -287,7 +282,7 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_RealizeWind
     return (jlong) (intptr_t) nativeWindow;
 }
 
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_CloseWindow
+JNIEXPORT jint JNICALL Java_jogamp_newt_opengl_kd_KDWindow_CloseWindow
   (JNIEnv *env, jobject obj, jlong window, jlong juserData)
 {
     KDWindow *w = (KDWindow*) (intptr_t) window;
@@ -301,11 +296,11 @@ JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_CloseWindow
 }
 
 /*
- * Class:     com_jogamp_newt_impl_opengl_kd_KDWindow
+ * Class:     jogamp_newt_opengl_kd_KDWindow
  * Method:    setVisible0
  * Signature: (JJZ)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_setVisible0
+JNIEXPORT void JNICALL Java_jogamp_newt_opengl_kd_KDWindow_setVisible0
   (JNIEnv *env, jobject obj, jlong window, jboolean visible)
 {
     KDWindow *w = (KDWindow*) (intptr_t) window;
@@ -315,7 +310,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_setVisible0
     (*env)->CallVoidMethod(env, obj, visibleChangedID, visible); // FIXME: or send via event ?
 }
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_setFullScreen0
+JNIEXPORT void JNICALL Java_jogamp_newt_opengl_kd_KDWindow_setFullScreen0
   (JNIEnv *env, jobject obj, jlong window, jboolean fullscreen)
 {
 /** not supported, due to missing NV property ..
@@ -332,7 +327,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_setFullScree
     (void)fullscreen;
 }
 
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_opengl_kd_KDWindow_setSize0
+JNIEXPORT void JNICALL Java_jogamp_newt_opengl_kd_KDWindow_setSize0
   (JNIEnv *env, jobject obj, jlong window, jint width, jint height)
 {
     KDWindow *w = (KDWindow*) (intptr_t) window;
diff --git a/src/newt/native/MacWindow.m b/src/newt/native/MacWindow.m
index e5021dc..3b708ac 100644
--- a/src/newt/native/MacWindow.m
+++ b/src/newt/native/MacWindow.m
@@ -33,7 +33,7 @@
 
 #import <inttypes.h>
 
-#import "com_jogamp_newt_impl_macosx_MacWindow.h"
+#import "jogamp_newt_macosx_MacWindow.h"
 #import "NewtMacWindow.h"
 
 #import "MouseEvent.h"
@@ -134,11 +134,11 @@ NS_ENDHANDLER
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacDisplay
+ * Class:     jogamp_newt_macosx_MacDisplay
  * Method:    initIDs
  * Signature: ()Z
  */
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_macosx_MacDisplay_initNSApplication0
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_macosx_MacDisplay_initNSApplication0
   (JNIEnv *env, jclass clazz)
 {
     static int initialized = 0;
@@ -168,11 +168,11 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_macosx_MacDisplay_initNSApp
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacDisplay
+ * Class:     jogamp_newt_macosx_MacDisplay
  * Method:    dispatchMessages0
  * Signature: ()V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacDisplay_dispatchMessages0
+JNIEXPORT void JNICALL Java_jogamp_newt_macosx_MacDisplay_dispatchMessages0
   (JNIEnv *env, jobject unused)
 {
     NSEvent* event = NULL;
@@ -206,11 +206,11 @@ NS_ENDHANDLER
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacScreen
+ * Class:     jogamp_newt_macosx_MacScreen
  * Method:    getWidthImpl
  * Signature: (I)I
  */
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_macosx_MacScreen_getWidthImpl0
+JNIEXPORT jint JNICALL Java_jogamp_newt_macosx_MacScreen_getWidthImpl0
   (JNIEnv *env, jclass clazz, jint screen_idx)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -227,11 +227,11 @@ JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_macosx_MacScreen_getWidthImpl0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacScreen
+ * Class:     jogamp_newt_macosx_MacScreen
  * Method:    getHeightImpl
  * Signature: (I)I
  */
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_macosx_MacScreen_getHeightImpl0
+JNIEXPORT jint JNICALL Java_jogamp_newt_macosx_MacScreen_getHeightImpl0
   (JNIEnv *env, jclass clazz, jint screen_idx)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -248,11 +248,11 @@ JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_macosx_MacScreen_getHeightImpl0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacWindow
+ * Class:     jogamp_newt_macosx_MacWindow
  * Method:    initIDs
  * Signature: ()Z
  */
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_initIDs0
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_macosx_MacWindow_initIDs0
   (JNIEnv *env, jclass clazz)
 {
     static int initialized = 0;
@@ -269,11 +269,11 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_initIDs0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacWindow
+ * Class:     jogamp_newt_macosx_MacWindow
  * Method:    createWindow0
  * Signature: (JIIIIZIIIJ)J
  */
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_createWindow0
+JNIEXPORT jlong JNICALL Java_jogamp_newt_macosx_MacWindow_createWindow0
   (JNIEnv *env, jobject jthis, jlong parent, jint x, jint y, jint w, jint h, jboolean fullscreen, jint styleMask, 
    jint bufferingType, jint screen_idx, jlong jview)
 {
@@ -355,11 +355,11 @@ NS_ENDHANDLER
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacWindow
+ * Class:     jogamp_newt_macosx_MacWindow
  * Method:    makeKeyAndOrderFront
  * Signature: (J)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_makeKeyAndOrderFront0
+JNIEXPORT void JNICALL Java_jogamp_newt_macosx_MacWindow_makeKeyAndOrderFront0
   (JNIEnv *env, jobject unused, jlong window)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -369,11 +369,11 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_makeKeyAndOrde
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacWindow
+ * Class:     jogamp_newt_macosx_MacWindow
  * Method:    makeKey
  * Signature: (J)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_makeKey0
+JNIEXPORT void JNICALL Java_jogamp_newt_macosx_MacWindow_makeKey0
   (JNIEnv *env, jobject unused, jlong window)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -383,11 +383,11 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_makeKey0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacWindow
+ * Class:     jogamp_newt_macosx_MacWindow
  * Method:    orderOut
  * Signature: (J)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_orderOut0
+JNIEXPORT void JNICALL Java_jogamp_newt_macosx_MacWindow_orderOut0
   (JNIEnv *env, jobject unused, jlong window)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -397,11 +397,11 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_orderOut0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacWindow
+ * Class:     jogamp_newt_macosx_MacWindow
  * Method:    close0
  * Signature: (J)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_close0
+JNIEXPORT void JNICALL Java_jogamp_newt_macosx_MacWindow_close0
   (JNIEnv *env, jobject unused, jlong window)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -422,11 +422,11 @@ NS_ENDHANDLER
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacWindow
+ * Class:     jogamp_newt_macosx_MacWindow
  * Method:    setTitle0
  * Signature: (JLjava/lang/String;)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_setTitle0
+JNIEXPORT void JNICALL Java_jogamp_newt_macosx_MacWindow_setTitle0
   (JNIEnv *env, jobject unused, jlong window, jstring title)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -438,11 +438,11 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_setTitle0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacWindow
+ * Class:     jogamp_newt_macosx_MacWindow
  * Method:    contentView
  * Signature: (J)J
  */
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_contentView0
+JNIEXPORT jlong JNICALL Java_jogamp_newt_macosx_MacWindow_contentView0
   (JNIEnv *env, jobject unused, jlong window)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -453,11 +453,11 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_contentView0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacWindow
+ * Class:     jogamp_newt_macosx_MacWindow
  * Method:    changeContentView
  * Signature: (J)J
  */
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_changeContentView0
+JNIEXPORT jlong JNICALL Java_jogamp_newt_macosx_MacWindow_changeContentView0
   (JNIEnv *env, jobject jthis, jlong parent, jlong window, jlong jview)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -473,11 +473,11 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_changeContent
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacWindow
+ * Class:     jogamp_newt_macosx_MacWindow
  * Method:    setContentSize
  * Signature: (JII)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_setContentSize0
+JNIEXPORT void JNICALL Java_jogamp_newt_macosx_MacWindow_setContentSize0
   (JNIEnv *env, jobject unused, jlong window, jint w, jint h)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -488,11 +488,11 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_setContentSize
 }
 
 /*
- * Class:     com_jogamp_newt_impl_macosx_MacWindow
+ * Class:     jogamp_newt_macosx_MacWindow
  * Method:    setFrameTopLeftPoint
  * Signature: (JII)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_macosx_MacWindow_setFrameTopLeftPoint0
+JNIEXPORT void JNICALL Java_jogamp_newt_macosx_MacWindow_setFrameTopLeftPoint0
   (JNIEnv *env, jobject unused, jlong parent, jlong window, jint x, jint y)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
diff --git a/src/newt/native/NewtMacWindow.m b/src/newt/native/NewtMacWindow.m
index 2d8a84b..cba6949 100644
--- a/src/newt/native/NewtMacWindow.m
+++ b/src/newt/native/NewtMacWindow.m
@@ -80,7 +80,6 @@ static jmethodID visibleChangedID = NULL;
 static jmethodID positionChangedID = NULL;
 static jmethodID focusChangedID    = NULL;
 static jmethodID windowDestroyNotifyID = NULL;
-static jmethodID windowDestroyedID = NULL;
 
 @implementation NewtView
 - (void) setJNIEnv: (JNIEnv*) theEnv
@@ -142,9 +141,8 @@ static jmethodID windowDestroyedID = NULL;
     positionChangedID = (*env)->GetMethodID(env, clazz, "positionChanged", "(II)V");
     focusChangedID = (*env)->GetMethodID(env, clazz, "focusChanged", "(Z)V");
     windowDestroyNotifyID    = (*env)->GetMethodID(env, clazz, "windowDestroyNotify",    "()V");
-    windowDestroyedID    = (*env)->GetMethodID(env, clazz, "windowDestroyed",    "()V");
     if (sendMouseEventID && sendKeyEventID && sizeChangedID && visibleChangedID && insetsChangedID &&
-        positionChangedID && focusChangedID && windowDestroyedID && windowDestroyNotifyID)
+        positionChangedID && focusChangedID && windowDestroyNotifyID)
     {
         return YES;
     }
@@ -456,7 +454,6 @@ static jint mods2JavaMods(NSUInteger mods)
 
     (*env)->CallVoidMethod(env, javaWindowObject, windowDestroyNotifyID);
     // Can't issue call here - locked window state, done from Java method
-    // (*env)->CallVoidMethod(env, javaWindowObject, windowDestroyedID); // No OSX hook for DidClose, so do it here 
 
     // EOL ..
     (*env)->DeleteGlobalRef(env, javaWindowObject);
diff --git a/src/newt/native/WindowEvent.h b/src/newt/native/WindowEvent.h
index 6274f94..05491b4 100644
--- a/src/newt/native/WindowEvent.h
+++ b/src/newt/native/WindowEvent.h
@@ -2,11 +2,12 @@
 #ifndef _WINDOW_EVENT_H_
 #define _WINDOW_EVENT_H_
 
-#define EVENT_WINDOW_RESIZED = 100;
-#define EVENT_WINDOW_MOVED   = 101;
-#define EVENT_WINDOW_DESTROY_NOTIFY = 102;
-#define EVENT_WINDOW_GAINED_FOCUS = 103;
-#define EVENT_WINDOW_LOST_FOCUS = 104;
-#define EVENT_WINDOW_REPAINT = 105; // TODO
+#define EVENT_WINDOW_RESIZED        100
+#define EVENT_WINDOW_MOVED          101
+#define EVENT_WINDOW_DESTROY_NOTIFY 102
+#define EVENT_WINDOW_GAINED_FOCUS   103
+#define EVENT_WINDOW_LOST_FOCUS     104
+#define EVENT_WINDOW_REPAINT        105
+#define EVENT_WINDOW_DESTROYED      106
 
 #endif
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c
index b282ec9..95f036b 100644
--- a/src/newt/native/WindowsWindow.c
+++ b/src/newt/native/WindowsWindow.c
@@ -96,9 +96,9 @@
 #define DISPLAY_DEVICE_ACTIVE 0x00000001
 #endif
 
-#include "com_jogamp_newt_impl_windows_WindowsDisplay.h"
-#include "com_jogamp_newt_impl_windows_WindowsScreen.h"
-#include "com_jogamp_newt_impl_windows_WindowsWindow.h"
+#include "jogamp_newt_windows_WindowsDisplay.h"
+#include "jogamp_newt_windows_WindowsScreen.h"
+#include "jogamp_newt_windows_WindowsWindow.h"
 
 #include "MouseEvent.h"
 #include "InputEvent.h"
@@ -124,7 +124,6 @@ static jmethodID positionChangedID = NULL;
 static jmethodID focusChangedID = NULL;
 static jmethodID visibleChangedID = NULL;
 static jmethodID windowDestroyNotifyID = NULL;
-static jmethodID windowDestroyedID = NULL;
 static jmethodID windowRepaintID = NULL;
 static jmethodID enqueueMouseEventID = NULL;
 static jmethodID sendMouseEventID = NULL;
@@ -820,8 +819,7 @@ static LRESULT CALLBACK wndProc(HWND wnd, UINT message,
     //
     // The signal pipeline for destruction is:
     //    Java::DestroyWindow(wnd) _or_ window-close-button -> 
-    //     WM_CLOSE -> Java::windowDestroyNotify -> W_DESTROY -> Java::windowDestroyed ->
-    //       Java::CleanupWindowResources()
+    //     WM_CLOSE -> Java::windowDestroyNotify -> W_DESTROY
     case WM_CLOSE:
         (*env)->CallVoidMethod(env, window, windowDestroyNotifyID);
         break;
@@ -834,7 +832,6 @@ static LRESULT CALLBACK wndProc(HWND wnd, UINT message,
             SetWindowLongPtr(wnd, GWLP_USERDATA, (intptr_t) NULL);
 #endif
             free(wud); wud=NULL;
-            (*env)->CallVoidMethod(env, window, windowDestroyedID);
             (*env)->DeleteGlobalRef(env, window);
         }
         break;
@@ -1018,11 +1015,11 @@ static LRESULT CALLBACK wndProc(HWND wnd, UINT message,
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsDisplay
+ * Class:     jogamp_newt_windows_WindowsDisplay
  * Method:    DispatchMessages
  * Signature: ()V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsDisplay_DispatchMessages0
+JNIEXPORT void JNICALL Java_jogamp_newt_windows_WindowsDisplay_DispatchMessages0
   (JNIEnv *env, jclass clazz)
 {
     int i = 0;
@@ -1047,87 +1044,22 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsDisplay_Dispatch
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsDisplay
- * Method:    LoadLibraryW
- * Signature: (Ljava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_windows_WindowsDisplay_LoadLibraryW0
-  (JNIEnv *env, jclass clazz, jstring dllName)
-{
-    jchar* _dllName = NewtCommon_GetNullTerminatedStringChars(env, dllName);
-    HMODULE lib = LoadLibraryW(_dllName);
-    free(_dllName);
-    return (jlong) (intptr_t) lib;
-}
-
-/*
- * Class:     com_jogamp_newt_impl_windows_WindowsDisplay
- * Method:    RegisterWindowClass
- * Signature: (Ljava/lang/String;J)I
- */
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_windows_WindowsDisplay_RegisterWindowClass0
-  (JNIEnv *env, jclass clazz, jstring wndClassName, jlong hInstance)
-{
-    ATOM res;
-    WNDCLASS wc;
-#ifndef UNICODE
-    const char* _wndClassName = NULL;
-#endif
-
-    /* register class */
-    wc.style = CS_HREDRAW | CS_VREDRAW;
-    wc.lpfnWndProc = (WNDPROC)wndProc;
-    wc.cbClsExtra = 0;
-    wc.cbWndExtra = 0;
-    /* This cast is legal because the HMODULE for a DLL is the same as
-       its HINSTANCE -- see MSDN docs for DllMain */
-    wc.hInstance = (HINSTANCE) (intptr_t) hInstance;
-    wc.hIcon = NULL;
-    wc.hCursor = LoadCursor( NULL, IDC_ARROW);
-    wc.hbrBackground = GetStockObject(BLACK_BRUSH);
-    wc.lpszMenuName = NULL;
-#ifdef UNICODE
-    wc.lpszClassName = NewtCommon_GetNullTerminatedStringChars(env, wndClassName);
-#else
-    _wndClassName = (*env)->GetStringUTFChars(env, wndClassName, NULL);
-    wc.lpszClassName = strdup(_wndClassName);
-    (*env)->ReleaseStringUTFChars(env, wndClassName, _wndClassName);
-#endif
-    res = RegisterClass(&wc);
-
-    free((void *)wc.lpszClassName);
-
-    return (jint)res;
-}
-
-/*
- * Class:     com_jogamp_newt_impl_windows_WindowsDisplay
- * Method:    CleanupWindowResources
- * Signature: (java/lang/String;J)V
- */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsDisplay_UnregisterWindowClass0
-  (JNIEnv *env, jclass clazz, jint wndClassAtom, jlong hInstance)
-{
-    UnregisterClass(MAKEINTATOM(wndClassAtom), (HINSTANCE) (intptr_t) hInstance);
-}
-
-/*
- * Class:     com_jogamp_newt_impl_windows_WindowsScreen
+ * Class:     jogamp_newt_windows_WindowsScreen
  * Method:    getWidthImpl
  * Signature: (I)I
  */
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_windows_WindowsScreen_getWidthImpl0
+JNIEXPORT jint JNICALL Java_jogamp_newt_windows_WindowsScreen_getWidthImpl0
   (JNIEnv *env, jobject obj, jint scrn_idx)
 {
     return (jint)GetSystemMetrics(SM_CXSCREEN);
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsScreen
+ * Class:     jogamp_newt_windows_WindowsScreen
  * Method:    getHeightImpl
  * Signature: (I)I
  */
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_windows_WindowsScreen_getHeightImpl0
+JNIEXPORT jint JNICALL Java_jogamp_newt_windows_WindowsScreen_getHeightImpl0
   (JNIEnv *env, jobject obj, jint scrn_idx)
 {
     return (jint)GetSystemMetrics(SM_CYSCREEN);
@@ -1207,11 +1139,11 @@ static HDC NewtScreen_createDisplayDC(LPCTSTR displayDeviceName) {
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsScreen
+ * Class:     jogamp_newt_windows_WindowsScreen
  * Method:    getScreenMode0
  * Signature: (II)[I
  */
-JNIEXPORT jintArray JNICALL Java_com_jogamp_newt_impl_windows_WindowsScreen_getScreenMode0
+JNIEXPORT jintArray JNICALL Java_jogamp_newt_windows_WindowsScreen_getScreenMode0
   (JNIEnv *env, jobject obj, jint scrn_idx, jint mode_idx)
 {
     DISPLAY_DEVICE device;
@@ -1280,11 +1212,11 @@ JNIEXPORT jintArray JNICALL Java_com_jogamp_newt_impl_windows_WindowsScreen_getS
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsScreen
+ * Class:     jogamp_newt_windows_WindowsScreen
  * Method:    setScreenMode0
  * Signature: (IIIIII)Z
  */
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_windows_WindowsScreen_setScreenMode0
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_windows_WindowsScreen_setScreenMode0
   (JNIEnv *env, jobject object, jint scrn_idx, jint width, jint height, jint bits, jint rate, jint rot)
 {
     DISPLAY_DEVICE device;
@@ -1317,11 +1249,11 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_windows_WindowsScreen_setSc
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsWindow
+ * Class:     jogamp_newt_windows_WindowsWindow
  * Method:    initIDs0
  * Signature: ()Z
  */
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_initIDs0
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_windows_WindowsWindow_initIDs0
   (JNIEnv *env, jclass clazz)
 {
     NewtCommon_init(env);
@@ -1332,7 +1264,6 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_initI
     focusChangedID = (*env)->GetMethodID(env, clazz, "focusChanged", "(Z)V");
     visibleChangedID = (*env)->GetMethodID(env, clazz, "visibleChanged", "(Z)V");
     windowDestroyNotifyID    = (*env)->GetMethodID(env, clazz, "windowDestroyNotify", "()V");
-    windowDestroyedID = (*env)->GetMethodID(env, clazz, "windowDestroyed", "()V");
     windowRepaintID = (*env)->GetMethodID(env, clazz, "windowRepaint", "(IIII)V");
     enqueueMouseEventID = (*env)->GetMethodID(env, clazz, "enqueueMouseEvent", "(ZIIIIII)V");
     sendMouseEventID = (*env)->GetMethodID(env, clazz, "sendMouseEvent", "(IIIIII)V");
@@ -1347,7 +1278,6 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_initI
         focusChangedID == NULL ||
         visibleChangedID == NULL ||
         windowDestroyNotifyID == NULL ||
-        windowDestroyedID == NULL ||
         windowRepaintID == NULL ||
         enqueueMouseEventID == NULL ||
         sendMouseEventID == NULL ||
@@ -1362,16 +1292,28 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_initI
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsWindow
+ * Class:     jogamp_newt_windows_WindowsWindow
+ * Method:    getNewtWndProc0
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_jogamp_newt_windows_WindowsWindow_getNewtWndProc0
+  (JNIEnv *env, jclass clazz)
+{
+    return (jlong) (intptr_t) wndProc;
+}
+
+/*
+ * Class:     jogamp_newt_windows_WindowsWindow
  * Method:    CreateWindow
- * Signature: (JILjava/lang/String;JJZIIII)J
  */
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_CreateWindow0
-  (JNIEnv *env, jobject obj, jlong parent, jint wndClassAtom, jstring jWndName, jlong hInstance, jlong visualID,
-        jboolean bIsUndecorated,
-        jint jx, jint jy, jint defaultWidth, jint defaultHeight)
+JNIEXPORT jlong JNICALL Java_jogamp_newt_windows_WindowsWindow_CreateWindow0
+  (JNIEnv *env, jobject obj, 
+   jlong hInstance, jstring jWndClassName, jstring jWndName, 
+   jlong parent, jlong visualID, jboolean bIsUndecorated,
+   jint jx, jint jy, jint defaultWidth, jint defaultHeight)
 {
     HWND parentWindow = (HWND) (intptr_t) parent;
+    const TCHAR* wndClassName = NULL;
     const TCHAR* wndName = NULL;
     DWORD windowStyle = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE | WS_TABSTOP;
     int x=(int)jx, y=(int)jy;
@@ -1379,8 +1321,10 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_CreateWi
     HWND window = NULL;
 
 #ifdef UNICODE
+    wndClassName = NewtCommon_GetNullTerminatedStringChars(env, jWndClassName);
     wndName = NewtCommon_GetNullTerminatedStringChars(env, jWndName);
 #else
+    wndClassName = (*env)->GetStringUTFChars(env, jWndClassName, NULL);
     wndName = (*env)->GetStringUTFChars(env, jWndName, NULL);
 #endif
 
@@ -1400,13 +1344,13 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_CreateWi
 
     (void) visualID; // FIXME: use the visualID ..
 
-    window = CreateWindow(MAKEINTATOM(wndClassAtom), wndName, windowStyle,
+    window = CreateWindow(wndClassName, wndName, windowStyle,
                           x, y, width, height,
                           parentWindow, NULL,
                           (HINSTANCE) (intptr_t) hInstance,
                           NULL);
 
-    DBG_PRINT("*** WindowsWindow: CreateWindow thread 0xX, parent %p, window %p, %d/%d %dx%d\n", 
+    DBG_PRINT("*** WindowsWindow: CreateWindow thread 0x%X, parent %p, window %p, %d/%d %dx%d\n", 
         (int)GetCurrentThreadId(), parentWindow, window, x, y, width, height);
 
     if (NULL == window) {
@@ -1427,8 +1371,10 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_CreateWi
     }
 
 #ifdef UNICODE
+    free((void*) wndClassName);
     free((void*) wndName);
 #else
+    (*env)->ReleaseStringUTFChars(env, jWndClassName, wndClassName);
     (*env)->ReleaseStringUTFChars(env, jWndName, wndName);
 #endif
 
@@ -1436,45 +1382,11 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_CreateWi
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsWindow
- * Method:    DestroyWindow
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_DestroyWindow0
-  (JNIEnv *env, jobject obj, jlong window)
-{
-    DBG_PRINT("*** WindowsWindow: DestroyWindow thread 0x%X, window %p\n", (int)GetCurrentThreadId(), window);
-    DestroyWindow((HWND) (intptr_t) window);
-}
-
-/*
- * Class:     com_jogamp_newt_impl_windows_WindowsWindow
- * Method:    GetDC
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_GetDC0
-  (JNIEnv *env, jobject obj, jlong window)
-{
-    return (jlong) (intptr_t) GetDC((HWND) (intptr_t) window);
-}
-
-/*
- * Class:     com_jogamp_newt_impl_windows_WindowsWindow
- * Method:    ReleaseDC
- * Signature: (JJ)V
- */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_ReleaseDC0
-  (JNIEnv *env, jobject obj, jlong window, jlong dc)
-{
-    ReleaseDC((HWND) (intptr_t) window, (HDC) (intptr_t) dc);
-}
-
-/*
- * Class:     com_jogamp_newt_impl_windows_WindowsWindow
+ * Class:     jogamp_newt_windows_WindowsWindow
  * Method:    MonitorFromWindow
  * Signature: (J)J
  */
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_MonitorFromWindow0
+JNIEXPORT jlong JNICALL Java_jogamp_newt_windows_WindowsWindow_MonitorFromWindow0
   (JNIEnv *env, jobject obj, jlong window)
 {
     #if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410 || WINVER >= 0x0500) && !defined(_WIN32_WCE)
@@ -1545,11 +1457,11 @@ int NewtWindow_setVisiblePosSize(JNIEnv *env, jobject obj, HWND hwnd, jboolean t
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsWindow
+ * Class:     jogamp_newt_windows_WindowsWindow
  * Method:    setVisible0
  * Signature: (JZ)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_setVisible0
+JNIEXPORT void JNICALL Java_jogamp_newt_windows_WindowsWindow_setVisible0
   (JNIEnv *env, jobject obj, jlong window, jboolean visible, jboolean top, jint x, jint y, jint width, jint height)
 {
     HWND hwnd = (HWND) (intptr_t) window;
@@ -1582,11 +1494,11 @@ static jboolean NewtWindows_setFullScreen(jboolean fullscreen)
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsWindow
+ * Class:     jogamp_newt_windows_WindowsWindow
  * Method:    reconfigureWindow0
  * Signature: (JIIIIZZII)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_reconfigureWindow0
+JNIEXPORT void JNICALL Java_jogamp_newt_windows_WindowsWindow_reconfigureWindow0
   (JNIEnv *env, jobject obj, jlong parent, jlong window, jint x, jint y, jint width, jint height, 
    jboolean visible, jboolean parentChange, jint fullScreenChange, jint decorationChange)
 {
@@ -1655,11 +1567,11 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_reconfigu
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsWindow
+ * Class:     jogamp_newt_windows_WindowsWindow
  * Method:    setTitle
  * Signature: (JLjava/lang/String;)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_setTitle0
+JNIEXPORT void JNICALL Java_jogamp_newt_windows_WindowsWindow_setTitle0
   (JNIEnv *env, jclass clazz, jlong window, jstring title)
 {
     HWND hwnd = (HWND) (intptr_t) window;
@@ -1673,11 +1585,11 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_setTitle0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_windows_WindowsWindow
+ * Class:     jogamp_newt_windows_WindowsWindow
  * Method:    requestFocus
  * Signature: (JZ)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_requestFocus0
+JNIEXPORT void JNICALL Java_jogamp_newt_windows_WindowsWindow_requestFocus0
   (JNIEnv *env, jobject obj, jlong window, jboolean force)
 {
     DBG_PRINT("*** WindowsWindow: RequestFocus0\n");
diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c
index 7a19cf2..96da040 100644
--- a/src/newt/native/X11Window.c
+++ b/src/newt/native/X11Window.c
@@ -51,9 +51,9 @@
 
 #include <X11/extensions/Xrandr.h>
 
-#include "com_jogamp_newt_impl_x11_X11Screen.h"
-#include "com_jogamp_newt_impl_x11_X11Display.h"
-#include "com_jogamp_newt_impl_x11_X11Window.h"
+#include "jogamp_newt_x11_X11Screen.h"
+#include "jogamp_newt_x11_X11Display.h"
+#include "jogamp_newt_x11_X11Window.h"
 
 #include "MouseEvent.h"
 #include "KeyEvent.h"
@@ -147,7 +147,6 @@ static jmethodID positionChangedID = NULL;
 static jmethodID focusChangedID = NULL;
 static jmethodID visibleChangedID = NULL;
 static jmethodID windowDestroyNotifyID = NULL;
-static jmethodID windowDestroyedID = NULL;
 static jmethodID windowRepaintID = NULL;
 static jmethodID windowReparentedID = NULL;
 static jmethodID enqueueMouseEventID = NULL;
@@ -198,11 +197,11 @@ static void displayDispatchErrorHandlerEnable(int onoff, JNIEnv * env) {
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Display
+ * Class:     jogamp_newt_x11_X11Display
  * Method:    initIDs
  * Signature: (Z)Z
  */
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Display_initIDs0
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_x11_X11Display_initIDs0
   (JNIEnv *env, jclass clazz)
 {
     jclass c;
@@ -230,11 +229,11 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Display_initIDs0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Display
+ * Class:     jogamp_newt_x11_X11Display
  * Method:    CompleteDisplay
  * Signature: (J)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Display_CompleteDisplay0
+JNIEXPORT void JNICALL Java_jogamp_newt_x11_X11Display_CompleteDisplay0
   (JNIEnv *env, jobject obj, jlong display)
 {
     Display * dpy = (Display *)(intptr_t)display;
@@ -458,11 +457,11 @@ static void NewtWindows_setFullscreen (Display *dpy, Window root, Window w, Bool
 #define USE_SENDIO_DIRECT 1
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Display
+ * Class:     jogamp_newt_x11_X11Display
  * Method:    DispatchMessages
  * Signature: (JIJJ)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Display_DispatchMessages0
+JNIEXPORT void JNICALL Java_jogamp_newt_x11_X11Display_DispatchMessages0
   (JNIEnv *env, jobject obj, jlong display, jlong javaObjectAtom, jlong wmDeleteAtom)
 {
     Display * dpy = (Display *) (intptr_t) display;
@@ -624,7 +623,6 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Display_DispatchMessages
                     (void*)evt.xdestroywindow.window, (void*)evt.xdestroywindow.event, evt.xdestroywindow.window != evt.xdestroywindow.event);
                 if ( evt.xdestroywindow.window == evt.xdestroywindow.event ) {
                     // ignore child destroy notification
-                    (*env)->CallVoidMethod(env, jwindow, windowDestroyedID);
                 }
                 break;
             case CreateNotify:
@@ -740,11 +738,11 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Display_DispatchMessages
  */
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Screen
+ * Class:     jogamp_newt_x11_X11Screen
  * Method:    GetScreen
  * Signature: (JI)J
  */
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_GetScreen0
+JNIEXPORT jlong JNICALL Java_jogamp_newt_x11_X11Screen_GetScreen0
   (JNIEnv *env, jclass clazz, jlong display, jint screen_index)
 {
     Display * dpy = (Display *)(intptr_t)display;
@@ -767,14 +765,14 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_GetScreen0
     return (jlong) (intptr_t) scrn;
 }
 
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getWidth0
+JNIEXPORT jint JNICALL Java_jogamp_newt_x11_X11Screen_getWidth0
   (JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
 {
     Display * dpy = (Display *) (intptr_t) display;
     return (jint) XDisplayWidth( dpy, scrn_idx);
 }
 
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getHeight0
+JNIEXPORT jint JNICALL Java_jogamp_newt_x11_X11Screen_getHeight0
   (JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
 {
     Display * dpy = (Display *) (intptr_t) display;
@@ -814,11 +812,11 @@ static int NewtScreen_XRotation2Degree(JNIEnv *env, int xrotation) {
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Screen
+ * Class:     jogamp_newt_x11_X11Screen
  * Method:    getAvailableScreenModeRotations0
  * Signature: (JI)I
  */
-JNIEXPORT jintArray JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getAvailableScreenModeRotations0
+JNIEXPORT jintArray JNICALL Java_jogamp_newt_x11_X11Screen_getAvailableScreenModeRotations0
   (JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
 {
     Display *dpy = (Display *) (intptr_t) display;
@@ -864,18 +862,18 @@ JNIEXPORT jintArray JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getAvailable
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Screen
+ * Class:     jogamp_newt_x11_X11Screen
  * Method:    getNumScreenModeResolution0
  * Signature: (JI)I
  */
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getNumScreenModeResolutions0
+JNIEXPORT jint JNICALL Java_jogamp_newt_x11_X11Screen_getNumScreenModeResolutions0
   (JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
 {
     Display *dpy = (Display *) (intptr_t) display;
     Window root = RootWindow(dpy, (int)scrn_idx);
     
     if(False == NewtScreen_hasRANDR(dpy)) {
-        DBG_PRINT("Java_com_jogamp_newt_impl_x11_X11Screen_getNumScreenModeResolutions0: RANDR not available\n");
+        DBG_PRINT("Java_jogamp_newt_x11_X11Screen_getNumScreenModeResolutions0: RANDR not available\n");
         return 0;
     }
 
@@ -886,18 +884,18 @@ JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getNumScreenModeR
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Screen
+ * Class:     jogamp_newt_x11_X11Screen
  * Method:    getScreenModeResolutions0
  * Signature: (JII)[I
  */
-JNIEXPORT jintArray JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getScreenModeResolution0
+JNIEXPORT jintArray JNICALL Java_jogamp_newt_x11_X11Screen_getScreenModeResolution0
   (JNIEnv *env, jclass clazz, jlong display, jint scrn_idx, jint resMode_idx)
 {
     Display *dpy = (Display *) (intptr_t) display;
     Window root = RootWindow(dpy, (int)scrn_idx);
     
     if(False == NewtScreen_hasRANDR(dpy)) {
-        DBG_PRINT("Java_com_jogamp_newt_impl_x11_X11Screen_getScreenModeResolution0: RANDR not available\n");
+        DBG_PRINT("Java_jogamp_newt_x11_X11Screen_getScreenModeResolution0: RANDR not available\n");
         return (*env)->NewIntArray(env, 0);
     }
 
@@ -929,18 +927,18 @@ JNIEXPORT jintArray JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getScreenMod
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Screen
+ * Class:     jogamp_newt_x11_X11Screen
  * Method:    getScreenModeRates0
  * Signature: (JII)[I
  */
-JNIEXPORT jintArray JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getScreenModeRates0
+JNIEXPORT jintArray JNICALL Java_jogamp_newt_x11_X11Screen_getScreenModeRates0
   (JNIEnv *env, jclass clazz, jlong display, jint scrn_idx, jint resMode_idx)
 {
     Display *dpy = (Display *) (intptr_t) display;
     Window root = RootWindow(dpy, (int)scrn_idx);
     
     if(False == NewtScreen_hasRANDR(dpy)) {
-        DBG_PRINT("Java_com_jogamp_newt_impl_x11_X11Screen_getScreenModeRates0: RANDR not available\n");
+        DBG_PRINT("Java_jogamp_newt_x11_X11Screen_getScreenModeRates0: RANDR not available\n");
         return (*env)->NewIntArray(env, 0);
     }
 
@@ -973,18 +971,18 @@ JNIEXPORT jintArray JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getScreenMod
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Screen
+ * Class:     jogamp_newt_x11_X11Screen
  * Method:    getCurrentScreenRate0
  * Signature: (JI)I
  */
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getCurrentScreenRate0
+JNIEXPORT jint JNICALL Java_jogamp_newt_x11_X11Screen_getCurrentScreenRate0
   (JNIEnv *env, jclass clazz, jlong display, jint scrn_idx) 
 {
     Display *dpy = (Display *) (intptr_t) display;
     Window root = RootWindow(dpy, (int)scrn_idx);
     
     if(False == NewtScreen_hasRANDR(dpy)) {
-        DBG_PRINT("Java_com_jogamp_newt_impl_x11_X11Screen_getCurrentScreenRate0: RANDR not available\n");
+        DBG_PRINT("Java_jogamp_newt_x11_X11Screen_getCurrentScreenRate0: RANDR not available\n");
         return -1;
     }
 
@@ -999,18 +997,18 @@ JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getCurrentScreenR
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Screen
+ * Class:     jogamp_newt_x11_X11Screen
  * Method:    getCurrentScreenRotation0
  * Signature: (JI)I
  */
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getCurrentScreenRotation0
+JNIEXPORT jint JNICALL Java_jogamp_newt_x11_X11Screen_getCurrentScreenRotation0
   (JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
 {
     Display *dpy = (Display *) (intptr_t) display;
     Window root = RootWindow(dpy, (int)scrn_idx);
     
     if(False == NewtScreen_hasRANDR(dpy)) {
-        DBG_PRINT("Java_com_jogamp_newt_impl_x11_X11Screen_getCurrentScreenRotation0: RANDR not available\n");
+        DBG_PRINT("Java_jogamp_newt_x11_X11Screen_getCurrentScreenRotation0: RANDR not available\n");
         return -1;
     }
 
@@ -1028,18 +1026,18 @@ JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getCurrentScreenR
 
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Screen
+ * Class:     jogamp_newt_x11_X11Screen
  * Method:    getCurrentScreenResolutionIndex0
  * Signature: (JI)I
  */
-JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getCurrentScreenResolutionIndex0
+JNIEXPORT jint JNICALL Java_jogamp_newt_x11_X11Screen_getCurrentScreenResolutionIndex0
   (JNIEnv *env, jclass clazz, jlong display, jint scrn_idx)
 {
    Display *dpy = (Display *) (intptr_t) display;
    Window root = RootWindow(dpy, (int)scrn_idx);
   
    if(False == NewtScreen_hasRANDR(dpy)) {
-       DBG_PRINT("Java_com_jogamp_newt_impl_x11_X11Screen_getCurrentScreenResolutionIndex0: RANDR not available\n");
+       DBG_PRINT("Java_jogamp_newt_x11_X11Screen_getCurrentScreenResolutionIndex0: RANDR not available\n");
        return -1;
    }
 
@@ -1057,18 +1055,18 @@ JNIEXPORT jint JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_getCurrentScreenR
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Screen
+ * Class:     jogamp_newt_x11_X11Screen
  * Method:    setCurrentScreenModeStart0
  * Signature: (JIIII)Z
  */
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_setCurrentScreenModeStart0
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_x11_X11Screen_setCurrentScreenModeStart0
   (JNIEnv *env, jclass clazz, jlong display, jint screen_idx, jint resMode_idx, jint freq, jint rotation)
 {
     Display *dpy = (Display *) (intptr_t) display;
     Window root = RootWindow(dpy, (int)screen_idx);
 
     if(False == NewtScreen_hasRANDR(dpy)) {
-        DBG_PRINT("Java_com_jogamp_newt_impl_x11_X11Screen_setCurrentScreenModeStart0: RANDR not available\n");
+        DBG_PRINT("Java_jogamp_newt_x11_X11Screen_setCurrentScreenModeStart0: RANDR not available\n");
         return JNI_FALSE;
     }
 
@@ -1117,11 +1115,11 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_setCurrentScr
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Screen
+ * Class:     jogamp_newt_x11_X11Screen
  * Method:    setCurrentScreenModePollEnd0
  * Signature: (J)Z
  */
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_setCurrentScreenModePollEnd0
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_x11_X11Screen_setCurrentScreenModePollEnd0
   (JNIEnv *env, jclass clazz, jlong display, jint screen_idx, jint resMode_idx, jint freq, jint rotation)
 {
     Display *dpy = (Display *) (intptr_t) display;
@@ -1130,7 +1128,7 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_setCurrentScr
     XRRScreenChangeNotifyEvent * scn_event = (XRRScreenChangeNotifyEvent *) &evt;
 
     if(False == NewtScreen_hasRANDR(dpy)) {
-        DBG_PRINT("Java_com_jogamp_newt_impl_x11_X11Screen_setCurrentScreenModePollEnd0: RANDR not available\n");
+        DBG_PRINT("Java_jogamp_newt_x11_X11Screen_setCurrentScreenModePollEnd0: RANDR not available\n");
         return JNI_FALSE;
     }
 
@@ -1179,11 +1177,11 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Screen_setCurrentScr
  */
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Window
+ * Class:     jogamp_newt_x11_X11Window
  * Method:    initIDs
  * Signature: ()Z
  */
-JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Window_initIDs0
+JNIEXPORT jboolean JNICALL Java_jogamp_newt_x11_X11Window_initIDs0
   (JNIEnv *env, jclass clazz)
 {
     sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(IIZ)V");
@@ -1191,7 +1189,6 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Window_initIDs0
     focusChangedID = (*env)->GetMethodID(env, clazz, "focusChanged", "(Z)V");
     visibleChangedID = (*env)->GetMethodID(env, clazz, "visibleChanged", "(Z)V");
     windowDestroyNotifyID = (*env)->GetMethodID(env, clazz, "windowDestroyNotify", "()V");
-    windowDestroyedID = (*env)->GetMethodID(env, clazz, "windowDestroyed", "()V");
     windowRepaintID = (*env)->GetMethodID(env, clazz, "windowRepaint", "(IIII)V");
     windowReparentedID = (*env)->GetMethodID(env, clazz, "windowReparented", "(J)V");
     enqueueMouseEventID = (*env)->GetMethodID(env, clazz, "enqueueMouseEvent", "(ZIIIIII)V");
@@ -1206,7 +1203,6 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Window_initIDs0
         focusChangedID == NULL ||
         visibleChangedID == NULL ||
         windowDestroyNotifyID == NULL ||
-        windowDestroyedID == NULL ||
         windowRepaintID == NULL ||
         windowReparentedID == NULL ||
         enqueueMouseEventID == NULL ||
@@ -1221,11 +1217,11 @@ JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_impl_x11_X11Window_initIDs0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Window
+ * Class:     jogamp_newt_x11_X11Window
  * Method:    CreateWindow
  * Signature: (JJIJIIII)J
  */
-JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_x11_X11Window_CreateWindow0
+JNIEXPORT jlong JNICALL Java_jogamp_newt_x11_X11Window_CreateWindow0
   (JNIEnv *env, jobject obj, jlong parent, jlong display, jint screen_index, 
                              jlong visualID, 
                              jlong javaObjectAtom, jlong windowDeleteAtom, 
@@ -1297,14 +1293,13 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_x11_X11Window_CreateWindow0
         pVisualQuery=NULL;
     }
 
-    attrMask  = ( CWBackingStore | CWBackingPlanes | CWBackingPixel | CWBackPixel | 
+    attrMask  = ( CWBackingStore | CWBackingPlanes | CWBackingPixel | CWBackPixmap |
                   CWBorderPixel | CWColormap | CWOverrideRedirect ) ;
 
     memset(&xswa, 0, sizeof(xswa));
-    // xswa.override_redirect = ( 0 != parent ) ? False : True;
     xswa.override_redirect = False; // use the window manager, always
     xswa.border_pixel = 0;
-    xswa.background_pixel = 0;
+    xswa.background_pixmap = None;
     xswa.backing_store=NotUseful; /* NotUseful, WhenMapped, Always */
     xswa.backing_planes=0;        /* planes to be preserved if possible */
     xswa.backing_pixel=0;         /* value to use in restoring planes */
@@ -1355,11 +1350,11 @@ JNIEXPORT jlong JNICALL Java_com_jogamp_newt_impl_x11_X11Window_CreateWindow0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Window
+ * Class:     jogamp_newt_x11_X11Window
  * Method:    CloseWindow
  * Signature: (JJ)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Window_CloseWindow0
+JNIEXPORT void JNICALL Java_jogamp_newt_x11_X11Window_CloseWindow0
   (JNIEnv *env, jobject obj, jlong display, jlong window, jlong javaObjectAtom, jlong wmDeleteAtom)
 {
     Display * dpy = (Display *) (intptr_t) display;
@@ -1387,7 +1382,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Window_CloseWindow0
     XUnmapWindow(dpy, w);
 
     // Drain all events related to this window ..
-    Java_com_jogamp_newt_impl_x11_X11Display_DispatchMessages0(env, obj, display, javaObjectAtom, wmDeleteAtom);
+    Java_jogamp_newt_x11_X11Display_DispatchMessages0(env, obj, display, javaObjectAtom, wmDeleteAtom);
 
     XDestroyWindow(dpy, w);
     XSync(dpy, False);
@@ -1395,8 +1390,6 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Window_CloseWindow0
     (*env)->DeleteGlobalRef(env, jwindow);
 
     DBG_PRINT( "X11: CloseWindow END\n");
-
-    (*env)->CallVoidMethod(env, obj, windowDestroyedID);
 }
 
 static void NewtWindows_setPosSize(Display *dpy, Window w, jint x, jint y, jint width, jint height)
@@ -1417,11 +1410,11 @@ static void NewtWindows_setPosSize(Display *dpy, Window w, jint x, jint y, jint
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Window
+ * Class:     jogamp_newt_x11_X11Window
  * Method:    setVisible0
  * Signature: (JJZIIII)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Window_setVisible0
+JNIEXPORT void JNICALL Java_jogamp_newt_x11_X11Window_setVisible0
   (JNIEnv *env, jobject obj, jlong display, jlong window, jboolean visible, jint x, jint y, jint width, jint height)
 {
     Display * dpy = (Display *) (intptr_t) display;
@@ -1443,11 +1436,11 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Window_setVisible0
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Window
+ * Class:     jogamp_newt_x11_X11Window
  * Method:    reconfigureWindow0
  * Signature: (JIJJIIIIZZII)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Window_reconfigureWindow0
+JNIEXPORT void JNICALL Java_jogamp_newt_x11_X11Window_reconfigureWindow0
   (JNIEnv *env, jobject obj, jlong jdisplay, jint screen_index, jlong jparent, jlong jwindow, 
    jint x, jint y, jint width, jint height, jboolean isVisible, jboolean parentChange, jint fullscreenChange, jint decorationChange)
 {
@@ -1512,22 +1505,22 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Window_reconfigureWindow
 }
 
 /*
- * Class:     com_jogamp_newt_impl_x11_X11Window
+ * Class:     jogamp_newt_x11_X11Window
  * Method:    requestFocus0
  * Signature: (JJ)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Window_requestFocus0
+JNIEXPORT void JNICALL Java_jogamp_newt_x11_X11Window_requestFocus0
   (JNIEnv *env, jobject obj, jlong display, jlong window, jboolean force)
 {
     NewtWindows_requestFocus ( env, obj, (Display *) (intptr_t) display, (Window)window, force ) ;
 }
 
 /*
- * Class:     Java_com_jogamp_newt_impl_x11_X11Window
+ * Class:     Java_jogamp_newt_x11_X11Window
  * Method:    setTitle0
  * Signature: (JJLjava/lang/String;)V
  */
-JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_x11_X11Window_setTitle0
+JNIEXPORT void JNICALL Java_jogamp_newt_x11_X11Window_setTitle0
   (JNIEnv *env, jclass clazz, jlong display, jlong window, jstring title)
 {
     Display * dpy = (Display *) (intptr_t) display;
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java b/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java
new file mode 100644
index 0000000..ceee2c8
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java
@@ -0,0 +1,72 @@
+package com.jogamp.opengl.test.bugs;
+
+import javax.swing.*;
+import java.awt.*;
+import javax.media.opengl.*;
+import javax.media.opengl.awt.*;
+
+public class Bug427GLJPanelTest1 extends JFrame implements GLEventListener {
+
+    public Bug427GLJPanelTest1() {
+        super("Bug427GLJPanelTest1");
+
+        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        setLayout(new BorderLayout());
+
+        setSize(600, 600);
+        setLocation(40, 40);
+        setVisible(true);
+
+        GLProfile glp = GLProfile.getDefault();
+        GLCapabilities caps = new GLCapabilities(glp);
+        caps.setDoubleBuffered(true);
+        caps.setHardwareAccelerated(true);
+
+        GLJPanel panel = new GLJPanel(caps);
+        panel.addGLEventListener(this);
+
+        add(panel, BorderLayout.CENTER);
+    }
+
+    public static void main(String[] args) {
+        Bug427GLJPanelTest1 demo = new Bug427GLJPanelTest1();
+        demo.setVisible(true);
+    }
+
+    public void display(GLAutoDrawable drawable) {
+        GL2 gl = drawable.getGL().getGL2();
+
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT);
+        gl.glBegin(GL.GL_TRIANGLES);
+
+        gl.glColor3f(1, 0, 0);
+        gl.glVertex3f(0.25f, 0.25f, 0);
+
+        gl.glColor3f(0, 1, 0);
+        gl.glVertex3f(0.5f, 0.25f, 0);
+
+        gl.glColor3f(0, 0, 1);
+        gl.glVertex3f(0.25f, 0.5f, 0);
+
+        gl.glEnd();
+        gl.glFlush();
+    }
+
+    public void init(GLAutoDrawable drawable) {
+        GL2 gl = drawable.getGL().getGL2();
+
+        gl.glClearColor(0, 0, 0, 0);
+        gl.glMatrixMode(GL2.GL_PROJECTION);
+        gl.glLoadIdentity();
+        gl.glOrtho(0, 1, 0, 1, -1, 1);
+    }
+
+    public void reshape(GLAutoDrawable glDrawable, int x, int y, int w, int h) {
+    }
+
+    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+    }
+	
+	public void dispose(GLAutoDrawable drawable) {
+	}
+}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java b/src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java
new file mode 100644
index 0000000..4c2b547
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java
@@ -0,0 +1,94 @@
+package com.jogamp.opengl.test.bugs;
+
+import java.awt.Frame;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.Random;
+
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.glu.GLU;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.awt.TextRenderer;
+
+/** 
+ * Demonstrates corruption with older versions of TextRenderer. Two
+ * problems: errors when punting from glyph-based renderer to
+ * string-by-string renderer, and failure of glyph-based renderer when
+ * backing store was NPOT using GL_ARB_texture_rectangle.
+ *
+ * @author emzic
+ */
+
+public class Issue326Test1 extends Frame implements GLEventListener {
+
+    int width, height;
+
+    public static void main(String[] args) {
+        new Issue326Test1();		
+    }
+	
+    GLCanvas canvas;
+    TextRenderer tr ;
+	
+    public Issue326Test1() {
+        super("TextTest");
+        this.setSize(800, 800);
+        canvas = new GLCanvas();
+        canvas.addGLEventListener(this);
+        add(canvas);
+		
+        setVisible(true);
+        addWindowListener(new WindowAdapter() {
+                public void windowClosing(WindowEvent e) {
+                    System.exit(0);
+                }
+            });
+    }
+
+    public void display(GLAutoDrawable drawable) {
+        GL2 gl = drawable.getGL().getGL2();
+        gl.glClearColor(0, 0, 0, 0);
+        gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT);
+		
+	    
+        gl.glMatrixMode(GL2.GL_PROJECTION);
+        gl.glLoadIdentity();		
+        //new GLU().gluPerspective(45f, (float)width/(float)height, 0.1f, 1000f);
+        gl.glOrtho(0.0, 800, 0.0, 800, -100.0, 100.0);
+        gl.glMatrixMode(GL2.GL_MODELVIEW);
+        gl.glLoadIdentity();
+		
+        tr.beginRendering(800,800);
+        tr.draw( "die Marktwirtschaft. Da regelt sich � angeblich", 16, 32);
+        tr.draw( "Hello World! This text is scrambled", 16, 16);
+        tr.endRendering();
+		
+    }
+
+    public void init(GLAutoDrawable arg0) {
+        tr = new TextRenderer(new java.awt.Font("Verdana", java.awt.Font.PLAIN, 12), true, false, null, false);
+        tr.setColor(1, 1, 1 ,1);
+    }
+
+    public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) {
+        width = arg3;
+        height = arg4;
+        GL2 gl = arg0.getGL().getGL2();
+        gl.glViewport(0, 0, width, height);
+        gl.glMatrixMode(GL2.GL_PROJECTION);
+        gl.glLoadIdentity();
+        gl.glOrtho(0.0, 800, 0.0, 200, -100.0, 100.0);
+        gl.glMatrixMode(GL2.GL_MODELVIEW);
+        gl.glLoadIdentity();
+    }
+
+	public void dispose(GLAutoDrawable drawable) {}
+}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java b/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java
new file mode 100644
index 0000000..8960c96
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java
@@ -0,0 +1,73 @@
+package com.jogamp.opengl.test.bugs;
+
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.event.*;
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.awt.GLCanvas;
+
+import com.jogamp.opengl.util.awt.*;
+
+/**
+ * Another test case demonstrating corruption with older version of
+ * TextRenderer when glyphs were too big for backing store. Font and
+ * text courtesy of Patrick Murris. Adapted from Issue326Test1.
+ */
+
+public class Issue326Test2 extends Frame implements GLEventListener {
+
+    int width, height;
+
+    public static void main(String[] args) {
+        new Issue326Test2();		
+    }
+	
+    GLCanvas canvas;
+    TextRenderer tr;
+	
+    public Issue326Test2() {
+        super("");
+        this.setSize(800, 800);
+        canvas = new GLCanvas();
+        canvas.addGLEventListener(this);
+        add(canvas);
+		
+        setVisible(true);
+        addWindowListener(new WindowAdapter() {
+                public void windowClosing(WindowEvent e) {
+                    System.exit(0);
+                }
+            });
+    }
+
+    public void display(GLAutoDrawable drawable) {
+        GL2 gl = drawable.getGL().getGL2();
+        gl.glClearColor(0, 0, 0, 0);
+        gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT);
+	    
+        tr.beginRendering(drawable.getWidth(), drawable.getHeight());
+        tr.draw("LA CLAPI\u00c8RE \nAlt: 1100-1700m \nGlissement de terrain majeur", 16, 80);
+        tr.draw("dans la haute Tin\u00e9e, sur un flanc du Parc du Mercantour.", 16, 16);
+        tr.endRendering();
+		
+    }
+
+    public void init(GLAutoDrawable arg0) {
+        tr = new TextRenderer(Font.decode("Arial-BOLD-64"));
+        tr.setColor(1, 1, 1 ,1);
+    }
+
+    public void reshape(GLAutoDrawable arg0, int x, int y, int w, int h) {
+        GL2 gl = arg0.getGL().getGL2();
+        gl.glMatrixMode(GL2.GL_PROJECTION);
+        gl.glLoadIdentity();
+        gl.glOrtho(0.0, w, 0.0, h, -1, 1);
+        gl.glMatrixMode(GL2.GL_MODELVIEW);
+        gl.glLoadIdentity();
+    }
+
+	public void dispose(GLAutoDrawable drawable) {}
+}
+
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java
new file mode 100644
index 0000000..c3401fe
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java
@@ -0,0 +1,107 @@
+package com.jogamp.opengl.test.bugs;
+
+import java.awt.BorderLayout;
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.event.*;
+import java.awt.geom.*;
+
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.glu.*;
+import com.jogamp.opengl.util.awt.TextRenderer;
+
+/** Test Code adapted from TextCube.java (in JOGL demos)
+ *
+ * @author spiraljetty
+ * @author kbr
+ */
+
+public abstract class Issue344Base implements GLEventListener
+{
+    GLU glu = new GLU();
+    TextRenderer renderer;
+
+    float textScaleFactor;
+    Font font;
+    boolean useMipMaps;
+
+    protected Issue344Base() {
+        font = new Font("default", Font.PLAIN, 200);
+        useMipMaps = true; //false
+    }
+
+    protected abstract String getText();
+
+    protected void run(String[] args) {
+        Frame frame = new Frame(getClass().getName());
+        frame.setLayout(new BorderLayout());
+
+        GLCanvas canvas = new GLCanvas();
+        canvas.addGLEventListener(this);
+        frame.add(canvas, BorderLayout.CENTER);
+
+        frame.setSize(512, 512);
+        frame.addWindowListener(new WindowAdapter() {
+                public void windowClosing(WindowEvent e) {
+                    new Thread(new Runnable() {
+                            public void run() {
+                                System.exit(0);
+                            }
+                        }).start();
+                }
+            });
+        frame.setVisible(true);
+    }
+
+    public void init(GLAutoDrawable drawable)
+    {
+        GL2 gl = drawable.getGL().getGL2();
+
+        gl.glEnable(GL2.GL_DEPTH_TEST);
+
+        renderer = new TextRenderer(font, useMipMaps);
+
+        Rectangle2D bounds = renderer.getBounds(getText());
+        float w = (float) bounds.getWidth();
+        float h = (float) bounds.getHeight();
+        textScaleFactor = 2.0f / (w * 1.1f);
+        gl.setSwapInterval(0);
+    }
+
+    public void display(GLAutoDrawable drawable)
+    {
+        GL2 gl = drawable.getGL().getGL2();
+        gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
+
+        gl.glMatrixMode(GL2.GL_MODELVIEW);
+        gl.glLoadIdentity();
+        glu.gluLookAt(0, 0, 10,
+                      0, 0, 0,
+                      0, 1, 0);
+
+        renderer.begin3DRendering();
+        Rectangle2D bounds = renderer.getBounds(getText());
+        float w = (float) bounds.getWidth();
+        float h = (float) bounds.getHeight();
+        renderer.draw3D(getText(),
+                        w / -2.0f * textScaleFactor,
+                        h / -2.0f * textScaleFactor,
+                        3f,
+                        textScaleFactor);
+		
+        renderer.end3DRendering();
+    }
+
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
+    {
+        GL2 gl = drawable.getGL().getGL2();
+        gl.glMatrixMode(GL2.GL_PROJECTION);
+        gl.glLoadIdentity();
+        glu.gluPerspective(15, (float) width / (float) height, 5, 15);
+    }
+
+	public void dispose(GLAutoDrawable drawable) {}
+}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java
new file mode 100644
index 0000000..f0da7cb
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java
@@ -0,0 +1,12 @@
+package com.jogamp.opengl.test.bugs;
+
+public class Issue344Test1 extends Issue344Base {
+    protected String getText() {
+        // test 1 - weird artifacts appear with a large font & long string 
+        return "abcdefghijklmnopqrstuvwxyz1234567890";
+    }
+
+    public static void main(String[] args) {
+        new Issue344Test1().run(args);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java
new file mode 100644
index 0000000..bb1acf2
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java
@@ -0,0 +1,12 @@
+package com.jogamp.opengl.test.bugs;
+
+public class Issue344Test2 extends Issue344Base {
+    protected String getText() {
+        // test 2 - unicode hangs program with a large font & long string
+        return "\u201Cabcdefghijklmnopqrstuvwxyz\u201D";
+    }
+
+    public static void main(String[] args) {
+        new Issue344Test2().run(args);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java
new file mode 100644
index 0000000..bb73d84
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java
@@ -0,0 +1,12 @@
+package com.jogamp.opengl.test.bugs;
+
+public class Issue344Test3 extends Issue344Base {
+    protected String getText() {
+        // test 3 - slight rendering artifacts around very large letters
+        return "abcde";
+    }
+
+    public static void main(String[] args) {
+        new Issue344Test3().run(args);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java
new file mode 100644
index 0000000..de4c37a
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java
@@ -0,0 +1,12 @@
+package com.jogamp.opengl.test.bugs;
+
+public class Issue344Test4 extends Issue344Base {
+    protected String getText() {
+        // test 4 - unicode letter as second-to-last is rendered incorrectly
+        return "\u201CGreetings\u201D!";
+    }
+
+    public static void main(String[] args) {
+        new Issue344Test4().run(args);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
new file mode 100644
index 0000000..d4f24bb
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
@@ -0,0 +1,166 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.acore;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.media.opengl.*;
+
+import com.jogamp.common.GlueGenVersion;
+import com.jogamp.common.util.VersionUtil;
+import com.jogamp.nativewindow.NativeWindowVersion;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.DumpGLInfo;
+import com.jogamp.opengl.JoglVersion;
+import com.jogamp.newt.opengl.*;
+import com.jogamp.newt.*;
+
+public class TestGLProfile01NEWT extends UITestCase {
+
+    @Test
+    public void test00Version() throws InterruptedException {
+        System.err.println(VersionUtil.getPlatformInfo());
+        System.err.println(GlueGenVersion.getInstance());
+        System.err.println(NativeWindowVersion.getInstance());
+        System.err.println(JoglVersion.getInstance());
+        System.err.println(NewtVersion.getInstance());
+
+        GLDrawableFactory factory = GLDrawableFactory.getFactory(GLProfile.getDefault());
+        List/*<GLCapabilitiesImmutable>*/ availCaps = factory.getAvailableCapabilities(null);
+        for(int i=0; i<availCaps.size(); i++) {
+            System.err.println(availCaps.get(i));
+        }
+    }
+
+    @Test
+    public void test01GLProfileDefault() throws InterruptedException {
+        System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
+        GLProfile glp = GLProfile.getDefault();
+        System.out.println("GLProfile.getDefault(): "+glp);
+        if(glp.getName().equals(GLProfile.GL4bc)) {
+            Assert.assertTrue(GLProfile.isGL4bcAvailable());
+            Assert.assertTrue(GLProfile.isGL3bcAvailable());
+            Assert.assertTrue(GLProfile.isGL2Available());
+            Assert.assertTrue(GLProfile.isGL2ES1Available());
+            Assert.assertTrue(GLProfile.isGL2ES2Available());
+        } else if(glp.getName().equals(GLProfile.GL3bc)) {
+            Assert.assertTrue(GLProfile.isGL3bcAvailable());
+            Assert.assertTrue(GLProfile.isGL2Available());
+            Assert.assertTrue(GLProfile.isGL2ES1Available());
+            Assert.assertTrue(GLProfile.isGL2ES2Available());
+        } else if(glp.getName().equals(GLProfile.GL2)) {
+            Assert.assertTrue(GLProfile.isGL2Available());
+            Assert.assertTrue(GLProfile.isGL2ES1Available());
+            Assert.assertTrue(GLProfile.isGL2ES2Available());
+        } else if(glp.getName().equals(GLProfile.GL2ES1)) {
+            Assert.assertTrue(GLProfile.isGL2ES1Available());
+        }
+        dumpVersion(glp);
+    }
+
+    @Test
+    public void test02GL2() throws InterruptedException {
+        GLProfile glp = GLProfile.get(GLProfile.GL2);
+        dumpVersion(glp);
+    }
+
+    @Test
+    public void test03GLProfileMaxProgrammable() throws InterruptedException {
+        // Assuming at least one programmable profile is available
+        GLProfile glp = GLProfile.getMaxProgrammable();
+        System.out.println("GLProfile.getMaxProgrammable(): "+glp);
+        if(glp.getName().equals(GLProfile.GL4)) {
+            Assert.assertTrue(GLProfile.isGL4Available());
+            Assert.assertTrue(GLProfile.isGL3Available());
+            Assert.assertTrue(GLProfile.isGL2Available());
+            Assert.assertTrue(GLProfile.isGL2ES1Available());
+            Assert.assertTrue(GLProfile.isGL2ES2Available());
+        } else if(glp.getName().equals(GLProfile.GL3)) {
+            Assert.assertTrue(GLProfile.isGL3Available());
+            Assert.assertTrue(GLProfile.isGL2Available());
+            Assert.assertTrue(GLProfile.isGL2ES1Available());
+            Assert.assertTrue(GLProfile.isGL2ES2Available());
+        } else if(glp.getName().equals(GLProfile.GL2)) {
+            Assert.assertTrue(GLProfile.isGL2Available());
+            Assert.assertTrue(GLProfile.isGL2ES1Available());
+            Assert.assertTrue(GLProfile.isGL2ES2Available());
+        } else if(glp.getName().equals(GLProfile.GL2ES2)) {
+            Assert.assertTrue(GLProfile.isGL2ES2Available());
+        }
+        dumpVersion(glp);
+    }
+
+    @Test
+    public void test04GLProfileGL2ES1() throws InterruptedException {
+        if(!GLProfile.isGL2ES1Available()) {
+            System.out.println("GLProfile GL2ES1 n/a");
+            return;
+        }
+        GLProfile glp = GLProfile.getGL2ES1();
+        System.out.println("GLProfile GL2ES1: "+glp);
+        dumpVersion(glp);
+    }
+
+    @Test
+    public void test05GLProfileGL2ES2() throws InterruptedException {
+        if(!GLProfile.isGL2ES2Available()) {
+            System.out.println("GLProfile GL2ES2 n/a");
+            return;
+        }
+        GLProfile glp = GLProfile.getGL2ES2();
+        System.out.println("GLProfile GL2ES2: "+glp);
+        dumpVersion(glp);
+    }
+
+    protected void dumpVersion(GLProfile glp) throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        GLWindow glWindow = GLWindow.create(caps);
+        Assert.assertNotNull(glWindow);
+        glWindow.setTitle("TestGLProfile01NEWT");
+
+        glWindow.addGLEventListener(new DumpGLInfo());
+
+        glWindow.setSize(128, 128);
+        glWindow.setVisible(true);
+
+        glWindow.display();
+        Thread.sleep(100);
+        glWindow.invalidate();
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestGLProfile01NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
new file mode 100644
index 0000000..bf4c493
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
@@ -0,0 +1,158 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.acore;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLPbuffer;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.awt.GLCanvas;
+import com.jogamp.opengl.util.Animator;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
+
+import java.awt.Frame;
+import javax.swing.SwingUtilities;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class TestSharedContextListAWT extends UITestCase {
+    static GLProfile glp;
+    static GLCapabilities caps;
+    static int width, height;
+    GLPbuffer sharedDrawable;
+    Gears sharedGears;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glp = GLProfile.getDefault();
+        Assert.assertNotNull(glp);
+        caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        width  = 512;
+        height = 512;
+    }
+
+    private void initShared() {
+        sharedDrawable = GLDrawableFactory.getFactory(glp).createGLPbuffer(null, caps, null, width, height, null);
+        Assert.assertNotNull(sharedDrawable);
+        sharedGears = new Gears();
+        Assert.assertNotNull(sharedGears);
+        sharedDrawable.addGLEventListener(sharedGears);
+        // init and render one frame, which will setup the Gears display lists
+        sharedDrawable.display();
+    }
+
+    private void releaseShared() {
+        Assert.assertNotNull(sharedDrawable);
+        sharedDrawable.destroy();
+    }
+    protected Frame createFrame(int x, int y, boolean useShared) {
+        return new Frame("Shared Gears AWT Test: "+x+"/"+y+" shared "+useShared);
+    }
+
+    protected GLCanvas runTestGL(final Frame frame, final Animator animator, final int x, final int y, final boolean useShared)
+            throws InterruptedException
+    {
+        final GLCanvas glCanvas = new GLCanvas(caps, useShared ? sharedDrawable.getContext() : null);        
+        Assert.assertNotNull(glCanvas);
+        frame.add(glCanvas);
+        frame.setLocation(x, y);
+        frame.setSize(width, height);
+        
+        Gears gears = new Gears();
+        if(useShared) {
+            gears.setGears(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
+        }
+        glCanvas.addGLEventListener(gears);
+
+        animator.add(glCanvas);
+
+        frame.setVisible(true);
+        Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glCanvas, true));
+
+        return glCanvas;
+    }
+
+    @Test
+    public void test01() throws InterruptedException {
+        initShared();
+
+        Frame f1 = createFrame(0, 0, true);
+        Frame f2 = createFrame(width, 0, true);
+        Frame f3 = createFrame(0, height, false);
+
+        Animator animator = new Animator();
+
+        GLCanvas glc1 = runTestGL(f1, animator, 0,     0,      true);
+        GLCanvas glc2 = runTestGL(f2, animator, width, 0,      true);
+        GLCanvas glc3 = runTestGL(f3, animator, 0,     height, false);
+
+        animator.start();
+        while(animator.isAnimating() && animator.getDuration()<duration) {
+            Thread.sleep(100);
+        }
+        animator.stop();
+
+        // here we go again: On AMD/X11 the create/destroy sequence must be the same
+        // even though this is agains the chicken/egg logic here ..
+        releaseShared();
+
+        f1.dispose();
+        Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc1, false));
+
+        f2.dispose();
+        Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc2, false));
+
+        f3.dispose();
+        Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc3, false));
+        
+        // see above ..
+        //releaseShared();
+    }
+
+    static long duration = 500; // ms
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                try {
+                    duration = Integer.parseInt(args[i]);
+                } catch (Exception ex) { ex.printStackTrace(); }
+            }
+        }
+        org.junit.runner.JUnitCore.main(TestSharedContextListAWT.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java
new file mode 100644
index 0000000..f5c9506
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java
@@ -0,0 +1,140 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.acore;
+
+import com.jogamp.newt.opengl.GLWindow;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLPbuffer;
+import javax.media.opengl.GLProfile;
+import com.jogamp.opengl.util.Animator;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class TestSharedContextListNEWT extends UITestCase {
+    static GLProfile glp;
+    static GLCapabilities caps;
+    static int width, height;
+    GLPbuffer sharedDrawable;
+    Gears sharedGears;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glp = GLProfile.getDefault();
+        Assert.assertNotNull(glp);
+        caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        width  = 512;
+        height = 512;
+    }
+
+    private void initShared() {
+        sharedDrawable = GLDrawableFactory.getFactory(glp).createGLPbuffer(null, caps, null, width, height, null);
+        Assert.assertNotNull(sharedDrawable);
+        sharedGears = new Gears();
+        Assert.assertNotNull(sharedGears);
+        sharedDrawable.addGLEventListener(sharedGears);
+        // init and render one frame, which will setup the Gears display lists
+        sharedDrawable.display();
+    }
+
+    private void releaseShared() {
+        Assert.assertNotNull(sharedDrawable);
+        sharedDrawable.destroy();
+    }
+
+    protected GLWindow runTestGL(Animator animator, int x, int y, boolean useShared) {
+        GLWindow glWindow = GLWindow.create(caps);
+        Assert.assertNotNull(glWindow);
+        glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared "+useShared);
+        if(useShared) {
+            glWindow.setSharedContext(sharedDrawable.getContext());
+        }
+
+        glWindow.setSize(width, height);
+        glWindow.setPosition(x, y);
+
+        Gears gears = new Gears();
+        if(useShared) {
+            gears.setGears(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
+        }
+        glWindow.addGLEventListener(gears);
+
+        animator.add(glWindow);
+
+        glWindow.setVisible(true);
+
+        return glWindow;
+    }
+
+    @Test
+    public void test01() throws InterruptedException {
+        initShared();
+        Animator animator = new Animator();
+        GLWindow f1 = runTestGL(animator, 0, 0, true);
+        GLWindow f2 = runTestGL(animator, width, 0, true);
+        GLWindow f3 = runTestGL(animator, 0, height, false);
+        animator.start();
+        while(animator.isAnimating() && animator.getDuration()<duration) {
+            Thread.sleep(100);
+        }
+        animator.stop();
+
+        // here we go again: On AMD/X11 the create/destroy sequence must be the same
+        // even though this is agains the chicken/egg logic here ..
+        releaseShared();
+
+        f1.destroy();
+        f2.destroy();
+        f3.destroy();
+
+        // see above ..
+        // releaseShared();
+    }
+
+    static long duration = 500; // ms
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                try {
+                    duration = Integer.parseInt(args[i]);
+                } catch (Exception ex) { ex.printStackTrace(); }
+            }
+        }
+        org.junit.runner.JUnitCore.main(TestSharedContextListNEWT.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java
new file mode 100644
index 0000000..21e1a4a
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java
@@ -0,0 +1,135 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.awt;
+
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.awt.GLCanvas;
+import com.jogamp.opengl.util.Animator;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+import java.awt.Frame;
+
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.Test;
+
+
+public class TestAWT01GLn extends UITestCase {
+    Frame frame=null;
+    GLCanvas glCanvas=null;
+
+    @BeforeClass
+    public static void startup() {
+        GLProfile.initSingleton(true);
+        System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
+    }
+
+    @Before
+    public void init() {
+        frame = new Frame("Texture Test");
+        Assert.assertNotNull(frame);
+    }
+
+    @After
+    public void release() {
+        Assert.assertNotNull(frame);
+        Assert.assertNotNull(glCanvas);
+        try {
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    frame.setVisible(false);
+                    frame.remove(glCanvas);
+                    frame.dispose();
+                }});
+        } catch (Throwable t) {
+            t.printStackTrace();
+            Assume.assumeNoException(t);
+        }
+        frame=null;
+        glCanvas=null;
+    }
+
+    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
+        glCanvas = new GLCanvas(caps);
+        Assert.assertNotNull(glCanvas);
+        glCanvas.addGLEventListener(new Gears());
+        frame.add(glCanvas);
+
+        // Revalidate size/layout.
+        // Always validate if component added/removed.
+        // Ensure 1st paint of GLCanvas will have a valid size, hence drawable gets created.
+        frame.setSize(512, 512);
+        frame.validate();
+
+        try {
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    frame.setVisible(true);
+                }});
+        } catch (Throwable t) {
+            t.printStackTrace();
+            Assume.assumeNoException(t);
+        }
+
+        glCanvas.display(); // one in process display
+
+        Animator animator = new Animator(glCanvas);
+        animator.start();
+
+        Thread.sleep(500); // 500 ms
+
+        animator.stop();
+    }
+
+    @Test
+    public void test01GLDefault() throws InterruptedException {
+        GLProfile glp = GLProfile.getDefault();
+        System.out.println("GLProfile Default: "+glp);
+        GLCapabilities caps = new GLCapabilities(glp);
+        runTestGL(caps);
+    }
+
+    @Test
+    public void test02GL2() throws InterruptedException {
+        GLProfile glprofile = GLProfile.get(GLProfile.GL2);
+        System.out.println( "GLProfile GL2: " + glprofile );
+        GLCapabilities caps = new GLCapabilities(glprofile);
+        runTestGL(caps);
+    }
+
+    public static void main(String args[]) {
+        org.junit.runner.JUnitCore.main(TestAWT01GLn.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java
new file mode 100644
index 0000000..535f0e9
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java
@@ -0,0 +1,111 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.awt;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import javax.media.opengl.GLProfile;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.Test;
+
+public class TestAWT02WindowClosing extends UITestCase {
+
+    static long durationPerTest = 200; // ms
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+    }
+
+    @Test
+    public void test01WindowClosing() throws InterruptedException {
+        Frame frame = new Frame();
+        frame.setSize(500, 500);
+        ClosingWindowAdapter closingWindowAdapter = new ClosingWindowAdapter(frame);
+        frame.addWindowListener(closingWindowAdapter);
+        final Frame _frame = frame;
+        try {
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    _frame.setVisible(true);
+                }});
+        } catch (Throwable t) {
+            t.printStackTrace();
+            Assume.assumeNoException(t);
+        }
+
+        Thread.sleep(durationPerTest);
+        if(!closingWindowAdapter.closingCalled) {
+            // programatically issue windowClosing
+            Toolkit tk = Toolkit.getDefaultToolkit();
+            EventQueue evtQ = tk.getSystemEventQueue();
+            evtQ.postEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));
+            Thread.sleep(200);
+        }
+        Assert.assertEquals(true, closingWindowAdapter.closingCalled);
+    }
+
+    static class ClosingWindowAdapter extends WindowAdapter {
+        boolean closingCalled = false;
+        Frame frame;
+        public ClosingWindowAdapter(Frame frame) {
+            this.frame = frame;
+        }
+        public void windowClosing(WindowEvent ev) {
+                System.out.println("windowClosing() called ..");
+                closingCalled = true;
+                frame.dispose();
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        System.out.println("durationPerTest: "+durationPerTest);
+        org.junit.runner.JUnitCore.main(TestAWT02WindowClosing.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java
new file mode 100644
index 0000000..2faf8fa
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java
@@ -0,0 +1,183 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.awt;
+
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.awt.GLCanvas;
+import com.jogamp.opengl.util.Animator;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+
+import java.awt.Frame;
+import java.awt.Label;
+
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.Test;
+
+
+public class TestAWT03GLCanvasRecreate01 extends UITestCase {
+    static long durationPerTest = 1000; // ms
+
+    Frame frame1=null;
+    Frame frame2=null;
+    GLCanvas glCanvas=null;
+    Label label = null;
+    Animator animator = null;
+
+    @BeforeClass
+    public static void startup() {
+        GLProfile.initSingleton(true);
+        System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
+    }
+
+    @Before
+    public void init() {
+        glCanvas = new GLCanvas();
+        Assert.assertNotNull(glCanvas);
+        glCanvas.addGLEventListener(new Gears());
+
+        animator = new Animator(glCanvas);
+        animator.start();
+
+        label = new Label("No GLCanvas");
+
+        frame1 = new Frame("Frame 1");
+        Assert.assertNotNull(frame1);
+        frame1.add(label);
+        frame1.setSize(512, 512);
+        frame1.setLocation(0, 0);
+        
+        frame2 = new Frame("Frame 2");
+        Assert.assertNotNull(frame2);
+        frame2.add(label);
+        frame2.setSize(512, 512);
+        frame2.setLocation(512, 0);
+    }
+
+    @After
+    public void release() {
+        Assert.assertNotNull(frame1);
+        Assert.assertNotNull(frame2);
+        Assert.assertNotNull(glCanvas);
+        try {
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    glCanvas.destroy();
+                    frame1.dispose();
+                    frame2.dispose();
+                }});
+        } catch (Throwable t) {
+            t.printStackTrace();
+            Assume.assumeNoException(t);
+        }
+        frame1=null;
+        frame2=null;
+        glCanvas=null;
+
+        animator.stop();
+        animator=null;
+    }
+
+    private void addCanvas(final Frame frame) {
+        try {
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    frame.remove(label);
+                    frame.add(glCanvas);
+                    frame.validate();
+                }});
+        } catch (Throwable t) {
+            t.printStackTrace();
+            Assume.assumeNoException(t);
+        }
+    }
+
+    private void removeCanvas(final Frame frame) {
+        try {
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    frame.remove(glCanvas);
+                    frame.add(label);
+                    frame.validate();
+                }});
+        } catch (Throwable t) {
+            t.printStackTrace();
+            Assume.assumeNoException(t);
+        }
+    }
+
+    private void setVisible(final Frame frame, final boolean v) {
+            try {
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    frame.setVisible(v);
+                }});
+        } catch (Throwable t) {
+            t.printStackTrace();
+            Assume.assumeNoException(t);
+        }
+    }
+
+
+    @Test
+    public void testAddRemove3Times() throws InterruptedException {
+        setVisible(frame1, true);
+        setVisible(frame2, true);
+
+        addCanvas(frame1);
+        Thread.sleep(durationPerTest/4);
+
+        removeCanvas(frame1);
+        addCanvas(frame2);
+        Thread.sleep(durationPerTest/4);
+
+        removeCanvas(frame2);
+        addCanvas(frame1);
+        Thread.sleep(durationPerTest/4);
+
+        removeCanvas(frame1);
+        addCanvas(frame2);
+        Thread.sleep(durationPerTest/4);
+    }
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
+            }
+        }
+        org.junit.runner.JUnitCore.main(TestAWT03GLCanvasRecreate01.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461OffscreenSupersamplingSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461OffscreenSupersamplingSwingAWT.java
new file mode 100644
index 0000000..55c9c68
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461OffscreenSupersamplingSwingAWT.java
@@ -0,0 +1,173 @@
+/**
+ * Copyright 2011 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.awt;
+
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+/**
+ * Copyright 2011 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+import java.awt.image.BufferedImage;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLPbuffer;
+import javax.media.opengl.GLProfile;
+import javax.swing.ImageIcon;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+/**
+ * Tests for bug 461, a failure of GLDrawableFactory.createGLPbuffer() on Windows
+ * when the stencil buffer is turned on.
+ *
+ * @author Wade Walker (from code sample provided by Owen Dimond)
+ */
+public class TestBug461OffscreenSupersamplingSwingAWT extends UITestCase implements GLEventListener {
+    JFrame jframe;
+    GLPbuffer offScreenBuffer;
+    
+    private void render(GLAutoDrawable drawable) {
+        GL2 gl = drawable.getGL().getGL2();
+        Assert.assertNotNull(gl);
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT);      
+
+        // draw a triangle filling the window
+        gl.glBegin(GL.GL_TRIANGLES);
+        gl.glColor3f(1, 0, 0);
+        gl.glVertex2d(-1, -1);
+        gl.glColor3f(0, 1, 0);
+        gl.glVertex2d(0, 1);
+        gl.glColor3f(0, 0, 1);
+        gl.glVertex2d(1, -1);
+        gl.glEnd();
+    }
+    
+    /* @Override */
+    public void init(GLAutoDrawable drawable) {                        
+    }
+
+    /* @Override */
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    }    
+    
+    /* @Override */
+    public void display(GLAutoDrawable drawable) {             
+        render(offScreenBuffer);
+        BufferedImage outputImage = com.jogamp.opengl.util.awt.Screenshot.readToBufferedImage(200, 200, false);        
+        Assert.assertNotNull(outputImage);
+        ImageIcon imageIcon = new ImageIcon(outputImage);
+        JLabel imageLabel = new JLabel(imageIcon);        
+        jframe.getContentPane().add(imageLabel);
+    }
+
+    /* @Override */
+    public void dispose(GLAutoDrawable drawable) {  
+        jframe.setVisible(false);
+        jframe.dispose();
+    }
+
+    @Test
+    public void testOffscreenSupersampling() {
+        jframe = new JFrame("Offscreen Supersampling");
+        Assert.assertNotNull(jframe);
+        jframe.setSize( 300, 300);
+        jframe.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e) {
+                System.exit(0);
+            }
+        });
+
+        GLProfile glp = GLProfile.get(GLProfile.GL2);
+        Assert.assertNotNull(glp);
+        
+        GLDrawableFactory fac = GLDrawableFactory.getFactory(glp);
+        Assert.assertNotNull(fac);
+        
+        Assert.assertTrue( fac.canCreateGLPbuffer(GLProfile.getDefaultDesktopDevice()) );
+        
+        GLCapabilities glCap = new GLCapabilities(glp);
+        Assert.assertNotNull(glCap);
+        
+        // COMMENTING OUT THIS LINE FIXES THE ISSUE. 
+        // Setting this in JOGL1 works. Thus this is a JOGL2 issue.
+        glCap.setSampleBuffers(true);
+      
+        // Without line below, there is an error on Windows.
+        glCap.setDoubleBuffered(false);
+        // Needed for drop shadows
+        glCap.setStencilBits(1);
+
+        //makes a new buffer
+        offScreenBuffer = fac.createGLPbuffer(GLProfile.getDefaultDesktopDevice(), glCap, null, 200, 200, null);
+        Assert.assertNotNull(offScreenBuffer);
+        offScreenBuffer.addGLEventListener(this);        
+        offScreenBuffer.display();
+        jframe.setVisible( true );
+    }
+
+    public static void main(String args[]) {
+        org.junit.runner.JUnitCore.main(TestBug461OffscreenSupersamplingSwingAWT.class.getName());
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java
new file mode 100644
index 0000000..779ad76
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java
@@ -0,0 +1,147 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.awt;
+
+import java.lang.reflect.InvocationTargetException;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.awt.GLCanvas;
+import com.jogamp.opengl.util.Animator;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import java.awt.Frame;
+import java.awt.Window;
+import javax.swing.JFrame;
+
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assume.*;
+import static org.junit.Assert.*;
+import static javax.swing.SwingUtilities.*;
+
+/**
+ * Tests context creation + display on various kinds of Window implementations.
+ * @author Michael Bien
+ */
+public class TestSwingAWT01GLn extends UITestCase {
+    private Window[] windows;
+
+
+    @BeforeClass
+    public static void startup() {
+        GLProfile.initSingleton(true);
+        System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
+    }
+
+    @Before
+    public void init() {
+        windows = new Window[]{
+            new Window(null),
+            new Frame("Frame GL test"),
+            new JFrame("JFrame GL test")
+        };
+    }
+
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException, InvocationTargetException {
+
+        for (final Window window : windows) {
+
+            System.out.println("testing with "+window.getClass().getName());
+
+            // final array as mutable container hack
+            final GLCanvas[] glCanvas = new GLCanvas[1];
+
+            Runnable test = new Runnable() {
+                public void run() {
+                    glCanvas[0] = new GLCanvas(caps);
+                    glCanvas[0].addGLEventListener(new Gears());
+                    window.add(glCanvas[0]);
+
+                    // Revalidate size/layout.
+                    // Always validate if component added/removed.
+                    // Ensure 1st paint of GLCanvas will have a valid size, hence drawable gets created.
+                    window.setSize(512, 512);
+                    window.validate();
+
+                    window.setVisible(true);
+                    glCanvas[0].display();
+                }
+            };
+
+            Runnable cleanup = new Runnable() {
+                public void run() {
+                    System.out.println("cleaning up...");
+                    window.setVisible(false);
+                    try {
+                        window.removeAll();
+                    } catch (Throwable t) {
+                        assumeNoException(t);
+                        t.printStackTrace();
+                    }
+                    window.dispose();
+                }
+
+            };
+
+            // AWT / Swing on EDT..
+            invokeAndWait(test);
+
+            Animator animator = new Animator(glCanvas[0]);
+            animator.start();
+            Thread.sleep(1000);
+            animator.stop();
+
+            // AWT / Swing on EDT..
+            invokeAndWait(cleanup);
+        }
+    }
+
+    @Test
+    public void test01GLDefault() throws InterruptedException, InvocationTargetException {
+        GLProfile glp = GLProfile.getDefault();
+        System.out.println("GLProfile Default: "+glp);
+        GLCapabilities caps = new GLCapabilities(glp);
+        runTestGL(caps);
+    }
+
+    @Test
+    public void test02GL2() throws InterruptedException, InvocationTargetException {
+        GLProfile glprofile = GLProfile.get(GLProfile.GL2);
+        System.out.println( "GLProfile GL2: " + glprofile );
+        GLCapabilities caps = new GLCapabilities(glprofile);
+        runTestGL(caps);
+    }
+
+    public static void main(String args[]) {
+        org.junit.runner.JUnitCore.main(TestSwingAWT01GLn.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java
new file mode 100644
index 0000000..fc19a68
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java
@@ -0,0 +1,155 @@
+/**
+ * Copyright 2011 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.awt.text;
+
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.awt.GLCanvas;
+import com.jogamp.opengl.util.Animator;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+import java.awt.Frame;
+import java.io.IOException;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.Test;
+
+/*
+ * Unit tests for Bug464
+ * Some ATI-Drivers crash the JVM if VBO-related glFunctions are called. This test checks 
+ * if TextRenderer calls any of these functions while it's useVertexArray variable is set
+ * to false.
+ * 2D- and 3D-TextRendering is tested by creating a GLCanvas showing a simple line of text 
+ * while filtering all glFunction calls by using a modified version of TraceGL2.
+ * VBO-related function are logged to the disallowedMethodCalls String of the GLEventListener
+ * instead of being executed (to prevent JVM crashes). Therefore, if the 
+ * disallowedMethodCalls isn't an empty String after the test, the test fails.
+ * 
+ * Other classes related to this test:
+ *   TestTextRendererGLEventListener01
+ *   TestTextRendererTraceGL2Mock01
+ */
+
+public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
+    static GLProfile glp;
+    static GLCapabilities caps;
+    
+    private GLCanvas glCanvas;
+    private Frame frame;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glp = GLProfile.get(GLProfile.GL2);
+        Assert.assertNotNull(glp);
+        caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+    }
+
+    @Before
+    public void initTest() {
+        glCanvas = new GLCanvas(caps);
+
+        frame = new Frame("TextRenderer Test");
+        Assert.assertNotNull(frame);
+        frame.add(glCanvas);
+        frame.setSize(512, 512);
+        frame.setVisible(true);
+        
+    }
+
+    @After
+    public void cleanupTest() {
+    	frame.setVisible(false);
+        frame.remove(glCanvas);
+        glCanvas=null;
+        Assert.assertNotNull(frame);
+        frame.dispose();
+        frame=null;
+    }
+
+    @Test
+    public void testTextRendererDraw2D() throws InterruptedException {
+
+        TextRendererGLEventListener01 listener = new TextRendererGLEventListener01(1);
+        Assert.assertNotNull(listener);
+        glCanvas.addGLEventListener(listener);
+        Animator animator = new Animator(glCanvas);
+
+        animator.start();
+	
+	    Thread.sleep(500); // 500 ms
+	
+	    animator.stop();
+        
+	    String disallowedMethods = listener.getDisallowedMethodCalls();
+	    if (!disallowedMethods.equals("")) {
+	    	Assert.fail("Following VBO-related glMethods have been called: "+ disallowedMethods);
+	    }
+    }
+    
+    @Test
+    public void testTextRendererDraw3D() throws InterruptedException {
+
+        TextRendererGLEventListener01 listener = new TextRendererGLEventListener01(2);
+        Assert.assertNotNull(listener);
+        glCanvas.addGLEventListener(listener);
+        Animator animator = new Animator(glCanvas);
+
+        animator.start();
+	
+	    Thread.sleep(500); // 500 ms
+	
+	    animator.stop();
+        
+	    String disallowedMethods = listener.getDisallowedMethodCalls();
+	    if (!disallowedMethods.equals("")) {
+	    	Assert.fail("Following VBO-related glMethods have been called: "+ disallowedMethods);
+	    }
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestAWTTextRendererUseVertexArrayBug464.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }	
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java
new file mode 100644
index 0000000..b147041
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java
@@ -0,0 +1,124 @@
+/**
+ * Copyright 2011 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.awt.text;
+
+import java.awt.Font;
+import java.io.OutputStream;
+import java.io.PrintStream;
+
+import com.jogamp.opengl.util.awt.TextRenderer;
+import javax.media.opengl.GL2ES1;
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.glu.GLU;
+
+import org.junit.Assert;
+
+/*
+ * Unit tests for Bug464
+ * GLEventListener for unit test TestAWTTextRendererUseVertexArrayBug464. The display
+ * method renders the String "ABC123#+?" to the lower left corner of the canvas.
+ *  
+ * The testNumber variable is used to switch between 2D- and 3D-textrendering in the display
+ * method.
+ * The disallowedMethodCalls variable is used to log VBO-related glFunction calls during
+ * the execution of the test.
+ * 
+ * Other classes related to this test:
+ *   TestAWTTextRendererUseVertexArrayBug464
+ *   TextRendererTraceGL2Mock01
+ */
+
+public class TextRendererGLEventListener01 implements GLEventListener {
+    private GLU glu = new GLU();
+    private TextRenderer renderer;
+    private String text;
+    private String disallowedMethodCalls;
+    private int testNumber;
+    
+    public TextRendererGLEventListener01(int testNumber) {
+        this.disallowedMethodCalls = "";
+        this.testNumber = testNumber;
+    }
+
+    public void init(GLAutoDrawable drawable) {
+        renderer = new TextRenderer(new Font("SansSerif", Font.BOLD, 36));
+        renderer.setUseVertexArrays(false);
+        Assert.assertNotNull(renderer);
+        Assert.assertFalse(renderer.getUseVertexArrays());
+        
+        text = "ABC123#+?";
+    	
+    	PrintStream nullStream = new PrintStream(new OutputStream(){ public void write(int b){}});
+    	drawable.setGL(new TextRendererTraceGL2Mock01(drawable.getGL().getGL2(), nullStream, this));
+    }
+
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+        GL2 gl = drawable.getGL().getGL2();
+        gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+        gl.glLoadIdentity();
+        glu.gluOrtho2D(0, 1, 0, 1);
+        gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+        gl.glLoadIdentity();
+    }
+
+    public void dispose(GLAutoDrawable drawable) {
+    	renderer.dispose();
+    }
+
+    public void display(GLAutoDrawable drawable) {
+        if (disallowedMethodCalls.equals("")) {
+        	if (testNumber == 1) {
+        		renderer.beginRendering(drawable.getWidth(), drawable.getHeight());
+                renderer.setColor(1.0f, 1.0f, 1.0f, 1.0f);
+                renderer.draw(text, 0, 0);
+                renderer.endRendering();
+        	}
+        	if (testNumber == 2) {
+        		renderer.begin3DRendering();
+        		renderer.setColor(1.0f, 1.0f, 1.0f, 1.0f);
+        		renderer.draw3D(text, 0, 0, 0, 0.002f);
+        		renderer.end3DRendering();
+        	}
+        }
+    }
+    
+    public void disallowedMethodCalled (String method) {
+    	if (!disallowedMethodCalls.equals("")) {
+    		disallowedMethodCalls += ", ";
+    	}
+    	disallowedMethodCalls += method;
+    }
+    
+    public String getDisallowedMethodCalls() {
+    	return this.disallowedMethodCalls;
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java
new file mode 100644
index 0000000..63258a5
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java
@@ -0,0 +1,137 @@
+/**
+ * Copyright 2011 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.awt.text;
+
+import java.io.PrintStream;
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+import javax.media.opengl.GL2;
+import javax.media.opengl.TraceGL2;
+
+import com.jogamp.common.nio.Buffers;
+
+/*
+ * Unit tests for Bug464
+ * Modified Version of TraceGL2 for unit test TestAWTTextRendererUseVertexArrayBug464. 
+ * This class overrides all glFunctions related to VBO's according to 
+ * http://code.google.com/p/glextensions/wiki/GL_ARB_vertex_buffer_object:
+ *   glBindBuffer (glBindBufferARB)
+ *   glDeleteBuffers (glDeleteBuffersARB)
+ *   glGenBuffers (glGenBuffersARB)
+ *   glIsBuffer (glIsBufferARB)
+ *   glBufferData (glBufferDataARB)
+ *   glBufferSubData (glBufferSubDataARB)
+ *   glGetBufferSubData (glGetBufferSubDataARB)
+ *   glMapBuffer (glMapBufferARB)
+ *   glUnmapBuffer (glUnmapBufferARB)
+ *   glGetBufferParameteriv (glGetBufferParameterivARB)
+ *   glGetBufferPointerv (glGetBufferPointervARB)
+ * Calls to the overridden methods are logged to the disallowedMethodCalls variable of
+ * the GLEventListener instead of being passed to the downstreamGL object.
+ * 
+ * Other classes related to this test:
+ *   TestAWTTextRendererUseVertexArrayBug464
+ *   TextRendererGLEventListener01
+ */
+
+public class TextRendererTraceGL2Mock01 extends TraceGL2 {
+	
+	TextRendererGLEventListener01 listener;
+
+	public TextRendererTraceGL2Mock01(GL2 downstreamGL2, PrintStream stream, TextRendererGLEventListener01 listener) {
+		super(downstreamGL2, stream);
+		this.listener = listener;
+	}	
+
+	@Override
+	public void glGetBufferSubData(int arg0, long arg1, long arg2, Buffer arg3) {
+		listener.disallowedMethodCalled("glGetBufferSubData");
+	}
+
+	@Override
+	public ByteBuffer glMapBuffer(int arg0, int arg1) {
+		listener.disallowedMethodCalled("glMapBuffer");
+		return Buffers.newDirectByteBuffer(0);
+	}
+
+	@Override
+	public void glGetBufferParameteriv(int arg0, int arg1, IntBuffer arg2) {
+		listener.disallowedMethodCalled("glGetBufferParameteriv");
+	}
+
+	@Override
+	public boolean glUnmapBuffer(int arg0) {
+		listener.disallowedMethodCalled("glUnmapBuffer");
+		return false;
+	}
+	
+	@Override
+	public void glGenBuffers(int arg0, IntBuffer arg1) {
+		listener.disallowedMethodCalled("glGenBuffers");
+	}
+
+	@Override
+	public void glGenBuffers(int arg0, int[] arg1, int arg2) {
+		listener.disallowedMethodCalled("glGenBuffers");
+	}
+
+	@Override
+	public boolean glIsBuffer(int arg0) {
+		listener.disallowedMethodCalled("glIsBuffer");
+		return false;
+	}
+
+	@Override
+	public void glBindBuffer(int arg0, int arg1) {
+		listener.disallowedMethodCalled("glBindBuffer");
+	}
+
+	@Override
+	public void glDeleteBuffers(int arg0, int[] arg1, int arg2) {
+		listener.disallowedMethodCalled("glDeleteBuffers");
+	}
+
+	@Override
+	public void glBufferSubData(int arg0, long arg1, long arg2, Buffer arg3) {
+		listener.disallowedMethodCalled("glBufferSubData");
+	}
+
+	@Override
+	public void glGetBufferParameteriv(int arg0, int arg1, int[] arg2, int arg3) {
+		listener.disallowedMethodCalled("glGetBufferParameteriv");
+	}
+
+	@Override
+	public void glBufferData(int arg0, long arg1, Buffer arg2, int arg3) {
+		listener.disallowedMethodCalled("glBufferData");
+	}
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java
new file mode 100644
index 0000000..c2182b8
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+package com.jogamp.opengl.test.junit.jogl.caps;
+
+import java.util.List;
+import javax.media.opengl.DefaultGLCapabilitiesChooser;
+import javax.media.opengl.GLCapabilitiesImmutable;
+
+class MultisampleChooser01 extends DefaultGLCapabilitiesChooser {
+
+    public int chooseCapabilities(GLCapabilitiesImmutable desired, List/*<GLCapabilitiesImmutable>*/ available, int windowSystemRecommendedChoice) {
+        boolean anyHaveSampleBuffers = false;
+        for (int i = 0; i < available.size(); i++) {
+            GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) available.get(i);
+            if ( caps.getSampleBuffers() ) {
+                anyHaveSampleBuffers = true;
+                break;
+            }
+        }
+        int selection = super.chooseCapabilities(desired, available, windowSystemRecommendedChoice);
+        if (!anyHaveSampleBuffers) {
+            System.err.println("WARNING: antialiasing will be disabled because none of the available pixel formats had it to offer");
+        } else {
+            GLCapabilitiesImmutable selected = (GLCapabilitiesImmutable) available.get(selection);
+            if (!selected.getSampleBuffers()) {
+                System.err.println("WARNING: antialiasing will be disabled because the DefaultGLCapabilitiesChooser didn't supply it");
+            }
+        }
+        return selection;
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleDemo01.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleDemo01.java
new file mode 100644
index 0000000..b41501a
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleDemo01.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.caps;
+
+import jogamp.opengl.x11.glx.GLX;
+import jogamp.opengl.x11.glx.X11GLXGraphicsConfiguration;
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES1;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLPipelineFactory;
+
+class MultisampleDemo01 implements GLEventListener {
+
+    static boolean glDebug = false;
+    static boolean glTrace = false;
+
+    boolean multisample;
+
+    public MultisampleDemo01(boolean multisample) {
+        this.multisample = multisample;
+    }
+
+    public void init(GLAutoDrawable drawable) {
+        AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+        System.err.println();
+        System.err.println("Info: " + config);
+        System.err.println();
+        if (NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(false))) {
+            X11GLXGraphicsConfiguration x11config = (X11GLXGraphicsConfiguration) config;
+            long display = drawable.getNativeSurface().getDisplayHandle();
+            int[] foo = new int[1];
+            GLX.glXGetFBConfigAttrib(display, x11config.getFBConfig(), GLX.GLX_SAMPLES, foo, 0);
+            System.out.println("GLX_SAMPLES " + foo[0]);
+            GLX.glXGetFBConfigAttrib(display, x11config.getFBConfig(), GLX.GLX_SAMPLE_BUFFERS, foo, 0);
+            System.out.println("GLX_SAMPLE_BUFFERS " + foo[0]);
+        }
+        GL _gl = drawable.getGL();
+        if (glDebug) {
+            try {
+                // Debug ..
+                _gl = _gl.getContext().setGL(GLPipelineFactory.create("javax.media.opengl.Debug", GL2.class, _gl, null));
+                if (glTrace) {
+                    // Trace ..
+                    _gl = _gl.getContext().setGL(GLPipelineFactory.create("javax.media.opengl.Trace", GL2.class, _gl, new Object[]{System.err}));
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        GL2 gl = _gl.getGL2();
+        if (multisample) {
+            gl.glEnable(GL.GL_MULTISAMPLE);
+        }
+        gl.glClearColor(0, 0, 0, 0);
+        //      gl.glEnable(GL.GL_DEPTH_TEST);
+        //      gl.glDepthFunc(GL.GL_LESS);
+        gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+        gl.glLoadIdentity();
+        gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+        gl.glLoadIdentity();
+        gl.glOrtho(-1, 1, -1, 1, -1, 1);
+        if (multisample) {
+            gl.glDisable(GL.GL_MULTISAMPLE);
+        }
+    }
+
+    public void dispose(GLAutoDrawable drawable) {
+    }
+
+    public void display(GLAutoDrawable drawable) {
+        GL2 gl = drawable.getGL().getGL2();
+        if (multisample) {
+            gl.glEnable(GL.GL_MULTISAMPLE);
+        }
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+        int numSteps = 20;
+        double increment = Math.PI / numSteps;
+        double radius = 1;
+        gl.glBegin(GL.GL_LINES);
+        for (int i = numSteps - 1; i >= 0; i--) {
+            gl.glVertex3d(radius * Math.cos(i * increment), radius * Math.sin(i * increment), 0);
+            gl.glVertex3d(-1.0 * radius * Math.cos(i * increment), -1.0 * radius * Math.sin(i * increment), 0);
+        }
+        gl.glEnd();
+        if (multisample) {
+            gl.glDisable(GL.GL_MULTISAMPLE);
+        }
+    }
+
+    // Unused routines
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    }
+
+    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleAWT.java
new file mode 100755
index 0000000..786fd60
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleAWT.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.caps;
+
+import java.lang.reflect.InvocationTargetException;
+import java.awt.BorderLayout;
+import java.awt.Frame;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.awt.GLCanvas;
+
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+import org.junit.Test;
+
+
+public class TestMultisampleAWT extends UITestCase {
+  static long durationPerTest = 250; // ms
+  private GLCanvas canvas;
+
+  public static void main(String[] args) {
+     for(int i=0; i<args.length; i++) {
+        if(args[i].equals("-time")) {
+            durationPerTest = MiscUtils.atoi(args[++i], 500);
+        }
+     }
+     System.out.println("durationPerTest: "+durationPerTest);
+     String tstname = TestMultisampleAWT.class.getName();
+     org.junit.runner.JUnitCore.main(tstname);
+  }
+
+  @Test
+  public void testMultiSampleAA4() throws InterruptedException, InvocationTargetException {
+    testMultiSampleAAImpl(4);
+  }
+
+  @Test
+  public void testMultiSampleNone() throws InterruptedException, InvocationTargetException {
+    testMultiSampleAAImpl(0);
+  }
+
+  private void testMultiSampleAAImpl(int samples) throws InterruptedException, InvocationTargetException {
+    GLCapabilities caps = new GLCapabilities(null);
+    GLCapabilitiesChooser chooser = new MultisampleChooser01();
+
+    if(samples>0) {
+        caps.setSampleBuffers(true);
+        caps.setNumSamples(samples);
+        // turns out we need to have alpha, 
+        // otherwise no AA will be visible.
+        caps.setAlphaBits(1); 
+    }
+
+    canvas = new GLCanvas(caps, chooser, null, null);
+    canvas.addGLEventListener(new MultisampleDemo01(samples>0?true:false));
+    
+    final Frame frame = new Frame("Multi Samples "+samples);
+    frame.setLayout(new BorderLayout());
+    canvas.setSize(512, 512);
+    frame.add(canvas, BorderLayout.CENTER);
+    frame.pack();
+
+    javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+        public void run() {
+            frame.setVisible(true);
+            frame.setLocation(0, 0);
+            canvas.requestFocus();
+            canvas.display();
+        }});
+
+    Thread.sleep(durationPerTest);
+
+    javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+        public void run() {
+            frame.setVisible(false);
+            frame.remove(canvas);
+            frame.dispose();
+        }});
+
+  }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleNEWT.java
new file mode 100755
index 0000000..8285a66
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleNEWT.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * - Redistribution of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * 
+ * - Redistribution in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * 
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ * 
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.caps;
+
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import javax.media.opengl.*;
+import org.junit.Test;
+
+public class TestMultisampleNEWT {
+  static long durationPerTest = 500; // ms
+  private GLWindow window;
+
+  public static void main(String[] args) {
+     for(int i=0; i<args.length; i++) {
+        if(args[i].equals("-time")) {
+            durationPerTest = MiscUtils.atoi(args[++i], 500);
+        }
+     }
+     System.out.println("durationPerTest: "+durationPerTest);
+     String tstname = TestMultisampleNEWT.class.getName();
+     org.junit.runner.JUnitCore.main(tstname);
+  }
+
+  @Test
+  public void testMultiSampleAA4() throws InterruptedException {
+    testMultiSampleAAImpl(4);
+  }
+
+  // @Test
+  public void testMultiSampleNone() throws InterruptedException {
+    testMultiSampleAAImpl(0);
+  }
+
+  private void testMultiSampleAAImpl(int samples) throws InterruptedException {
+    GLCapabilities caps = new GLCapabilities(null);
+    GLCapabilitiesChooser chooser = new MultisampleChooser01();
+
+    if(samples>0) {
+        caps.setSampleBuffers(true);
+        caps.setNumSamples(4);
+    }
+    // turns out we need to have alpha, 
+    // otherwise no AA will be visible.
+    caps.setAlphaBits(1); 
+
+    window = GLWindow.create(caps);
+    window.setCapabilitiesChooser(chooser);
+    window.addGLEventListener(new MultisampleDemo01(samples>0?true:false));
+    window.setSize(512, 512);
+    window.setVisible(true);
+    window.setPosition(0, 0);
+    window.requestFocus();
+
+    GLCapabilitiesImmutable capsChosen0 = window.getChosenGLCapabilities();
+
+    Thread.sleep(durationPerTest);
+
+    window.destroy();
+  }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquare.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquare.java
new file mode 100644
index 0000000..eaf697a
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquare.java
@@ -0,0 +1,169 @@
+package com.jogamp.opengl.test.junit.jogl.demos.es1;
+
+import com.jogamp.common.nio.Buffers;
+import java.nio.*;
+import java.util.*;
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import javax.media.nativewindow.*;
+
+import com.jogamp.opengl.util.*;
+import com.jogamp.opengl.util.glsl.fixedfunc.*;
+
+public class RedSquare implements GLEventListener {
+
+    public static boolean glDebugEmu = false;
+    public static boolean glDebug = false ;
+    public static boolean glTrace = false ;
+    public static boolean oneThread = false;
+    public static boolean useAnimator = false;
+    public static int swapInterval = -1;
+
+    boolean debug = false;
+    long startTime = 0;
+    long curTime = 0;
+
+    GLU glu = null;
+
+    public RedSquare() {
+        this(false);
+    }
+
+    public RedSquare(boolean debug) {
+        this.debug = debug;
+    }
+
+    // FIXME: we must add storage of the pointers in the GL state to
+    // the GLImpl classes. The need for this can be seen by making
+    // these variables method local instead of instance members. The
+    // square will disappear after a second or so due to garbage
+    // collection. On desktop OpenGL this implies a stack of
+    // references due to the existence of glPush/PopClientAttrib. On
+    // OpenGL ES 1/2 it can simply be one set of references.
+    private FloatBuffer colors;
+    private FloatBuffer vertices;
+
+    public void init(GLAutoDrawable drawable) {
+        System.out.println("RedSquare: Init");
+        GL _gl = drawable.getGL();
+
+        if(glDebugEmu) {
+            try {
+                // Debug ..
+                _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES2.class, _gl, null) );
+
+                if(glTrace) {
+                    // Trace ..
+                    _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES2.class, _gl, new Object[] { System.err } ) );
+                }
+            } catch (Exception e) {e.printStackTrace();} 
+            glDebug = false;
+            glTrace = false;
+        }
+
+        GL2ES1 gl = FixedFuncUtil.getFixedFuncImpl(_gl);
+        if(swapInterval>=0) {
+            gl.setSwapInterval(swapInterval);
+        }
+
+        if(glDebug) {
+            try {
+                // Debug ..
+                gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES1.class, gl, null) );
+            } catch (Exception e) {e.printStackTrace();} 
+        }
+
+        if(glTrace) {
+            try {
+                // Trace ..
+                gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES1.class, gl, new Object[] { System.err } ) );
+            } catch (Exception e) {e.printStackTrace();}
+        }
+
+        glu = GLU.createGLU(gl);
+
+        if(debug) {
+            System.err.println(Thread.currentThread()+" Entering initialization");
+            System.err.println(Thread.currentThread()+" GL Profile: "+gl.getGLProfile());
+            System.err.println(Thread.currentThread()+" GL:" + gl);
+            System.err.println(Thread.currentThread()+" GL_VERSION=" + gl.glGetString(gl.GL_VERSION));
+            System.err.println(Thread.currentThread()+" GL_EXTENSIONS:");
+            System.err.println(Thread.currentThread()+"   " + gl.glGetString(gl.GL_EXTENSIONS));
+            System.err.println(Thread.currentThread()+" swapInterval: " + swapInterval + " (GL: "+gl.getSwapInterval()+")");
+            System.err.println(Thread.currentThread()+" GLU: " + glu);
+        }
+
+        // Allocate vertex arrays
+        colors   = Buffers.newDirectFloatBuffer(16);
+        vertices = Buffers.newDirectFloatBuffer(12);
+        // Fill them up
+        colors.put( 0, 1);    colors.put( 1, 0);     colors.put( 2, 0);    colors.put( 3, 1);
+        colors.put( 4, 0);    colors.put( 5, 0);     colors.put( 6, 1);    colors.put( 7, 1);
+        colors.put( 8, 1);    colors.put( 9, 0);     colors.put(10, 0);    colors.put(11, 1);
+        colors.put(12, 1);    colors.put(13, 0);     colors.put(14, 0);    colors.put(15, 1);
+        vertices.put(0, -2);  vertices.put( 1,  2);  vertices.put( 2,  0);
+        vertices.put(3,  2);  vertices.put( 4,  2);  vertices.put( 5,  0);
+        vertices.put(6, -2);  vertices.put( 7, -2);  vertices.put( 8,  0);
+        vertices.put(9,  2);  vertices.put(10, -2);  vertices.put(11,  0);
+
+        gl.glEnableClientState(gl.GL_VERTEX_ARRAY);
+        gl.glEnableClientState(gl.GL_COLOR_ARRAY);
+        gl.glVertexPointer(3, GL.GL_FLOAT, 0, vertices);
+        gl.glColorPointer(4, GL.GL_FLOAT, 0, colors);
+
+        // OpenGL Render Settings
+        gl.glClearColor(0, 0, 0, 1);
+        gl.glEnable(GL.GL_DEPTH_TEST);
+
+        startTime = System.currentTimeMillis();
+        curTime = startTime;
+    }
+
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+        System.out.println("RedSquare: Reshape");
+        GL2ES1 gl = drawable.getGL().getGL2ES1();
+        // Set location in front of camera
+        gl.glMatrixMode(gl.GL_PROJECTION);
+        gl.glLoadIdentity();
+        glu.gluPerspective(45.0f, (float)width / (float)height, 1.0f, 100.0f);
+        //gl.glOrthof(-4.0f, 4.0f, -4.0f, 4.0f, 1.0f, 100.0f);
+        //glu.gluLookAt(0, 0, -20, 0, 0, 0, 0, 1, 0);
+    }
+
+    public void display(GLAutoDrawable drawable) {
+        curTime = System.currentTimeMillis();
+        GL2ES1 gl = drawable.getGL().getGL2ES1();
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+
+        // One rotation every four seconds
+        gl.glMatrixMode(gl.GL_MODELVIEW);
+        gl.glLoadIdentity();
+        gl.glTranslatef(0, 0, -10);
+        float ang = ((float) (curTime - startTime) * 360.0f) / 4000.0f;
+        gl.glRotatef(ang, 0, 0, 1);
+        gl.glRotatef(ang, 0, 1, 0);
+
+
+        // Draw a square
+        gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
+    }
+
+    public void dispose(GLAutoDrawable drawable) {
+        System.out.println("RedSquare: Dispose");
+        GL2ES1 gl = drawable.getGL().getGL2ES1();
+        if(debug) {
+            System.out.println(Thread.currentThread()+" RedSquare.dispose: "+gl.getContext());
+        }
+        gl.glDisableClientState(gl.GL_VERTEX_ARRAY);
+        gl.glDisableClientState(gl.GL_COLOR_ARRAY);
+        glu.destroy();
+        glu = null;
+        colors.clear();
+        colors   = null;
+        vertices.clear();
+        vertices = null;
+        if(debug) {
+            System.out.println(Thread.currentThread()+" RedSquare.dispose: FIN");
+        }
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquare0.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquare0.java
new file mode 100644
index 0000000..f062a73
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquare0.java
@@ -0,0 +1,198 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.jogl.demos.es2;
+
+import com.jogamp.common.nio.Buffers;
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.GLArrayDataWrapper;
+import com.jogamp.opengl.util.PMVMatrix;
+import com.jogamp.opengl.test.junit.jogl.demos.es2.shader.RedSquareShader;
+import com.jogamp.opengl.test.junit.util.GLSLSimpleProgram;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.nio.FloatBuffer;
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLUniformData;
+import org.junit.Assert;
+
+public class RedSquare0 implements GLEventListener {
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    PrintStream pbaos = new PrintStream(baos);
+    GLSLSimpleProgram myShader;
+    PMVMatrix pmvMatrix;
+    int mgl_PMVMatrix;
+    GLUniformData pmvMatrixUniform;
+    int mgl_Vertex;
+    int mgl_Color;
+    long t0;
+
+    public void init(GLAutoDrawable glad) {
+        GLContext context = glad.getContext();
+        context.makeCurrent();
+        GL2ES2 gl = context.getGL().getGL2ES2();
+        myShader = GLSLSimpleProgram.create(gl, RedSquareShader.VERTEX_SHADER_TEXT, RedSquareShader.FRAGMENT_SHADER_TEXT, true);
+        gl.glUseProgram(myShader.getShaderProgram());
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        // setup mgl_PMVMatrix
+        pmvMatrix = new PMVMatrix();
+        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glLoadIdentity();
+        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glLoadIdentity();
+        mgl_PMVMatrix = gl.glGetUniformLocation(myShader.getShaderProgram(), "mgl_PMVMatrix");
+        Assert.assertTrue(0 <= mgl_PMVMatrix);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
+        pmvMatrixUniform.setLocation(mgl_PMVMatrix);
+        gl.glUniform(pmvMatrixUniform);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        // Allocate Vertex Array
+        int components = 3;
+        int numElements = 4;
+        mgl_Vertex = gl.glGetAttribLocation(myShader.getShaderProgram(), "mgl_Vertex");
+        Assert.assertTrue(0 <= mgl_Vertex);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        FloatBuffer buffer = Buffers.newDirectFloatBuffer(numElements * components);
+        GLArrayDataWrapper vertices = GLArrayDataWrapper.createGLSL(gl, "mgl_Vertex", 3, gl.GL_FLOAT, false, 0, buffer, -1, 0);
+        {
+            // Fill them up
+            FloatBuffer verticeb = (FloatBuffer) vertices.getBuffer();
+            verticeb.put(-2);
+            verticeb.put(2);
+            verticeb.put(0);
+            verticeb.put(2);
+            verticeb.put(2);
+            verticeb.put(0);
+            verticeb.put(-2);
+            verticeb.put(-2);
+            verticeb.put(0);
+            verticeb.put(2);
+            verticeb.put(-2);
+            verticeb.put(0);
+        }
+        buffer.flip();
+        vertices.setLocation(mgl_Vertex);
+        gl.glEnableVertexAttribArray(mgl_Vertex);
+        gl.glVertexAttribPointer(vertices);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        // Allocate Color Array
+        components = 4;
+        numElements = 4;
+        mgl_Color = gl.glGetAttribLocation(myShader.getShaderProgram(), "mgl_Color");
+        Assert.assertTrue(0 <= mgl_Color);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        buffer = Buffers.newDirectFloatBuffer(numElements * components);
+        GLArrayDataWrapper colors = GLArrayDataWrapper.createGLSL(gl, "mgl_Color", 4, gl.GL_FLOAT, false, 0, buffer, -1, 0);
+        {
+            // Fill them up
+            FloatBuffer colorb = (FloatBuffer) colors.getBuffer();
+            colorb.put(1);
+            colorb.put(0);
+            colorb.put(0);
+            colorb.put(1);
+            colorb.put(0);
+            colorb.put(0);
+            colorb.put(1);
+            colorb.put(1);
+            colorb.put(1);
+            colorb.put(0);
+            colorb.put(0);
+            colorb.put(1);
+            colorb.put(1);
+            colorb.put(0);
+            colorb.put(0);
+            colorb.put(1);
+        }
+        buffer.flip();
+        colors.setLocation(mgl_Color);
+        gl.glEnableVertexAttribArray(mgl_Color);
+        gl.glVertexAttribPointer(colors);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        // OpenGL Render Settings
+        gl.glClearColor(0, 0, 0, 1);
+        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+        gl.glUseProgram(0);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
+        t0 = System.currentTimeMillis();
+    }
+
+    public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+        GL2ES2 gl = glad.getGL().getGL2ES2();
+        gl.glUseProgram(myShader.getShaderProgram());
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        // Set location in front of camera
+        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glLoadIdentity();
+        pmvMatrix.gluPerspective(45.0F, (float) width / (float) height, 1.0F, 100.0F);
+        //pmvMatrix.glOrthof(-4.0f, 4.0f, -4.0f, 4.0f, 1.0f, 100.0f);
+        gl.glUniform(pmvMatrixUniform);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        gl.glUseProgram(0);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+    }
+
+    public void display(GLAutoDrawable glad) {
+        long t1 = System.currentTimeMillis();
+
+        GL2ES2 gl = glad.getGL().getGL2ES2();
+        gl.glUseProgram(myShader.getShaderProgram());
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        // One rotation every four seconds
+        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glLoadIdentity();
+        pmvMatrix.glTranslatef(0, 0, -10);
+        float ang = ((float) (t1 - t0) * 360.0F) / 4000.0F;
+        pmvMatrix.glRotatef(ang, 0, 0, 1);
+        pmvMatrix.glRotatef(ang, 0, 1, 0);
+        gl.glUniform(pmvMatrixUniform);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        // Draw a square
+        gl.glDrawArrays(gl.GL_TRIANGLE_STRIP, 0, 4);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        gl.glUseProgram(0);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+    }
+
+    public void dispose(GLAutoDrawable glad) {
+        GL2ES2 gl = glad.getGL().getGL2ES2();
+        gl.glDisableVertexAttribArray(mgl_Vertex);
+        gl.glDisableVertexAttribArray(mgl_Color);
+        myShader.release(gl);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        pmvMatrix.destroy();
+        pmvMatrix = null;
+        System.err.println("dispose done");
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java
new file mode 100644
index 0000000..3ef62df
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.demos.es2.shader;
+
+public class RedSquareShader {
+    public static String VERTEX_SHADER_TEXT =
+                " #ifdef GL_ES\n" +
+                "  #define MEDIUMP mediump\n" +
+                "  #define HIGHP highp\n" +
+                "#else\n" +
+                "  #define MEDIUMP\n" +
+                "  #define HIGHP\n" +
+                "#endif\n" +
+                "\n" +
+                "uniform MEDIUMP mat4    mgl_PMVMatrix[2];\n" +
+                "attribute HIGHP vec4    mgl_Vertex;\n" +
+                "attribute HIGHP vec4    mgl_Color;\n" +
+                "varying   HIGHP vec4    frontColor;\n" +
+                "\n" +
+                "void main(void)\n" +
+                "{\n" +
+                "  frontColor=mgl_Color;\n" +
+                "  gl_Position = mgl_PMVMatrix[0] * mgl_PMVMatrix[1] * mgl_Vertex;\n" +
+                "}\n" ;
+
+    public static String FRAGMENT_SHADER_TEXT =
+                "#ifdef GL_ES\n" +
+                "  #define MEDIUMP mediump\n" +
+                "  #define HIGHP highp\n" +
+                "#else\n" +
+                "  #define MEDIUMP\n" +
+                "  #define HIGHP\n" +
+                "#endif\n" +
+                "\n" +
+                "varying   HIGHP vec4    frontColor;\n" +
+                "\n" +
+                "void main (void)\n" +
+                "{\n" +
+                "    gl_FragColor = frontColor;\n" +
+                "}\n" ;
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/Gears.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/Gears.java
new file mode 100644
index 0000000..0dcf6be
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/Gears.java
@@ -0,0 +1,371 @@
+
+package com.jogamp.opengl.test.junit.jogl.demos.gl2.gears;
+
+import javax.media.opengl.*;
+
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.event.awt.*;
+import com.jogamp.newt.Window;
+
+/**
+ * Gears.java <BR>
+ * author: Brian Paul (converted to Java by Ron Cemer and Sven Gothel) <P>
+ *
+ * This version is equal to Brian Paul's version 1.2 1999/10/21
+ */
+
+public class Gears implements GLEventListener {
+  private float view_rotx = 20.0f, view_roty = 30.0f, view_rotz = 0.0f;
+  private int gear1=0, gear2=0, gear3=0;
+  private float angle = 0.0f;
+  private int swapInterval;
+
+  private boolean mouseRButtonDown = false;
+  private int prevMouseX, prevMouseY;
+
+  public Gears(int swapInterval) {
+    this.swapInterval = swapInterval;
+  }
+
+  public Gears() {
+    this.swapInterval = 1;
+  }
+
+  public void setGears(int g1, int g2, int g3) {
+      gear1 = g1;
+      gear2 = g2;
+      gear3 = g3;
+  }
+
+  /**
+   * @return display list gear1
+   */
+  public int getGear1() { return gear1; }
+
+  /**
+   * @return display list gear2
+   */
+  public int getGear2() { return gear2; }
+
+  /**
+   * @return display list gear3
+   */
+  public int getGear3() { return gear3; }
+
+  public void init(GLAutoDrawable drawable) {
+    System.err.println("Gears: Init");
+    // Use debug pipeline
+    // drawable.setGL(new DebugGL(drawable.getGL()));
+
+    GL2 gl = drawable.getGL().getGL2();
+
+    float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f };
+    float red[] = { 0.8f, 0.1f, 0.0f, 0.7f };
+    float green[] = { 0.0f, 0.8f, 0.2f, 0.7f };
+    float blue[] = { 0.2f, 0.2f, 1.0f, 0.7f };
+
+    gl.glLightfv(GL2.GL_LIGHT0, GL2.GL_POSITION, pos, 0);
+    gl.glEnable(GL2.GL_CULL_FACE);
+    gl.glEnable(GL2.GL_LIGHTING);
+    gl.glEnable(GL2.GL_LIGHT0);
+    gl.glEnable(GL2.GL_DEPTH_TEST);
+            
+    /* make the gears */
+    if(0>=gear1) {
+        gear1 = gl.glGenLists(1);
+        gl.glNewList(gear1, GL2.GL_COMPILE);
+        gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, red, 0);
+        gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
+        gl.glEndList();
+        System.err.println("gear1 list created: "+gear1);
+    } else {
+        System.err.println("gear1 list reused: "+gear1);
+    }
+            
+    if(0>=gear2) {
+        gear2 = gl.glGenLists(1);
+        gl.glNewList(gear2, GL2.GL_COMPILE);
+        gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, green, 0);
+        gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f);
+        gl.glEndList();
+        System.err.println("gear2 list created: "+gear2);
+    } else {
+        System.err.println("gear2 list reused: "+gear2);
+    }
+            
+    if(0>=gear3) {
+        gear3 = gl.glGenLists(1);
+        gl.glNewList(gear3, GL2.GL_COMPILE);
+        gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, blue, 0);
+        gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f);
+        gl.glEndList();
+        System.err.println("gear3 list created: "+gear3);
+    } else {
+        System.err.println("gear3 list reused: "+gear3);
+    }
+            
+    gl.glEnable(GL2.GL_NORMALIZE);
+                
+    // MouseListener gearsMouse = new TraceMouseAdapter(new GearsMouseAdapter());
+    MouseListener gearsMouse = new GearsMouseAdapter();    
+    KeyListener gearsKeys = new GearsKeyAdapter();
+
+    if (drawable instanceof Window) {
+        Window window = (Window) drawable;
+        window.addMouseListener(gearsMouse);
+        window.addKeyListener(gearsKeys);
+    } else if (GLProfile.isAWTAvailable() && drawable instanceof java.awt.Component) {
+        java.awt.Component comp = (java.awt.Component) drawable;
+        new AWTMouseAdapter(gearsMouse).addTo(comp);
+        new AWTKeyAdapter(gearsKeys).addTo(comp);
+    }
+  }
+    
+  public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    System.err.println("Gears: Reshape "+x+"/"+y+" "+width+"x"+height);
+    GL2 gl = drawable.getGL().getGL2();
+
+    gl.setSwapInterval(swapInterval);
+
+    float h = (float)height / (float)width;
+            
+    gl.glMatrixMode(GL2.GL_PROJECTION);
+
+    gl.glLoadIdentity();
+    gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
+    gl.glMatrixMode(GL2.GL_MODELVIEW);
+    gl.glLoadIdentity();
+    gl.glTranslatef(0.0f, 0.0f, -40.0f);
+  }
+
+  public void dispose(GLAutoDrawable drawable) {
+    System.err.println("Gears: Dispose");
+    setGears(0, 0, 0);
+  }
+
+  public void display(GLAutoDrawable drawable) {
+    // Turn the gears' teeth
+    angle += 2.0f;
+
+    // Get the GL corresponding to the drawable we are animating
+    GL2 gl = drawable.getGL().getGL2();
+
+    gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+
+    // Special handling for the case where the GLJPanel is translucent
+    // and wants to be composited with other Java 2D content
+    if (GLProfile.isAWTAvailable() && 
+        (drawable instanceof javax.media.opengl.awt.GLJPanel) &&
+        !((javax.media.opengl.awt.GLJPanel) drawable).isOpaque() &&
+        ((javax.media.opengl.awt.GLJPanel) drawable).shouldPreserveColorBufferIfTranslucent()) {
+      gl.glClear(GL2.GL_DEPTH_BUFFER_BIT);
+    } else {
+      gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
+    }
+            
+    // Rotate the entire assembly of gears based on how the user
+    // dragged the mouse around
+    gl.glPushMatrix();
+    gl.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
+    gl.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
+    gl.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
+            
+    // Place the first gear and call its display list
+    gl.glPushMatrix();
+    gl.glTranslatef(-3.0f, -2.0f, 0.0f);
+    gl.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+    gl.glCallList(gear1);
+    gl.glPopMatrix();
+            
+    // Place the second gear and call its display list
+    gl.glPushMatrix();
+    gl.glTranslatef(3.1f, -2.0f, 0.0f);
+    gl.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
+    gl.glCallList(gear2);
+    gl.glPopMatrix();
+            
+    // Place the third gear and call its display list
+    gl.glPushMatrix();
+    gl.glTranslatef(-3.1f, 4.2f, 0.0f);
+    gl.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
+    gl.glCallList(gear3);
+    gl.glPopMatrix();
+            
+    // Remember that every push needs a pop; this one is paired with
+    // rotating the entire gear assembly
+    gl.glPopMatrix();
+  }
+
+  public static void gear(GL2 gl,
+                          float inner_radius,
+                          float outer_radius,
+                          float width,
+                          int teeth,
+                          float tooth_depth)
+  {
+    int i;
+    float r0, r1, r2;
+    float angle, da;
+    float u, v, len;
+
+    r0 = inner_radius;
+    r1 = outer_radius - tooth_depth / 2.0f;
+    r2 = outer_radius + tooth_depth / 2.0f;
+            
+    da = 2.0f * (float) Math.PI / teeth / 4.0f;
+            
+    gl.glShadeModel(GL2.GL_FLAT);
+
+    gl.glNormal3f(0.0f, 0.0f, 1.0f);
+
+    /* draw front face */
+    gl.glBegin(GL2.GL_QUAD_STRIP);
+    for (i = 0; i <= teeth; i++)
+      {
+        angle = i * 2.0f * (float) Math.PI / teeth;
+        gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
+        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
+        if(i < teeth)
+          {
+            gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
+            gl.glVertex3f(r1 * (float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f);
+          }
+      }
+    gl.glEnd();
+
+    /* draw front sides of teeth */
+    gl.glBegin(GL2.GL_QUADS);
+    for (i = 0; i < teeth; i++)
+      {
+        angle = i * 2.0f * (float) Math.PI / teeth;
+        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
+        gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f);
+        gl.glVertex3f(r2 * (float)Math.cos(angle + 2.0f * da), r2 * (float)Math.sin(angle + 2.0f * da), width * 0.5f);
+        gl.glVertex3f(r1 * (float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f);
+      }
+    gl.glEnd();
+    
+    /* draw back face */
+    gl.glBegin(GL2.GL_QUAD_STRIP);
+    for (i = 0; i <= teeth; i++)
+      {
+        angle = i * 2.0f * (float) Math.PI / teeth;
+        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
+        gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
+        gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
+        gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
+      }
+    gl.glEnd();
+    
+    /* draw back sides of teeth */
+    gl.glBegin(GL2.GL_QUADS);
+    for (i = 0; i < teeth; i++)
+      {
+        angle = i * 2.0f * (float) Math.PI / teeth;
+        gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
+        gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f);
+        gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f);
+        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
+      }
+    gl.glEnd();
+    
+    /* draw outward faces of teeth */
+    gl.glBegin(GL2.GL_QUAD_STRIP);
+    for (i = 0; i < teeth; i++)
+      {
+        angle = i * 2.0f * (float) Math.PI / teeth;
+        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f);
+        gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f);
+        u = r2 * (float)Math.cos(angle + da) - r1 * (float)Math.cos(angle);
+        v = r2 * (float)Math.sin(angle + da) - r1 * (float)Math.sin(angle);
+        len = (float)Math.sqrt(u * u + v * v);
+        u /= len;
+        v /= len;
+        gl.glNormal3f(v, -u, 0.0f);
+        gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f);
+        gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f);
+        gl.glNormal3f((float)Math.cos(angle), (float)Math.sin(angle), 0.0f);
+        gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), width * 0.5f);
+        gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f);
+        u = r1 * (float)Math.cos(angle + 3 * da) - r2 * (float)Math.cos(angle + 2 * da);
+        v = r1 * (float)Math.sin(angle + 3 * da) - r2 * (float)Math.sin(angle + 2 * da);
+        gl.glNormal3f(v, -u, 0.0f);
+        gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), width * 0.5f);
+        gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f);
+        gl.glNormal3f((float)Math.cos(angle), (float)Math.sin(angle), 0.0f);
+      }
+    gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), width * 0.5f);
+    gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), -width * 0.5f);
+    gl.glEnd();
+    
+    gl.glShadeModel(GL2.GL_SMOOTH);
+    
+    /* draw inside radius cylinder */
+    gl.glBegin(GL2.GL_QUAD_STRIP);
+    for (i = 0; i <= teeth; i++)
+      {
+        angle = i * 2.0f * (float) Math.PI / teeth;
+        gl.glNormal3f(-(float)Math.cos(angle), -(float)Math.sin(angle), 0.0f);
+        gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f);
+        gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f);
+      }
+    gl.glEnd();
+  }
+
+  class GearsKeyAdapter extends KeyAdapter {      
+    public void keyPressed(KeyEvent e) {
+        int kc = e.getKeyCode();
+        if(KeyEvent.VK_LEFT == kc) {
+            view_roty -= 1;
+        } else if(KeyEvent.VK_RIGHT == kc) {
+            view_roty += 1;
+        } else if(KeyEvent.VK_UP == kc) {
+            view_rotx -= 1;
+        } else if(KeyEvent.VK_DOWN == kc) {
+            view_rotx += 1;
+        }
+    }
+  }
+  
+  class GearsMouseAdapter extends MouseAdapter {
+      public void mousePressed(MouseEvent e) {
+        prevMouseX = e.getX();
+        prevMouseY = e.getY();
+        if ((e.getModifiers() & e.BUTTON3_MASK) != 0) {
+          mouseRButtonDown = true;
+        }
+      }
+        
+      public void mouseReleased(MouseEvent e) {
+        if ((e.getModifiers() & e.BUTTON3_MASK) != 0) {
+          mouseRButtonDown = false;
+        }
+      }
+        
+      public void mouseDragged(MouseEvent e) {
+        int x = e.getX();
+        int y = e.getY();
+        int width=0, height=0;
+        Object source = e.getSource();
+        if(source instanceof Window) {
+            Window window = (Window) source;
+            width=window.getWidth();
+            height=window.getHeight();
+        } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) {
+            java.awt.Component comp = (java.awt.Component) source;
+            width=comp.getWidth();
+            height=comp.getHeight();
+        } else {
+            throw new RuntimeException("Event source neither Window nor Component: "+source);
+        }
+        float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
+        float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
+        
+        prevMouseX = x;
+        prevMouseY = y;
+
+        view_rotx += thetaX;
+        view_roty += thetaY;
+      }
+  }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java
new file mode 100644
index 0000000..d04ce38
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java
@@ -0,0 +1,122 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.demos.gl2.gears;
+
+import javax.media.opengl.*;
+import com.jogamp.opengl.util.Animator;
+import javax.media.opengl.awt.GLCanvas;
+import com.jogamp.newt.event.awt.AWTKeyAdapter;
+import com.jogamp.newt.event.awt.AWTWindowAdapter;
+import com.jogamp.newt.event.TraceKeyAdapter;
+import com.jogamp.newt.event.TraceWindowAdapter;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.QuitAdapter;
+import java.awt.Frame;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+public class TestGearsAWT extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glp = GLProfile.getDefault();
+        Assert.assertNotNull(glp);
+        width  = 512;
+        height = 512;
+    }
+
+    @AfterClass
+    public static void releaseClass() {
+    }
+
+    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
+        Frame frame = new Frame("Gears AWT Test");
+        Assert.assertNotNull(frame);
+
+        GLCanvas glCanvas = new GLCanvas(caps);
+        Assert.assertNotNull(glCanvas);
+        frame.add(glCanvas);
+        frame.setSize(512, 512);
+
+        glCanvas.addGLEventListener(new Gears());
+
+        Animator animator = new Animator(glCanvas);
+        QuitAdapter quitAdapter = new QuitAdapter();
+
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glCanvas);
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+
+        frame.setVisible(true);
+        animator.start();
+
+        while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getDuration()<duration) {
+            Thread.sleep(100);
+        }
+
+        Assert.assertNotNull(frame);
+        Assert.assertNotNull(glCanvas);
+        Assert.assertNotNull(animator);
+
+        animator.stop();
+        Assert.assertEquals(false, animator.isAnimating());
+        frame.setVisible(false);
+        Assert.assertEquals(false, frame.isVisible());
+        frame.remove(glCanvas);
+        frame.dispose();
+        frame=null;
+        glCanvas=null;
+    }
+
+    @Test
+    public void test01() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        runTestGL(caps);
+    }
+
+    static long duration = 500; // ms
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                try {
+                    duration = Integer.parseInt(args[i]);
+                } catch (Exception ex) { ex.printStackTrace(); }
+            }
+        }
+        org.junit.runner.JUnitCore.main(TestGearsAWT.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java
new file mode 100644
index 0000000..40e2ae9
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWT.java
@@ -0,0 +1,130 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.demos.gl2.gears;
+
+import javax.media.opengl.*;
+import com.jogamp.opengl.util.FPSAnimator;
+import javax.media.opengl.awt.GLJPanel;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import java.awt.AWTException;
+import java.awt.BorderLayout;
+import java.lang.reflect.InvocationTargetException;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class TestGearsGLJPanelAWT extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(false);
+        glp = GLProfile.getDefault();
+        Assert.assertNotNull(glp);
+        width  = 512;
+        height = 512;
+    }
+
+    @AfterClass
+    public static void releaseClass() {
+    }
+
+    protected void runTestGL(GLCapabilities caps)
+            throws AWTException, InterruptedException, InvocationTargetException
+    {
+        JFrame frame = new JFrame("Swing GLJPanel");
+        Assert.assertNotNull(frame);
+
+        GLJPanel glJPanel = new GLJPanel(caps);
+        Assert.assertNotNull(glJPanel);
+        glJPanel.addGLEventListener(new Gears());
+
+        FPSAnimator animator = new FPSAnimator(glJPanel, 60);
+
+        final JFrame _frame = frame;
+        final GLJPanel _glJPanel = glJPanel;
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    _frame.getContentPane().add(_glJPanel, BorderLayout.CENTER);
+                    _frame.setSize(512, 512);
+                    _frame.setVisible(true);
+                } } ) ;
+
+        animator.start();
+        Assert.assertEquals(true, animator.isAnimating());
+
+        while(animator.isAnimating() && animator.getDuration()<duration) {
+            Thread.sleep(100);
+        }
+
+        Assert.assertNotNull(frame);
+        Assert.assertNotNull(glJPanel);
+        Assert.assertNotNull(animator);
+
+        animator.stop();
+        Assert.assertEquals(false, animator.isAnimating());
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    _frame.setVisible(false);
+                    _frame.getContentPane().remove(_glJPanel);
+                    _frame.remove(_glJPanel);
+                    _glJPanel.destroy();
+                    _frame.dispose();
+                } } );
+    }
+
+    @Test
+    public void test01()
+            throws AWTException, InterruptedException, InvocationTargetException
+    {
+        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        runTestGL(caps);
+    }
+
+    static long duration = 500; // ms
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                try {
+                    duration = Integer.parseInt(args[i]);
+                } catch (Exception ex) { ex.printStackTrace(); }
+            }
+        }
+        org.junit.runner.JUnitCore.main(TestGearsGLJPanelAWT.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWTBug450.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWTBug450.java
new file mode 100644
index 0000000..cd26825
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/TestGearsGLJPanelAWTBug450.java
@@ -0,0 +1,163 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ package com.jogamp.opengl.test.junit.jogl.demos.gl2.gears;
+
+import javax.media.opengl.*;
+
+import com.jogamp.opengl.util.FPSAnimator;
+
+import javax.media.opengl.awt.GLJPanel;
+import javax.media.opengl.glu.gl2.GLUgl2;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import java.awt.AWTException;
+import java.awt.BorderLayout;
+import java.lang.reflect.InvocationTargetException;
+import java.nio.ByteBuffer;
+
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+/**
+ * Test for bug 450, which causes the right part of the frame to be black
+ * for all x >= height.
+ * 
+ * Draws the Gears demo in a window that's twice as wide than it is tall,
+ * and checks to see if a particular pixel in the right half of the frame
+ * is colored.
+ *
+ * @author Wade Walker (adapted from TestGearsGLJPanelAWT)
+ */
+public class TestGearsGLJPanelAWTBug450 extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+    /** Set this if test fails. Needed because we can't throw an exception
+     * all the way up the stack from where we test the pixel. */
+    static boolean failed;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(false);
+        glp = GLProfile.getDefault();
+        Assert.assertNotNull(glp);
+        width  = 512;
+        height = 256;
+    }
+
+    @AfterClass
+    public static void releaseClass() {
+    }
+
+    protected void runTestGL(GLCapabilities caps)
+            throws AWTException, InterruptedException, InvocationTargetException
+    {
+        JFrame frame = new JFrame("Swing GLJPanel");
+        Assert.assertNotNull(frame);
+
+        GLJPanel glJPanel = new GLJPanel(caps);
+        Assert.assertNotNull(glJPanel);
+        glJPanel.addGLEventListener(new Gears() {
+        	@Override
+        	public void display(GLAutoDrawable drawable) {
+        		super.display(drawable);
+        		// look at one pixel at the bottom of the frame, just right of
+        		// the center line, and make sure it's not black
+        	    GL2 gl = GLUgl2.getCurrentGL2();
+        	    ByteBuffer bytebuffer = ByteBuffer.allocateDirect( 3 );
+        	    gl.glReadPixels( 260, 10, 1, 1, GL2.GL_BGR, GL2.GL_UNSIGNED_BYTE, bytebuffer );
+        	    byte byte0 = bytebuffer.get( 0 );
+        	    byte byte1 = bytebuffer.get( 1 );
+        	    byte byte2 = bytebuffer.get( 2 );
+        	    if( (byte0 == 0) && (byte1 == 0) && (byte2 == 0) )
+        	    	failed = true;
+        	}
+        });
+
+        FPSAnimator animator = new FPSAnimator(glJPanel, 60);
+
+        final JFrame _frame = frame;
+        final GLJPanel _glJPanel = glJPanel;
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    _frame.getContentPane().add(_glJPanel, BorderLayout.CENTER);
+                    _frame.setSize(width, height);
+                    _frame.setVisible(true);
+                } } ) ;
+
+        animator.start();
+        Assert.assertEquals(true, animator.isAnimating());
+
+        while(animator.isAnimating() && animator.getDuration()<duration) {
+            Thread.sleep(100);
+        }
+
+        Assert.assertNotNull(frame);
+        Assert.assertNotNull(glJPanel);
+        Assert.assertNotNull(animator);
+
+        animator.stop();
+        Assert.assertEquals(false, animator.isAnimating());
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+            		_frame.setVisible(false);
+                    _frame.getContentPane().remove(_glJPanel);
+                    _frame.remove(_glJPanel);
+                    _glJPanel.destroy();
+                    _frame.dispose();
+                } } );
+
+        Assert.assertFalse( failed );
+    }
+
+    @Test
+    public void test01()
+            throws AWTException, InterruptedException, InvocationTargetException
+    {
+        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        runTestGL(caps);
+    }
+
+    static long duration = 500; // ms
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                try {
+                    duration = Integer.parseInt(args[i]);
+                } catch (Exception ex) { ex.printStackTrace(); }
+            }
+        }
+        org.junit.runner.JUnitCore.main(TestGearsGLJPanelAWTBug450.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/newt/TestGearsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/newt/TestGearsNEWT.java
new file mode 100644
index 0000000..0f7d77f
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/newt/TestGearsNEWT.java
@@ -0,0 +1,130 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.newt;
+
+import com.jogamp.newt.event.KeyAdapter;
+import com.jogamp.newt.event.KeyEvent;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.QuitAdapter;
+
+import com.jogamp.opengl.util.Animator;
+
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLRunnable;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+public class TestGearsNEWT extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glp = GLProfile.getDefault();
+        Assert.assertNotNull(glp);
+        width  = 512;
+        height = 512;
+    }
+
+    @AfterClass
+    public static void releaseClass() {
+    }
+
+    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
+        GLWindow glWindow = GLWindow.create(caps);
+        Assert.assertNotNull(glWindow);
+        glWindow.setTitle("Gears NEWT Test");
+
+        glWindow.addGLEventListener(new Gears());
+
+        Animator animator = new Animator(glWindow);
+        QuitAdapter quitAdapter = new QuitAdapter();
+
+        //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
+        //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
+        glWindow.addKeyListener(quitAdapter);
+        glWindow.addWindowListener(quitAdapter);
+
+        final GLWindow f_glWindow = glWindow;
+        glWindow.addKeyListener(new KeyAdapter() {
+            public void keyTyped(KeyEvent e) {
+                if(e.getKeyChar()=='f') {
+                    new Thread() {
+                        public void run() {
+                            f_glWindow.setFullscreen(!f_glWindow.isFullscreen());
+                    } }.start();
+                } else if(e.getKeyChar()=='d') {
+                    new Thread() {
+                        public void run() {
+                            f_glWindow.setUndecorated(!f_glWindow.isUndecorated());
+                    } }.start();
+                }
+            }
+        });
+
+        glWindow.setSize(width, height);
+        glWindow.setVisible(true);
+        animator.start();
+
+        while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getDuration()<duration) {
+            Thread.sleep(100);
+        }
+
+        animator.stop();
+        glWindow.invalidate();
+    }
+
+    @Test
+    public void test01() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        runTestGL(caps);
+    }
+
+    static long duration = 500; // ms
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                try {
+                    duration = Integer.parseInt(args[i]);
+                } catch (Exception ex) { ex.printStackTrace(); }
+            }
+        }
+        org.junit.runner.JUnitCore.main(TestGearsNEWT.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/newt/TestGearsNewtAWTWrapper.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/newt/TestGearsNewtAWTWrapper.java
new file mode 100644
index 0000000..f05c20c
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/gears/newt/TestGearsNewtAWTWrapper.java
@@ -0,0 +1,112 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.newt;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.jogamp.opengl.util.Animator;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.QuitAdapter;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+public class TestGearsNewtAWTWrapper extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glp = GLProfile.getDefault();
+        Assert.assertNotNull(glp);
+        width  = 512;
+        height = 512;
+    }
+
+    @AfterClass
+    public static void releaseClass() {
+    }
+
+    protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException {
+        Display nDisplay = NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null, false); // local display
+        Screen nScreen  = NewtFactory.createScreen(nDisplay, 0); // screen 0
+        Window nWindow = NewtFactory.createWindow(nScreen, caps);
+
+        GLWindow glWindow = GLWindow.create(nWindow);
+        Assert.assertNotNull(glWindow);
+        glWindow.setTitle("Gears NewtAWTWrapper Test");
+
+        glWindow.addGLEventListener(new Gears());
+
+        Animator animator = new Animator(glWindow);
+        QuitAdapter quitAdapter = new QuitAdapter();
+
+        glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
+        glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
+
+        glWindow.setSize(width, height);
+        glWindow.setVisible(true);
+        animator.start();
+
+        while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getDuration()<duration) {
+            Thread.sleep(100);
+        }
+
+        animator.stop();
+        glWindow.invalidate();
+    }
+
+    @Test
+    public void test01() throws InterruptedException {
+        GLCapabilitiesImmutable caps = new GLCapabilities(GLProfile.getDefault());
+        runTestGL(caps);
+    }
+
+    static long duration = 500; // ms
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                try {
+                    duration = Integer.parseInt(args[i]);
+                } catch (Exception ex) { ex.printStackTrace(); }
+            }
+        }
+        org.junit.runner.JUnitCore.main(TestGearsNewtAWTWrapper.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/drawable/TestDrawable01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/drawable/TestDrawable01NEWT.java
new file mode 100644
index 0000000..8897dc6
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/drawable/TestDrawable01NEWT.java
@@ -0,0 +1,184 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.drawable;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import javax.media.opengl.*;
+
+import com.jogamp.newt.*;
+import java.io.IOException;
+
+public class TestDrawable01NEWT extends UITestCase {
+    static GLProfile glp;
+    static GLDrawableFactory factory;
+    static int width, height;
+    GLCapabilities caps;
+    Window window;
+    GLDrawable drawable;
+    GLContext context;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glp = GLProfile.getDefault();
+        Assert.assertNotNull(glp);
+        factory = GLDrawableFactory.getFactory(glp);
+        Assert.assertNotNull(factory);
+        width  = 640;
+        height = 480;
+    }
+
+    @AfterClass
+    public static void releaseClass() {
+        Assert.assertNotNull(factory);
+        factory=null;
+    }
+
+    @Before
+    public void initTest() {
+        caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+    }
+
+    void createWindow(boolean onscreen, boolean pbuffer, boolean undecorated) {
+        caps.setOnscreen(onscreen);
+        caps.setPBuffer(!onscreen && pbuffer);
+        caps.setDoubleBuffered(onscreen);
+        // System.out.println("Requested: "+caps);
+
+        //
+        // Create native windowing resources .. X11/Win/OSX
+        // 
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+
+        window = NewtFactory.createWindow(screen, caps);
+        Assert.assertNotNull(window);
+        window.setUndecorated(onscreen && undecorated);
+        window.setSize(width, height);
+        window.setVisible(true);
+        // System.out.println("Created: "+window);
+
+        //
+        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // equivalent to GLAutoDrawable methods: setVisible(true)
+        // 
+        GLCapabilities glCaps = (GLCapabilities) window.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+        Assert.assertNotNull(glCaps);
+        Assert.assertTrue(glCaps.getGreenBits()>5);
+        Assert.assertTrue(glCaps.getBlueBits()>5);
+        Assert.assertTrue(glCaps.getRedBits()>5);
+        Assert.assertEquals(glCaps.isOnscreen(),onscreen);
+        Assert.assertTrue(onscreen || !pbuffer || glCaps.isPBuffer()); // pass if onscreen, or !pbuffer req. or have pbuffer
+        Assert.assertEquals(glCaps.getDoubleBuffered(),onscreen);
+        Assert.assertTrue(glCaps.getDepthBits()>4);
+
+        drawable = factory.createGLDrawable(window);
+        Assert.assertNotNull(drawable);
+        // System.out.println("Pre: "+drawable);
+        //
+        drawable.setRealized(true);
+        // Assert.assertEquals(width,drawable.getWidth());
+        // Assert.assertEquals(height,drawable.getHeight());
+        // Assert.assertEquals(glCaps,drawable.getChosenGLCapabilities());
+        Assert.assertEquals(window,drawable.getNativeSurface());
+        // System.out.println("Post: "+drawable);
+
+        context = drawable.createContext(null);
+        Assert.assertNotNull(context);
+        // System.out.println(context);
+        
+        int res = context.makeCurrent();
+        Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
+
+        // draw something ..
+
+        drawable.swapBuffers();
+        context.release();
+
+        // System.out.println("Final: "+window);
+    }
+
+    void destroyWindow() {
+        // GLWindow.dispose(..) sequence
+        Assert.assertNotNull(context);
+        context.destroy();
+
+        Assert.assertNotNull(drawable);
+        drawable.setRealized(false);
+
+        // GLWindow.destroy(..) sequence cont..
+        Assert.assertNotNull(window);
+        window.invalidate();
+
+        drawable = null;
+        context = null;
+        window = null;
+    }
+
+    @Test
+    public void testOnScreenDecorated() throws InterruptedException {
+        createWindow(true, false, false);
+        Thread.sleep(1000); // 1000 ms
+        destroyWindow();
+    }
+
+    @Test
+    public void testOnScreenUndecorated() throws InterruptedException {
+        createWindow(true, false, true);
+        Thread.sleep(1000); // 1000 ms
+        destroyWindow();
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestDrawable01NEWT.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java
new file mode 100644
index 0000000..ed2f5d3
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java
@@ -0,0 +1,143 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.glsl;
+
+import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquare0;
+import com.jogamp.opengl.test.junit.util.GLSLSimpleProgram;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLProfile;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.test.junit.jogl.demos.es2.shader.RedSquareShader;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+
+import java.io.IOException;
+import javax.media.opengl.GL2ES2;
+import org.junit.AfterClass;
+
+public class TestGLSLSimple01NEWT extends UITestCase {
+    static long durationPerTest = 100; // ms
+
+    @BeforeClass
+    public static void initClass() {
+        System.err.println("class init");
+        GLProfile.initSingleton(true);
+    }
+
+    @AfterClass
+    public static void tearDownClass() {
+        System.err.println("class tear down ..");
+        GLProfile.shutdown();
+        System.err.println("class tear down end");
+    }
+
+    @Test(timeout=60000)
+    public void testGLSLCompilation01() {
+        GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+        Assert.assertNotNull(glp);
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+
+        GLWindow window = GLWindow.create(caps);
+        Assert.assertNotNull(window);
+        window.setSize(800, 600);
+        window.setVisible(true);
+        Assert.assertTrue(window.isNativeValid());
+
+        GLContext context = window.getContext();
+        context.setSynchronized(true);
+        
+        // trigger native creation of drawable/context
+        window.display();
+        Assert.assertTrue(window.isRealized());
+        Assert.assertTrue(window.getContext().isCreated());
+
+        context.makeCurrent();
+
+        // given
+
+        GL2ES2 gl = context.getGL().getGL2ES2();
+        GLSLSimpleProgram myShader = GLSLSimpleProgram.create(gl,
+                RedSquareShader.VERTEX_SHADER_TEXT,
+                RedSquareShader.FRAGMENT_SHADER_TEXT,
+                true);
+
+        myShader.release(gl);
+        context.release();
+        window.destroy();
+    }
+
+    @Test(timeout=60000)
+    public void testGLSLUse01() throws InterruptedException {
+        GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+        Assert.assertNotNull(glp);
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+
+        GLWindow window = GLWindow.create(caps);
+        Assert.assertNotNull(window);
+        window.setSize(800, 600);
+        window.setVisible(true);
+        Assert.assertTrue(window.isNativeValid());
+        window.addGLEventListener(new RedSquare0());
+        
+        Animator animator = new Animator(window);
+        animator.start();
+        Assert.assertEquals(true, animator.isAnimating());
+        while(animator.isAnimating() && animator.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+        }
+        Assert.assertEquals(true, animator.isAnimating());
+
+        window.destroy();
+        animator.stop();
+    }
+
+    public static void main(String args[]) throws IOException {
+        System.err.println("main - start");
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
+            }
+        }
+        String tstname = TestGLSLSimple01NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+        System.err.println("main - end");
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java
new file mode 100644
index 0000000..e7f376e
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java
@@ -0,0 +1,162 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.jogl.glsl;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.util.Animator;
+
+import javax.media.opengl.GL2GL3;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.awt.GLCanvas;
+import java.awt.Frame;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+/**
+ * Duplicates bug 459, where a vertex shader won't compile when 8 bits of stencil are requested.
+ * This bug is Windows-only; it works on Mac OS X and CentOS.
+ */
+public class TestShaderCompilationBug459AWT extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+    static long duration = 500; // ms
+    /** Exception in shader code sets this, since it won't bubble up through AWT. */
+    GLException glexception;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glp = GLProfile.getDefault();
+        Assert.assertNotNull(glp);
+        width  = 512;
+        height = 512;
+    }
+
+    @AfterClass
+    public static void releaseClass() {
+    }
+
+    @Test
+    public void compileShader() throws InterruptedException {
+        GLProfile glp = GLProfile.get("GL2GL3");         
+        GLCapabilities caps = new GLCapabilities(glp);   
+        // commenting out this line makes it work
+        caps.setStencilBits(8);
+
+        // commenting in this line also makes it work
+        //caps.setSampleBuffers(true); 
+
+        Frame frame = new Frame("Bug 459 shader compilation test");
+        Assert.assertNotNull(frame);
+
+        GLCanvas glCanvas = new GLCanvas(caps);
+        Assert.assertNotNull(glCanvas);
+        frame.add(glCanvas);
+        frame.setSize(512, 512);
+
+        glCanvas.addGLEventListener(new GLEventListener() {
+            /* @Override */
+            public void init(GLAutoDrawable drawable) {
+                String code = "void main(void){gl_Position = vec4(0,0,0,1);}";         
+
+                GL2GL3 gl = drawable.getGL().getGL2GL3();         
+                int id = gl.glCreateShader(GL2GL3.GL_VERTEX_SHADER); 
+
+                try {
+                    gl.glShaderSource(id, 1, new String[] { code }, (int[])null, 0); 
+                    gl.glCompileShader(id); 
+    
+                    int[] compiled = new int[1]; 
+                    gl.glGetShaderiv(id, GL2GL3.GL_COMPILE_STATUS, compiled, 0); 
+                    if (compiled[0] == GL2GL3.GL_FALSE) { 
+                        int[] logLength = new int[1]; 
+                        gl.glGetShaderiv(id, GL2GL3.GL_INFO_LOG_LENGTH, logLength, 0); 
+                        
+                        byte[] log = new byte[logLength[0]]; 
+                        gl.glGetShaderInfoLog(id, logLength[0], (int[])null, 0, log, 0); 
+                        
+                        System.err.println("Error compiling the shader: " + new String(log)); 
+                            
+                        gl.glDeleteShader(id); 
+                    } 
+                    else {
+                        System.out.println("Shader compiled: id=" + id); 
+                    }
+                }
+                catch( GLException e ) {
+                    glexception = e;
+                }
+            }
+
+            /* @Override */
+            public void dispose(GLAutoDrawable drawable) {
+            }
+
+            /* @Override */
+            public void display(GLAutoDrawable drawable) {
+            }
+
+            /* @Override */
+            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+            }
+        });
+
+        Animator animator = new Animator(glCanvas);
+        frame.setVisible(true);
+        animator.start();
+
+        while(animator.isAnimating() && animator.getDuration()<duration) {
+            Thread.sleep(100);
+        }
+
+        Assert.assertTrue( glexception != null ? glexception.getMessage() : "", glexception == null );
+        Assert.assertNotNull(frame);
+        Assert.assertNotNull(glCanvas);
+        Assert.assertNotNull(animator);
+
+        animator.stop();
+        Assert.assertEquals(false, animator.isAnimating());
+        frame.setVisible(false);
+        Assert.assertEquals(false, frame.isVisible());
+        frame.remove(glCanvas);
+        frame.dispose();
+        frame=null;
+        glCanvas=null;
+    }
+
+    public static void main(String args[]) {
+        org.junit.runner.JUnitCore.main(TestShaderCompilationBug459AWT.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java
new file mode 100644
index 0000000..be4873f
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java
@@ -0,0 +1,231 @@
+package com.jogamp.opengl.test.junit.jogl.glsl;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+import javax.media.opengl.GL3;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLProfile;
+
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.util.glsl.ShaderUtil;
+
+import java.io.IOException;
+import org.junit.AfterClass;
+
+/**
+ * Bug 'Function glTransformFeedbackVaryings incorrectly passes argument'
+ * http://jogamp.org/bugzilla/show_bug.cgi?id=407
+ */
+public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
+
+    private String VERTEX_SHADER_TEXT;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+    }
+
+    @AfterClass
+    public static void tearDownClass() {
+        GLProfile.shutdown();
+    }
+
+    class MyShader {
+        int shaderProgram;
+        int vertShader;
+
+        MyShader(int shaderProgram, int vertShader) {
+            this.shaderProgram = shaderProgram;
+            this.vertShader = vertShader;
+        }
+    }
+
+    private MyShader getShader(GL3 gl, String text, int type) {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        PrintStream pbaos = new PrintStream(baos);
+
+        int shaderProgram = gl.glCreateProgram();
+
+        int vertShader = gl.glCreateShader(type);
+
+        String[] lines = new String[]{text};
+        int[] lengths = new int[]{lines[0].length()};
+        gl.glShaderSource(vertShader, lines.length, lines, lengths, 0);
+        gl.glCompileShader(vertShader);
+
+        if(!ShaderUtil.isShaderStatusValid(gl, vertShader, gl.GL_COMPILE_STATUS, pbaos)) {
+            System.out.println("getShader:postCompile: "+baos.toString());
+            Assert.assertTrue(false);
+        }
+        pbaos.flush(); baos.reset();
+
+        gl.glAttachShader(shaderProgram, vertShader);
+
+        return new MyShader(shaderProgram, vertShader);
+    }
+
+    private void releaseShader(GL3 gl, MyShader myShader) {
+        if(null!=myShader) {
+            gl.glDetachShader(myShader.shaderProgram, myShader.vertShader);
+            gl.glDeleteShader(myShader.vertShader);
+            gl.glDeleteProgram(myShader.shaderProgram);
+        }
+    }
+
+
+    private GLWindow prepareTest() {
+        if(!GLProfile.isGL3Available()) {
+            System.err.println("GL3 not available");
+            System.err.println(GLProfile.glAvailabilityToString());
+            return null;
+        }
+        VERTEX_SHADER_TEXT =
+                  "#version 150                           \n"
+                + "                                       \n"
+                + "out vec4 Position;                     \n"
+                + "                                       \n"
+                + "void main() {                          \n"
+                + "  Position = vec4(1.0, 1.0, 1.0, 1.0); \n"
+                + "}                                      \n";
+
+        GLCapabilities caps;        
+
+        GLProfile glp = null;
+        try {
+            glp = GLProfile.get(GLProfile.GL3);
+        } catch (Throwable t) {
+            t.printStackTrace();
+            Assume.assumeNoException(t);
+        }
+        caps = new GLCapabilities(glp);
+
+        caps.setOnscreen(true);
+        caps.setDoubleBuffered(true);
+
+        GLWindow window = GLWindow.create(caps);
+        Assert.assertNotNull(window);
+        window.setUndecorated(true);
+        window.setSize(800, 600);
+        window.setVisible(true);
+        Assert.assertTrue(window.isNativeValid());
+
+        window.getContext().setSynchronized(true);
+
+        // trigger native creation of drawable/context
+        window.display();
+        Assert.assertTrue(window.isRealized());
+        Assert.assertTrue(window.getContext().isCreated());
+
+        return window;
+    }
+
+    private void cleanupTest(GLWindow window) {
+        if(null!=window) {
+            window.destroy();
+        }
+    }
+
+    @Test(timeout=60000)
+    public void testGlTransformFeedbackVaryings_WhenVarNameOK() {
+        if(!GLProfile.isGL3Available()) {
+            return;
+        }
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        PrintStream pbaos = new PrintStream(baos);
+
+        GLWindow window = prepareTest();
+        GLContext context = window.getContext();
+        context.makeCurrent();
+
+        // given
+
+        GL3 gl = context.getGL().getGL3();
+        MyShader myShader = getShader(gl, VERTEX_SHADER_TEXT, GL3.GL_VERTEX_SHADER);
+        String[] vars = new String[]{"Position"};
+
+        // when
+
+        gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL3.GL_SEPARATE_ATTRIBS);
+        gl.glLinkProgram(myShader.shaderProgram);
+
+        // then
+
+        boolean error = false;
+
+        if(!ShaderUtil.isProgramValid(gl, myShader.shaderProgram, pbaos)) {
+            System.out.println("Error (unexpected link error) - testGlTransformFeedbackVaryings_WhenVarNameOK:postLink: "+baos.toString());
+            error = true;
+        }
+        pbaos.flush(); baos.reset();
+
+        Assert.assertEquals(GL3.GL_NO_ERROR, gl.glGetError());
+
+        releaseShader(gl, myShader);
+        context.release();
+        cleanupTest(window);
+
+        Assert.assertFalse(error);
+    }
+
+    @Test(timeout=60000)
+    public void testGlTransformFeedbackVaryings_WhenVarNameWrong() {
+        if(!GLProfile.isGL3Available()) {
+            return;
+        }
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        PrintStream pbaos = new PrintStream(baos);
+
+        GLWindow window = prepareTest();
+        GLContext context = window.getContext();
+        context.makeCurrent();
+
+        // given
+
+        GL3 gl = context.getGL().getGL3();
+        MyShader myShader = getShader(gl, VERTEX_SHADER_TEXT, GL3.GL_VERTEX_SHADER);
+        String[] vars = new String[]{"PPPosition"};
+
+        // when
+
+        gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL3.GL_SEPARATE_ATTRIBS);
+        gl.glLinkProgram(myShader.shaderProgram);
+
+        // then
+
+        boolean error = false;
+
+        if(!ShaderUtil.isProgramValid(gl, myShader.shaderProgram, pbaos)) {
+            System.out.println("GOOD (expected link error) - testGlTransformFeedbackVaryings_WhenVarNameWrong:postLink: "+baos.toString());
+            // should be invalid, due to wrong var name
+        } else {
+            // oops 
+            System.out.println("Error (unexpected link success) - testGlTransformFeedbackVaryings_WhenVarNameWrong link worked, but it should not");
+            error = true;
+        }
+        pbaos.flush(); baos.reset();
+
+        Assert.assertEquals(GL3.GL_NO_ERROR, gl.glGetError());
+        // You cannot assume this error message - Assert.assertTrue(baos.toString().contains("(named PPPosition)"));
+
+        releaseShader(gl, myShader);
+        context.release();
+        cleanupTest(window);
+
+        Assert.assertFalse(error);
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestTransformFeedbackVaryingsBug407NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java
new file mode 100644
index 0000000..1f525a6
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java
@@ -0,0 +1,114 @@
+/**
+ * Copyright 2011 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.glu;
+
+import java.awt.Frame;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.nio.ByteBuffer;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.glu.gl2.GLUgl2;
+
+import org.junit.Test;
+
+/**
+ * Tests for bug 463, where gluScaleImage uses up all system memory. This was due to creating millions of
+ * 4-byte direct buffer objects inside the tight loops of Image.fill_image() and Image.empty_image(). Since
+ * the JVM apparently can only allocate direct buffer in 4MB chunks, each 4-byte buffer cost us a million times
+ * the memory it should have. Changing the constructor of Type_Widget.java back to non-direct buffer (like it
+ * was in JOGL 1) solves the problem.  
+ * @author Wade Walker
+ */
+public class TestBug463ScaleImageMemoryAWT implements GLEventListener {
+
+    /* @Override */
+    public void init(GLAutoDrawable drawable) {
+    }
+
+    /* @Override */
+    public void display(GLAutoDrawable drawable) {
+        int widthin = 559;
+        int heightin = 425;
+        
+        int widthout = 1024;
+        int heightout = 512;
+        
+        int textureInLength = widthin * heightin * 4;
+        int textureOutLength = widthout * heightout * 4;
+        
+        byte[] datain = new byte[textureInLength];
+        byte[] dataout = new byte[textureOutLength];
+        
+        ByteBuffer bufferIn  = ByteBuffer.wrap(datain);
+        ByteBuffer bufferOut = ByteBuffer.wrap(dataout);      
+        GLUgl2 glu = new GLUgl2();
+        // in the failing case, the system would run out of memory in here
+        glu.gluScaleImage( GL.GL_RGBA,
+                           widthin, heightin, GL.GL_UNSIGNED_BYTE, bufferIn,
+                           widthout, heightout, GL.GL_UNSIGNED_BYTE, bufferOut );
+    }
+
+    /* @Override */
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    }
+
+
+    /* @Override */
+    public void dispose(GLAutoDrawable drawable) {
+    }
+
+    @Test
+    public void test01() {
+        Frame frame = new Frame("Test");
+        GLProfile glprofile = GLProfile.getDefault();
+        GLCapabilities glCapabilities = new GLCapabilities(glprofile);
+        final GLCanvas canvas = new GLCanvas(glCapabilities);
+        frame.setSize(256, 256);
+        frame.add(canvas);
+        frame.setVisible( true );
+        canvas.addGLEventListener( this );
+
+        frame.addWindowListener(new WindowAdapter() {
+            public void windowClosing( WindowEvent e ) {
+                System.exit(0);
+            }
+        });
+        canvas.display();
+   }
+
+    public static void main(String args[]) {
+        org.junit.runner.JUnitCore.main(TestBug463ScaleImageMemoryAWT.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestGluUnprojectDoubleNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestGluUnprojectDoubleNOUI.java
new file mode 100755
index 0000000..34b30f0
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestGluUnprojectDoubleNOUI.java
@@ -0,0 +1,57 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.glu;
+
+import javax.media.opengl.glu.GLU;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author Julien Gouesse
+ */
+public class TestGluUnprojectDoubleNOUI {
+
+    @Test
+    public void test(){
+        final GLU glu = new GLU();
+        final int[] pickedPoint = new int[]{400,300};
+        final double pickedPointDepth = 0;
+        final double[] sceneModelViewValues = new double[]{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
+        final double[] projectionValues = new double[]{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
+        final int[] viewport = new int[]{0,0,800,600};
+        final double[] objCoords = new double[]{Double.NaN,Double.NaN,Double.NaN};
+        glu.gluUnProject(pickedPoint[0], pickedPoint[1], pickedPointDepth, sceneModelViewValues, 0, projectionValues, 0, viewport, 0, objCoords, 0);
+        Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));      
+    }
+    
+    public static void main(String args[]) {
+        org.junit.runner.JUnitCore.main(TestGluUnprojectDoubleNOUI.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestGluUnprojectFloatNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestGluUnprojectFloatNOUI.java
new file mode 100755
index 0000000..9e48a20
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestGluUnprojectFloatNOUI.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.glu;
+
+import javax.media.opengl.glu.GLU;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author Julien Gouesse
+ */
+public class TestGluUnprojectFloatNOUI {
+
+    
+    @Test
+    public void test(){
+        final GLU glu = new GLU();
+        final int[] pickedPoint = new int[]{400,300};
+        final float pickedPointDepth = 0;
+        final float[] sceneModelViewValues = new float[]{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
+        final float[] projectionValues = new float[]{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
+        final int[] viewport = new int[]{0,0,800,600};
+        final float[] objCoords = new float[]{Float.NaN,Float.NaN,Float.NaN};
+        glu.gluUnProject(pickedPoint[0], pickedPoint[1], pickedPointDepth, sceneModelViewValues, 0, projectionValues, 0, viewport, 0, objCoords, 0);
+        Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));      
+    }
+    
+    public static void main(String args[]) {
+        org.junit.runner.JUnitCore.main(TestGluUnprojectFloatNOUI.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
new file mode 100644
index 0000000..21a9736
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
@@ -0,0 +1,333 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.newt;
+
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import com.jogamp.opengl.test.junit.util.*;
+
+import java.lang.reflect.InvocationTargetException;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.awt.GLCanvas;
+import com.jogamp.opengl.util.Animator;
+
+import com.jogamp.newt.Screen;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.AWTException;
+import java.awt.Robot;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import javax.media.opengl.GLEventListener;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.BorderFactory;
+import javax.swing.border.Border;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
+    static long durationPerTest = 500; // ms
+    static Robot robot;
+    static Border border;
+    static JFrame frame;
+    static JButton button;
+    static JPanel panel;
+    static JPanel colorPanel;
+    static boolean windowClosing;
+
+    boolean modLightBrighter = true;
+
+    Color modLight(Color c) {
+        Color c2;
+        if(modLightBrighter) {
+            c2 = c.brighter();
+        } else {
+            c2 = c.darker();
+        }
+        if(c2.equals(c)) {
+            modLightBrighter = !modLightBrighter;
+        }
+        return c2;
+    }
+
+    class SwingGLAction implements GLEventListener {
+        public void init(GLAutoDrawable glad) {
+        }
+
+        public void dispose(GLAutoDrawable glad) {
+        }
+
+        public void display(GLAutoDrawable glad) {
+            colorPanel.setBackground(modLight(colorPanel.getBackground()));
+            colorPanel.repaint();
+        }
+
+        public void reshape(GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
+        }
+    }
+
+    @BeforeClass
+    public static void setup() throws InterruptedException, InvocationTargetException, AWTException {
+        int count;
+
+        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.setup(): Start Pre-JOGL-Swing");
+
+        // GLProfile.initSingleton(false);
+        // GLProfile.initSingleton(true);
+
+        // simulate AWT usage before JOGL's initialization of X11 threading
+        windowClosing=false;
+        border = BorderFactory.createLineBorder (Color.yellow, 2);
+
+        panel = new JPanel();
+        panel.setLayout(new BorderLayout());
+
+        button = new JButton("Click me");
+        button.addMouseListener(new MouseAdapter() {
+            public void mouseClicked(MouseEvent e) {
+                System.err.println("Test: "+e);
+            }
+        });
+        panel.add(button, BorderLayout.NORTH);
+
+        colorPanel = new JPanel();
+        Dimension size = new Dimension(400,100);
+        colorPanel.setPreferredSize(size);
+        colorPanel.setBorder(border);
+        panel.add(colorPanel, BorderLayout.SOUTH);
+
+        frame = new JFrame("PRE JOGL");
+        frame.addWindowListener( new WindowAdapter() {
+            public void windowClosing(WindowEvent ev) {
+                windowClosing=true;
+            }
+        });
+        frame.setContentPane(panel);
+        frame.setSize(512, 512);
+        frame.setLocation(0, 0);
+        frame.pack();
+
+        // AWT/Swing: From here on (post setVisible(true)
+        //            you need to use AWT/Swing's invokeAndWait()
+
+        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame.setVisible(true);
+                colorPanel.setBackground(Color.white);
+                colorPanel.repaint();
+            }});
+
+        robot = new Robot();
+        robot.setAutoWaitForIdle(true);
+
+        AWTRobotUtil.toFront(robot, frame);
+        AWTRobotUtil.requestFocus(robot, button);
+
+        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.setup(): Before JOGL init");
+
+        GLProfile.initSingleton(false);
+
+        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.setup(): End Pre-JOGL-Swing");
+    }
+
+    @AfterClass
+    public static void release() throws InterruptedException, InvocationTargetException {
+        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.release(): Start");
+        robot = null;
+        Assert.assertNotNull(frame);
+        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame.dispose();
+            }
+        });
+        frame=null;
+        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.release(): End");
+    }
+
+    protected void runTestGL(final Canvas canvas, GLAutoDrawable drawable) 
+        throws AWTException, InterruptedException, InvocationTargetException {
+
+        Dimension size = new Dimension(400,400);
+        canvas.setPreferredSize(size);
+
+        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                panel.add(canvas, BorderLayout.CENTER);
+                frame.pack();
+            }
+        });
+
+        AWTRobotUtil.toFront(robot, frame);
+
+        drawable.addGLEventListener(new Gears());
+
+        for(int i=0; i<100; i++) {
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    colorPanel.setBackground(modLight(colorPanel.getBackground()));
+                    colorPanel.repaint();
+                }
+            });
+            drawable.display(); // one in process display
+            Thread.sleep(10);
+        }
+
+        colorPanel.setBackground(Color.blue);
+        drawable.addGLEventListener(new SwingGLAction());
+
+        Point p0 = canvas.getLocationOnScreen();
+        Rectangle r0 = canvas.getBounds();
+        robot.mouseMove( (int) ( p0.getX() + .5 ) ,
+                         (int) ( p0.getY() + .5 ) );
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        for(int i=0; !windowClosing && i<durationPerTest/10; i++) {
+            p0.translate(1,1);
+            robot.mouseMove( (int) ( p0.getX() + .5 ) ,
+                             (int) ( p0.getY() + .5 ) );
+            Thread.sleep(10);
+        }
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        for(int i=0; !windowClosing && i<durationPerTest/100; i++) {
+            Thread.sleep(100);
+        }
+
+        Assert.assertNotNull(canvas);
+        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                panel.remove(canvas);
+                frame.pack();
+            }
+        });
+    }
+
+    @Test
+    public void test01NewtCanvasAWT() throws AWTException, InterruptedException, InvocationTargetException {
+        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test01NewtCanvasAWT(): Start");
+
+        GLProfile glp = GLProfile.getDefault();
+        GLCapabilities caps = new GLCapabilities(glp);
+
+        GLWindow win0 = GLWindow.create(caps);
+        win0.setSize(100,100);
+        win0.setVisible(true);
+        Screen screen = win0.getScreen();
+        win0.setPosition(screen.getWidth()-150, 0);
+        win0.addGLEventListener(new Gears());
+        Animator anim = new Animator(win0);
+        anim.start();
+
+        GLWindow win1 = GLWindow.create(caps);
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(win1);
+        anim.add(win1);
+        runTestGL(newtCanvasAWT, win1);
+
+        win0.destroy();
+        Assert.assertEquals(true, anim.isAnimating());
+
+        newtCanvasAWT.destroy();
+
+        win0.invalidate();
+        Assert.assertEquals(true, anim.isAnimating());
+        win1.invalidate();
+        Assert.assertEquals(false, anim.isAnimating());
+
+        anim.stop();
+
+        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test01NewtCanvasAWT(): End");
+    }
+
+    @Test
+    public void test02GLCanvas() throws AWTException, InterruptedException, InvocationTargetException {
+        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test02GLCanvas(): Start");
+        GLProfile glp = GLProfile.getDefault();
+        GLCapabilities caps = new GLCapabilities(glp);
+
+        Animator anim = new Animator();
+        anim.start();
+
+        /**
+         * Using GLCanvas _and_ NEWT side by side currently causes a deadlock
+         * in AWT with AMD drivers !
+         *
+        GLWindow win0 = GLWindow.create(caps);
+        win0.setSize(100,100);
+        win0.setVisible(true);
+        Screen screen = win0.getScreen();
+        win0.setPosition(screen.getWidth()-150, 0);
+        win0.addGLEventListener(new Gears());
+        anim.add(win0);
+         */
+
+        GLCanvas glCanvas = new GLCanvas(caps);
+        anim.add(glCanvas);
+        runTestGL(glCanvas, glCanvas);
+
+        /**
+        win0.destroy();
+        Assert.assertEquals(true, anim.isAnimating());
+         */
+        anim.stop();
+        System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test02GLCanvas(): End");
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        System.out.println("durationPerTest: "+durationPerTest);
+        org.junit.runner.JUnitCore.main(TestSwingAWTRobotUsageBeforeJOGLInitBug411.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java
new file mode 100644
index 0000000..95e7d6e
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java
@@ -0,0 +1,70 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.offscreen;
+
+import java.io.IOException;
+import javax.media.opengl.*;
+
+import com.jogamp.opengl.util.texture.TextureIO;
+import java.io.File;
+
+public class ReadBuffer2File extends ReadBufferBase {
+
+    public ReadBuffer2File(GLDrawable externalRead) {
+        super(externalRead);
+    }
+
+    @Override
+    public void dispose(GLAutoDrawable drawable) {
+        super.dispose(drawable);
+    }
+    int shotNum = 0;
+
+    void copyTextureData2File() throws IOException {
+        if (!readBufferUtil.isValid()) {
+            return;
+        }
+
+        File file = File.createTempFile("shot" + shotNum + "-", ".ppm");
+        TextureIO.write(readBufferUtil.getTextureData(), file);
+        System.out.println("Wrote: " + file.getAbsolutePath() + ", ...");
+        shotNum++;
+        readBufferUtil.rewindPixelBuffer();
+    }
+
+    @Override
+    public void display(GLAutoDrawable drawable) {
+        super.display(drawable);
+        try {
+            copyTextureData2File();
+        } catch (IOException ex) {
+            throw new RuntimeException("can not read buffer to file", ex);
+        }
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java
new file mode 100644
index 0000000..96a830a
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java
@@ -0,0 +1,188 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.offscreen;
+
+import java.nio.*;
+import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.*;
+
+import com.jogamp.opengl.util.*;
+
+import javax.media.opengl.fixedfunc.GLPointerFunc;
+import com.jogamp.opengl.util.texture.TextureCoords;
+import com.jogamp.opengl.util.GLArrayDataClient;
+import com.jogamp.opengl.util.GLArrayDataServer;
+
+public class ReadBuffer2Screen extends ReadBufferBase {
+    PMVMatrix pmvMatrix;
+    GLArrayDataClient readTextureVertices = null;
+    GLArrayDataClient readTextureCoords = null;
+    boolean enableBufferAlways = false; // FIXME
+    boolean enableBufferVBO    = true; // FIXME
+
+    public ReadBuffer2Screen (GLDrawable externalRead) {
+        super(externalRead);
+    }
+
+    @Override
+    public void init(GLAutoDrawable drawable) {
+        super.init(drawable);
+
+        GL gl = drawable.getGL();
+
+        pmvMatrix = new PMVMatrix();
+
+        float f_edge = 1f;
+        if(null==readTextureVertices) {
+            //readTextureVertices = GLArrayDataClient.createFixed(gl, GLPointerFunc.GL_VERTEX_ARRAY, "mgl_Vertex", 
+            //                                                    2, GL.GL_FLOAT, true, 4);
+            readTextureVertices = GLArrayDataServer.createFixed(gl, GLPointerFunc.GL_VERTEX_ARRAY, "mgl_Vertex", 
+                                                                2, GL.GL_FLOAT, true, 4, GL.GL_STATIC_DRAW);
+            readTextureVertices.setEnableAlways(enableBufferAlways);
+            readTextureVertices.setVBOUsage(enableBufferVBO);
+            {
+                FloatBuffer vb = (FloatBuffer)readTextureVertices.getBuffer();
+                vb.put(-f_edge); vb.put(-f_edge);
+                vb.put( f_edge); vb.put(-f_edge);
+                vb.put(-f_edge); vb.put( f_edge);
+                vb.put( f_edge); vb.put( f_edge);
+            }
+            readTextureVertices.seal(gl, true);
+            System.out.println(readTextureVertices);
+        }
+
+        // Clear background to gray
+        gl.glClearColor(0.5f, 0.5f, 0.5f, 0.4f);
+    }
+
+    @Override
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+        super.reshape(drawable, x, y, width, height);
+
+        GL gl = drawable.getGL();
+
+        gl.glViewport(0, 0, width, height);
+
+        if(gl instanceof GLLightingFunc) {
+            ((GLLightingFunc)gl).glShadeModel(GLLightingFunc.GL_SMOOTH);
+        }
+
+        GLMatrixFunc glM;
+        if(gl instanceof GLMatrixFunc) {
+            glM = (GLMatrixFunc)gl;
+        } else {
+            throw new GLException("ES2 currently unhandled .. ");
+        }
+
+        // Identity ..
+        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glLoadIdentity();
+        pmvMatrix.glTranslatef(0, 0, -2.5f);
+        if(null!=glM) {
+            glM.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+            glM.glLoadMatrixf(pmvMatrix.glGetMvMatrixf());
+        }
+
+        // Set location in front of camera
+        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glLoadIdentity();
+        pmvMatrix.gluPerspective(45.0f, (float)width / (float)height, 1.0f, 100.0f);
+        if(null!=glM) {
+            glM.glMatrixMode(PMVMatrix.GL_PROJECTION);
+            glM.glLoadMatrixf(pmvMatrix.glGetPMatrixf());
+        }
+    }
+
+    @Override
+    public void dispose(GLAutoDrawable drawable) {
+        super.dispose(drawable);
+    }
+
+    void renderOffscreenTexture(GL gl) {
+      if(!readBufferUtil.isValid()) return;
+
+      // Now draw one quad with the texture
+      readBufferUtil.getTexture().enable();
+      readBufferUtil.getTexture().bind();
+
+      if(gl.isGL2ES1()) {
+          // gl.getGL2ES1().glTexEnvi(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_MODE, GL2ES1.GL_REPLACE);
+          gl.getGL2ES1().glTexEnvi(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_MODE, GL2ES1.GL_MODULATE);
+      }
+
+      updateTextureCoords(gl, false);
+
+      readTextureVertices.enableBuffer(gl, true);
+      if(null!=readTextureCoords) {
+          readTextureCoords.enableBuffer(gl, true);
+      }
+      gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, readTextureVertices.getElementNumber());
+      /**
+      if(null!=readTextureCoords) {
+          readTextureCoords.enableBuffer(gl, false);
+      }
+      readTextureVertices.enableBuffer(gl, false); */
+
+      readBufferUtil.getTexture().disable();
+    }
+
+    void updateTextureCoords(GL gl, boolean force) {
+        if(force || null==readTextureCoords) {
+            readTextureCoords = GLArrayDataServer.createFixed(gl, GLPointerFunc.GL_TEXTURE_COORD_ARRAY, "mgl_MultiTexCoord0", 
+                                                              2, GL.GL_FLOAT, true, 4, GL.GL_STATIC_DRAW);
+            readTextureCoords.setEnableAlways(enableBufferAlways);
+            readTextureCoords.setVBOUsage(enableBufferVBO);
+            {
+                TextureCoords coords = readBufferUtil.getTexture().getImageTexCoords();
+                FloatBuffer cb = (FloatBuffer)readTextureCoords.getBuffer();
+                cb.put(coords.left());  cb.put(coords.bottom());
+                cb.put(coords.right()); cb.put(coords.bottom());
+                cb.put(coords.left());  cb.put(coords.top());
+                cb.put(coords.right()); cb.put(coords.top());
+            }
+            readTextureCoords.seal(gl, true);
+            System.out.println(readTextureCoords);
+        }
+    }
+
+    @Override
+    public void display(GLAutoDrawable drawable) {
+        super.display(drawable);
+
+        GL gl = drawable.getGL();
+
+        gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT);
+        if(gl instanceof GLLightingFunc) {
+            ((GLLightingFunc)gl).glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+        }
+
+        renderOffscreenTexture(gl);
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java
new file mode 100644
index 0000000..71a73a7
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java
@@ -0,0 +1,91 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.offscreen;
+
+import javax.media.opengl.*;
+
+public class ReadBufferBase implements GLEventListener {
+    public boolean glDebug = false ;
+    public boolean glTrace = false ;
+
+    protected GLDrawable externalRead;
+
+    ReadBufferUtil readBufferUtil = new ReadBufferUtil();
+
+    public ReadBufferBase (GLDrawable externalRead) {
+        this.externalRead = externalRead ;
+    }
+
+    public void init(GLAutoDrawable drawable) {
+        GL _gl = drawable.getGL();
+
+        _gl.glGetError(); // flush error ..
+
+        if(glDebug) {
+            try {
+                _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, _gl, null) );
+            } catch (Exception e) {
+                throw new RuntimeException("can not set debug pipeline", e);
+            }
+        }
+
+        if(glTrace) {
+            try {
+                _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, _gl, new Object[] { System.err } ) );
+            } catch (Exception e) {
+                throw new RuntimeException("can not set trace pipeline", e);
+            }
+        }
+
+        System.out.println(_gl);
+
+        _gl.getContext().setGLReadDrawable(externalRead);
+        if(_gl.isGL2GL3()) {
+            _gl.getGL2GL3().glReadBuffer(GL2GL3.GL_FRONT);
+        }
+        System.out.println("---------------------------");
+        System.out.println(_gl.getContext());
+        System.out.println("---------------------------");
+    }
+
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    }
+
+    public void dispose(GLAutoDrawable drawable) {
+        readBufferUtil.dispose();
+    }
+
+    public void display(GLAutoDrawable drawable) {
+        GL gl = drawable.getGL();
+
+        readBufferUtil.fetchOffscreenTexture(drawable, gl);
+    }
+
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferUtil.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferUtil.java
new file mode 100644
index 0000000..d4fa0d6
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferUtil.java
@@ -0,0 +1,107 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.offscreen;
+
+import com.jogamp.opengl.util.GLBuffers;
+import java.nio.*;
+import javax.media.opengl.*;
+
+import com.jogamp.opengl.util.texture.Texture;
+import com.jogamp.opengl.util.texture.TextureData;
+
+public class ReadBufferUtil {
+    protected int readPixelSizeLast = 0;
+    protected Buffer readPixelBuffer = null;
+    protected TextureData readTextureData = null;
+    protected Texture readTexture = new Texture(GL.GL_TEXTURE_2D);
+
+    public Buffer getPixelBuffer() { return readPixelBuffer; }
+    public void rewindPixelBuffer() { readPixelBuffer.rewind(); }
+
+    public TextureData getTextureData() { return readTextureData; }
+    public Texture getTexture() { return readTexture; }
+
+    public boolean isValid() {
+      return null!=readTexture && null!=readTextureData && null!=readPixelBuffer ;
+    }
+
+    public void fetchOffscreenTexture(GLDrawable drawable, GL gl) {
+        int readPixelSize = drawable.getWidth() * drawable.getHeight() * 3 ; // RGB
+        boolean newData = false;
+        if(readPixelSize>readPixelSizeLast) {
+            readPixelBuffer = GLBuffers.newDirectGLBuffer(GL.GL_UNSIGNED_BYTE, readPixelSize);
+            readPixelSizeLast = readPixelSize ;
+            try {
+                readTextureData = new TextureData(
+                           gl.getGLProfile(),
+                           // gl.isGL2GL3()?gl.GL_RGBA:gl.GL_RGB,
+                           gl.GL_RGB,
+                           drawable.getWidth(), drawable.getHeight(),
+                           0, 
+                           gl.GL_RGB,
+                           gl.GL_UNSIGNED_BYTE,
+                           false, false, 
+                           false /* flip */,
+                           readPixelBuffer,
+                           null /* Flusher */);
+                newData = true;
+            } catch (Exception e) {
+                readTextureData = null;
+                readPixelBuffer = null;
+                readPixelSizeLast = 0;
+                throw new RuntimeException("can not fetch offscreen texture", e);
+            }
+        }
+        if(null!=readPixelBuffer) {
+            readPixelBuffer.clear();
+            gl.glReadPixels(0, 0, drawable.getWidth(), drawable.getHeight(), GL.GL_RGB, GL.GL_UNSIGNED_BYTE, readPixelBuffer);
+            readPixelBuffer.rewind();
+            if(newData) {
+                readTexture.updateImage(readTextureData);
+            } else {
+                readTexture.updateSubImage(readTextureData, 0, 
+                                           0, 0, // src offset
+                                           0, 0, // dst offset
+                                           drawable.getWidth(), drawable.getHeight());
+            }
+            readPixelBuffer.rewind();
+        }
+    }
+
+    @SuppressWarnings("deprecation")
+    public void dispose() {
+        readTexture.dispose();
+        readTextureData = null;
+        readPixelBuffer.clear();
+        readPixelBuffer = null;
+        readPixelSizeLast = 0;
+    }
+
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java
new file mode 100644
index 0000000..3ad2c42
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.offscreen;
+
+import javax.media.opengl.*;
+
+import com.jogamp.opengl.util.texture.TextureIO;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.media.nativewindow.*;
+
+public class Surface2File implements SurfaceUpdatedListener {
+
+    ReadBufferUtil readBufferUtil = new ReadBufferUtil();
+    int shotNum = 0;
+
+    public void dispose() {
+        readBufferUtil.dispose();
+    }
+
+    public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+        if (updater instanceof GLDrawable) {
+            GLDrawable drawable = (GLDrawable) updater;
+            GLContext ctx = GLContext.getCurrent();
+            if (null != ctx && ctx.getGLDrawable() == drawable) {
+                GL gl = ctx.getGL();
+                // FIXME glFinish() is an expensive paranoia sync, should not be necessary due to spec
+                gl.glFinish();
+                readBufferUtil.fetchOffscreenTexture(drawable, gl);
+                gl.glFinish();
+                try {
+                    surface2File("shot");
+                } catch (IOException ex) {
+                    throw new RuntimeException("can not write survace to file", ex);
+                }
+            }
+        }
+    }
+
+    public void surface2File(String basename) throws IOException {
+        if (!readBufferUtil.isValid()) {
+            return;
+        }
+
+        File file = File.createTempFile(basename + shotNum + "-", ".ppm");
+        TextureIO.write(readBufferUtil.getTextureData(), file);
+        System.err.println("Wrote: " + file.getAbsolutePath() + ", ...");
+        shotNum++;
+        readBufferUtil.rewindPixelBuffer();
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java
new file mode 100644
index 0000000..6a02bc0
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java
@@ -0,0 +1,327 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.offscreen;
+
+
+import com.jogamp.newt.Display;
+import com.jogamp.newt.NewtFactory;
+import com.jogamp.newt.Screen;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.event.MouseListener;
+import com.jogamp.newt.event.WindowListener;
+import com.jogamp.newt.opengl.GLWindow;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquare;
+import java.io.IOException;
+
+public class TestOffscreen01GLPBufferNEWT extends UITestCase {
+    static GLProfile glpDefault;
+    static GLDrawableFactory glDrawableFactory;
+    static int width, height;
+    GLCapabilities capsDefault;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glpDefault = GLProfile.getDefault();
+        Assert.assertNotNull(glpDefault);
+        glDrawableFactory = GLDrawableFactory.getFactory(glpDefault);
+        System.out.println("INFO: PBuffer supported: "+ glDrawableFactory.canCreateGLPbuffer(null));
+        width  = 640;
+        height = 480;
+    }
+
+    @AfterClass
+    public static void releaseClass() {
+    }
+
+    @Before
+    public void init() {
+        capsDefault = new GLCapabilities(glpDefault);
+        Assert.assertNotNull(capsDefault);
+    }
+
+    private void do01OffscreenWindowPBuffer(GLCapabilities caps) {
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+        Window window = NewtFactory.createWindow(screen, caps);
+        Assert.assertNotNull(window);
+        window.setSize(width, height);
+        GLWindow glWindow = GLWindow.create(window);
+        Assert.assertNotNull(glWindow);
+        glWindow.setVisible(true);
+
+        GLEventListener demo = new RedSquare();
+        WindowUtilNEWT.setDemoFields(demo, window, glWindow, false);
+        glWindow.addGLEventListener(demo);
+
+        while ( glWindow.getTotalFrames() < 2) {
+            glWindow.display();
+        }
+
+        if(null!=glWindow) {
+            glWindow.destroy();
+        }
+        if(null!=window) {
+            window.destroy();
+        }
+        if(null!=screen) {
+            screen.destroy();
+        }
+        if(null!=display) {
+            display.destroy();
+        }
+    }
+
+    @Test
+    public void test01aOffscreenWindowPBuffer() {
+        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+            return;
+        }
+        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        do01OffscreenWindowPBuffer(caps2);
+    }
+
+    @Test
+    public void test01bOffscreenWindowPBufferStencil() {
+        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+            return;
+        }
+        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        caps2.setStencilBits(8);
+        do01OffscreenWindowPBuffer(caps2);
+    }
+
+    @Test
+    public void test01cOffscreenWindowPBufferStencilAlpha() {
+        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+            return;
+        }
+        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        caps2.setStencilBits(8);
+        caps2.setAlphaBits(8);
+        do01OffscreenWindowPBuffer(caps2);
+    }
+
+    @Test
+    public void test01cOffscreenWindowPBuffer555() {
+        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+            return;
+        }
+        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        caps2.setRedBits(5);
+        caps2.setGreenBits(5);
+        caps2.setBlueBits(5);
+        do01OffscreenWindowPBuffer(caps2);
+    }
+
+    @Test
+    public void test02Offscreen3Windows1DisplayPBuffer() {
+        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+            return;
+        }
+        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        int winnum = 3, i;
+        Window windows[] = new Window[winnum];
+        GLWindow glWindows[] = new GLWindow[winnum];
+        GLEventListener demos[] = new GLEventListener[winnum];
+
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+
+        for(i=0; i<winnum; i++) {
+            System.out.println("Create Window "+i);
+            windows[i] = NewtFactory.createWindow(screen, caps2);
+            Assert.assertNotNull(windows[i]);
+            windows[i].setSize(width, height);
+            glWindows[i] = GLWindow.create(windows[i]);
+            Assert.assertNotNull(glWindows[i]);
+            glWindows[i].setVisible(true);
+
+            demos[i] = new RedSquare();
+            WindowUtilNEWT.setDemoFields(demos[i], windows[i], glWindows[i], false);
+            glWindows[i].addGLEventListener(demos[i]);
+        }
+
+        while ( glWindows[0].getTotalFrames() < 2) {
+            for(i=0; i<winnum; i++) {
+                glWindows[i].display();
+            }
+        }
+
+        for(i=0; i<winnum; i++) {
+            if(null!=glWindows[i]) {
+                glWindows[i].destroy();
+            }
+            if(null!=windows[i]) {
+                windows[i].destroy();
+            }
+        }
+        if(null!=screen) {
+            screen.destroy();
+        }
+        if(null!=display) {
+            display.destroy();
+        }
+    }
+
+    @Test
+    public void test03Offscreen3Windows3DisplaysPBuffer() {
+        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+            return;
+        }
+        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        int winnum = 3, i;
+        Display displays[] = new Display[winnum];
+        Screen screens[] = new Screen[winnum];
+        Window windows[] = new Window[winnum];
+        GLWindow glWindows[] = new GLWindow[winnum];
+        GLEventListener demos[] = new GLEventListener[winnum];
+
+        for(i=0; i<winnum; i++) {
+            System.out.println("Create Window "+i);
+            displays[i] = NewtFactory.createDisplay(null, false); // local display
+            Assert.assertNotNull(displays[i]);
+            screens[i]  = NewtFactory.createScreen(displays[i], 0); // screen 0
+            Assert.assertNotNull(screens[i]);
+            windows[i] = NewtFactory.createWindow(screens[i], caps2);
+            Assert.assertNotNull(windows[i]);
+            windows[i].setSize(width, height);
+            glWindows[i] = GLWindow.create(windows[i]);
+            Assert.assertNotNull(glWindows[i]);
+            glWindows[i].setVisible(true);
+            demos[i] = new RedSquare();
+            WindowUtilNEWT.setDemoFields(demos[i], windows[i], glWindows[i], false);
+            glWindows[i].addGLEventListener(demos[i]);
+        }
+
+        while ( glWindows[0].getTotalFrames() < 2) {
+            for(i=0; i<winnum; i++) {
+                glWindows[i].display();
+            }
+        }
+
+        for(i=0; i<winnum; i++) {
+            if(null!=glWindows[i]) {
+                glWindows[i].destroy();
+            }
+            if(null!=windows[i]) {
+                windows[i].destroy();
+            }
+            if(null!=screens[i]) {
+                screens[i].destroy();
+            }
+            if(null!=displays[i]) {
+                displays[i].destroy();
+            }
+        }
+    }
+
+    @Test
+    public void test04OffscreenSnapshotWithDemoPBuffer() {
+        if(!glDrawableFactory.canCreateGLPbuffer(null)) {
+            System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
+            return;
+        }
+        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+
+        System.out.println("Create Window 1");
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+        Window window = NewtFactory.createWindow(screen, caps2);
+        Assert.assertNotNull(window);
+        window.setSize(width, height);
+        GLWindow glWindow = GLWindow.create(window);
+        Assert.assertNotNull(glWindow);
+        glWindow.setVisible(true);
+
+        GLWindow windowOnScreen = null;
+        WindowListener wl=null;
+        MouseListener ml=null;
+        SurfaceUpdatedListener ul=null;
+
+        GLEventListener demo = new RedSquare();
+        Assert.assertNotNull(demo);
+
+        WindowUtilNEWT.run(glWindow, demo, windowOnScreen, wl, ml, ul, 2, true /*snapshot*/, false /*debug*/);
+
+        if(null!=windowOnScreen) {
+            windowOnScreen.destroy();
+        }
+        if(null!=glWindow) {
+            glWindow.destroy();
+        }
+        if(null!=window) {
+            window.destroy();
+        }
+        if(null!=screen) {
+            screen.destroy();
+        }
+        if(null!=display) {
+            display.destroy();
+        }
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestOffscreen01GLPBufferNEWT.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java
new file mode 100644
index 0000000..d92b4ff
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java
@@ -0,0 +1,184 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.offscreen;
+
+
+import com.jogamp.newt.Display;
+import com.jogamp.newt.NewtFactory;
+import com.jogamp.newt.Screen;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.event.MouseListener;
+import com.jogamp.newt.event.WindowListener;
+import com.jogamp.newt.opengl.GLWindow;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquare;
+import java.io.IOException;
+
+public class TestOffscreen02BitmapNEWT extends UITestCase {
+    static GLProfile glpDefault;
+    static GLDrawableFactory glDrawableFactory;
+    static int width, height;
+    GLCapabilities capsDefault;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glpDefault = GLProfile.getDefault();
+        Assert.assertNotNull(glpDefault);
+        glDrawableFactory = GLDrawableFactory.getFactory(glpDefault);
+        System.out.println("INFO: PBuffer supported: "+ glDrawableFactory.canCreateGLPbuffer(null));
+        width  = 640;
+        height = 480;
+    }
+
+    @AfterClass
+    public static void releaseClass() {
+    }
+
+    @Before
+    public void init() {
+        capsDefault = new GLCapabilities(glpDefault);
+        Assert.assertNotNull(capsDefault);
+    }
+
+    @Test
+    public void test11OffscreenWindowPixmap() {
+        // Offscreen doesn't work on >= GL3 (ATI)
+        GLProfile glp = GLProfile.get(GLProfile.GL2);
+        Assert.assertNotNull(glp);
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+
+        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
+
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+        Window window = NewtFactory.createWindow(screen, caps2);
+        Assert.assertNotNull(window);
+        window.setSize(width, height);
+        GLWindow glWindow = GLWindow.create(window);
+        Assert.assertNotNull(glWindow);
+        glWindow.setVisible(true);
+
+        GLEventListener demo = new RedSquare();
+        WindowUtilNEWT.setDemoFields(demo, window, glWindow, false);
+        glWindow.addGLEventListener(demo);
+
+        while ( glWindow.getTotalFrames() < 2) {
+            glWindow.display();
+        }
+
+        if(null!=glWindow) {
+            glWindow.destroy();
+        }
+        if(null!=window) {
+            window.destroy();
+        }
+        if(null!=screen) {
+            screen.destroy();
+        }
+        if(null!=display) {
+            display.destroy();
+        }
+    }
+
+    @Test
+    public void test14OffscreenSnapshotWithDemoPixmap() {
+        // Offscreen doesn't work on >= GL3 (ATI)
+        GLProfile glp = GLProfile.get(GLProfile.GL2);
+        Assert.assertNotNull(glp);
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+
+        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
+
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+        Window window = NewtFactory.createWindow(screen, caps2);
+        Assert.assertNotNull(window);
+        window.setSize(width, height);
+        GLWindow glWindow = GLWindow.create(window);
+        Assert.assertNotNull(glWindow);
+        glWindow.setVisible(true);
+
+        GLWindow windowOnScreen = null;
+        WindowListener wl=null;
+        MouseListener ml=null;
+        SurfaceUpdatedListener ul=null;
+
+        GLEventListener demo = new RedSquare();
+        Assert.assertNotNull(demo);
+
+        WindowUtilNEWT.run(glWindow, demo, windowOnScreen, wl, ml, ul, 2, true /*snapshot*/, false /*debug*/);
+
+        if(null!=windowOnScreen) {
+            windowOnScreen.destroy();
+        }
+        if(null!=glWindow) {
+            glWindow.destroy();
+        }
+        if(null!=window) {
+            window.destroy();
+        }
+        if(null!=screen) {
+            screen.destroy();
+        }
+        if(null!=display) {
+            display.destroy();
+        }
+    }
+    public static void main(String args[]) throws IOException {
+        String tstname = TestOffscreen02BitmapNEWT.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java
new file mode 100644
index 0000000..4420a51
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java
@@ -0,0 +1,110 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.offscreen;
+
+import com.jogamp.opengl.test.junit.util.*;
+
+import org.junit.Assert;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+
+public class WindowUtilNEWT {
+
+    public static GLCapabilities fixCaps(GLCapabilities caps, boolean onscreen, boolean pbuffer, boolean undecorated) {
+        GLCapabilities caps2 = (GLCapabilities) caps.cloneMutable();
+        caps2.setOnscreen(onscreen);
+        caps2.setPBuffer(!onscreen && pbuffer);
+        caps2.setDoubleBuffered(!onscreen);
+        return caps2;
+    }
+
+    public static void setDemoFields(GLEventListener demo, Window window, GLWindow glWindow, boolean debug) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(window);
+        if(debug) {
+            MiscUtils.setFieldIfExists(demo, "glDebug", true);
+            MiscUtils.setFieldIfExists(demo, "glTrace", true);
+        }
+        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    public static void run(GLWindow windowOffScreen, GLEventListener demo, 
+                           GLWindow windowOnScreen, WindowListener wl, MouseListener ml, 
+                           SurfaceUpdatedListener ul, int frames, boolean snapshot, boolean debug) {
+        Assert.assertNotNull(windowOffScreen);
+        Assert.assertNotNull(demo);
+
+        setDemoFields(demo, windowOffScreen, windowOffScreen, debug);
+        windowOffScreen.addGLEventListener(demo);
+
+        if ( null != windowOnScreen ) {
+            if(null!=wl) {
+                windowOnScreen.addWindowListener(wl);
+            }
+            if(null!=ml) {
+                windowOnScreen.addMouseListener(ml);
+            }
+            windowOnScreen.setVisible(true);
+        }
+
+        GLDrawable readDrawable = windowOffScreen.getContext().getGLDrawable() ;
+
+        if ( null == windowOnScreen ) {
+            if(snapshot) {
+                Surface2File s2f = new Surface2File();
+                windowOffScreen.addSurfaceUpdatedListener(s2f);
+            }
+        } else {
+            ReadBuffer2Screen readDemo = new ReadBuffer2Screen( readDrawable ) ;
+            windowOnScreen.addGLEventListener(readDemo);
+        }
+        if(null!=ul) {
+            windowOffScreen.addSurfaceUpdatedListener(ul);
+        }
+
+        if(debug) {
+            System.err.println("+++++++++++++++++++++++++++");
+            System.err.println(windowOffScreen);
+            System.err.println("+++++++++++++++++++++++++++");
+        }
+
+        while ( windowOffScreen.getTotalFrames() < frames) {
+            windowOffScreen.display();
+        }
+        windowOffScreen.removeAllSurfaceUpdatedListener();
+
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/OneTriangle.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/OneTriangle.java
new file mode 100644
index 0000000..655e590
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/OneTriangle.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.swt;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.glu.GLU;
+
+import org.eclipse.swt.graphics.Rectangle;
+
+/**
+ * A utility class to encapsulate drawing a single triangle for unit tests.
+ * @author Wade Walker
+ */
+public class OneTriangle {
+
+    public static void setup( GL2 gl, Rectangle rectangle ) {
+        gl.glMatrixMode( GL2.GL_PROJECTION );
+        gl.glLoadIdentity();
+
+        // coordinate system origin at lower left with width and height same as the window
+        GLU glu = new GLU();
+        glu.gluOrtho2D( 0.0f, rectangle.width, 0.0f, rectangle.height );
+
+        gl.glMatrixMode( GL2.GL_MODELVIEW );
+        gl.glLoadIdentity();
+
+        gl.glViewport( 0, 0, rectangle.width, rectangle.height );
+    }
+
+    public static void render( GL2 gl, Rectangle rectangle ) {
+        gl.glClear( GL.GL_COLOR_BUFFER_BIT );
+
+        // draw a triangle filling the window
+        gl.glLoadIdentity();
+        gl.glBegin( GL.GL_TRIANGLES );
+        gl.glColor3f( 1, 0, 0 );
+        gl.glVertex2f( 0, 0 );
+        gl.glColor3f( 0, 1, 0 );
+        gl.glVertex2f( rectangle.width, 0 );
+        gl.glColor3f( 0, 0, 1 );
+        gl.glVertex2f( rectangle.width / 2, rectangle.height );
+        gl.glEnd();
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWT01GLn.java
new file mode 100644
index 0000000..af125d4
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWT01GLn.java
@@ -0,0 +1,199 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.swt;
+
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLProfile;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.opengl.GLCanvas;
+import org.eclipse.swt.opengl.GLData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.Test;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+/**
+ * Tests that a basic SWT app can open without crashing under different GL profiles. Uses the SWT GL canvas.
+ * @author Wade Walker
+ */
+public class TestSWT01GLn extends UITestCase {
+
+    static int duration = 250;
+
+    static final int iwidth = 640;
+    static final int iheight = 480;
+
+    Display display = null;
+    Shell shell = null;
+    Composite composite = null;
+
+    @BeforeClass
+    public static void startup() {
+        GLProfile.initSingleton( true );
+        System.out.println( "GLProfile " + GLProfile.glAvailabilityToString() );
+    }
+
+    @Before
+    public void init() {
+        display = new Display();
+        Assert.assertNotNull( display );
+        shell = new Shell( display );
+        Assert.assertNotNull( shell );
+        shell.setLayout( new FillLayout() );
+        composite = new Composite( shell, SWT.NONE );
+        composite.setLayout( new FillLayout() );
+        Assert.assertNotNull( composite );
+    }
+
+    @After
+    public void release() {
+        Assert.assertNotNull( display );
+        Assert.assertNotNull( shell );
+        Assert.assertNotNull( composite );
+        try {
+            composite.dispose();
+            shell.dispose();
+            display.dispose();
+        }
+        catch( Throwable throwable ) {
+            throwable.printStackTrace();
+            Assume.assumeNoException( throwable );
+        }
+        display = null;
+        shell = null;
+        composite = null;
+    }
+
+    protected void runTestAGL( GLProfile glprofile ) throws InterruptedException {
+        GLData gldata = new GLData();
+        gldata.doubleBuffer = true;
+        // need SWT.NO_BACKGROUND to prevent SWT from clearing the window
+        // at the wrong times (we use glClear for this instead)
+        final GLCanvas glcanvas = new GLCanvas( composite, SWT.NO_BACKGROUND, gldata );
+        Assert.assertNotNull( glcanvas );
+        glcanvas.setCurrent();
+        final GLContext glcontext = GLDrawableFactory.getFactory( glprofile ).createExternalGLContext();
+        Assert.assertNotNull( glcontext );
+
+        // fix the viewport when the user resizes the window
+        glcanvas.addListener( SWT.Resize, new Listener() {
+            public void handleEvent( Event event ) {
+                Rectangle rectangle = glcanvas.getClientArea();
+                glcanvas.setCurrent();
+                glcontext.makeCurrent();
+                GL2 gl = glcontext.getGL().getGL2();
+                OneTriangle.setup( gl, rectangle );
+                glcontext.release();
+                System.err.println("resize");
+            }
+        });
+
+        // draw the triangle when the OS tells us that any part of the window needs drawing
+        glcanvas.addPaintListener( new PaintListener() {
+            public void paintControl( PaintEvent paintevent ) {
+                Rectangle rectangle = glcanvas.getClientArea();
+                glcanvas.setCurrent();
+                glcontext.makeCurrent();
+                GL2 gl = glcontext.getGL().getGL2();
+                OneTriangle.render( gl, rectangle );
+                glcanvas.swapBuffers();
+                glcontext.release();
+                System.err.println("paint");
+            }
+        });
+        
+        shell.setText( getClass().getName() );
+        shell.setSize( 640, 480 );
+        shell.open();
+
+        long lStartTime = System.currentTimeMillis();
+        long lEndTime = lStartTime + duration;
+        try {
+            while( (System.currentTimeMillis() < lEndTime) && !glcanvas.isDisposed() ) {
+                if( !display.readAndDispatch() ) {
+                    // blocks on linux .. display.sleep();
+                    Thread.sleep(10);
+                }
+            }
+        } catch( Throwable throwable ) {
+            throwable.printStackTrace();
+            Assume.assumeNoException( throwable );
+        }
+        glcanvas.dispose();
+    }
+
+    @Test
+    public void testA01GLDefault() throws InterruptedException {
+        GLProfile glprofile = GLProfile.getDefault();
+        System.out.println( "GLProfile Default: " + glprofile );
+        runTestAGL( glprofile );
+    }
+
+    @Test
+    public void test02GL2() throws InterruptedException {
+        GLProfile glprofile = GLProfile.get(GLProfile.GL2);
+        System.out.println( "GLProfile GL2: " + glprofile );
+        runTestAGL( glprofile );
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                duration = atoi(args[++i]);
+            }
+        }
+        System.out.println("durationPerTest: "+duration);
+        org.junit.runner.JUnitCore.main(TestSWT01GLn.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWT02GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWT02GLn.java
new file mode 100644
index 0000000..b3d167b
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWT02GLn.java
@@ -0,0 +1,236 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.swt;
+
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLProfile;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.Test;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.ProxySurface;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLDrawable;
+import jogamp.nativewindow.swt.SWTAccessor;
+import org.eclipse.swt.widgets.Canvas;
+
+/**
+ * Tests that a basic SWT app can open without crashing under different GL profiles. Uses the SWT GL canvas.
+ * @author Wade Walker
+ */
+public class TestSWT02GLn extends UITestCase {
+
+    static int duration = 250;
+
+    static final int iwidth = 640;
+    static final int iheight = 480;
+
+    Display display = null;
+    Shell shell = null;
+    Composite composite = null;
+
+    @BeforeClass
+    public static void startup() {
+        GLProfile.initSingleton( true );
+        System.out.println( "GLProfile " + GLProfile.glAvailabilityToString() );
+    }
+
+    @Before
+    public void init() {
+        display = new Display();
+        Assert.assertNotNull( display );
+        shell = new Shell( display );
+        Assert.assertNotNull( shell );
+        shell.setLayout( new FillLayout() );
+        composite = new Composite( shell, SWT.NONE );
+        composite.setLayout( new FillLayout() );
+        Assert.assertNotNull( composite );
+    }
+
+    @After
+    public void release() {
+        Assert.assertNotNull( display );
+        Assert.assertNotNull( shell );
+        Assert.assertNotNull( composite );
+        try {
+            composite.dispose();
+            shell.dispose();
+            display.dispose();
+        }
+        catch( Throwable throwable ) {
+            throwable.printStackTrace();
+            Assume.assumeNoException( throwable );
+        }
+        display = null;
+        shell = null;
+        composite = null;
+    }
+
+    protected void runTestAGL( GLProfile glprofile ) throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glprofile);
+        GLDrawableFactory factory = GLDrawableFactory.getFactory(glprofile);
+        
+        // need SWT.NO_BACKGROUND to prevent SWT from clearing the window
+        // at the wrong times (we use glClear for this instead)
+        final Canvas canvas = new Canvas( composite, SWT.NO_BACKGROUND);
+        Assert.assertNotNull( canvas );
+        
+        SWTAccessor.setRealized(canvas, true);
+        AbstractGraphicsDevice device = SWTAccessor.getDevice(canvas);
+        long nativeWindowHandle = SWTAccessor.getWindowHandle(canvas);
+        System.err.println("*** device: " + device);
+        System.err.println("*** window handle: 0x" + Long.toHexString(nativeWindowHandle));
+        
+        ProxySurface proxySurface = factory.createProxySurface(device, nativeWindowHandle, caps, null);
+        Assert.assertNotNull( proxySurface );        
+        proxySurface.setSize( 640, 480 );
+        System.err.println("*** ProxySurface: " + proxySurface);
+        final GLDrawable drawable = factory.createGLDrawable(proxySurface);
+        Assert.assertNotNull( drawable );
+        drawable.setRealized(true);
+        System.err.println("*** Drawable: " + drawable);
+        Assert.assertTrue( drawable.isRealized() );
+        final GLContext glcontext = drawable.createContext(null);
+        // trigger native creation ..
+        if( GLContext.CONTEXT_NOT_CURRENT < glcontext.makeCurrent() ) {        
+            glcontext.release();
+        }
+        
+        final boolean[] sizeMissing = new boolean[] { false };
+        
+        // fix the viewport when the user resizes the window
+        canvas.addListener( SWT.Resize, new Listener() {
+            public void handleEvent( Event event ) {
+                Rectangle rectangle = canvas.getClientArea();
+                boolean glok=false;
+                if( GLContext.CONTEXT_NOT_CURRENT < glcontext.makeCurrent() ) {
+                    glok=true;
+                    GL2 gl = glcontext.getGL().getGL2();
+                    OneTriangle.setup( gl, rectangle );
+                    glcontext.release();
+                } else {
+                    sizeMissing[0] = true;
+                }
+                System.err.println("resize: glok " + glok);
+            }
+        });
+
+        // draw the triangle when the OS tells us that any part of the window needs drawing
+        canvas.addPaintListener( new PaintListener() {
+            public void paintControl( PaintEvent paintevent ) {
+                Rectangle rectangle = canvas.getClientArea();
+                boolean glok=false;
+                if( GLContext.CONTEXT_NOT_CURRENT < glcontext.makeCurrent() ) {
+                    glok=true;
+                    GL2 gl = glcontext.getGL().getGL2();
+                    if(sizeMissing[0]) {
+                        OneTriangle.setup( gl, rectangle );
+                        sizeMissing[0] = false;
+                    }
+                    OneTriangle.render( gl, rectangle );
+                    drawable.swapBuffers();
+                    glcontext.release();
+                }
+                System.err.println("paint: glok " + glok);
+            }
+        });
+        
+        shell.setText( getClass().getName() );
+        shell.setSize( 640, 480 );
+        shell.open();
+
+        long lStartTime = System.currentTimeMillis();
+        long lEndTime = lStartTime + duration;
+        try {
+            while( (System.currentTimeMillis() < lEndTime) && !canvas.isDisposed() ) {
+                if( !display.readAndDispatch() ) {
+                    // blocks on linux .. display.sleep();
+                    Thread.sleep(10);
+                }
+            }
+        } catch( Throwable throwable ) {
+            throwable.printStackTrace();
+            Assume.assumeNoException( throwable );
+        }
+        glcontext.destroy();
+        drawable.setRealized(false);
+        canvas.dispose();
+    }
+
+    @Test
+    public void testA01GLDefault() throws InterruptedException {
+        GLProfile glprofile = GLProfile.getDefault();
+        System.out.println( "GLProfile Default: " + glprofile );
+        runTestAGL( glprofile );
+    }
+
+    @Test
+    public void test02GL2() throws InterruptedException {
+        GLProfile glprofile = GLProfile.get(GLProfile.GL2);
+        System.out.println( "GLProfile GL2: " + glprofile );
+        runTestAGL( glprofile );
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                duration = atoi(args[++i]);
+            }
+        }
+        System.out.println("durationPerTest: "+duration);
+        org.junit.runner.JUnitCore.main(TestSWT02GLn.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java
new file mode 100644
index 0000000..25653ab
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java
@@ -0,0 +1,184 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.swt;
+
+import java.awt.Frame;
+
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.awt.GLCanvas;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.awt.SWT_AWT;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.Test;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+/**
+ * Tests that a basic SWT app can open without crashing under different GL profiles. Uses the AWT GL canvas with
+ * the SWT_AWT bridge.
+ * @author Wade Walker
+ */
+public class TestSWTAWT01GLn extends UITestCase {
+
+    static final int duration = 250;
+
+    Display display = null;
+    Shell shell = null;
+    Composite composite = null;
+    Frame frame = null;
+    GLCanvas glcanvas = null;
+
+    @BeforeClass
+    public static void startup() {
+        GLProfile.initSingleton( true );
+        System.out.println( "GLProfile " + GLProfile.glAvailabilityToString() );
+    }
+
+    @Before
+    public void init() {
+        display = new Display();
+        Assert.assertNotNull( display );
+        shell = new Shell( display );
+        Assert.assertNotNull( shell );
+        shell.setLayout( new FillLayout() );
+        composite = new Composite( shell, SWT.EMBEDDED | SWT.NO_BACKGROUND );
+        composite.setLayout( new FillLayout() );
+        Assert.assertNotNull( composite );
+        frame = SWT_AWT.new_Frame( composite );
+        Assert.assertNotNull( frame );
+    }
+
+    @After
+    public void release() {
+        Assert.assertNotNull( display );
+        Assert.assertNotNull( shell );
+        Assert.assertNotNull( composite );
+        Assert.assertNotNull( glcanvas );
+        try {
+            frame.setVisible( false );
+            frame.remove( glcanvas );
+            frame.dispose();
+            composite.dispose();
+            shell.dispose();
+            display.dispose();
+        }
+        catch( Throwable throwable ) {
+            throwable.printStackTrace();
+            Assume.assumeNoException( throwable );
+        }
+        display = null;
+        shell = null;
+        composite = null;
+        frame = null;
+        glcanvas = null;
+    }
+
+    protected void runTestGL( GLProfile glprofile ) throws InterruptedException {
+        GLCapabilities glcapabilities = new GLCapabilities( glprofile );
+        glcanvas = new GLCanvas( glcapabilities );
+        Assert.assertNotNull( glcanvas );
+        frame.add( glcanvas );
+
+        glcanvas.addGLEventListener( new GLEventListener() {
+            /* @Override */
+            public void init( GLAutoDrawable glautodrawable ) {
+            }
+
+            /* @Override */
+            public void dispose( GLAutoDrawable glautodrawable ) {
+            }
+
+            /* @Override */
+            public void display( GLAutoDrawable glautodrawable ) {
+                Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getWidth(), glautodrawable.getHeight() );
+                GL2 gl = glautodrawable.getGL().getGL2();
+                OneTriangle.render( gl, rectangle );
+            }
+
+            /* @Override */
+            public void reshape( GLAutoDrawable glautodrawable, int x, int y, int width, int height ) {
+                Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getWidth(), glautodrawable.getHeight() );
+                GL2 gl = glautodrawable.getGL().getGL2();
+                OneTriangle.setup( gl, rectangle );
+            }
+        });
+
+        shell.setText( getClass().getName() );
+        shell.setSize( 640, 480 );
+        shell.open();
+
+        long lStartTime = System.currentTimeMillis();
+        long lEndTime = lStartTime + duration;
+        try {
+            while( (System.currentTimeMillis() < lEndTime) && !composite.isDisposed() ) {
+                if( !display.readAndDispatch() ) {
+                    // blocks on linux .. display.sleep();
+                    Thread.sleep(10);
+                }
+            }
+        }
+        catch( Throwable throwable ) {
+            throwable.printStackTrace();
+            Assume.assumeNoException( throwable );
+        }
+    }
+
+    @Test
+    public void test01GLDefault() throws InterruptedException {
+        GLProfile glprofile = GLProfile.getDefault();
+        System.out.println( "GLProfile Default: " + glprofile );
+        runTestGL( glprofile );
+    }
+
+    @Test
+    public void test02GL2() throws InterruptedException {
+        GLProfile glprofile = GLProfile.get(GLProfile.GL2);
+        System.out.println( "GLProfile GL2: " + glprofile );
+        runTestGL( glprofile );
+    }
+
+    public static void main(String args[]) {
+        org.junit.runner.JUnitCore.main( TestSWTAWT01GLn.class.getName() );
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestGrayTextureFromFileAWTBug417.java b/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestGrayTextureFromFileAWTBug417.java
new file mode 100644
index 0000000..82cd917
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestGrayTextureFromFileAWTBug417.java
@@ -0,0 +1,143 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.texture;
+
+import com.jogamp.opengl.test.junit.jogl.util.texture.gl2.TextureGL2ListenerDraw1;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.awt.GLCanvas;
+import com.jogamp.opengl.util.texture.TextureIO;
+import com.jogamp.opengl.util.Animator;
+
+import java.awt.Frame;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.junit.Assert;
+import org.junit.After;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Unit test for bug 417, which shows a GLException when reading a grayscale texture.
+ * Couldn't duplicate the failure, so it must have been fixed unknowingly sometime
+ * after the bug was submitted.
+ * @author Wade Walker
+ */
+public class TestGrayTextureFromFileAWTBug417 extends UITestCase {
+    static GLProfile glp;
+    static GLCapabilities caps;
+    InputStream textureStream;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glp = GLProfile.get(GLProfile.GL2GL3);
+        Assert.assertNotNull(glp);
+        caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+    }
+
+    @Before
+    public void initTest() {
+        textureStream = TestGrayTextureFromFileAWTBug417.class.getResourceAsStream( "grayscale_texture.png" );
+        Assert.assertNotNull(textureStream);
+    }
+
+    @After
+    public void cleanupTest() {
+        textureStream=null;
+    }
+
+    @Test
+    public void test1() throws InterruptedException {
+        GLCanvas glCanvas = new GLCanvas(caps);
+
+        Frame frame = new Frame("Texture Test");
+        Assert.assertNotNull(frame);
+        frame.add(glCanvas);
+        frame.setSize( 256, 128 );
+
+        // load texture from file inside current GL context to match the way
+        // the bug submitter was doing it
+        glCanvas.addGLEventListener(new TextureGL2ListenerDraw1( null ) {
+            @Override
+            public void init(GLAutoDrawable drawable) {
+                try {
+                    setTexture( TextureIO.newTexture( textureStream, true, TextureIO.PNG ) );
+                }
+                catch(GLException glexception) {
+                    glexception.printStackTrace();
+                    Assume.assumeNoException(glexception);
+                }
+                catch(IOException ioexception) {
+                    ioexception.printStackTrace();
+                    Assume.assumeNoException(ioexception);
+                }
+            }
+        });
+
+        Animator animator = new Animator(glCanvas);
+        frame.setVisible(true);
+        animator.start();
+
+        Thread.sleep(500); // 500 ms
+
+        animator.stop();
+        frame.setVisible(false);
+        frame.remove(glCanvas);
+        glCanvas=null;
+        Assert.assertNotNull(frame);
+        frame.dispose();
+        frame=null;
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestGrayTextureFromFileAWTBug417.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestTexture01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestTexture01AWT.java
new file mode 100644
index 0000000..bd83799
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestTexture01AWT.java
@@ -0,0 +1,146 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.texture;
+
+import com.jogamp.opengl.test.junit.jogl.util.texture.gl2.TextureGL2ListenerDraw1;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.awt.GLCanvas;
+import com.jogamp.opengl.util.texture.TextureData;
+import com.jogamp.opengl.util.texture.awt.AWTTextureIO;
+import com.jogamp.opengl.util.Animator;
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Frame;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+
+import java.io.IOException;
+import org.junit.Assert;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class TestTexture01AWT extends UITestCase {
+    static GLProfile glp;
+    static GLCapabilities caps;
+    BufferedImage textureImage;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        glp = GLProfile.get(GLProfile.GL2GL3);
+        Assert.assertNotNull(glp);
+        caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+    }
+
+    @Before
+    public void initTest() {
+        // create base image
+        BufferedImage baseImage = new BufferedImage(256, 256, BufferedImage.TYPE_3BYTE_BGR);
+        Assert.assertNotNull(baseImage);
+        Graphics2D g = baseImage.createGraphics();
+        Assert.assertNotNull(g);
+        g.setPaint(new GradientPaint(0, 0, Color.CYAN,
+                                 baseImage.getWidth(), baseImage.getHeight(), Color.BLUE));
+        g.fillRect(0, 0, baseImage.getWidth(), baseImage.getHeight());
+        g.dispose();
+
+        // create texture image
+        int imageType = BufferedImage.TYPE_3BYTE_BGR;
+        textureImage = new BufferedImage(baseImage.getWidth(),
+                                         baseImage.getHeight(),
+                                         imageType);
+        Assert.assertNotNull(textureImage);
+        g = textureImage.createGraphics();
+        g.setComposite(AlphaComposite.Src);
+        g.drawImage(baseImage, 0, 0, null);
+        g.dispose();
+
+        baseImage.flush();
+        baseImage=null;
+    }
+
+    @After
+    public void cleanupTest() {
+        Assert.assertNotNull(textureImage);
+        textureImage.flush();
+        textureImage=null;
+    }
+
+    @Test
+    public void test1() throws InterruptedException {
+        GLCanvas glCanvas = new GLCanvas(caps);
+
+        Frame frame = new Frame("Texture Test");
+        Assert.assertNotNull(frame);
+        frame.add(glCanvas);
+        frame.setSize(512, 512);
+
+        // create texture    
+        TextureData textureData = AWTTextureIO.newTextureData(caps.getGLProfile(), textureImage, false);
+        glCanvas.addGLEventListener(new TextureGL2ListenerDraw1(textureData));
+
+        Animator animator = new Animator(glCanvas);
+        frame.setVisible(true);
+        animator.start();
+
+        Thread.sleep(500); // 500 ms
+
+        animator.stop();
+        frame.setVisible(false);
+        frame.remove(glCanvas);
+        glCanvas=null;
+        Assert.assertNotNull(frame);
+        frame.dispose();
+        frame=null;
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestTexture01AWT.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/texture/grayscale_texture.png b/src/test/com/jogamp/opengl/test/junit/jogl/texture/grayscale_texture.png
new file mode 100755
index 0000000..dac0f13
Binary files /dev/null and b/src/test/com/jogamp/opengl/test/junit/jogl/texture/grayscale_texture.png differ
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/gl2/TextureGL2ListenerDraw1.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/gl2/TextureGL2ListenerDraw1.java
new file mode 100644
index 0000000..649a3b1
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/gl2/TextureGL2ListenerDraw1.java
@@ -0,0 +1,112 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.jogl.util.texture.gl2;
+
+import com.jogamp.opengl.util.texture.Texture;
+import com.jogamp.opengl.util.texture.TextureCoords;
+import com.jogamp.opengl.util.texture.TextureData;
+import com.jogamp.opengl.util.texture.TextureIO;
+import javax.media.opengl.GL2ES1;
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.glu.GLU;
+
+public class TextureGL2ListenerDraw1 implements GLEventListener {
+    private GLU      glu = new GLU();
+    private TextureData textureData;
+    private Texture  texture;
+    
+    public TextureGL2ListenerDraw1(TextureData td) {
+        this.textureData = td;
+    }
+
+    public void init(GLAutoDrawable drawable) {
+        if(null!=textureData) {
+            this.texture = TextureIO.newTexture(textureData);
+        }
+    }
+
+    public void setTexture( Texture texture ) {
+        this.texture = texture;
+    }
+
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+        GL2 gl = drawable.getGL().getGL2();
+        gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+        gl.glLoadIdentity();
+        glu.gluOrtho2D(0, 1, 0, 1);
+        gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+        gl.glLoadIdentity();
+    }
+
+    public void dispose(GLAutoDrawable drawable) {
+        GL2 gl = drawable.getGL().getGL2();
+        if(null!=texture) {
+            texture.disable();
+            texture.destroy(gl);
+        }
+        if(null!=textureData) {
+            textureData.destroy();
+        }
+    }
+
+    public void display(GLAutoDrawable drawable) {
+        GL2 gl = drawable.getGL().getGL2();
+
+        // need a valid GL context for this ..
+
+        /** OpenGL ..
+        texture.updateSubImage(textureData, 0,
+                               20, 20, 
+                               20, 20,
+                               100, 100); */
+
+    
+        // Now draw one quad with the texture
+        if(null!=texture) {
+            texture.enable();
+            texture.bind();
+            gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_REPLACE);
+            TextureCoords coords = texture.getImageTexCoords();
+            gl.glBegin(GL2.GL_QUADS);
+            gl.glTexCoord2f(coords.left(), coords.bottom());
+            gl.glVertex3f(0, 0, 0);
+            gl.glTexCoord2f(coords.right(), coords.bottom());
+            gl.glVertex3f(1, 0, 0);
+            gl.glTexCoord2f(coords.right(), coords.top());
+            gl.glVertex3f(1, 1, 0);
+            gl.glTexCoord2f(coords.left(), coords.top());
+            gl.glVertex3f(0, 1, 0);
+            gl.glEnd();
+            texture.disable();
+        }
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java
new file mode 100644
index 0000000..69f9da0
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java
@@ -0,0 +1,122 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.newt;
+
+import org.junit.Test;
+import org.junit.Assert;
+
+import java.lang.reflect.InvocationTargetException;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+import javax.media.nativewindow.NativeWindow;
+import javax.media.nativewindow.util.Point;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+import com.jogamp.newt.event.WindowAdapter;
+import com.jogamp.newt.event.WindowEvent;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+public class TestCloseNewtAWT extends UITestCase {
+
+    GLWindow newtWindow = null;
+    NewtCanvasAWT newtCanvas = null;
+    JFrame frame = null;
+
+    class MyCanvas extends NewtCanvasAWT {
+         public MyCanvas(Window window) {
+            super(window);
+         }
+
+         public void addNotify() {
+            System.err.println("MyCanvas START add: "+Thread.currentThread()+", holds AWTTreeLock: "+Thread.holdsLock(this.getTreeLock()));
+            super.addNotify();
+            System.err.println("MyCanvas END add: "+Thread.currentThread()+", holds AWTTreeLock: "+Thread.holdsLock(this.getTreeLock()));
+         }
+
+         public void removeNotify() {
+            System.err.println("MyCanvas START remove: "+Thread.currentThread()+", holds AWTTreeLock: "+Thread.holdsLock(this.getTreeLock()));
+
+            // trigger critical situation around the AWT TreeLock
+            newtWindow.runOnEDTIfAvail(true, new Runnable() {
+                public void run() {
+                    // NEWT EDT while AWT is locked
+                    System.err.println("MyCanvas On NEWT-EDT From AWT-EDT: "+Thread.currentThread()+
+                                       ", holds AWTTreeLock: "+Thread.holdsLock(MyCanvas.this.getTreeLock()));
+
+                    // Critical: Within NEWT EDT, while AWT is locked
+                    NativeWindow nw = MyCanvas.this.getNativeWindow();
+                    if(null != nw) {
+                        Point p = nw.getLocationOnScreen(null);
+                        System.err.println("MyCanvas On NEWT-EDT: position: "+p);
+                    } else {
+                        System.err.println("MyCanvas On NEWT-EDT: position n/a, null NativeWindow");
+                    }
+                }
+            });
+            System.err.println("MyCanvas passed critical: "+Thread.currentThread()+", holds AWTTreeLock: "+Thread.holdsLock(this.getTreeLock()));
+
+            super.removeNotify();
+
+            System.err.println("MyCanvas END remove: "+Thread.currentThread()+", holds AWTTreeLock: "+Thread.holdsLock(this.getTreeLock()));
+         }
+    }
+
+    @Test
+    public void testCloseNewtAWT() throws InterruptedException, InvocationTargetException {
+        newtWindow = GLWindow.create(new GLCapabilities(GLProfile.getDefault()));
+        newtCanvas = new MyCanvas(newtWindow);
+
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                frame = new JFrame("NEWT Close Test");
+                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+                frame.getContentPane().add(newtCanvas);
+                frame.pack();
+                frame.setSize(800, 600);
+                frame.setVisible(true);
+            }
+        });
+        Thread.sleep(1000);
+
+        Assert.assertEquals(true,  AWTRobotUtil.closeWindow(frame, true));
+
+        GLProfile.shutdown();
+    }
+
+    public static void main(String[] args) {
+        String tstname = TestCloseNewtAWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java
new file mode 100644
index 0000000..9343e2d
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java
@@ -0,0 +1,264 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.newt;
+
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestDisplayLifecycle01NEWT extends UITestCase {
+    static GLProfile glp;
+    static GLCapabilities caps;
+    static int width, height;
+    static long durationPerTest = 100; // ms
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        width  = 640;
+        height = 480;
+        glp = GLProfile.getDefault();
+        caps = new GLCapabilities(glp);
+    }
+
+    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height)
+        throws InterruptedException
+    {
+        Assert.assertNotNull(caps);
+
+        //
+        // Create native windowing resources .. X11/Win/OSX
+        // 
+        GLWindow glWindow;
+        if(null!=screen) {
+            Window window = NewtFactory.createWindow(screen, caps);
+            Assert.assertNotNull(window);
+            glWindow = GLWindow.create(window);
+        } else {
+            glWindow = GLWindow.create(caps);
+        }
+
+        GLEventListener demo = new Gears();
+        setDemoFields(demo, glWindow);
+        glWindow.addGLEventListener(demo);
+        glWindow.addWindowListener(new TraceWindowAdapter());
+        glWindow.setSize(width, height);
+        return glWindow;
+    }
+
+    private void testDisplayCreate01(Display display, Screen screen) throws InterruptedException {
+        // start-state == end-state
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(false,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+
+        // Create Window, pending lazy native creation
+        GLWindow window = createWindow(screen, caps, width, height);
+        Assert.assertEquals(screen,window.getScreen());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+
+        Assert.assertNotNull(window.getScreen());
+        Assert.assertEquals(true,window.isValid());
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        // lazy native creation sequence: Display, Screen and Window
+        Assert.assertEquals(0, window.getTotalFrames());
+        window.setVisible(true);
+
+        Assert.assertEquals(screen,window.getScreen());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(1,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+        System.err.println("Frames for setVisible(true) 1: "+window.getTotalFrames());
+        Assert.assertTrue(0 < window.getTotalFrames());
+
+        while(window.getDuration()<1*durationPerTest) {
+            window.display();
+            Thread.sleep(100);
+        }
+        System.err.println("duration: "+window.getDuration());
+
+        // just make the Window invisible
+        window.setVisible(false);
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        // just make the Window visible again
+        window.resetCounter();
+        Assert.assertEquals(0, window.getTotalFrames());
+        window.setVisible(true);
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+        System.err.println("Frames for setVisible(true) 1: "+window.getTotalFrames());
+        Assert.assertTrue(0 < window.getTotalFrames());
+
+        while(window.getDuration()<2*durationPerTest) {
+            window.display();
+            Thread.sleep(100);
+        }
+        System.err.println("duration: "+window.getDuration());
+
+        // destruction ..
+        window.destroy();
+        Assert.assertEquals(screen,window.getScreen());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(false,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(true, window.isValid());
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+        window.resetCounter();
+        Assert.assertEquals(0, window.getTotalFrames());
+
+        // a display call shall not change a thing
+        window.display();
+        Assert.assertEquals(0, window.getTotalFrames());
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        // recover Window
+        window.setVisible(true);
+
+        Assert.assertEquals(screen,window.getScreen());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(1,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+        System.err.println("Frames for setVisible(true) 2: "+window.getTotalFrames());
+        Assert.assertTrue(0 < window.getTotalFrames());
+
+        while(window.getDuration()<1*durationPerTest) {
+            window.display();
+            Thread.sleep(100);
+        }
+        System.err.println("duration: "+window.getDuration());
+
+        // destruction ..
+        window.destroy();
+        display.dumpDisplayList("Post destroy(true)");
+
+        // end-state == start-state
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(false,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+
+        Assert.assertNotNull(window.getScreen());
+        Assert.assertEquals(true,window.isValid());
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+    }
+
+    @Test
+    public void testDisplayCreate01_AutoDestroyLifecycle() throws InterruptedException {
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        // Create Display/Screen, pending lazy native creation
+        Display display = NewtFactory.createDisplay(null);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        testDisplayCreate01(display, screen);
+        testDisplayCreate01(display, screen);
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);
+        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        System.err.println("durationPerTest: "+durationPerTest);
+        String tstname = TestDisplayLifecycle01NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java
new file mode 100644
index 0000000..d17c5f0
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java
@@ -0,0 +1,386 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.newt;
+
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestDisplayLifecycle02NEWT extends UITestCase {
+    static GLProfile glp;
+    static GLCapabilities caps;
+    static int width, height;
+    static long durationPerTest = 100; // ms
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        width  = 640;
+        height = 480;
+        glp = GLProfile.getDefault();
+        caps = new GLCapabilities(glp);
+    }
+
+    static GLWindow createWindow(GLCapabilities caps, int width, int height)
+        throws InterruptedException
+    {
+        Assert.assertNotNull(caps);
+
+        //
+        // Create native windowing resources .. X11/Win/OSX
+        // 
+        GLWindow glWindow = GLWindow.create(caps);
+
+        GLEventListener demo = new Gears();
+        setDemoFields(demo, glWindow);
+        glWindow.addGLEventListener(demo);
+        glWindow.addWindowListener(new TraceWindowAdapter());
+        glWindow.setSize(width, height);
+        return glWindow;
+    }
+
+    private void testDisplayCreate01Impl() throws InterruptedException {
+        // start-state == end-state
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        // Create Window, pending lazy native creation
+        GLWindow window = createWindow(caps, width, height);
+        Screen screen = window.getScreen();
+        Display display = screen.getDisplay();
+
+        Assert.assertEquals(screen,window.getScreen());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,Screen.getActiveScreenNumber());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        // lazy native creation sequence: Display, Screen and Window
+        Assert.assertEquals(0, window.getTotalFrames());
+        window.setVisible(true);
+
+        Assert.assertEquals(screen,window.getScreen());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(1,Screen.getActiveScreenNumber());
+        Assert.assertEquals(1,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+        System.err.println("Frames for setVisible(true) 1: "+window.getTotalFrames());
+        Assert.assertTrue(0 < window.getTotalFrames());
+
+        while(window.getDuration()<1*durationPerTest) {
+            window.display();
+            Thread.sleep(100);
+        }
+        System.err.println("duration: "+window.getDuration());
+
+        // just make the Window invisible
+        window.setVisible(false);
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        // just make the Window visible again
+        window.resetCounter();
+        Assert.assertEquals(0, window.getTotalFrames());
+        window.setVisible(true);
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+        System.err.println("Frames for setVisible(true) 1: "+window.getTotalFrames());
+        Assert.assertTrue(0 < window.getTotalFrames());
+
+        while(window.getDuration()<2*durationPerTest) {
+            window.display();
+            Thread.sleep(100);
+        }
+        System.err.println("duration: "+window.getDuration());
+
+        // destruction.. ref count down, but keep all
+        window.destroy();
+        Assert.assertEquals(screen,window.getScreen());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(false,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,Screen.getActiveScreenNumber());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertNotNull(window.getScreen());
+        Assert.assertEquals(true,window.isValid());
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        window.resetCounter();
+        Assert.assertEquals(0, window.getTotalFrames());
+
+        // a display call shall not change a thing
+        window.display();
+        Assert.assertEquals(0, window.getTotalFrames());
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        // recover Window
+        window.setVisible(true);
+
+        Assert.assertEquals(screen,window.getScreen());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,window.isValid());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(1,Screen.getActiveScreenNumber());
+        Assert.assertEquals(1,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+        System.err.println("Frames for setVisible(true) 2: "+window.getTotalFrames());
+        Assert.assertTrue(0 < window.getTotalFrames());
+
+        while(window.getDuration()<1*durationPerTest) {
+            window.display();
+            Thread.sleep(100);
+        }
+        System.err.println("duration: "+window.getDuration());
+
+        // destruction + invalidate, ie Display/Screen will be unreferenced
+        window.invalidate();
+        Assert.assertNull(window.getScreen());
+        Assert.assertEquals(false,window.isValid());
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        display.dumpDisplayList("Post destroy(true)");
+
+        // end-state == start-state
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(false,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,Screen.getActiveScreenNumber());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+    }
+
+    @Test
+    public void testDisplayCreate01() throws InterruptedException {
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        // Create Display/Screen, pending lazy native creation
+        testDisplayCreate01Impl();
+        testDisplayCreate01Impl();
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+    }
+
+    private void testDisplayCreate02Impl() throws InterruptedException {
+        // start-state == end-state
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        // Create Window, pending lazy native creation
+        GLWindow window1 = createWindow(caps, width, height);
+        window1.setPosition(0, 0);
+        Screen screen = window1.getScreen();
+        Display display = screen.getDisplay();
+
+        GLWindow window2 = createWindow(caps, width, height);
+        Assert.assertSame(screen, window2.getScreen());
+        Assert.assertSame(display, window2.getScreen().getDisplay());
+        window2.setPosition(screen.getWidth()-width, 0);
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,Screen.getActiveScreenNumber());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(false,window1.isNativeValid());
+        Assert.assertEquals(false,window1.isVisible());
+        Assert.assertEquals(false,window2.isNativeValid());
+        Assert.assertEquals(false,window2.isVisible());
+
+        // lazy native creation sequence: Display, Screen and Window
+        Assert.assertEquals(0, window1.getTotalFrames());
+        window1.setVisible(true);
+
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(1,Screen.getActiveScreenNumber());
+        Assert.assertEquals(1,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(true,window1.isNativeValid());
+        Assert.assertEquals(true,window1.isVisible());
+        System.err.println("Frames for setVisible(true) 1: "+window1.getTotalFrames());
+        Assert.assertTrue(0 < window1.getTotalFrames());
+
+        Assert.assertEquals(0, window2.getTotalFrames());
+        window2.setVisible(true);
+
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(1,Screen.getActiveScreenNumber());
+        Assert.assertEquals(2,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(true,window2.isNativeValid());
+        Assert.assertEquals(true,window2.isVisible());
+        System.err.println("Frames for setVisible(true) 2: "+window2.getTotalFrames());
+        Assert.assertTrue(0 < window2.getTotalFrames());
+
+        while(window1.getDuration()<1*durationPerTest) {
+            window1.display();
+            Thread.sleep(100);
+        }
+        System.err.println("duration: "+window1.getDuration());
+
+        // just make the Window invisible
+        window1.setVisible(false);
+        Assert.assertEquals(true,window1.isNativeValid());
+        Assert.assertEquals(false,window1.isVisible());
+
+        // destruction ...
+        window1.destroy();
+        Assert.assertNotNull(window1.getScreen());
+        Assert.assertEquals(true,window1.isValid());
+        Assert.assertEquals(false,window1.isNativeValid());
+        Assert.assertEquals(false,window1.isVisible());
+
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(1,Screen.getActiveScreenNumber());
+        Assert.assertEquals(1,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+
+        // destruction
+        window2.destroy();
+        Assert.assertNotNull(window2.getScreen());
+        Assert.assertEquals(true,window2.isValid());
+        Assert.assertEquals(false,window2.isNativeValid());
+        Assert.assertEquals(false,window2.isVisible());
+
+        // end-state == start-state
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(false,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,Screen.getActiveScreenNumber());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+
+        // invalidate .. remove all refs
+        window1.invalidate();
+        Assert.assertNull(window1.getScreen());
+        Assert.assertEquals(false,window1.isValid());
+        Assert.assertEquals(false,window1.isNativeValid());
+        Assert.assertEquals(false,window1.isVisible());
+
+        // invalidate .. remove all refs
+        window2.invalidate();
+        Assert.assertNull(window2.getScreen());
+        Assert.assertEquals(false,window2.isValid());
+        Assert.assertEquals(false,window2.isNativeValid());
+        Assert.assertEquals(false,window2.isVisible());
+
+    }
+
+    @Test
+    public void testDisplayCreate02() throws InterruptedException {
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        // Create Display/Screen, pending lazy native creation
+        testDisplayCreate02Impl();
+        testDisplayCreate02Impl();
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);
+        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        System.err.println("durationPerTest: "+durationPerTest);
+        String tstname = TestDisplayLifecycle02NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java b/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
new file mode 100644
index 0000000..67dd2a3
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
@@ -0,0 +1,110 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import java.io.IOException;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
+
+import com.jogamp.newt.awt.NewtCanvasAWT;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import com.jogamp.opengl.test.junit.util.*;
+
+/**
+ * This simple program will throw a {@link RuntimeException} when the application is closed.
+ */
+public class TestEventSourceNotAWTBug extends UITestCase {
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+    }
+
+    @Test
+    public void testEventSourceNotNewtBug() throws InterruptedException {
+        JFrame jf = new JFrame();
+
+        jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLWindow glWindow = GLWindow.create(caps);
+        final NewtCanvasAWT canvas = new NewtCanvasAWT(glWindow);
+        jf.getContentPane().add(canvas);
+
+        // The following line isn't event necessary to see the problem.
+        glWindow.addGLEventListener(new Gears());
+
+        final JFrame f_jf = jf;
+
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                f_jf.setSize(800, 600);
+                f_jf.setVisible(true);
+            }
+        });
+
+        Thread.sleep(500);
+
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                f_jf.dispose();
+            }
+        });
+        glWindow.invalidate();
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestEventSourceNotAWTBug.class.getName();
+        /*
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } ); */
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java
new file mode 100644
index 0000000..047df5c
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java
@@ -0,0 +1,201 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import org.junit.Assert;
+import org.junit.AfterClass;
+
+import java.awt.AWTException;
+import java.awt.BorderLayout;
+import java.awt.Button;
+import java.awt.Robot;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLProfile;
+import javax.swing.JFrame;
+
+import java.util.ArrayList;
+import java.io.IOException;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.jogamp.newt.awt.NewtCanvasAWT;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquare;
+
+import com.jogamp.opengl.test.junit.util.*;
+
+public class TestFocus01SwingAWTRobot extends UITestCase {
+    static int width, height;
+    static long durationPerTest = 800;
+    static long awtWaitTimeout = 1000;
+
+    static GLCapabilities glCaps;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        width = 640;
+        height = 480;
+        glCaps = new GLCapabilities(null);
+    }
+
+    @AfterClass
+    public static void release() {
+    }
+
+    @Test
+    public void testFocus01ProgrFocus() throws AWTException, InterruptedException, InvocationTargetException {
+        testFocus01ProgrFocusImpl(null);
+    }
+
+    @Test
+    public void testFocus02RobotFocus() throws AWTException, InterruptedException, InvocationTargetException {
+        Robot robot = new Robot();
+        robot.setAutoWaitForIdle(true);
+        testFocus01ProgrFocusImpl(robot);
+    }
+
+    private void testFocus01ProgrFocusImpl(Robot robot) throws AWTException,
+            InvocationTargetException, InterruptedException {
+        ArrayList eventCountAdapters = new ArrayList();
+
+        // Create a window.
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        glWindow1.setTitle("testNewtChildFocus");
+        GLEventListener demo1 = new RedSquare();
+        TestListenerCom01AWT.setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+        NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
+        eventCountAdapters.add(glWindow1FA);
+        glWindow1.addWindowListener(glWindow1FA);
+
+        // Monitor NEWT focus and keyboard events.
+        NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+        eventCountAdapters.add(glWindow1KA);
+        glWindow1.addKeyListener(glWindow1KA);
+
+        // Wrap the window in a canvas.
+        final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+
+        // Monitor AWT focus and keyboard events.
+        AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
+        newtCanvasAWT.addKeyListener(newtCanvasAWTKA);
+        eventCountAdapters.add(newtCanvasAWTKA);
+        AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
+        newtCanvasAWT.addFocusListener(newtCanvasAWTFA);
+        eventCountAdapters.add(newtCanvasAWTFA);
+
+        // Add the canvas to a frame, and make it all visible.
+        JFrame frame1 = new JFrame("Swing AWT Parent Frame: "
+                + glWindow1.getTitle());
+        frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
+        Button button = new Button("Click me ..");
+        AWTFocusAdapter buttonFA = new AWTFocusAdapter("Button");
+        button.addFocusListener(buttonFA);
+        eventCountAdapters.add(buttonFA);
+        AWTKeyAdapter buttonKA = new AWTKeyAdapter("Button");
+        button.addKeyListener(buttonKA);
+        eventCountAdapters.add(buttonKA);
+        frame1.getContentPane().add(button, BorderLayout.NORTH);
+        frame1.setSize(width, height);
+        frame1.setVisible(true);
+        Assert.assertTrue(AWTRobotUtil.toFront(robot, frame1));
+
+        int wait=0;
+        while(wait<awtWaitTimeout/100 && glWindow1.getTotalFrames()<1) { Thread.sleep(awtWaitTimeout/10); wait++; }
+        System.err.println("Frames for initial setVisible(true): "+glWindow1.getTotalFrames());
+        Assert.assertTrue(glWindow1.isVisible());
+        Assert.assertTrue(0 < glWindow1.getTotalFrames());
+
+        // Continuous animation ..
+        Animator animator = new Animator(glWindow1);
+        animator.start();
+
+        // Button Focus
+        Thread.sleep(100); // allow event sync
+        System.err.println("FOCUS AWT  Button request");
+        EventCountAdapterUtil.reset(eventCountAdapters);
+        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, button, button, buttonFA, null));
+        Assert.assertEquals(1, buttonFA.getCount());
+        Assert.assertEquals(0, glWindow1FA.getCount());
+        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
+        System.err.println("FOCUS AWT  Button sync");
+        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, button, buttonKA));
+
+        // Request the AWT focus, which should automatically provide the NEWT window with focus.
+        Thread.sleep(100); // allow event sync
+        System.err.println("FOCUS NEWT Canvas/GLWindow request");
+        EventCountAdapterUtil.reset(eventCountAdapters);
+        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, newtCanvasAWT, newtCanvasAWT.getNEWTChild(), glWindow1FA, buttonFA));
+        Assert.assertTrue(AWTRobotUtil.waitForCount(0, newtCanvasAWTFA));
+        Assert.assertEquals(1, glWindow1FA.getCount());
+        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
+        Assert.assertEquals(-1, buttonFA.getCount()); // lost focus
+        System.err.println("FOCUS NEWT Canvas/GLWindow sync");
+        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, glWindow1, glWindow1KA));
+        Assert.assertEquals("AWT parent canvas received keyboard events", 0, newtCanvasAWTKA.getCount());
+
+        // Remove listeners to avoid logging during dispose/destroy.
+        glWindow1.removeKeyListener(glWindow1KA);
+        glWindow1.removeWindowListener(glWindow1FA);
+        newtCanvasAWT.removeKeyListener(newtCanvasAWTKA);
+        newtCanvasAWT.removeFocusListener(newtCanvasAWTFA);
+
+        // Shutdown the test.
+        animator.stop();
+        frame1.dispose();
+        glWindow1.invalidate();
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        System.out.println("durationPerTest: "+durationPerTest);
+        String tstname = TestFocus01SwingAWTRobot.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java
new file mode 100644
index 0000000..15e4c3a
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java
@@ -0,0 +1,301 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import java.lang.reflect.*;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import java.awt.AWTException;
+import java.awt.Button;
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.Robot;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import java.util.ArrayList;
+
+import javax.media.opengl.*;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.newt.opengl.*;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.*;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestFocus02SwingAWTRobot extends UITestCase {
+    static int width, height;
+    static long durationPerTest = 800;
+    static long awtWaitTimeout = 1000;
+    static long waitReparent = 0;
+    static GLCapabilities glCaps;
+
+    @BeforeClass
+    public static void initClass() throws AWTException {
+        width  = 640;
+        height = 480;
+
+        JFrame f = new JFrame();
+        f.setSize(100,100);
+        f.setVisible(true);
+        f.dispose();
+        f=null;
+
+        GLProfile.initSingleton(false);
+        glCaps = new GLCapabilities(null);
+    }
+
+    @AfterClass
+    public static void release() {
+    }
+    
+    private void testFocus01ProgrFocusImpl(Robot robot) 
+        throws AWTException, InterruptedException, InvocationTargetException {
+        int x = 0;
+        int y = 0;
+
+        ArrayList eventCountAdapters = new ArrayList();
+
+        /**
+         * JFrame . JPanel . Container . NewtCanvasAWT . GLWindow
+         */
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
+        GLEventListener demo1 = new Gears();
+        glWindow1.addGLEventListener(demo1);
+        NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
+        glWindow1.addWindowListener(glWindow1FA);
+        eventCountAdapters.add(glWindow1FA);
+        NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+        glWindow1.addKeyListener(glWindow1KA);
+        eventCountAdapters.add(glWindow1KA);
+        NEWTMouseAdapter glWindow1MA = new NEWTMouseAdapter("GLWindow1");
+        glWindow1.addMouseListener(glWindow1MA);
+        eventCountAdapters.add(glWindow1MA);
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+        AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
+        newtCanvasAWT.addFocusListener(newtCanvasAWTFA);
+        eventCountAdapters.add(newtCanvasAWTFA);
+        AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
+        newtCanvasAWT.addKeyListener(newtCanvasAWTKA);
+        eventCountAdapters.add(newtCanvasAWTKA);
+        AWTMouseAdapter newtCanvasAWTMA = new AWTMouseAdapter("NewtCanvasAWT");
+        newtCanvasAWT.addMouseListener(newtCanvasAWTMA);
+        eventCountAdapters.add(newtCanvasAWTMA);
+
+        Button buttonNorthInner = new Button("north");
+        AWTFocusAdapter buttonNorthInnerFA = new AWTFocusAdapter("ButtonNorthInner");
+        buttonNorthInner.addFocusListener(buttonNorthInnerFA);
+        eventCountAdapters.add(buttonNorthInnerFA);
+        AWTKeyAdapter buttonNorthInnerKA = new AWTKeyAdapter("ButtonNorthInner");
+        buttonNorthInner.addKeyListener(buttonNorthInnerKA);
+        eventCountAdapters.add(buttonNorthInnerKA);
+        AWTMouseAdapter buttonNorthInnerMA = new AWTMouseAdapter("ButtonNorthInner");
+        buttonNorthInner.addMouseListener(buttonNorthInnerMA);
+        eventCountAdapters.add(buttonNorthInnerMA);
+        Container container1 = new Container();
+        container1.setLayout(new BorderLayout());
+        container1.add(buttonNorthInner, BorderLayout.NORTH);
+        container1.add(new Button("south"), BorderLayout.SOUTH);
+        container1.add(new Button("east"), BorderLayout.EAST);
+        container1.add(new Button("west"), BorderLayout.WEST);
+        container1.add(newtCanvasAWT, BorderLayout.CENTER);
+
+        Button buttonNorthOuter = new Button("north");
+        AWTFocusAdapter buttonNorthOuterFA = new AWTFocusAdapter("ButtonNorthOuter");
+        buttonNorthOuter.addFocusListener(buttonNorthOuterFA);
+        eventCountAdapters.add(buttonNorthOuterFA);
+        AWTKeyAdapter buttonNorthOuterKA = new AWTKeyAdapter("ButtonNorthOuter");
+        buttonNorthOuter.addKeyListener(buttonNorthOuterKA);
+        eventCountAdapters.add(buttonNorthOuterKA);
+        AWTMouseAdapter buttonNorthOuterMA = new AWTMouseAdapter("ButtonNorthOuter");
+        buttonNorthOuter.addMouseListener(buttonNorthOuterMA);
+        eventCountAdapters.add(buttonNorthOuterMA);
+        JPanel jPanel1 = new JPanel();
+        jPanel1.setLayout(new BorderLayout());
+        jPanel1.add(buttonNorthOuter, BorderLayout.NORTH);
+        jPanel1.add(new Button("south"), BorderLayout.SOUTH);
+        jPanel1.add(new Button("east"), BorderLayout.EAST);
+        jPanel1.add(new Button("west"), BorderLayout.WEST);
+        jPanel1.add(container1, BorderLayout.CENTER);
+
+        JFrame jFrame1 = new JFrame("Swing Parent JFrame");
+        AWTFocusAdapter jFrame1FA = new AWTFocusAdapter("JFrame1");
+        jFrame1.addFocusListener(jFrame1FA);
+        // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+        jFrame1.setContentPane(jPanel1);
+        jFrame1.setSize(width, height);
+        jFrame1.setVisible(true); // from here on, we need to run modifications on EDT
+        Assert.assertTrue(AWTRobotUtil.toFront(robot, jFrame1));
+
+        int wait=0;
+        while(wait<awtWaitTimeout/100 && glWindow1.getTotalFrames()<1) { Thread.sleep(awtWaitTimeout/10); wait++; }
+        System.err.println("Frames for initial setVisible(true): "+glWindow1.getTotalFrames());
+        Assert.assertTrue(glWindow1.isVisible());
+        Assert.assertTrue(0 < glWindow1.getTotalFrames());
+
+        // Continuous animation ..
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+
+        // Button Outer Focus
+        Thread.sleep(100); // allow event sync
+        System.err.println("FOCUS AWT  Button Outer request");
+        EventCountAdapterUtil.reset(eventCountAdapters);
+        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, buttonNorthOuter, buttonNorthOuter, buttonNorthOuterFA, null));
+        Assert.assertEquals(1, buttonNorthOuterFA.getCount());
+        Assert.assertEquals(0, glWindow1FA.getCount());
+        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
+        Assert.assertEquals(0, buttonNorthInnerFA.getCount());
+        Assert.assertEquals(0, jFrame1FA.getCount());
+        System.err.println("FOCUS AWT  Button Outer sync");
+        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, buttonNorthOuter, buttonNorthOuterKA));
+        Assert.assertEquals(1, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 1, 
+                                                           buttonNorthOuter, buttonNorthOuterMA));
+        Assert.assertEquals(3, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 2, 
+                                                           buttonNorthOuter, buttonNorthOuterMA));
+
+        // NEWT Focus
+        Thread.sleep(100); // allow event sync
+        System.err.println("FOCUS NEWT Canvas/GLWindow request");
+        EventCountAdapterUtil.reset(eventCountAdapters);
+        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, newtCanvasAWT, newtCanvasAWT.getNEWTChild(), glWindow1FA, buttonNorthOuterFA));
+        Assert.assertTrue(AWTRobotUtil.waitForCount(0, newtCanvasAWTFA));
+        Assert.assertEquals(1, glWindow1FA.getCount());
+        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
+        Assert.assertEquals(0, buttonNorthInnerFA.getCount());
+        Assert.assertEquals(-1, buttonNorthOuterFA.getCount()); // lost focus
+        Assert.assertEquals(0, jFrame1FA.getCount());
+        System.err.println("FOCUS NEWT Canvas/GLWindow sync");
+        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, glWindow1, glWindow1KA));
+        Assert.assertEquals("AWT parent canvas received keyboard events", 0, newtCanvasAWTKA.getCount());
+        Assert.assertEquals(1, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 1, 
+                                                           glWindow1, glWindow1MA));
+        Assert.assertEquals(3, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 2, 
+                                                           glWindow1, glWindow1MA));
+        Assert.assertEquals("AWT parent canvas received mouse events", 0, newtCanvasAWTMA.getCount());
+
+        // Button Inner Focus
+        Thread.sleep(100); // allow event sync
+        System.err.println("FOCUS AWT  Button request");
+        EventCountAdapterUtil.reset(eventCountAdapters);
+        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, buttonNorthInner, buttonNorthInner, buttonNorthInnerFA, glWindow1FA));
+        Assert.assertEquals(1, buttonNorthInnerFA.getCount());
+        Assert.assertEquals(-1, glWindow1FA.getCount()); // lost focus
+        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
+        Assert.assertEquals(0, buttonNorthOuterFA.getCount());
+        Assert.assertEquals(0, jFrame1FA.getCount());
+        System.err.println("FOCUS AWT  Button sync");
+        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, buttonNorthInner, buttonNorthInnerKA));
+        Assert.assertEquals(1, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 1, 
+                                                           buttonNorthInner, buttonNorthInnerMA));
+        Assert.assertEquals(3, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 2, 
+                                                           buttonNorthInner, buttonNorthInnerMA));
+
+        // NEWT Focus
+        Thread.sleep(100); // allow event sync
+        System.err.println("FOCUS NEWT Canvas/GLWindow request");
+        EventCountAdapterUtil.reset(eventCountAdapters);
+        Assert.assertTrue(AWTRobotUtil.requestFocusAndWait(robot, newtCanvasAWT, newtCanvasAWT.getNEWTChild(), glWindow1FA, buttonNorthInnerFA));
+        Assert.assertTrue(AWTRobotUtil.waitForCount(0, newtCanvasAWTFA));
+        Assert.assertEquals(1, glWindow1FA.getCount());
+        Assert.assertEquals(0, newtCanvasAWTFA.getCount());
+        Assert.assertEquals(-1, buttonNorthInnerFA.getCount()); // lost focus
+        Assert.assertEquals(0, buttonNorthOuterFA.getCount());
+        Assert.assertEquals(0, jFrame1FA.getCount());
+        System.err.println("FOCUS NEWT Canvas/GLWindow sync");
+        Assert.assertEquals(2, AWTRobotUtil.testKeyType(robot, 2, glWindow1, glWindow1KA));
+        Assert.assertEquals("AWT parent canvas received keyboard events", 0, newtCanvasAWTKA.getCount());
+        Assert.assertEquals(1, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 1, 
+                                                           glWindow1, glWindow1MA));
+        Assert.assertEquals(3, AWTRobotUtil.testMouseClick(robot, java.awt.event.InputEvent.BUTTON1_MASK, 2, 
+                                                           glWindow1, glWindow1MA));
+        Assert.assertEquals("AWT parent canvas received mouse events", 0, newtCanvasAWTMA.getCount());
+
+
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+
+        final JFrame _jFrame1 = jFrame1;
+        final JPanel _jPanel1 = jPanel1;
+        final Container _container1 = container1;
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    _jFrame1.setVisible(false);
+                    _jPanel1.remove(_container1);
+                    _jFrame1.dispose();
+                } });
+
+        glWindow1.invalidate();
+    }
+
+    @Test
+    public void testFocus01ProgrFocus() throws AWTException, InterruptedException, InvocationTargetException {
+        testFocus01ProgrFocusImpl(null);
+    }
+
+    @Test
+    public void testFocus02RobotFocus() throws AWTException, InterruptedException, InvocationTargetException {
+        Robot robot = new Robot();
+        robot.setAutoWaitForIdle(true);
+        testFocus01ProgrFocusImpl(robot);
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            } else if(args[i].equals("-wait")) {
+                waitReparent = atoi(args[++i]);
+            }
+        }
+        System.err.println("durationPerTest "+durationPerTest);
+        System.err.println("waitReparent "+waitReparent);
+        String tstname = TestFocus02SwingAWTRobot.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java
new file mode 100644
index 0000000..f957157
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java
@@ -0,0 +1,133 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.media.opengl.*;
+
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+
+public class TestGLWindows00NEWT extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+    static long durationPerTest = 100; // ms
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        // GLProfile.initSingleton(false);
+        width  = 640;
+        height = 480;
+        glp = GLProfile.getDefault();
+    }
+
+    static GLWindow createWindow(Screen screen, GLCapabilitiesImmutable caps)
+        throws InterruptedException
+    {
+        Assert.assertNotNull(caps);
+        //
+        // Create native windowing resources .. X11/Win/OSX
+        // 
+        GLWindow glWindow;
+        if(null!=screen) {
+            glWindow = GLWindow.create(screen, caps);
+            Assert.assertNotNull(glWindow);
+        } else {
+            glWindow = GLWindow.create(caps);
+            Assert.assertNotNull(glWindow);
+        }
+
+        GLEventListener demo = new Gears();
+        glWindow.addGLEventListener(demo);
+
+        glWindow.setSize(512, 512);
+        glWindow.setVisible(true);
+        Assert.assertEquals(true,glWindow.isVisible());
+        Assert.assertEquals(true,glWindow.isNativeValid());
+
+        return glWindow;
+    }
+
+    static void destroyWindow(GLWindow glWindow) {
+        if(null!=glWindow) {
+            glWindow.invalidate();
+            Assert.assertEquals(false,glWindow.isNativeValid());
+            Assert.assertEquals(false,glWindow.isValid());
+        }
+    }
+
+    @Test
+    public void testWindow00() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        GLWindow window1 = createWindow(null, caps); // local
+        Assert.assertEquals(true,window1.isNativeValid());
+        Assert.assertEquals(true,window1.isVisible());
+        AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
+
+        System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
+
+        for(int state=0; state*100<durationPerTest; state++) {
+            Thread.sleep(100);
+        }
+
+        destroyWindow(window1);
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        System.out.println("durationPerTest: "+durationPerTest);
+        String tstname = TestGLWindows00NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java
new file mode 100644
index 0000000..5be9771
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java
@@ -0,0 +1,384 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.media.opengl.*;
+
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestGLWindows01NEWT extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+    static long durationPerTest = 100; // ms
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        // GLProfile.initSingleton(false);
+        width  = 640;
+        height = 480;
+        glp = GLProfile.getDefault();
+    }
+
+    static GLWindow createWindow(Screen screen, GLCapabilities caps,
+                                 int width, int height, boolean onscreen, boolean undecorated,
+                                 boolean addGLEventListenerAfterVisible) 
+        throws InterruptedException
+    {
+        Assert.assertNotNull(caps);
+        caps.setOnscreen(onscreen);
+        // System.out.println("Requested: "+caps);
+
+        //
+        // Create native windowing resources .. X11/Win/OSX
+        // 
+        GLWindow glWindow;
+        if(null!=screen) {
+            glWindow = GLWindow.create(screen, caps);
+            Assert.assertNotNull(glWindow);
+        } else {
+            glWindow = GLWindow.create(caps);
+            Assert.assertNotNull(glWindow);
+        }
+
+        glWindow.setUndecorated(onscreen && undecorated);
+        Assert.assertEquals(false,glWindow.isVisible());
+        Assert.assertEquals(false,glWindow.isNativeValid());
+
+        GLEventListener demo = new Gears();
+        setDemoFields(demo, glWindow);
+        if(!addGLEventListenerAfterVisible) {
+            glWindow.addGLEventListener(demo);
+        }
+        glWindow.addWindowListener(new TraceWindowAdapter());
+
+        glWindow.setSize(width, height);
+
+        Assert.assertEquals(0, glWindow.getTotalFrames());
+        glWindow.setVisible(true);
+        Assert.assertEquals(true,glWindow.isVisible());
+        Assert.assertEquals(true,glWindow.isNativeValid());
+        System.out.println("Frames for initial setVisible(true): "+glWindow.getTotalFrames());
+        Assert.assertTrue(0 < glWindow.getTotalFrames());
+
+        //
+        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // equivalent to GLAutoDrawable methods: setVisible(true)
+        // 
+        GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
+        Assert.assertNotNull(caps2);
+        Assert.assertTrue(caps2.getGreenBits()>=5);
+        Assert.assertTrue(caps2.getBlueBits()>=5);
+        Assert.assertTrue(caps2.getRedBits()>=5);
+        Assert.assertEquals(caps2.isOnscreen(),onscreen);
+
+        if(addGLEventListenerAfterVisible) {
+            glWindow.addGLEventListener(demo);
+            glWindow.display();
+        }
+
+        return glWindow;
+    }
+
+    static void destroyWindow(GLWindow glWindow) {
+        if(null!=glWindow) {
+            glWindow.invalidate();
+            Assert.assertEquals(false,glWindow.isNativeValid());
+            Assert.assertEquals(false,glWindow.isValid());
+        }
+    }
+
+    @Test
+    public void testWindowNativeRecreate01aSimple() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        GLWindow window = createWindow(null, caps, width, height, 
+                                       true /* onscreen */, false /* undecorated */, 
+                                       false /*addGLEventListenerAfterVisible*/);
+
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+        window.destroy();
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        window.display();
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        window.setVisible(true);
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+
+        window.setVisible(false);
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        destroyWindow(window);
+    }
+
+    @Test
+    public void testWindowNativeRecreate01bSimple() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        GLWindow window = createWindow(null, caps, width, height, 
+                                       true /* onscreen */, false /* undecorated */, 
+                                       true /*addGLEventListenerAfterVisible*/);
+
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+        window.destroy();
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        window.display();
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        window.setVisible(true);
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+
+        window.setVisible(false);
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        destroyWindow(window);
+    }
+
+    @Test
+    public void testWindowDecor01aSimple() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        GLWindow window = createWindow(null, caps, width, height, 
+                                       true /* onscreen */, false /* undecorated */, 
+                                       false /*addGLEventListenerAfterVisible*/);
+        System.out.println("Created: "+window);
+        int state;
+        for(state=0; state*100<durationPerTest; state++) {
+            Thread.sleep(100);
+        }
+        System.out.println("duration: "+window.getDuration());
+        destroyWindow(window);
+    }
+
+    @Test
+    public void testWindowDecor01bSimple() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        GLWindow window = createWindow(null, caps, width, height, 
+                                       true /* onscreen */, false /* undecorated */, 
+                                       true /*addGLEventListenerAfterVisible*/);
+        System.out.println("Created: "+window);
+        int state;
+        for(state=0; state*100<durationPerTest; state++) {
+            Thread.sleep(100);
+        }
+        System.out.println("duration: "+window.getDuration());
+        destroyWindow(window);
+    }
+
+    @Test
+    public void testWindowDecor02DestroyWinTwiceA() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        GLWindow window = createWindow(null, caps, width, height, 
+                                       true /* onscreen */, false /* undecorated */, 
+                                       false /*addGLEventListenerAfterVisible*/);
+        int state;
+        for(state=0; state*100<durationPerTest; state++) {
+            Thread.sleep(100);
+        }
+        System.out.println("duration: "+window.getDuration());
+        destroyWindow(window);
+    }
+
+    @Test
+    public void testWindowDecor03TwoWinOneDisplay() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+        GLWindow window1 = createWindow(screen, caps, width, height,
+                                       true /* onscreen */, false /* undecorated */, 
+                                       false /*addGLEventListenerAfterVisible*/);
+        Assert.assertNotNull(window1);
+
+        GLWindow window2 = createWindow(screen, caps, width, height, 
+                                       true /* onscreen */, false /* undecorated */, 
+                                       false /*addGLEventListenerAfterVisible*/);
+        Assert.assertNotNull(window2);
+
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+
+        Assert.assertEquals(2,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+
+        int state;
+        for(state=0; state*100<durationPerTest; state++) {
+            Thread.sleep(100);
+        }
+        System.out.println("duration1: "+window1.getDuration());
+        System.out.println("duration2: "+window2.getDuration());
+
+        destroyWindow(window1);
+        destroyWindow(window2);
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(false,display.getEDTUtil().isRunning());
+
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+    }
+
+    @Test
+    public void testWindowDecor03TwoWinTwoDisplays() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+
+        Display display1 = NewtFactory.createDisplay(null, false); // local display
+        Assert.assertNotNull(display1);
+        Display display2 = NewtFactory.createDisplay(null, false); // local display
+        Assert.assertNotNull(display2);
+        Assert.assertNotSame(display1, display2);
+
+        Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
+        Assert.assertNotNull(screen1);
+        GLWindow window1 = createWindow(screen1, caps, width, height, 
+                                       true /* onscreen */, false /* undecorated */, 
+                                       false /*addGLEventListenerAfterVisible*/);
+        Assert.assertNotNull(window1);
+
+        Screen screen2  = NewtFactory.createScreen(display2, 0); // screen 0
+        Assert.assertNotNull(screen2);
+        GLWindow window2 = createWindow(screen2, caps, width, height, 
+                                       true /* onscreen */, false /* undecorated */, 
+                                       false /*addGLEventListenerAfterVisible*/);
+        Assert.assertNotNull(window2);
+
+        Assert.assertEquals(2,Display.getActiveDisplayNumber());
+
+        Assert.assertEquals(1,display1.getReferenceCount());
+        Assert.assertEquals(true,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(1,screen1.getReferenceCount());
+        Assert.assertEquals(true,screen1.isNativeValid());
+
+        Assert.assertEquals(1,display2.getReferenceCount());
+        Assert.assertEquals(true,display2.isNativeValid());
+        Assert.assertNotNull(display2.getEDTUtil());
+        Assert.assertEquals(true,display2.getEDTUtil().isRunning());
+        Assert.assertEquals(1,screen2.getReferenceCount());
+        Assert.assertEquals(true,screen2.isNativeValid());
+
+        int state;
+        for(state=0; state*100<durationPerTest; state++) {
+            Thread.sleep(100);
+        }
+        System.out.println("duration1: "+window1.getDuration());
+        System.out.println("duration2: "+window2.getDuration());
+
+        // It is observed that some X11 drivers, eg ATI, fglrx 8.78.6,
+        // are quite sensitive to multiple Display connections (NEWT Display -> X11 Display).
+        // In such cases, closing displays shall happen in the same order as
+        // opening them, otherwise some driver related bug appears.
+        // You may test this, ie just reverse the destroy order below.
+        // See also native test: jogl/test/native/displayMultiple02.c
+        destroyWindow(window1);
+        destroyWindow(window2);
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        Assert.assertEquals(0,display1.getReferenceCount());
+        Assert.assertEquals(false,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(false,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen1.getReferenceCount());
+        Assert.assertEquals(false,screen1.isNativeValid());
+
+        Assert.assertEquals(0,display2.getReferenceCount());
+        Assert.assertEquals(false,display2.isNativeValid());
+        Assert.assertNotNull(display2.getEDTUtil());
+        Assert.assertEquals(false,display2.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen2.getReferenceCount());
+        Assert.assertEquals(false,screen2.isNativeValid()); 
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);
+        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        System.out.println("durationPerTest: "+durationPerTest);
+        String tstname = TestGLWindows01NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
new file mode 100644
index 0000000..6582a96
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
@@ -0,0 +1,303 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.media.opengl.*;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestGLWindows02NEWTAnimated extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+    static long durationPerTest = 100; // ms
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        width  = 640;
+        height = 480;
+        glp = GLProfile.getDefault();
+    }
+
+    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+        Assert.assertNotNull(caps);
+        caps.setOnscreen(onscreen);
+        // System.out.println("Requested: "+caps);
+
+        //
+        // Create native windowing resources .. X11/Win/OSX
+        // 
+        GLWindow glWindow;
+        if(null!=screen) {
+            Window window = NewtFactory.createWindow(screen, caps);
+            Assert.assertNotNull(window);
+            glWindow = GLWindow.create(window);
+        } else {
+            glWindow = GLWindow.create(caps);
+        }
+        Assert.assertNotNull(glWindow);
+        glWindow.setUndecorated(onscreen && undecorated);
+
+        GLEventListener demo = new Gears();
+        setDemoFields(demo, glWindow);
+        glWindow.addGLEventListener(demo);
+        glWindow.addWindowListener(new TraceWindowAdapter());
+        Assert.assertEquals(false,glWindow.isNativeValid());
+
+        glWindow.setSize(width, height);
+        Assert.assertEquals(false,glWindow.isVisible());
+        glWindow.setVisible(true);
+        Assert.assertEquals(true,glWindow.isVisible());
+        Assert.assertEquals(true,glWindow.isNativeValid());
+        // Assert.assertEquals(width,glWindow.getWidth());
+        // Assert.assertEquals(height,glWindow.getHeight());
+        // System.out.println("Created: "+glWindow);
+
+        //
+        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // equivalent to GLAutoDrawable methods: setVisible(true)
+        // 
+        GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
+        Assert.assertNotNull(caps2);
+        Assert.assertTrue(caps2.getGreenBits()>=5);
+        Assert.assertTrue(caps2.getBlueBits()>=5);
+        Assert.assertTrue(caps2.getRedBits()>=5);
+        Assert.assertEquals(caps2.isOnscreen(),onscreen);
+
+        return glWindow;
+    }
+
+    static void destroyWindow(GLWindow glWindow) {
+        if(null!=glWindow) {
+            glWindow.destroy();
+        }
+    }
+
+    @Test
+    public void testWindowDecor01Simple() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Animator animator = new Animator(window);
+        Assert.assertTrue(animator.start());
+        while(animator.isAnimating() && animator.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+        }
+        destroyWindow(window);
+        Assert.assertEquals(true, animator.isAnimating());
+        Assert.assertTrue(animator.stop());
+    }
+
+    @Test
+    public void testWindowDecor02DestroyWinTwiceA() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Animator animator = new Animator(window);
+        Assert.assertTrue(animator.start());
+        while(animator.isAnimating() && animator.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+        }
+        destroyWindow(window);
+        destroyWindow(window);
+        Assert.assertEquals(true, animator.isAnimating());
+        Assert.assertTrue(animator.stop());
+    }
+
+    @Test
+    public void testWindowDecor03TwoWinOneDisplay() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+        GLWindow window1 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Assert.assertNotNull(window1);
+        window1.setPosition(0, 0);
+
+        GLWindow window2 = createWindow(screen, caps, width-10, height-10, true /* onscreen */, false /* undecorated */);
+        Assert.assertNotNull(window2);
+        window2.setPosition(screen.getWidth()-width, 0);
+
+        Animator animator = new Animator();
+        Assert.assertEquals(false, animator.isStarted());
+        Assert.assertEquals(false, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        Assert.assertTrue(animator.start());
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(false, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        animator.add(window1);
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(true, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        animator.add(window2);
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(true, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        while(animator.isAnimating() && animator.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+        }
+        window1.invalidate();
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(true, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        while(animator.isAnimating() && animator.getDuration()<2*durationPerTest) {
+            Thread.sleep(100);
+        }
+        window2.invalidate();
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(false, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+        Assert.assertTrue(animator.stop());
+    }
+
+    @Test
+    public void testWindowDecor03TwoWinTwoDisplays() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+
+        Display display1 = NewtFactory.createDisplay(null, false); // local display
+        Assert.assertNotNull(display1);
+        Display display2 = NewtFactory.createDisplay(null, false); // local display
+        Assert.assertNotNull(display2);
+        Assert.assertNotSame(display1, display2);
+
+        Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
+        Assert.assertNotNull(screen1);
+        GLWindow window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Assert.assertNotNull(window1);
+        window1.setPosition(0, 0);
+
+        Screen screen2  = NewtFactory.createScreen(display2, 0); // screen 0
+        Assert.assertNotNull(screen2);
+        GLWindow window2 = createWindow(screen2, caps, width-10, height-10, true /* onscreen */, false /* undecorated */);
+        Assert.assertNotNull(window2);
+        window2.setPosition(screen2.getWidth()-width, 0);
+
+        Animator animator = new Animator();
+        Assert.assertEquals(false, animator.isStarted());
+        Assert.assertEquals(false, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        Assert.assertTrue(animator.start());
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(false, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        animator.add(window1);
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(true, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        animator.add(window2);
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(true, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        while(animator.isAnimating() && animator.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+        }
+        destroyWindow(window1);
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(true, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        while(animator.isAnimating() && animator.getDuration()<2*durationPerTest) {
+            Thread.sleep(100);
+        }
+        destroyWindow(window2);
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(true, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        Assert.assertEquals(true, animator.pause());
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(false, animator.isAnimating());
+        Assert.assertEquals(true, animator.isPaused());
+
+        Assert.assertEquals(true, animator.resume());
+        Assert.assertEquals(true, animator.isStarted());
+        Assert.assertEquals(true, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+
+        Assert.assertTrue(animator.stop());
+        Assert.assertEquals(false, animator.isStarted());
+        Assert.assertEquals(false, animator.isAnimating());
+        Assert.assertEquals(false, animator.isPaused());
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);
+        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        String tstname = TestGLWindows02NEWTAnimated.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
new file mode 100644
index 0000000..b2068d9
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
@@ -0,0 +1,167 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import java.awt.Button;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.Frame;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.*;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquare;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestListenerCom01AWT extends UITestCase {
+    static int width, height;
+    static long durationPerTest = 500;
+    static boolean verbose = false;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        width  = 640;
+        height = 480;
+    }
+
+    @Test
+    public void testListenerStringPassingAndOrder() throws InterruptedException {
+        // setup NEWT GLWindow ..
+        GLWindow glWindow = GLWindow.create(new GLCapabilities(null));
+        Assert.assertNotNull(glWindow);
+        glWindow.setTitle("NEWT - CHILD");
+
+        System.out.println("durationPerTest "+durationPerTest);
+
+        GLEventListener demo = new Gears();
+        setDemoFields(demo, glWindow, false);
+        glWindow.addGLEventListener(demo);
+
+        WindowEventCom1 wl1 = new WindowEventCom1();
+        WindowEventCom2 wl2 = new WindowEventCom2();
+        WindowEventCom3 wl3 = new WindowEventCom3();
+
+        // TraceWindowAdapter wlT = new TraceWindowAdapter();
+        // glWindow.addWindowListener(0, wlT);
+        // Assert.assertEquals(wlT, glWindow.getWindowListener(0));
+
+        glWindow.addWindowListener(0, wl3);
+        glWindow.addWindowListener(0, wl2);
+        glWindow.addWindowListener(0, wl1);
+
+        Assert.assertEquals(wl1, glWindow.getWindowListener(0));
+        Assert.assertEquals(wl2, glWindow.getWindowListener(1));
+        Assert.assertEquals(wl3, glWindow.getWindowListener(2));
+
+        // attach NEWT GLWindow to AWT Canvas
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
+        Frame frame = new Frame("AWT Parent Frame");
+        frame.add(newtCanvasAWT);
+        frame.setSize(width, height);
+        frame.setVisible(true);
+
+        Animator animator1 = new Animator(glWindow);
+        animator1.start();
+        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+            width+=10; height+=10;
+            frame.setSize(width, height);
+        }
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+
+        frame.dispose();
+        glWindow.invalidate();
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);
+        Window window = glWindow.getWindow();
+        if(debug) {
+            MiscUtils.setFieldIfExists(demo, "glDebug", true);
+            MiscUtils.setFieldIfExists(demo, "glTrace", true);
+        }
+        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        verbose = true;
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        String tstname = TestListenerCom01AWT.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java
new file mode 100644
index 0000000..6b501e3
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java
@@ -0,0 +1,171 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.media.opengl.*;
+import com.jogamp.opengl.util.Animator;
+
+import com.jogamp.newt.*;
+import com.jogamp.newt.opengl.*;
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.NativeWindowException;
+
+public class TestRemoteGLWindows01NEWT extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+    static long durationPerTest = 100; // ms
+    static String remoteDisplay = "nowhere:0.0";
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        // GLProfile.initSingleton(false);
+        width  = 640;
+        height = 480;
+        glp = GLProfile.getDefault();
+    }
+
+    static GLWindow createWindow(Screen screen, GLCapabilities caps, GLEventListener demo)
+        throws InterruptedException
+    {
+        Assert.assertNotNull(caps);
+        //
+        // Create native windowing resources .. X11/Win/OSX
+        // 
+        GLWindow glWindow;
+        if(null!=screen) {
+            glWindow = GLWindow.create(screen, caps);
+            Assert.assertNotNull(glWindow);
+        } else {
+            glWindow = GLWindow.create(caps);
+            Assert.assertNotNull(glWindow);
+        }
+        
+        glWindow.addGLEventListener(demo);
+
+        glWindow.setSize(512, 512);
+        glWindow.setVisible(true);
+        Assert.assertEquals(true,glWindow.isVisible());
+        Assert.assertEquals(true,glWindow.isNativeValid());
+
+        return glWindow;
+    }
+
+    static void destroyWindow(GLWindow glWindow) {
+        if(null!=glWindow) {
+            glWindow.invalidate();
+            Assert.assertEquals(false,glWindow.isNativeValid());
+            Assert.assertEquals(false,glWindow.isValid());
+        }
+    }
+
+    @Test
+    public void testRemoteWindow01() throws InterruptedException {
+        Animator animator = new Animator();
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        GLWindow window1 = createWindow(null, caps, new Gears(1)); // local with vsync
+        Assert.assertEquals(true,window1.isNativeValid());
+        Assert.assertEquals(true,window1.isVisible());
+        AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
+
+        System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
+
+        animator.add(window1);
+
+        // Remote Display/Device/Screen/Window ..
+        // Eager initialization of NEWT Display -> AbstractGraphicsDevice -> GLProfile (device)
+        Display display2; // remote display
+        AbstractGraphicsDevice device2;
+        Screen screen2;
+        GLWindow window2;
+        try {
+            display2 = NewtFactory.createDisplay(remoteDisplay); // remote display
+            display2.createNative();
+            System.err.println(display2);
+            device2 = display2.getGraphicsDevice();
+            System.err.println(device2);
+            GLProfile.initProfiles(device2); // just to make sure
+            System.err.println("");
+            System.err.println("GLProfiles window2: "+device2.getConnection()+": "+GLProfile.glAvailabilityToString(device2));
+            screen2  = NewtFactory.createScreen(display2, 0); // screen 0
+            window2 = createWindow(screen2, caps, new Gears(0)); // remote, no vsync
+        } catch (NativeWindowException nwe) {
+            System.err.println(nwe);
+            Assume.assumeNoException(nwe);
+            destroyWindow(window1);
+            return;
+        }
+
+        Assert.assertEquals(true,window2.isNativeValid());
+        Assert.assertEquals(true,window2.isVisible());
+
+        animator.add(window2);
+        animator.start();
+
+        while(animator.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+        }
+
+        destroyWindow(window1);
+        destroyWindow(window2);
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            } else if(args[i].equals("-display")) {
+                remoteDisplay = args[++i];
+            }
+        }
+        System.out.println("durationPerTest: "+durationPerTest);
+        System.out.println("display: "+remoteDisplay);
+        String tstname = TestRemoteGLWindows01NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java
new file mode 100644
index 0000000..9c44545
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java
@@ -0,0 +1,151 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.media.nativewindow.*;
+
+import com.jogamp.newt.*;
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+public class TestRemoteWindow01NEWT extends UITestCase {
+    static int width, height;
+    static String remoteDisplay = "nowhere:0.0";
+
+    @BeforeClass
+    public static void initClass() {
+        NativeWindowFactory.initSingleton(true);
+        width  = 640;
+        height = 480;
+    }
+
+    static Window createWindow(Screen screen, Capabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+        Assert.assertNotNull(caps);
+        caps.setOnscreen(onscreen);
+        // System.out.println("Requested: "+caps);
+
+        //
+        // Create native windowing resources .. X11/Win/OSX
+        // 
+        Window window = NewtFactory.createWindow(screen, caps);
+        Assert.assertNotNull(window);
+        window.setUndecorated(onscreen && undecorated);
+        window.setSize(width, height);
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+        window.setVisible(true);
+        Assert.assertEquals(true,window.isVisible());
+        Assert.assertEquals(true,window.isNativeValid());
+        // Assert.assertEquals(width,window.getWidth());
+        // Assert.assertEquals(height,window.getHeight());
+        // System.out.println("Created: "+window);
+
+        //
+        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // equivalent to GLAutoDrawable methods: setVisible(true)
+        // 
+        CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+        Assert.assertNotNull(chosenCapabilities);
+        Assert.assertTrue(chosenCapabilities.getGreenBits()>5);
+        Assert.assertTrue(chosenCapabilities.getBlueBits()>5);
+        Assert.assertTrue(chosenCapabilities.getRedBits()>5);
+        Assert.assertEquals(chosenCapabilities.isOnscreen(),onscreen);
+
+        return window;
+    }
+
+    static void destroyWindow(Display display, Screen screen, Window window) {
+        if(null!=window) {
+            window.destroy();
+        }
+        if(null!=screen) {
+            screen.destroy();
+        }
+        if(null!=display) {
+            display.destroy();
+        }
+    }
+
+    @Test
+    public void testRemoteWindow01() throws InterruptedException {
+        Capabilities caps = new Capabilities();
+        Display display1 = NewtFactory.createDisplay(null); // local display
+        Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
+        Window window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */);
+        window1.setVisible(true);
+
+        Assert.assertEquals(true,window1.isNativeValid());
+        Assert.assertEquals(true,window1.isVisible());
+
+        // Remote Display/Device/Screen/Window ..
+        Display display2;
+        AbstractGraphicsDevice device2;
+        Screen screen2;
+        Window window2;
+        try {
+            display2 = NewtFactory.createDisplay(remoteDisplay);
+            display2.createNative(); 
+            screen2  = NewtFactory.createScreen(display2, 0); // screen 0
+            window2 = createWindow(screen2, caps, width, height, true /* onscreen */, false /* undecorated */);
+            window2.setVisible(true);
+        } catch (NativeWindowException nwe) {
+            System.err.println(nwe);
+            Assume.assumeNoException(nwe);
+            destroyWindow(display1, screen1, window1);
+            return;
+        }
+
+        Assert.assertEquals(true,window2.isNativeValid());
+        Assert.assertEquals(true,window2.isVisible());
+
+        Thread.sleep(500); // 500 ms
+
+        destroyWindow(display1, screen1, window1);
+        destroyWindow(display2, screen2, window2);
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-display")) {
+                remoteDisplay = args[++i];
+            }
+        }
+        System.out.println("display: "+remoteDisplay);
+        String tstname = TestRemoteWindow01NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode00NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode00NEWT.java
new file mode 100644
index 0000000..7de63e6
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode00NEWT.java
@@ -0,0 +1,135 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import java.io.IOException;
+import javax.media.nativewindow.NativeWindowFactory;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.jogamp.newt.NewtFactory;
+import com.jogamp.newt.Screen;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.ScreenMode;
+import com.jogamp.newt.util.MonitorMode;
+import com.jogamp.newt.util.ScreenModeUtil;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import java.util.Iterator;
+import java.util.List;
+import javax.media.nativewindow.Capabilities;
+import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionReadOnly;
+import javax.media.nativewindow.util.SurfaceSize;
+
+public class TestScreenMode00NEWT extends UITestCase {
+    static int width, height;
+    
+    static int waitTimeShort = 4; //1 sec
+    static int waitTimeLong = 6; //6 sec
+    
+    
+
+    @BeforeClass
+    public static void initClass() {
+        NativeWindowFactory.initSingleton(true);
+        width  = 640;
+        height = 480;
+    }
+
+    @Test
+    public void testScreenModeInfo00() throws InterruptedException {
+        DimensionReadOnly res = new Dimension(640, 480);
+        SurfaceSize surfsz = new SurfaceSize(res, 32);
+        DimensionReadOnly mm = new Dimension(500, 400);
+        MonitorMode mon = new MonitorMode(surfsz, mm, 60);
+        ScreenMode sm_out = new ScreenMode(mon, 90);
+        System.err.println("00 out: "+sm_out);
+
+        int[] props = ScreenModeUtil.streamOut(sm_out);
+        ScreenMode sm_in = ScreenModeUtil.streamIn(props, 0);
+        System.err.println("00 in : "+sm_in);
+
+        Assert.assertEquals(sm_in.getMonitorMode().getSurfaceSize().getResolution(),
+                            sm_out.getMonitorMode().getSurfaceSize().getResolution());
+
+        Assert.assertEquals(sm_in.getMonitorMode().getSurfaceSize(),
+                            sm_out.getMonitorMode().getSurfaceSize());
+
+        Assert.assertEquals(sm_in.getMonitorMode().getScreenSizeMM(),
+                            sm_out.getMonitorMode().getScreenSizeMM());
+
+        Assert.assertEquals(sm_in.getMonitorMode(), sm_out.getMonitorMode());
+
+        Assert.assertEquals(sm_in, sm_out);
+        
+        Assert.assertEquals(sm_out.hashCode(), sm_in.hashCode());
+    }
+
+    @Test
+    public void testScreenModeInfo01() throws InterruptedException {
+    	Capabilities caps = new Capabilities();
+        Window window = NewtFactory.createWindow(caps);
+        window.setSize(width, height);
+        window.setVisible(true);
+
+        Screen screen = window.getScreen();
+
+        List screenModes = screen.getScreenModes();
+        if(null != screenModes) {
+            Assert.assertTrue(screenModes.size()>0);
+            int i=0;
+            for(Iterator iter=screenModes.iterator(); iter.hasNext(); i++) {
+                System.err.println(i+": "+iter.next());
+            }
+            ScreenMode sm_o = screen.getOriginalScreenMode();
+            Assert.assertNotNull(sm_o);            
+            ScreenMode sm_c = screen.getOriginalScreenMode();
+            Assert.assertNotNull(sm_c);
+            System.err.println("orig: "+sm_o);
+            System.err.println("curr: "+sm_c);
+        } else {
+            // no support ..
+            System.err.println("Your platform has no ScreenMode change support, sorry");
+        }
+
+        window.invalidate();
+
+        Assert.assertEquals(false,window.isVisible());
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(false,screen.getDisplay().isNativeValid());
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestScreenMode00NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode01NEWT.java
new file mode 100644
index 0000000..ffff682
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode01NEWT.java
@@ -0,0 +1,284 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import java.io.IOException;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.opengl.util.Animator;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.jogamp.newt.Display;
+import com.jogamp.newt.NewtFactory;
+import com.jogamp.newt.Screen;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.ScreenMode;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.newt.util.ScreenModeUtil;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import java.util.List;
+import javax.media.nativewindow.util.Dimension;
+
+public class TestScreenMode01NEWT extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+    
+    static int waitTimeShort = 1000; // 1 sec
+    static int waitTimeLong = 5000; // 5 sec
+    
+    
+
+    @BeforeClass
+    public static void initClass() {
+        NativeWindowFactory.initSingleton(true);
+        width  = 640;
+        height = 480;
+        glp = GLProfile.getDefault();
+    }
+
+    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+        Assert.assertNotNull(caps);
+        caps.setOnscreen(onscreen);
+
+        GLWindow window = GLWindow.create(screen, caps);
+        window.setSize(width, height);
+        window.addGLEventListener(new Gears());
+        Assert.assertNotNull(window);
+        window.setVisible(true);
+        return window;
+    }
+
+    static void destroyWindow(Window window) {
+        if(null!=window) {
+            window.destroy();
+        }
+    }
+    
+    @Test
+    public void testFullscreenChange01() throws InterruptedException {
+    	GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+
+        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Animator animator = new Animator(window);
+        animator.start();
+        
+        window.setFullscreen(true);
+        Assert.assertEquals(true, window.isFullscreen());
+        
+        Thread.sleep(waitTimeShort);
+
+        window.setFullscreen(false);
+        Assert.assertEquals(false, window.isFullscreen());
+        
+        Thread.sleep(waitTimeShort);
+
+        animator.stop();
+        destroyWindow(window);    	
+    }
+
+    @Test
+    public void testScreenModeChange01() throws InterruptedException {
+        Thread.sleep(waitTimeShort);
+
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Assert.assertNotNull(window);
+
+        List screenModes = screen.getScreenModes();
+        if(null==screenModes) {
+            // no support ..
+            System.err.println("Your platform has no ScreenMode change support, sorry");
+            destroyWindow(window);
+            return;
+        }
+        Assert.assertTrue(screenModes.size()>0);
+
+        Animator animator = new Animator(window);
+        animator.start();
+
+        ScreenMode smCurrent = screen.getCurrentScreenMode();
+        Assert.assertNotNull(smCurrent);
+        ScreenMode smOrig = screen.getOriginalScreenMode();
+        Assert.assertNotNull(smOrig);
+        Assert.assertEquals(smCurrent, smOrig);
+        System.err.println("[0] current/orig: "+smCurrent);
+
+        screenModes = ScreenModeUtil.filterByRate(screenModes, smOrig.getMonitorMode().getRefreshRate());
+        Assert.assertNotNull(screenModes);
+        Assert.assertTrue(screenModes.size()>0);
+        screenModes = ScreenModeUtil.filterByRotation(screenModes, 0);
+        Assert.assertNotNull(screenModes);
+        Assert.assertTrue(screenModes.size()>0);
+        screenModes = ScreenModeUtil.filterByResolution(screenModes, new Dimension(801, 601));
+        Assert.assertNotNull(screenModes);
+        Assert.assertTrue(screenModes.size()>0);
+        screenModes = ScreenModeUtil.getHighestAvailableBpp(screenModes);
+        Assert.assertNotNull(screenModes);
+        Assert.assertTrue(screenModes.size()>0);
+
+        ScreenMode sm = (ScreenMode) screenModes.get(0);
+        System.err.println("[0] set current: "+sm);
+        screen.setCurrentScreenMode(sm);
+        Assert.assertEquals(sm, screen.getCurrentScreenMode());
+        Assert.assertNotSame(smOrig, screen.getCurrentScreenMode());
+
+        Thread.sleep(waitTimeLong);
+
+        // check reset ..
+
+        ScreenMode saveOrigMode = (ScreenMode) smOrig.clone();
+
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+
+        animator.stop();
+        destroyWindow(window);
+
+        Assert.assertEquals(false,window.isVisible());
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(false,display.isNativeValid());
+
+        screen.createNative(); // trigger native re-creation
+
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertEquals(true,screen.isNativeValid());
+
+        smCurrent = screen.getCurrentScreenMode();
+        System.err.println("[1] current/orig: "+smCurrent);
+
+        Assert.assertNotNull(smCurrent);
+        Assert.assertEquals(saveOrigMode, smOrig);
+
+        screen.destroy();
+
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(false,display.isNativeValid());
+
+        Thread.sleep(waitTimeShort);
+    }
+
+    @Test
+    public void testScreenModeChangeWithFS01Pre() throws InterruptedException {
+        Thread.sleep(waitTimeShort);
+        testScreenModeChangeWithFS01Impl(true) ;
+        Thread.sleep(waitTimeShort);
+    }
+
+    @Test
+    public void testScreenModeChangeWithFS01Post() throws InterruptedException {
+        Thread.sleep(waitTimeShort);
+        testScreenModeChangeWithFS01Impl(false) ;
+        Thread.sleep(waitTimeShort);
+    }
+
+    protected void testScreenModeChangeWithFS01Impl(boolean preFS) throws InterruptedException {
+    	GLCapabilities caps = new GLCapabilities(glp);
+        Display display = NewtFactory.createDisplay(null); // local display
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Animator animator = new Animator(window);
+        animator.start();
+
+        ScreenMode smOrig = screen.getOriginalScreenMode();
+        List screenModes = screen.getScreenModes();
+        if(null==screenModes) {
+            // no support ..
+            destroyWindow(window);
+            return;
+        }
+        Assert.assertTrue(screenModes.size()>0);
+        screenModes = ScreenModeUtil.filterByRate(screenModes, smOrig.getMonitorMode().getRefreshRate());
+        screenModes = ScreenModeUtil.filterByRotation(screenModes, 0);
+        screenModes = ScreenModeUtil.filterByResolution(screenModes, new Dimension(801, 601));
+        screenModes = ScreenModeUtil.getHighestAvailableBpp(screenModes);
+
+        ScreenMode screenMode = (ScreenMode) screenModes.get(0);
+        Assert.assertNotNull(screenMode);
+        
+        if(preFS) {
+            System.err.println("[0] set FS pre 0: "+window.isFullscreen());
+            window.setFullscreen(true);
+            Assert.assertEquals(true, window.isFullscreen());
+            System.err.println("[0] set FS pre X: "+window.isFullscreen());
+        }
+
+        System.err.println("[0] set current: "+screenMode);
+        screen.setCurrentScreenMode(screenMode);
+        
+        if(!preFS) {
+            System.err.println("[0] set FS post 0: "+window.isFullscreen());
+            window.setFullscreen(true);
+            Assert.assertEquals(true, window.isFullscreen());
+            System.err.println("[0] set FS post X: "+window.isFullscreen());
+        }
+
+        Thread.sleep(waitTimeLong);
+        
+        // check reset ..
+
+        ScreenMode saveOrigMode = (ScreenMode) smOrig.clone();
+
+        animator.stop();
+        destroyWindow(window);
+
+        screen.createNative(); // trigger native re-creation
+
+        ScreenMode smCurrent = screen.getCurrentScreenMode();
+        System.err.println("[1] current/orig: "+smCurrent);
+
+        Assert.assertNotNull(smCurrent);
+        Assert.assertEquals(saveOrigMode, smOrig);
+
+        screen.destroy();
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestScreenMode01NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode02NEWT.java
new file mode 100644
index 0000000..2ec0490
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestScreenMode02NEWT.java
@@ -0,0 +1,187 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import java.io.IOException;
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.opengl.util.Animator;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.jogamp.newt.Display;
+import com.jogamp.newt.NewtFactory;
+import com.jogamp.newt.Screen;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.ScreenMode;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.newt.util.ScreenModeUtil;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import java.util.List;
+import javax.media.nativewindow.util.Dimension;
+
+public class TestScreenMode02NEWT extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+    
+    static int waitTimeShort = 1000; // 1 sec
+    static int waitTimeLong = 5000; // 5 sec
+
+    @BeforeClass
+    public static void initClass() {
+        NativeWindowFactory.initSingleton(true);
+        width  = 640;
+        height = 480;
+        glp = GLProfile.getDefault();
+    }
+
+    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+        Assert.assertNotNull(caps);
+        caps.setOnscreen(onscreen);
+
+        GLWindow window = GLWindow.create(screen, caps);
+        window.setSize(width, height);
+        window.addGLEventListener(new Gears());
+        Assert.assertNotNull(window);
+        window.setVisible(true);
+        Assert.assertTrue(window.isVisible());
+        return window;
+    }
+
+    static void destroyWindow(Window window) {
+        if(null!=window) {
+            window.destroy();
+        }
+    }
+    
+    @Test
+    public void testScreenRotationChange01() throws InterruptedException {
+        Thread.sleep(waitTimeShort);
+
+        GLCapabilities caps = new GLCapabilities(glp);
+        Assert.assertNotNull(caps);
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Assert.assertNotNull(window);
+
+        List screenModes = screen.getScreenModes();
+        if(null==screenModes) {
+            // no support ..
+            System.err.println("Your platform has no ScreenMode change support, sorry");
+            destroyWindow(window);
+            return;
+        }
+        Assert.assertTrue(screenModes.size()>0);
+
+        Animator animator = new Animator(window);
+        animator.start();
+
+        ScreenMode smCurrent = screen.getCurrentScreenMode();
+        Assert.assertNotNull(smCurrent);
+        ScreenMode smOrig = screen.getOriginalScreenMode();
+        Assert.assertNotNull(smOrig);
+        Assert.assertEquals(smCurrent, smOrig);
+        System.err.println("[0] current/orig: "+smCurrent);
+
+        screenModes = ScreenModeUtil.filterByRate(screenModes, smOrig.getMonitorMode().getRefreshRate());
+        Assert.assertNotNull(screenModes);
+        Assert.assertTrue(screenModes.size()>0);
+        screenModes = ScreenModeUtil.filterByRotation(screenModes, 90);
+        if(null==screenModes) {
+            // no rotation support ..
+            System.err.println("Your platform has no rotation support, sorry");
+            destroyWindow(window);
+            return;
+        }
+        Assert.assertTrue(screenModes.size()>0);
+        screenModes = ScreenModeUtil.filterByResolution(screenModes, new Dimension(801, 601));
+        Assert.assertNotNull(screenModes);
+        Assert.assertTrue(screenModes.size()>0);
+        screenModes = ScreenModeUtil.getHighestAvailableBpp(screenModes);
+        Assert.assertNotNull(screenModes);
+        Assert.assertTrue(screenModes.size()>0);
+
+        ScreenMode sm = (ScreenMode) screenModes.get(0);
+        System.err.println("[0] set current: "+sm);
+        screen.setCurrentScreenMode(sm);
+        Assert.assertEquals(sm, screen.getCurrentScreenMode());
+        Assert.assertNotSame(smOrig, screen.getCurrentScreenMode());
+
+        Thread.sleep(waitTimeLong);
+
+        // check reset ..
+
+        ScreenMode saveOrigMode = (ScreenMode) smOrig.clone();
+
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+
+        animator.stop();
+        destroyWindow(window);
+
+        Assert.assertEquals(false,window.isVisible());
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(false,display.isNativeValid());
+
+        screen.createNative(); // trigger native re-creation
+
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertEquals(true,screen.isNativeValid());
+
+        smCurrent = screen.getCurrentScreenMode();
+        System.err.println("[1] current/orig: "+smCurrent);
+
+        Assert.assertNotNull(smCurrent);
+        Assert.assertEquals(saveOrigMode, smOrig);
+
+        screen.destroy();
+
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(false,display.isNativeValid());
+
+        Thread.sleep(waitTimeShort);
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestScreenMode02NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
new file mode 100644
index 0000000..581877e
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
@@ -0,0 +1,160 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.newt;
+
+import org.junit.Test;
+import org.junit.Assert;
+
+import java.lang.reflect.InvocationTargetException;
+import java.awt.Frame;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+import javax.media.nativewindow.WindowClosingProtocol;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.awt.GLCanvas;
+
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+public class TestWindowClosingProtocol01AWT extends UITestCase {
+
+    @Test
+    public void testCloseFrameGLCanvas() throws InterruptedException, InvocationTargetException {
+        final Frame frame = new Frame("testCloseFrameGLCanvas AWT");
+
+        GLProfile glp = GLProfile.getDefault();
+        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCanvas glCanvas = new GLCanvas(caps);
+        glCanvas.addGLEventListener(new Gears());
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                frame.add(glCanvas);
+                frame.pack();
+                frame.setSize(512, 512);
+                frame.validate();
+                frame.setVisible(true);
+            } });
+        Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas, true));
+
+        //
+        // close with op: DO_NOTHING_ON_CLOSE -> NOP (default)
+        //
+        int op = glCanvas.getDefaultCloseOperation();
+        Assert.assertEquals(WindowClosingProtocol.DO_NOTHING_ON_CLOSE, op);
+
+        Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false)); // nop
+        Thread.sleep(100);
+        Assert.assertEquals(true, frame.isDisplayable());
+        Assert.assertEquals(true, glCanvas.isValid());
+        Assert.assertEquals(true, glCanvas.isDisplayable());
+
+        //
+        // close with op (GLCanvas): DISPOSE_ON_CLOSE -> dispose
+        //
+        glCanvas.setDefaultCloseOperation(WindowClosingProtocol.DISPOSE_ON_CLOSE);
+        op = glCanvas.getDefaultCloseOperation();
+        Assert.assertEquals(WindowClosingProtocol.DISPOSE_ON_CLOSE, op);
+
+        Assert.assertEquals(true,  AWTRobotUtil.closeWindow(frame, false)); // no frame close
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas, false));
+        Assert.assertEquals(true,  frame.isDisplayable());
+        Assert.assertEquals(false, glCanvas.isRealized());
+
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                frame.dispose();
+            } });
+    }
+
+    @Test
+    public void testCloseJFrameGLCanvas() throws InterruptedException, InvocationTargetException {
+        final JFrame frame = new JFrame("testCloseJFrameGLCanvas AWT");
+
+        GLProfile glp = GLProfile.getDefault();
+        GLCapabilities caps = new GLCapabilities(glp);
+        GLCanvas glCanvas = new GLCanvas(caps);
+        glCanvas.addGLEventListener(new Gears());
+        frame.getContentPane().add(glCanvas);
+        frame.pack();
+        frame.setSize(512, 512);
+        frame.validate();
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                frame.setVisible(true);
+            } });
+        Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true));
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas, true));
+
+        //
+        // close with op: DO_NOTHING_ON_CLOSE -> NOP / HIDE (default)
+        //
+        Assert.assertEquals(JFrame.HIDE_ON_CLOSE, frame.getDefaultCloseOperation());
+        int op = glCanvas.getDefaultCloseOperation();
+        Assert.assertEquals(WindowClosingProtocol.DO_NOTHING_ON_CLOSE, op);
+
+        Assert.assertEquals(true,  AWTRobotUtil.closeWindow(frame, false)); // nop
+        Thread.sleep(100);
+        Assert.assertEquals(true,  frame.isDisplayable());
+        Assert.assertEquals(true,  glCanvas.isValid());
+        Assert.assertEquals(true,  glCanvas.isDisplayable());
+
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                frame.setVisible(true);
+            } });
+        Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true));
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas, true));
+
+        //
+        // close with op (JFrame): DISPOSE_ON_CLOSE -- GLCanvas --> dispose
+        //
+        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+        Assert.assertEquals(JFrame.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
+        op = glCanvas.getDefaultCloseOperation();
+        Assert.assertEquals(WindowClosingProtocol.DISPOSE_ON_CLOSE, op);
+
+        Assert.assertEquals(true,  AWTRobotUtil.closeWindow(frame, true));
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas, false));
+        Assert.assertEquals(false, frame.isDisplayable());
+        Assert.assertEquals(false, glCanvas.isValid());
+        Assert.assertEquals(false, glCanvas.isDisplayable());
+        Assert.assertEquals(false, glCanvas.isRealized());
+    }
+
+    public static void main(String[] args) {
+        String tstname = TestWindowClosingProtocol01AWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java
new file mode 100644
index 0000000..8f5baec
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java
@@ -0,0 +1,96 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.newt;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.junit.Test;
+import org.junit.Assert;
+
+import javax.media.nativewindow.WindowClosingProtocol;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.newt.opengl.GLWindow;
+
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+public class TestWindowClosingProtocol02NEWT extends UITestCase {
+
+    @Test
+    public void testCloseGLWindow() throws InterruptedException, InvocationTargetException {
+        GLProfile glp = GLProfile.getDefault();
+        GLCapabilities caps = new GLCapabilities(glp);
+        final GLWindow glWindow = GLWindow.create(caps);
+        final AWTRobotUtil.WindowClosingListener windowClosingListener = AWTRobotUtil.addClosingListener(glWindow);
+
+        glWindow.addGLEventListener(new Gears());
+        glWindow.setSize(512, 512);
+        glWindow.setVisible(true);
+        Assert.assertEquals(true, glWindow.isVisible());
+
+        // CHECK DEFAULT ..
+        int op = glWindow.getDefaultCloseOperation();
+        Assert.assertEquals(WindowClosingProtocol.DISPOSE_ON_CLOSE, op);
+
+        //
+        // close with op: DO_NOTHING_ON_CLOSE -> NOP
+        //
+        glWindow.setDefaultCloseOperation(WindowClosingProtocol.DO_NOTHING_ON_CLOSE);
+        op = glWindow.getDefaultCloseOperation();
+        Assert.assertEquals(WindowClosingProtocol.DO_NOTHING_ON_CLOSE, op);
+
+        Assert.assertEquals(true, AWTRobotUtil.closeWindow(glWindow, false)); // nop
+        Assert.assertEquals(true, glWindow.isValid());
+        Assert.assertEquals(true, glWindow.isNativeValid());
+        Assert.assertEquals(true, windowClosingListener.isWindowClosing());
+        windowClosingListener.reset();
+
+        //
+        // close with op (GLCanvas): DISPOSE_ON_CLOSE -> dispose
+        //
+        glWindow.setDefaultCloseOperation(WindowClosingProtocol.DISPOSE_ON_CLOSE);
+        op = glWindow.getDefaultCloseOperation();
+        Assert.assertEquals(WindowClosingProtocol.DISPOSE_ON_CLOSE, op);
+
+        Assert.assertEquals(true,  AWTRobotUtil.closeWindow(glWindow, true));
+        Assert.assertEquals(true,  glWindow.isValid());
+        Assert.assertEquals(false, glWindow.isNativeValid());
+        Assert.assertEquals(true,  windowClosingListener.isWindowClosing());
+    }
+
+    public static void main(String[] args) {
+        String tstname = TestWindowClosingProtocol02NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
new file mode 100644
index 0000000..a107306
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
@@ -0,0 +1,115 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.newt;
+
+import com.jogamp.newt.awt.NewtCanvasAWT;
+import com.jogamp.newt.opengl.GLWindow;
+import org.junit.Test;
+import org.junit.Assert;
+
+import java.lang.reflect.InvocationTargetException;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+import javax.media.nativewindow.WindowClosingProtocol;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
+
+    @Test
+    public void testCloseJFrameNewtCanvasAWT() throws InterruptedException, InvocationTargetException {
+        final JFrame frame = new JFrame("testCloseJFrameNewtCanvasAWT");
+
+        GLProfile glp = GLProfile.getDefault();
+        GLCapabilities caps = new GLCapabilities(glp);
+        final GLWindow glWindow = GLWindow.create(caps);
+        final AWTRobotUtil.WindowClosingListener windowClosingListener = AWTRobotUtil.addClosingListener(glWindow);
+
+        glWindow.addGLEventListener(new Gears());
+
+        NewtCanvasAWT newtCanvas = new NewtCanvasAWT(glWindow);
+
+        frame.getContentPane().add(newtCanvas);
+        frame.pack();
+        frame.setSize(512, 512);
+        frame.validate();
+        frame.setVisible(true);
+        Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true));
+
+        //
+        // close with op: DO_NOTHING_ON_CLOSE -> NOP / HIDE (default)
+        //
+        Assert.assertEquals(JFrame.HIDE_ON_CLOSE, frame.getDefaultCloseOperation());
+        int op = newtCanvas.getDefaultCloseOperation();
+        Assert.assertEquals(WindowClosingProtocol.DO_NOTHING_ON_CLOSE, op);
+
+        Assert.assertEquals(true,  AWTRobotUtil.closeWindow(frame, false));
+        Assert.assertEquals(true,  frame.isDisplayable());
+        Assert.assertEquals(true,  newtCanvas.isValid());
+        Assert.assertEquals(true,  newtCanvas.isDisplayable());
+        Assert.assertEquals(true,  glWindow.isValid());
+        Assert.assertEquals(true,  glWindow.isNativeValid());
+        Assert.assertEquals(true,  windowClosingListener.isWindowClosing());
+        windowClosingListener.reset();
+
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                frame.setVisible(true);
+            } });
+        Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true));
+
+        //
+        // close with op (JFrame): DISPOSE_ON_CLOSE -- newtCanvas -- glWindow --> dispose
+        //
+        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+        Assert.assertEquals(JFrame.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
+        op = newtCanvas.getDefaultCloseOperation();
+        Assert.assertEquals(WindowClosingProtocol.DISPOSE_ON_CLOSE, op);
+
+        Assert.assertEquals(true,  AWTRobotUtil.closeWindow(frame, true));
+        Assert.assertEquals(false, frame.isDisplayable());
+        Assert.assertEquals(false, newtCanvas.isValid());
+        Assert.assertEquals(false, newtCanvas.isDisplayable());
+        Assert.assertEquals(true,  glWindow.isValid());
+        Assert.assertEquals(false, glWindow.isNativeValid());
+        Assert.assertEquals(true,  windowClosingListener.isWindowClosing());
+    }
+
+    public static void main(String[] args) {
+        String tstname = TestWindowClosingProtocol03NewtAWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java
new file mode 100644
index 0000000..5ac6041
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java
@@ -0,0 +1,179 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import javax.media.nativewindow.*;
+
+import com.jogamp.newt.*;
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+public class TestWindows01NEWT extends UITestCase {
+    static int width, height;
+
+    @BeforeClass
+    public static void initClass() {
+        NativeWindowFactory.initSingleton(true);
+        width  = 640;
+        height = 480;
+    }
+
+    static Window createWindow(Screen screen, Capabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+        Assert.assertNotNull(caps);
+        caps.setOnscreen(onscreen);
+        // System.out.println("Requested: "+caps);
+
+        //
+        // Create native windowing resources .. X11/Win/OSX
+        // 
+        Window window = NewtFactory.createWindow(screen, caps);
+        Assert.assertNotNull(window);
+        window.setUndecorated(onscreen && undecorated);
+        window.setSize(width, height);
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+        window.setVisible(true);
+        Assert.assertEquals(true,window.isVisible());
+        Assert.assertEquals(true,window.isNativeValid());
+        // Assert.assertEquals(width,window.getWidth());
+        // Assert.assertEquals(height,window.getHeight());
+        // System.out.println("Created: "+window);
+
+        //
+        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // equivalent to GLAutoDrawable methods: setVisible(true)
+        // 
+        CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+        Assert.assertNotNull(chosenCapabilities);
+        Assert.assertTrue(chosenCapabilities.getGreenBits()>5);
+        Assert.assertTrue(chosenCapabilities.getBlueBits()>5);
+        Assert.assertTrue(chosenCapabilities.getRedBits()>5);
+        Assert.assertEquals(chosenCapabilities.isOnscreen(),onscreen);
+
+        return window;
+    }
+
+    static void destroyWindow(Display display, Screen screen, Window window) {
+        if(null!=window) {
+            window.destroy();
+        }
+        if(null!=screen) {
+            screen.destroy();
+        }
+        if(null!=display) {
+            display.destroy();
+        }
+    }
+
+    @Test
+    public void testWindowNativeRecreate01Simple() throws InterruptedException {
+        Capabilities caps = new Capabilities();
+        Assert.assertNotNull(caps);
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+
+        Window window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        window.destroy();
+        Assert.assertEquals(false,window.isNativeValid());
+        Assert.assertEquals(false,window.isVisible());
+
+        window.setVisible(true);
+        Assert.assertEquals(true,window.isNativeValid());
+        Assert.assertEquals(true,window.isVisible());
+
+        Thread.sleep(100); // 100 ms
+        destroyWindow(display, screen, window);
+    }
+
+    @Test
+    public void testWindowDecor01Simple() throws InterruptedException {
+        Capabilities caps = new Capabilities();
+        Assert.assertNotNull(caps);
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+
+        Window window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Thread.sleep(100); // 100 ms
+        destroyWindow(display, screen, window);
+    }
+
+    @Test
+    public void testWindowDecor02DestroyWinTwiceA() throws InterruptedException {
+        Capabilities caps = new Capabilities();
+        Assert.assertNotNull(caps);
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+
+        Window window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Thread.sleep(100); // 100 ms
+        destroyWindow(null, null, window);
+        destroyWindow(display, screen, window);
+    }
+
+    @Test
+    public void testWindowDecor03TwoWin() throws InterruptedException {
+        Capabilities caps = new Capabilities();
+        Assert.assertNotNull(caps);
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+
+        Window window1 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Window window2 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        Thread.sleep(100); // 100 ms
+        destroyWindow(null, null, window2);
+        destroyWindow(display, screen, window1);
+    }
+
+    public static void main(String args[]) throws IOException {
+        String tstname = TestWindows01NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java
new file mode 100644
index 0000000..609d443
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import com.jogamp.newt.event.*;
+
+class WindowEventCom1 extends WindowAdapter {
+
+    public void windowResized(WindowEvent e) {
+        e.setAttachment(new String("WindowEventCom1.windowResized: "+e));
+    }
+    public void windowMoved(WindowEvent e) {
+        e.setAttachment(new String("WindowEventCom1.windowMoved: "+e));
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java
new file mode 100644
index 0000000..d15a3cc
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java
@@ -0,0 +1,48 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import com.jogamp.newt.event.*;
+
+class WindowEventCom2 extends WindowAdapter {
+
+    public void windowResized(WindowEvent e) {
+        String str = (String) e.getAttachment();
+        if(null==str) {
+            e.setAttachment(new String("WindowEventCom2.windowResized: "+e));
+        }
+    }
+    public void windowMoved(WindowEvent e) {
+        String str = (String) e.getAttachment();
+        if(null==str) {
+            e.setAttachment(new String("WindowEventCom2.windowMoved: "+e));
+        }
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java
new file mode 100644
index 0000000..87e5ecc
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt;
+
+import com.jogamp.newt.event.*;
+
+class WindowEventCom3 extends WindowAdapter {
+
+    public void windowResized(WindowEvent e) {
+        String str = (String) e.getAttachment();
+        System.out.println("WindowEventCom3.windowResized: "+str);
+    }
+    public void windowMoved(WindowEvent e) {
+        String str = (String) e.getAttachment();
+        System.out.println("WindowEventCom3.windowMoved: "+str);
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java
new file mode 100644
index 0000000..d518616
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java
@@ -0,0 +1,57 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import javax.media.opengl.*;
+
+public class GLRunnableDummy implements GLRunnable {
+    float r=0.0f;
+    float g=0.0f;
+    float b=0.0f;
+    float d=0.001f;
+
+    public void run(GLAutoDrawable drawable) {
+        GL2ES1 gl = drawable.getGL().getGL2ES1();
+        gl.glClearColor(r, g, b, 1f);
+        r+=d;
+        if(r>1f) {
+            r=1f;
+            d*=-1f;
+        } else if(r<0f) {
+            r=0f;
+            d*=-1f;
+        }
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java
new file mode 100644
index 0000000..3313ec6
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+import com.jogamp.newt.event.*;
+
+class KeyAction extends KeyAdapter {
+    NEWTEventFiFo eventFifo;
+
+    public KeyAction(NEWTEventFiFo eventFifo) { 
+        this.eventFifo = eventFifo; 
+    }
+
+    public void keyTyped(KeyEvent e) {
+        eventFifo.put(e);
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
new file mode 100644
index 0000000..5173d0f
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
@@ -0,0 +1,716 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.media.opengl.*;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.*;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquare;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestParenting01NEWT extends UITestCase {
+    static int width, height;
+    static long durationPerTest = 500;
+    static long waitAbout10FramesAt30fps = 10*34; // 10 frames @ 30fps
+    static GLCapabilities glCaps;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        width  = 640;
+        height = 480;
+        glCaps = new GLCapabilities(null);
+    }
+
+    @Test
+    public void testWindowParenting01CreateVisibleDestroy() throws InterruptedException {
+        int x = 0;
+        int y = 0;
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Display display = null;
+        Screen screen = null;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        Assert.assertNotNull(glWindow1);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertNull(glWindow1.getParent());
+        screen = glWindow1.getScreen();
+        display = screen.getDisplay();
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
+        glWindow1.setSize(640, 480);
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+
+        GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
+        Assert.assertNotNull(glWindow2);
+        Assert.assertEquals(false, glWindow2.isVisible());
+        Assert.assertEquals(false, glWindow2.isNativeValid());
+        Assert.assertSame(glWindow1,glWindow2.getParent());
+        Assert.assertSame(screen,glWindow2.getScreen());
+        Assert.assertSame(display,glWindow2.getScreen().getDisplay());
+        glWindow2.setSize(320, 240);
+        GLEventListener demo2 = new Gears();
+        setDemoFields(demo2, glWindow2, false);
+        glWindow2.addGLEventListener(demo2);
+
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning()); // GLWindow -> invoke ..
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        // visible test
+        Assert.assertEquals(0, glWindow1.getTotalFrames());
+        Assert.assertEquals(0, glWindow2.getTotalFrames());
+        glWindow1.setVisible(true);
+        System.err.println("Frames for setVisible(true): A1: "+glWindow1.getTotalFrames()+", B1: "+glWindow2.getTotalFrames());
+        Assert.assertTrue(0 < glWindow1.getTotalFrames());
+        Assert.assertTrue(0 < glWindow2.getTotalFrames());
+
+        Assert.assertEquals(true, glWindow1.isVisible());
+        Assert.assertEquals(true, glWindow1.isNativeValid());
+        Assert.assertEquals(true, glWindow2.isVisible());
+        Assert.assertEquals(true, glWindow2.isNativeValid());
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(2,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+
+        glWindow1.setVisible(false);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(true, glWindow1.isNativeValid());
+        Assert.assertEquals(false, glWindow2.isVisible());
+        Assert.assertEquals(true, glWindow2.isNativeValid());
+
+        glWindow1.resetCounter();
+        glWindow2.resetCounter();
+        Assert.assertEquals(0, glWindow1.getTotalFrames());
+        Assert.assertEquals(0, glWindow2.getTotalFrames());
+        glWindow1.setVisible(true);
+        System.err.println("Frames for setVisible(true): A2: "+glWindow1.getTotalFrames()+", B2: "+glWindow2.getTotalFrames());
+        Assert.assertTrue(0 < glWindow1.getTotalFrames());
+        Assert.assertTrue(0 < glWindow2.getTotalFrames());
+
+        Assert.assertEquals(true, glWindow1.isVisible());
+        Assert.assertEquals(true, glWindow1.isNativeValid());
+        Assert.assertEquals(true, glWindow2.isVisible());
+        Assert.assertEquals(true, glWindow2.isNativeValid());
+
+        glWindow1.resetCounter();
+        glWindow2.resetCounter();
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+        Assert.assertEquals(true, animator1.isAnimating());
+        Assert.assertEquals(false, animator1.isPaused());
+        Assert.assertNotNull(animator1.getThread());
+        Animator animator2 = new Animator(glWindow2);
+        animator2.start();
+        Assert.assertEquals(true, animator2.isAnimating());
+        Assert.assertEquals(false, animator2.isPaused());
+        Assert.assertNotNull(animator2.getThread());
+        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+        }
+        System.err.println("Frames for setVisible(true): A3: "+glWindow1.getTotalFrames()+", B3: "+glWindow2.getTotalFrames());
+        Assert.assertTrue(0 < glWindow1.getTotalFrames());
+        Assert.assertTrue(0 < glWindow2.getTotalFrames());
+
+        Assert.assertEquals(true, animator1.pause());
+        Assert.assertEquals(false, animator1.isAnimating());
+        Assert.assertEquals(true, animator1.isPaused());
+        Assert.assertNotNull(animator1.getThread());
+        Assert.assertEquals(true, animator2.pause());
+        Assert.assertEquals(false, animator2.isAnimating());
+        Assert.assertEquals(true, animator2.isPaused());
+        Assert.assertNotNull(animator2.getThread());
+
+        glWindow1.resetCounter();
+        glWindow2.resetCounter();
+        Assert.assertEquals(true, animator1.resume());
+        Assert.assertEquals(true, animator1.isAnimating());
+        Assert.assertEquals(false, animator1.isPaused());
+        Assert.assertNotNull(animator1.getThread());
+        Assert.assertEquals(true, animator2.resume());
+        Assert.assertEquals(true, animator2.isAnimating());
+        Assert.assertEquals(false, animator2.isPaused());
+        Assert.assertNotNull(animator2.getThread());
+        Thread.sleep(waitAbout10FramesAt30fps);
+        System.err.println("Frames for setVisible(true): A4: "+glWindow1.getTotalFrames()+", B4: "+glWindow2.getTotalFrames());
+        Assert.assertTrue(0 < glWindow1.getTotalFrames());
+        Assert.assertTrue(0 < glWindow2.getTotalFrames());
+
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+        Assert.assertEquals(false, animator1.isPaused());
+        Assert.assertEquals(null, animator1.getThread());
+        animator2.stop();
+        Assert.assertEquals(false, animator2.isAnimating());
+        Assert.assertEquals(false, animator2.isPaused());
+        Assert.assertEquals(null, animator2.getThread());
+
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(2,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+
+        glWindow2.destroy(); // can be recreated, refs are hold
+        Assert.assertEquals(true,  glWindow1.isVisible());
+        Assert.assertEquals(true,  glWindow1.isNativeValid());
+        Assert.assertEquals(true,  glWindow1.isValid());
+        Assert.assertEquals(false, glWindow2.isVisible());
+        Assert.assertEquals(false, glWindow2.isNativeValid());
+        Assert.assertEquals(true,  glWindow2.isValid());
+
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(1,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+
+        glWindow1.destroy(); // can be recreated, refs are hold
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertEquals(true,  glWindow1.isValid());
+        Assert.assertEquals(false, glWindow2.isVisible());
+        Assert.assertEquals(false, glWindow2.isNativeValid());
+        Assert.assertEquals(true,  glWindow2.isValid());
+
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(false,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        // recreation ..
+        glWindow1.resetCounter();
+        glWindow2.resetCounter();
+        Assert.assertEquals(0, glWindow1.getTotalFrames());
+        Assert.assertEquals(0, glWindow2.getTotalFrames());
+        glWindow1.setVisible(true);
+        Assert.assertEquals(true, glWindow1.isVisible());
+        Assert.assertEquals(true, glWindow1.isNativeValid());
+        Assert.assertEquals(true, glWindow2.isVisible());
+        Assert.assertEquals(true, glWindow2.isNativeValid());
+
+        System.err.println("Frames for setVisible(true): A3: "+glWindow1.getTotalFrames()+", B3: "+glWindow2.getTotalFrames());
+        Assert.assertTrue(0 < glWindow1.getTotalFrames());
+        Assert.assertTrue(0 < glWindow2.getTotalFrames());
+
+        Assert.assertEquals(1,display.getReferenceCount());
+        Assert.assertEquals(true,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(true,display.getEDTUtil().isRunning());
+        Assert.assertEquals(2,screen.getReferenceCount());
+        Assert.assertEquals(true,screen.isNativeValid());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+
+        // chain glwindow1 -> glwindow2 ; can be recreated ..
+        glWindow1.destroy();
+        Assert.assertEquals(true, glWindow1.isValid());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertEquals(true, glWindow2.isValid());
+        Assert.assertEquals(false, glWindow2.isNativeValid());
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(false,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        glWindow1.invalidate();
+        Assert.assertEquals(false, glWindow1.isValid());
+        Assert.assertEquals(false, glWindow2.isValid());
+
+        // test double destroy/invalidate ..
+        glWindow2.invalidate();
+        Assert.assertEquals(false, glWindow2.isValid());
+
+        Assert.assertEquals(0,display.getReferenceCount());
+        Assert.assertEquals(false,display.isNativeValid());
+        Assert.assertNotNull(display.getEDTUtil());
+        Assert.assertEquals(false,display.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen.getReferenceCount());
+        Assert.assertEquals(false,screen.isNativeValid());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+    }
+
+    @Test
+    public void testWindowParenting02ReparentTop2WinReparentRecreate() throws InterruptedException {
+        testWindowParenting02ReparentTop2WinImpl(true);
+    }
+
+    @Test
+    public void testWindowParenting02ReparentTop2WinReparentNative() throws InterruptedException {
+        testWindowParenting02ReparentTop2WinImpl(false);
+    }
+
+    /**
+     * @param reparentRecreate true, if the followup reparent should utilize destroy/create, instead of native reparenting
+     */
+    protected void testWindowParenting02ReparentTop2WinImpl(boolean reparentRecreate) throws InterruptedException {
+        int x = 0;
+        int y = 0;
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Display display1 = null;
+        Screen screen1 = null;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        glWindow1.setTitle("testWindowParenting02ReparentTop2Win");
+        glWindow1.setSize(640, 480);
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+        screen1 = glWindow1.getScreen();
+        display1 = screen1.getDisplay();
+
+        Assert.assertEquals(0,display1.getReferenceCount());
+        Assert.assertEquals(false,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen1.getReferenceCount());
+        Assert.assertEquals(false,screen1.isNativeValid());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        GLWindow glWindow2 = GLWindow.create(glCaps);
+        glWindow2.setSize(320, 240);
+        GLEventListener demo2 = new Gears();
+        setDemoFields(demo2, glWindow2, false);
+        glWindow2.addGLEventListener(demo2);
+        Assert.assertSame(screen1, glWindow2.getScreen());
+        Assert.assertSame(display1, glWindow2.getScreen().getDisplay());
+
+        Assert.assertEquals(0,display1.getReferenceCount());
+        Assert.assertEquals(false,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen1.getReferenceCount());
+        Assert.assertEquals(false,screen1.isNativeValid());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        Assert.assertEquals(0, glWindow1.getTotalFrames());
+        glWindow1.setVisible(true);
+        Assert.assertEquals(1,display1.getReferenceCount());
+        Assert.assertEquals(true,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(1,screen1.getReferenceCount());
+        Assert.assertEquals(true,screen1.isNativeValid());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+        Assert.assertEquals(true, glWindow1.isVisible());
+        System.err.println("Frames for setVisible(true) A1: "+glWindow1.getTotalFrames());
+        Assert.assertTrue(0 < glWindow1.getTotalFrames());
+
+        Assert.assertEquals(0, glWindow2.getTotalFrames());
+        glWindow2.setVisible(true);
+
+        Assert.assertEquals(1,display1.getReferenceCount());
+        Assert.assertEquals(true,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(2,screen1.getReferenceCount());
+        Assert.assertEquals(true,screen1.isNativeValid());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+        Assert.assertEquals(true, glWindow2.isVisible());
+        System.err.println("Frames for setVisible(true) B1: "+glWindow2.getTotalFrames());
+        Assert.assertTrue(0 < glWindow1.getTotalFrames());
+
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+        Animator animator2 = new Animator(glWindow2);
+        animator2.start();
+
+        int state = 0;
+        int reparentAction;
+        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
+            Thread.sleep(durationPerTest);
+            switch(state) {
+                case 0:
+                    // glWindow2 -- child --> glWindow1: compatible
+                    Assert.assertEquals(true, glWindow2.isVisible());
+                    System.err.println("Frames(1) "+glWindow2.getTotalFrames());
+                    reparentAction = glWindow2.reparentWindow(glWindow1, reparentRecreate);
+                    System.err.println("Frames(2) "+glWindow2.getTotalFrames());
+                    Assert.assertTrue(Window.ReparentAction.ACTION_INVALID < reparentAction);
+                    Assert.assertEquals(true, glWindow2.isVisible());
+                    Assert.assertEquals(true, glWindow2.isNativeValid());
+                    Assert.assertSame(glWindow1,glWindow2.getParent());
+                    System.err.println("Frames for reparentWindow(parent, "+reparentRecreate+"): "+reparentAction+", B2: "+glWindow2.getTotalFrames());
+                    Assert.assertTrue(0 < glWindow2.getTotalFrames());
+
+                    Assert.assertEquals(1,display1.getReferenceCount());
+                    Assert.assertEquals(true,display1.isNativeValid());
+                    Assert.assertNotNull(display1.getEDTUtil());
+                    Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+                    Assert.assertEquals(true,screen1.isNativeValid());
+                    Assert.assertSame(screen1,glWindow2.getScreen());
+                    Assert.assertSame(display1,glWindow2.getScreen().getDisplay());
+                    Assert.assertEquals(2,screen1.getReferenceCount());
+                    Assert.assertEquals(1,Display.getActiveDisplayNumber());
+
+                    break;
+
+                case 1:
+                    // glWindow2 --> top
+                    Assert.assertEquals(true, glWindow2.isVisible());
+
+                    reparentAction = glWindow2.reparentWindow(null, reparentRecreate);
+                    Assert.assertTrue(Window.ReparentAction.ACTION_INVALID < reparentAction);
+                    Assert.assertEquals(true, glWindow2.isVisible());
+                    Assert.assertEquals(true, glWindow2.isNativeValid());
+                    Assert.assertNull(glWindow2.getParent());
+                    System.err.println("Frames for reparentWindow(parent, "+reparentRecreate+"): "+reparentAction+", B3: "+glWindow2.getTotalFrames());
+                    Assert.assertTrue(0 < glWindow2.getTotalFrames());
+
+                    Assert.assertEquals(1,display1.getReferenceCount());
+                    Assert.assertEquals(true,display1.isNativeValid());
+                    Assert.assertNotNull(display1.getEDTUtil());
+                    Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+                    Assert.assertEquals(true,screen1.isNativeValid());
+                    Assert.assertSame(screen1,glWindow2.getScreen());
+                    Assert.assertSame(display1,glWindow2.getScreen().getDisplay());
+                    Assert.assertEquals(2,screen1.getReferenceCount());
+                    Assert.assertEquals(1,Display.getActiveDisplayNumber());
+
+                    break;
+            }
+            state++;
+        }
+        //
+        // both windows are now top level
+        //
+
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+        Assert.assertEquals(false, animator1.isPaused());
+        Assert.assertEquals(null, animator1.getThread());
+        animator2.stop();
+        Assert.assertEquals(false, animator2.isAnimating());
+        Assert.assertEquals(false, animator2.isPaused());
+        Assert.assertEquals(null, animator2.getThread());
+
+        // pre-destroy check (both valid and running)
+        Assert.assertEquals(1,display1.getReferenceCount());
+        Assert.assertEquals(true,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(2,screen1.getReferenceCount());
+        Assert.assertEquals(true,screen1.isNativeValid());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+
+        // destroy glWindow2
+        glWindow2.destroy();
+        Assert.assertEquals(true,  glWindow1.isValid());
+        Assert.assertEquals(true,  glWindow1.isNativeValid());
+        Assert.assertEquals(true,  glWindow1.isVisible());
+        Assert.assertEquals(true,  glWindow2.isValid());
+        Assert.assertEquals(false, glWindow2.isNativeValid());
+        Assert.assertEquals(false, glWindow2.isVisible());
+
+        Assert.assertEquals(1,display1.getReferenceCount());
+        Assert.assertEquals(true,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(1,screen1.getReferenceCount());
+        Assert.assertEquals(true,screen1.isNativeValid());
+
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+
+        // destroy glWindow1
+        glWindow1.destroy();
+        Assert.assertEquals(true,  glWindow1.isValid());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(true,  glWindow2.isValid());
+        Assert.assertEquals(false, glWindow2.isNativeValid());
+        Assert.assertEquals(false, glWindow2.isVisible());
+
+        Assert.assertEquals(0,display1.getReferenceCount());
+        Assert.assertEquals(false,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(false,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen1.getReferenceCount());
+        Assert.assertEquals(false,screen1.isNativeValid());
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        glWindow1.invalidate();
+        Assert.assertEquals(false, glWindow1.isValid());
+        Assert.assertEquals(true,  glWindow2.isValid());
+
+        glWindow2.invalidate();
+        Assert.assertEquals(false, glWindow2.isValid());
+    }
+
+    @Test
+    public void testWindowParenting03ReparentWin2TopReparentRecreate() throws InterruptedException {
+        testWindowParenting03ReparentWin2TopImpl(true);
+    }
+
+    @Test
+    public void testWindowParenting03ReparentWin2TopReparentNative() throws InterruptedException {
+        testWindowParenting03ReparentWin2TopImpl(false);
+    }
+
+    protected void testWindowParenting03ReparentWin2TopImpl(boolean reparentRecreate) throws InterruptedException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+        Display display1 = null;
+        Screen screen1 = null;
+        Display display2 = null;
+        Screen screen2 = null;
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        screen1 = glWindow1.getScreen();
+        display1 = screen1.getDisplay();
+        glWindow1.setTitle("testWindowParenting03ReparentWin2Top");
+        glWindow1.setSize(640, 480);
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+
+        Assert.assertEquals(0,display1.getReferenceCount());
+        Assert.assertEquals(false,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen1.getReferenceCount());
+        Assert.assertEquals(false,screen1.isNativeValid());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
+        screen2 = glWindow2.getScreen();
+        display2 = screen2.getDisplay();
+        glWindow2.setSize(320, 240);
+        GLEventListener demo2 = new Gears();
+        setDemoFields(demo2, glWindow2, false);
+        glWindow2.addGLEventListener(demo2);
+
+        Assert.assertEquals(0,display2.getReferenceCount());
+        Assert.assertEquals(false,display2.isNativeValid());
+        Assert.assertNotNull(display2.getEDTUtil());
+        Assert.assertEquals(true,display2.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen2.getReferenceCount());
+        Assert.assertEquals(false,screen2.isNativeValid());
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        Assert.assertSame(screen1,glWindow2.getScreen());
+        Assert.assertSame(display1,glWindow2.getScreen().getDisplay());
+
+        Assert.assertEquals(0, glWindow1.getTotalFrames());
+        Assert.assertEquals(0, glWindow2.getTotalFrames());
+        glWindow1.setVisible(true);
+        System.err.println("Frames for setVisible(): A1: "+glWindow1.getTotalFrames()+", B1: "+glWindow2.getTotalFrames());
+        Assert.assertTrue(0 < glWindow2.getTotalFrames());
+        Assert.assertTrue(0 < glWindow1.getTotalFrames());
+
+        Assert.assertEquals(1,display1.getReferenceCount());
+        Assert.assertEquals(true,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(2,screen1.getReferenceCount());
+        Assert.assertEquals(true,screen1.isNativeValid());
+        Assert.assertSame(glWindow1,glWindow2.getParent());
+        Assert.assertSame(screen1,glWindow2.getScreen());
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+        Animator animator2 = new Animator(glWindow2);
+        animator2.start();
+
+        int state = 0;
+        int reparentAction;
+        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
+            Thread.sleep(durationPerTest);
+            switch(state) {
+                case 0:
+                    Assert.assertEquals(true, glWindow2.isVisible());
+                    reparentAction = glWindow2.reparentWindow(null, reparentRecreate);
+                    Assert.assertTrue(Window.ReparentAction.ACTION_INVALID < reparentAction);
+                    Assert.assertEquals(true, glWindow2.isVisible());
+                    Assert.assertEquals(true, glWindow2.isNativeValid());
+                    System.err.println("Frames for reparentWindow(parent, "+reparentRecreate+"): "+reparentAction+", B2: "+glWindow2.getTotalFrames());
+                    Assert.assertTrue(0 < glWindow2.getTotalFrames());
+                    Assert.assertNull(glWindow2.getParent());
+                    Assert.assertSame(screen1,glWindow2.getScreen());
+                    Assert.assertSame(display1,glWindow2.getScreen().getDisplay());
+                    Assert.assertEquals(1,Display.getActiveDisplayNumber());
+                    break;
+                case 1:
+                    Assert.assertEquals(true, glWindow2.isVisible());
+                    reparentAction = glWindow2.reparentWindow(glWindow1, reparentRecreate);
+                    Assert.assertTrue(Window.ReparentAction.ACTION_INVALID < reparentAction);
+                    Assert.assertEquals(true, glWindow2.isVisible());
+                    Assert.assertEquals(true, glWindow2.isNativeValid());
+                    System.err.println("Frames for reparentWindow(parent, "+reparentRecreate+"): "+reparentAction+", B3 "+glWindow2.getTotalFrames());
+                    Assert.assertTrue(0 < glWindow2.getTotalFrames());
+                    Assert.assertSame(glWindow1,glWindow2.getParent());
+                    Assert.assertSame(screen1,glWindow2.getScreen());
+                    Assert.assertSame(display1,glWindow2.getScreen().getDisplay());
+                    Assert.assertEquals(1,Display.getActiveDisplayNumber());
+                    break;
+            }
+            state++;
+        }
+        //
+        // glwindow2 is child of glwindow1
+        //
+
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+        Assert.assertEquals(false, animator1.isPaused());
+        Assert.assertEquals(null, animator1.getThread());
+        animator2.stop();
+        Assert.assertEquals(false, animator2.isAnimating());
+        Assert.assertEquals(false, animator2.isPaused());
+        Assert.assertEquals(null, animator2.getThread());
+
+        Assert.assertEquals(1,display1.getReferenceCount());
+        Assert.assertEquals(true,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(true,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(2,screen1.getReferenceCount());
+        Assert.assertEquals(true,screen1.isNativeValid());
+        Assert.assertSame(glWindow1,glWindow2.getParent());
+        Assert.assertSame(screen1,glWindow2.getScreen());
+
+        Assert.assertEquals(1,Display.getActiveDisplayNumber());
+
+        glWindow1.destroy(); // should destroy both windows, actually, since glWindow2 is a child
+        Assert.assertEquals(true,  glWindow1.isValid());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(true,  glWindow2.isValid());
+        Assert.assertEquals(false, glWindow2.isNativeValid());
+        Assert.assertEquals(false, glWindow2.isVisible());
+
+        Assert.assertEquals(0,display1.getReferenceCount());
+        Assert.assertEquals(false,display1.isNativeValid());
+        Assert.assertNotNull(display1.getEDTUtil());
+        Assert.assertEquals(false,display1.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen1.getReferenceCount());
+        Assert.assertEquals(false,screen1.isNativeValid());
+
+        Assert.assertEquals(0,display2.getReferenceCount());
+        Assert.assertEquals(false,display2.isNativeValid());
+        Assert.assertNotNull(display2.getEDTUtil());
+        Assert.assertEquals(false,display2.getEDTUtil().isRunning());
+        Assert.assertEquals(0,screen2.getReferenceCount());
+        Assert.assertEquals(false,screen2.isNativeValid());
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+
+        glWindow2.destroy(); // dbl destroy check ..
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertEquals(false, glWindow2.isNativeValid());
+
+        glWindow1.invalidate(); // parent -> child
+        Assert.assertEquals(false, glWindow1.isValid());
+        Assert.assertEquals(false, glWindow2.isValid());
+
+        Assert.assertEquals(0,Display.getActiveDisplayNumber());
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);        
+        if(debug) {
+            MiscUtils.setFieldIfExists(demo, "glDebug", true);
+            MiscUtils.setFieldIfExists(demo, "glTrace", true);
+        }
+        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow.getWindow())) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        System.err.println("durationPerTest: "+durationPerTest);
+        String tstname = TestParenting01NEWT.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
new file mode 100644
index 0000000..424fff0
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
@@ -0,0 +1,443 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import java.awt.Button;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.Container;
+import java.awt.Frame;
+import java.awt.Dimension;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.*;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquare;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestParenting01aAWT extends UITestCase {
+    static int width, height;
+    static long durationPerTest = 800;
+    static long waitReparent = 0;
+    static GLCapabilities glCaps;
+
+    @BeforeClass
+    public static void initClass() throws InterruptedException {
+        GLProfile.initSingleton(true);
+        width  = 640;
+        height = 480;
+        glCaps = new GLCapabilities(null);
+        // Thread.sleep(10000);
+    }
+
+    @Test
+    public void testWindowParenting01CreateVisibleDestroy1() throws InterruptedException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        Assert.assertNotNull(glWindow1);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertNull(glWindow1.getParent());
+        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+        Assert.assertNotNull(newtCanvasAWT);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertNull(glWindow1.getParent());
+
+        Frame frame1 = new Frame("AWT Parent Frame");
+        frame1.setLayout(new BorderLayout());
+        frame1.add(new Button("North"), BorderLayout.NORTH);
+        frame1.add(new Button("South"), BorderLayout.SOUTH);
+        frame1.add(new Button("East"), BorderLayout.EAST);
+        frame1.add(new Button("West"), BorderLayout.WEST);
+
+        Container container1 = new Container();
+        container1.setLayout(new BorderLayout());
+        container1.add(new Button("north"), BorderLayout.NORTH);
+        container1.add(new Button("south"), BorderLayout.SOUTH);
+        container1.add(new Button("east"), BorderLayout.EAST);
+        container1.add(new Button("west"), BorderLayout.WEST);
+        container1.add(newtCanvasAWT, BorderLayout.CENTER);
+
+        frame1.add(container1, BorderLayout.CENTER);
+        frame1.setSize(width, height);
+
+        // visible test
+        frame1.setVisible(true);
+        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+        }
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+
+        frame1.setVisible(false);
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        frame1.setVisible(true);
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        frame1.remove(newtCanvasAWT);
+        // Assert.assertNull(glWindow1.getParent());
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        frame1.dispose();
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        glWindow1.invalidate();
+        //Assert.assertEquals(false, glWindow1.isValid());
+    }
+
+    @Test
+    public void testWindowParenting02CreateVisibleDestroy2Defered() throws InterruptedException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        Assert.assertNotNull(glWindow1);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertNull(glWindow1.getParent());
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+        Assert.assertNotNull(newtCanvasAWT);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertNull(glWindow1.getParent());
+
+        Frame frame = new Frame("AWT Parent Frame");
+        Assert.assertNotNull(frame);
+        frame.setSize(width, height);
+
+        // visible test
+        frame.setVisible(true);
+
+        frame.add(newtCanvasAWT);
+        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+        }
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+
+        frame.dispose();
+        glWindow1.invalidate();
+    }
+
+    @Test
+    public void testWindowParenting02CreateVisibleDestroy3Odd() throws InterruptedException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+
+        Frame frame = new Frame("AWT Parent Frame");
+        Assert.assertNotNull(frame);
+        frame.setSize(width, height);
+
+        // visible test
+        frame.setVisible(true);
+
+        frame.add(newtCanvasAWT);
+
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+        Assert.assertEquals(true, animator1.isStarted());
+        Assert.assertEquals(true, animator1.isAnimating());
+        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+        }
+
+        Assert.assertEquals(true, animator1.isAnimating()); // !!!
+
+        frame.dispose();
+        glWindow1.invalidate();
+    }
+
+    @Test
+    public void testWindowParenting03ReparentNewtWin2Top() throws InterruptedException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+
+        Frame frame = new Frame("AWT Parent Frame");
+        frame.setSize(width, height);
+        frame.setLocation(640, 480);
+        frame.setVisible(true);
+
+        frame.add(newtCanvasAWT);
+        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+
+        int state = 0;
+        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
+            Thread.sleep(durationPerTest);
+            switch(state) {
+                case 0:
+                    glWindow1.reparentWindow(null);
+                    Assert.assertEquals(true, glWindow1.isNativeValid());
+                    Assert.assertNull(glWindow1.getParent());
+                    break;
+                case 1:
+                    glWindow1.reparentWindow(newtCanvasAWT.getNativeWindow());
+                    Assert.assertEquals(true, glWindow1.isNativeValid());
+                    Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+                    break;
+            }
+            state++;
+        }
+
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+
+        frame.dispose();
+        glWindow1.invalidate();
+    }
+
+    @Test
+    public void testWindowParenting04ReparentNewtWin2TopLayouted() throws InterruptedException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+
+        Frame frame = new Frame("AWT Parent Frame");
+        frame.setLayout(new BorderLayout());
+        frame.add(new Button("North"), BorderLayout.NORTH);
+        frame.add(new Button("South"), BorderLayout.SOUTH);
+        frame.add(new Button("East"), BorderLayout.EAST);
+        frame.add(new Button("West"), BorderLayout.WEST);
+        frame.setSize(width, height);
+        frame.setLocation(640, 480);
+        frame.setVisible(true);
+
+        frame.add(newtCanvasAWT, BorderLayout.CENTER);
+        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+
+        int state = 0;
+        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
+            Thread.sleep(durationPerTest);
+            switch(state) {
+                case 0:
+                    glWindow1.reparentWindow(null);
+                    Assert.assertEquals(true, glWindow1.isNativeValid());
+                    Assert.assertNull(glWindow1.getParent());
+                    break;
+                case 1:
+                    glWindow1.reparentWindow(newtCanvasAWT.getNativeWindow());
+                    Assert.assertEquals(true, glWindow1.isNativeValid());
+                    Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+                    break;
+            }
+            state++;
+        }
+
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+
+        frame.dispose();
+        glWindow1.invalidate();
+    }
+
+    @Test
+    public void testWindowParenting05ReparentAWTWinHopFrame2Frame() throws InterruptedException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        glWindow1.setUndecorated(true);
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+
+        Frame frame1 = new Frame("AWT Parent Frame");
+        frame1.setLayout(new BorderLayout());
+        frame1.add(new Button("North"), BorderLayout.NORTH);
+        frame1.add(new Button("South"), BorderLayout.SOUTH);
+        frame1.add(new Button("East"), BorderLayout.EAST);
+        frame1.add(new Button("West"), BorderLayout.WEST);
+        frame1.setSize(width, height);
+        frame1.setLocation(0, 0);
+        frame1.setVisible(true);
+
+        Frame frame2 = new Frame("AWT Parent Frame");
+        frame2.setLayout(new BorderLayout());
+        frame2.add(new Button("North"), BorderLayout.NORTH);
+        frame2.add(new Button("South"), BorderLayout.SOUTH);
+        frame2.add(new Button("East"), BorderLayout.EAST);
+        frame2.add(new Button("West"), BorderLayout.WEST);
+        frame2.setSize(width, height);
+        frame2.setLocation(640, 480);
+        frame2.setVisible(true);
+
+        frame1.add(newtCanvasAWT, BorderLayout.CENTER);
+        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+
+        int state = 0;
+        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
+            Thread.sleep(durationPerTest);
+            switch(state) {
+                case 0:
+                    frame1.remove(newtCanvasAWT);
+                    frame2.add(newtCanvasAWT, BorderLayout.CENTER);
+                    break;
+                case 1:
+                    frame2.remove(newtCanvasAWT);
+                    frame1.add(newtCanvasAWT, BorderLayout.CENTER);
+                    break;
+            }
+            state++;
+        }
+
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+
+        frame1.dispose();
+        frame2.dispose();
+        glWindow1.invalidate();
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);        
+        if(debug) {
+            MiscUtils.setFieldIfExists(demo, "glDebug", true);
+            MiscUtils.setFieldIfExists(demo, "glTrace", true);
+        }
+        if(!MiscUtils.setFieldIfExists(demo, "window", glWindow.getWindow())) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            } else if(args[i].equals("-wait")) {
+                waitReparent = atoi(args[++i]);
+            }
+        }
+        String tstname = TestParenting01aAWT.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
new file mode 100644
index 0000000..2b8d344
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
@@ -0,0 +1,205 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import java.awt.Button;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.Frame;
+import java.awt.Dimension;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.FPSAnimator;
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.*;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquare;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestParenting01bAWT extends UITestCase {
+    static int width, height;
+    static long durationPerTest = 800;
+    static long waitReparent = 0;
+    static GLCapabilities glCaps;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        width  = 640;
+        height = 480;
+        glCaps = new GLCapabilities(null);
+    }
+
+    @Test
+    public void testWindowParenting05ReparentAWTWinHopFrame2FrameFPS25Animator() throws InterruptedException {
+        testWindowParenting05ReparentAWTWinHopFrame2FrameImpl(25);
+    }
+
+    @Test
+    public void testWindowParenting05ReparentAWTWinHopFrame2FrameStdAnimator() throws InterruptedException {
+        testWindowParenting05ReparentAWTWinHopFrame2FrameImpl(0);
+    }
+
+    public void testWindowParenting05ReparentAWTWinHopFrame2FrameImpl(int fps) throws InterruptedException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        glWindow1.setUndecorated(true);
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+
+        Frame frame1 = new Frame("AWT Parent Frame");
+        frame1.setLayout(new BorderLayout());
+        frame1.add(new Button("North"), BorderLayout.NORTH);
+        frame1.add(new Button("South"), BorderLayout.SOUTH);
+        frame1.add(new Button("East"), BorderLayout.EAST);
+        frame1.add(new Button("West"), BorderLayout.WEST);
+        frame1.setSize(width, height);
+        frame1.setLocation(0, 0);
+        frame1.setVisible(true);
+
+        Frame frame2 = new Frame("AWT Parent Frame");
+        frame2.setLayout(new BorderLayout());
+        frame2.add(new Button("North"), BorderLayout.NORTH);
+        frame2.add(new Button("South"), BorderLayout.SOUTH);
+        frame2.add(new Button("East"), BorderLayout.EAST);
+        frame2.add(new Button("West"), BorderLayout.WEST);
+        frame2.setSize(width, height);
+        frame2.setLocation(640, 480);
+        frame2.setVisible(true);
+
+        frame1.add(newtCanvasAWT, BorderLayout.CENTER);
+        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+
+        GLAnimatorControl animator1;
+        if(fps>0) {
+            animator1 = new FPSAnimator(glWindow1, fps);
+        } else {
+            animator1 = new Animator(glWindow1);
+        }
+        animator1.start();
+
+        int state;
+        for(state=0; state<3; state++) {
+            Thread.sleep(durationPerTest);
+            switch(state) {
+                case 0:
+                    frame1.remove(newtCanvasAWT);
+                    frame2.add(newtCanvasAWT, BorderLayout.CENTER);
+                    break;
+                case 1:
+                    frame2.remove(newtCanvasAWT);
+                    frame1.add(newtCanvasAWT, BorderLayout.CENTER);
+                    break;
+            }
+        }
+
+        Assert.assertEquals(true, animator1.isAnimating());
+        Assert.assertEquals(false, animator1.isPaused());
+        Assert.assertNotNull(animator1.getThread());
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+        Assert.assertEquals(false, animator1.isPaused());
+        Assert.assertEquals(null, animator1.getThread());
+
+        frame1.dispose();
+        frame2.dispose();
+        glWindow1.invalidate();
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);
+        Window window = glWindow.getWindow();
+        if(debug) {
+            MiscUtils.setFieldIfExists(demo, "glDebug", true);
+            MiscUtils.setFieldIfExists(demo, "glTrace", true);
+        }
+        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            } else if(args[i].equals("-wait")) {
+                waitReparent = atoi(args[++i]);
+            }
+        }
+        String tstname = TestParenting01bAWT.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
new file mode 100644
index 0000000..7321c6b
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
@@ -0,0 +1,243 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import java.awt.Button;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.Container;
+import java.awt.Frame;
+import java.awt.Dimension;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.*;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquare;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestParenting01cAWT extends UITestCase {
+    static int width, height;
+    static long durationPerTest = 800;
+    static GLCapabilities glCaps;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        width  = 640;
+        height = 480;
+        glCaps = new GLCapabilities(null);
+    }
+
+    @Test
+    public void testWindowParenting01CreateVisibleDestroy1() throws InterruptedException {
+        int x = 0;
+        int y = 0;
+        int i;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        Assert.assertNotNull(glWindow1);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertNull(glWindow1.getParent());
+        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+        Assert.assertNotNull(newtCanvasAWT);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertNull(glWindow1.getParent());
+
+        Frame frame1 = new Frame("AWT Parent Frame");
+        frame1.setLayout(new BorderLayout());
+        frame1.add(new Button("North"), BorderLayout.NORTH);
+        frame1.add(new Button("South"), BorderLayout.SOUTH);
+        frame1.add(new Button("East"), BorderLayout.EAST);
+        frame1.add(new Button("West"), BorderLayout.WEST);
+
+        Container container1 = new Container();
+        container1.setLayout(new BorderLayout());
+        container1.add(new Button("north"), BorderLayout.NORTH);
+        container1.add(new Button("south"), BorderLayout.SOUTH);
+        container1.add(new Button("east"), BorderLayout.EAST);
+        container1.add(new Button("west"), BorderLayout.WEST);
+        container1.add(newtCanvasAWT, BorderLayout.CENTER);
+
+        frame1.add(container1, BorderLayout.CENTER);
+        frame1.setSize(width, height);
+
+        // visible test
+        frame1.setVisible(true);
+        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+
+        for(i=0; i*100<durationPerTest; i++) {
+            Thread.sleep(100);
+        }
+
+        frame1.setVisible(false);
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        frame1.setVisible(true);
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        frame1.remove(newtCanvasAWT);
+        // Assert.assertNull(glWindow1.getParent());
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        frame1.dispose();
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        glWindow1.invalidate();
+        //Assert.assertEquals(false, glWindow1.isValid());
+    }
+
+    @Test
+    public void testWindowParenting05ReparentAWTWinHopFrame2Frame() throws InterruptedException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        glWindow1.setUndecorated(true);
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+
+        Frame frame1 = new Frame("AWT Parent Frame");
+        frame1.setLayout(new BorderLayout());
+        frame1.add(new Button("North"), BorderLayout.NORTH);
+        frame1.add(new Button("South"), BorderLayout.SOUTH);
+        frame1.add(new Button("East"), BorderLayout.EAST);
+        frame1.add(new Button("West"), BorderLayout.WEST);
+        frame1.setSize(width, height);
+        frame1.setLocation(0, 0);
+        frame1.setVisible(true);
+
+        Frame frame2 = new Frame("AWT Parent Frame");
+        frame2.setLayout(new BorderLayout());
+        frame2.add(new Button("North"), BorderLayout.NORTH);
+        frame2.add(new Button("South"), BorderLayout.SOUTH);
+        frame2.add(new Button("East"), BorderLayout.EAST);
+        frame2.add(new Button("West"), BorderLayout.WEST);
+        frame2.setSize(width, height);
+        frame2.setLocation(640, 480);
+        frame2.setVisible(true);
+
+        frame1.add(newtCanvasAWT, BorderLayout.CENTER);
+        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+
+        int state;
+        for(state=0; state<3; state++) {
+            Thread.sleep(durationPerTest);
+            switch(state) {
+                case 0:
+                    frame1.remove(newtCanvasAWT);
+                    frame2.add(newtCanvasAWT, BorderLayout.CENTER);
+                    break;
+                case 1:
+                    frame2.remove(newtCanvasAWT);
+                    frame1.add(newtCanvasAWT, BorderLayout.CENTER);
+                    break;
+            }
+        }
+
+        frame1.dispose();
+        frame2.dispose();
+        glWindow1.invalidate();
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);
+        Window window = glWindow.getWindow();
+        if(debug) {
+            MiscUtils.setFieldIfExists(demo, "glDebug", true);
+            MiscUtils.setFieldIfExists(demo, "glTrace", true);
+        }
+        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        String tstname = TestParenting01cAWT.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
new file mode 100644
index 0000000..1c155f7
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
@@ -0,0 +1,365 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+import java.lang.reflect.*;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.awt.Button;
+import java.awt.BorderLayout;
+import java.awt.Container;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+import javax.media.opengl.*;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.*;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquare;
+
+public class TestParenting01cSwingAWT extends UITestCase {
+    static int width, height;
+    static long durationPerTest = 800;
+    static long waitReparent = 0;
+    static GLCapabilities glCaps;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        width  = 640;
+        height = 480;
+        glCaps = new GLCapabilities(null);
+    }
+
+    @Test
+    public void testWindowParenting01CreateVisibleDestroy1() throws InterruptedException, InvocationTargetException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        /**
+         * JFrame . JPanel . Container . NewtCanvasAWT . GLWindow
+         */
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        Assert.assertNotNull(glWindow1);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertNull(glWindow1.getParent());
+        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+        final GLWindow _glWindow1 = glWindow1;
+        final GLRunnable _glRunnable = new GLRunnableDummy();
+        Thread disturbanceThread = new Thread(new Runnable() {
+            public void run() {
+                System.out.println("$");
+                while(true) 
+                {
+                   try {
+                       _glWindow1.invoke(true, _glRunnable);
+                       Thread.yield();
+                   } catch (Throwable t) {}
+               }
+            }
+        });
+        disturbanceThread.start();
+
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+        Assert.assertNotNull(newtCanvasAWT);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertNull(glWindow1.getParent());
+
+        Container container1 = new Container();
+        container1.setLayout(new BorderLayout());
+        container1.add(new Button("north"), BorderLayout.NORTH);
+        container1.add(new Button("south"), BorderLayout.SOUTH);
+        container1.add(new Button("east"), BorderLayout.EAST);
+        container1.add(new Button("west"), BorderLayout.WEST);
+        container1.add(newtCanvasAWT, BorderLayout.CENTER);
+
+        JPanel jPanel1 = new JPanel();
+        jPanel1.setLayout(new BorderLayout());
+        jPanel1.add(new Button("north"), BorderLayout.NORTH);
+        jPanel1.add(new Button("south"), BorderLayout.SOUTH);
+        jPanel1.add(new Button("east"), BorderLayout.EAST);
+        jPanel1.add(new Button("west"), BorderLayout.WEST);
+        jPanel1.add(container1, BorderLayout.CENTER);
+
+        JFrame jFrame1 = new JFrame("Swing Parent JFrame");
+        // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+        jFrame1.setContentPane(jPanel1);
+        jFrame1.setSize(width, height);
+        System.out.println("Demos: 1 - Visible");
+        jFrame1.setVisible(true); // from here on, we need to run modifications on EDT
+
+        final JFrame _jFrame1 = jFrame1;
+        final JPanel _jPanel1 = jPanel1;
+        final Container _container1 = container1;
+
+        // visible test
+        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+
+        while(animator1.isAnimating() && animator1.getDuration()<durationPerTest) {
+            Thread.sleep(100);
+        }
+        System.out.println("Demos: 2 - StopAnimator");
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+		    System.out.println("Demos: 3 - !Visible");
+                    _jFrame1.setVisible(false);
+                } });
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+		    System.out.println("Demos: 4 - Visible");
+                    _jFrame1.setVisible(true);
+                } });
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+		    System.out.println("Demos: 5 - X Container");
+                    _jPanel1.remove(_container1);
+                } });
+        // Assert.assertNull(glWindow1.getParent());
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    _jFrame1.dispose();
+                } });
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        glWindow1.invalidate();
+        //Assert.assertEquals(false, glWindow1.isValid());
+    }
+
+    @Test
+    public void testWindowParenting05ReparentAWTWinHopFrame2Frame() throws InterruptedException, InvocationTargetException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        /**
+         * JFrame . JPanel . Container . NewtCanvasAWT . GLWindow
+         */
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        Assert.assertNotNull(glWindow1);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertNull(glWindow1.getParent());
+        glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+        Animator animator1 = new Animator(glWindow1);
+        animator1.start();
+        final GLWindow _glWindow1 = glWindow1;
+        final GLRunnable _glRunnable = new GLRunnableDummy();
+        Thread disturbanceThread = new Thread(new Runnable() {
+            public void run() {
+                System.out.println("$");
+                while(true) 
+                {
+                   try {
+                       _glWindow1.invoke(true, _glRunnable);
+                       Thread.yield();
+                   } catch (Throwable t) {}
+               }
+            }
+        });
+        disturbanceThread.start();
+
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+        Assert.assertNotNull(newtCanvasAWT);
+        Assert.assertEquals(false, glWindow1.isVisible());
+        Assert.assertEquals(false, glWindow1.isNativeValid());
+        Assert.assertNull(glWindow1.getParent());
+
+        Container container1 = new Container();
+        container1.setLayout(new BorderLayout());
+        container1.add(new Button("north"), BorderLayout.NORTH);
+        container1.add(new Button("south"), BorderLayout.SOUTH);
+        container1.add(new Button("east"), BorderLayout.EAST);
+        container1.add(new Button("west"), BorderLayout.WEST);
+        container1.add(newtCanvasAWT, BorderLayout.CENTER);
+
+        JPanel jPanel1 = new JPanel();
+        jPanel1.setLayout(new BorderLayout());
+        jPanel1.add(new Button("north"), BorderLayout.NORTH);
+        jPanel1.add(new Button("south"), BorderLayout.SOUTH);
+        jPanel1.add(new Button("east"), BorderLayout.EAST);
+        jPanel1.add(new Button("west"), BorderLayout.WEST);
+        jPanel1.add(container1, BorderLayout.CENTER);
+
+        JFrame jFrame1 = new JFrame("Swing Parent JFrame");
+        // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+        jFrame1.setContentPane(jPanel1);
+        jFrame1.setLocation(0, 0);
+        jFrame1.setSize(width, height);
+        jFrame1.setVisible(true); // from here on, we need to run modifications on EDT
+
+        JPanel jPanel2 = new JPanel();
+        jPanel2.setLayout(new BorderLayout());
+        jPanel2.add(new Button("north"), BorderLayout.NORTH);
+        jPanel2.add(new Button("south"), BorderLayout.SOUTH);
+        jPanel2.add(new Button("east"), BorderLayout.EAST);
+        jPanel2.add(new Button("west"), BorderLayout.WEST);
+
+        JFrame jFrame2 = new JFrame("Swing Parent JFrame");
+        // jFrame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        jFrame2.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+        jFrame2.setContentPane(jPanel2);
+        jFrame2.setLocation(640, 480);
+        jFrame2.setSize(width, height);
+        jFrame2.setVisible(true); // from here on, we need to run modifications on EDT
+
+        final NewtCanvasAWT _newtCanvasAWT = newtCanvasAWT;
+        final JFrame _jFrame1 = jFrame1;
+        final JPanel _jPanel1 = jPanel1;
+        final Container _container1 = container1;
+        final JFrame _jFrame2 = jFrame2;
+        final JPanel _jPanel2 = jPanel2;
+
+        // visible test
+        Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
+
+        int state = 0;
+        while(animator1.isAnimating() && animator1.getDuration()<3*durationPerTest) {
+            Thread.sleep(durationPerTest);
+            switch(state) {
+                case 0:
+                    SwingUtilities.invokeAndWait(new Runnable() {
+                            public void run() {
+                                _container1.remove(_newtCanvasAWT);
+                                _jPanel2.add(_newtCanvasAWT, BorderLayout.CENTER);
+                            } });
+                    break;
+                case 1:
+                    SwingUtilities.invokeAndWait(new Runnable() {
+                            public void run() {
+                                _jPanel2.remove(_newtCanvasAWT);
+                                _container1.add(_newtCanvasAWT, BorderLayout.CENTER);
+                            } });
+                    break;
+            }
+            state++;
+        }
+
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    _jFrame1.setVisible(false);
+                    _jFrame2.setVisible(false);
+                } });
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    _jFrame1.dispose();
+                    _jFrame2.dispose();
+                } });
+        Assert.assertEquals(true, glWindow1.isValid());
+
+        glWindow1.invalidate();
+        //Assert.assertEquals(false, glWindow1.isValid());
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);
+        Window window = glWindow.getWindow();
+        if(debug) {
+            MiscUtils.setFieldIfExists(demo, "glDebug", true);
+            MiscUtils.setFieldIfExists(demo, "glTrace", true);
+        }
+        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            } else if(args[i].equals("-wait")) {
+                waitReparent = atoi(args[++i]);
+            }
+        }
+        System.out.println("durationPerTest "+durationPerTest);
+        System.out.println("waitReparent "+waitReparent);
+        String tstname = TestParenting01cSwingAWT.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
new file mode 100644
index 0000000..20388e2
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
@@ -0,0 +1,267 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import java.awt.Button;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.Frame;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.*;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquare;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestParenting02AWT extends UITestCase {
+    static int width, height;
+    static long durationPerTest = 500;
+    static long waitReparent = 300;
+    static boolean verbose = false;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        width  = 640;
+        height = 480;
+    }
+
+    @Test
+    public void testWindowParenting01NewtChildOnAWTParentLayouted() throws InterruptedException {
+        runNewtChildOnAWTParent(true, false);
+    }
+
+    @Test
+    public void testWindowParenting02NewtChildOnAWTParentLayoutedDef() throws InterruptedException {
+        runNewtChildOnAWTParent(true, true);
+    }
+
+    @Test
+    public void testWindowParenting03NewtChildOnAWTParentDirect() throws InterruptedException {
+        runNewtChildOnAWTParent(false, false);
+    }
+
+    @Test
+    public void testWindowParenting04NewtChildOnAWTParentDirectDef() throws InterruptedException {
+        runNewtChildOnAWTParent(false, true);
+    }
+
+    public void runNewtChildOnAWTParent(boolean useLayout, boolean deferredPeer) throws InterruptedException {
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        // setup NEWT GLWindow ..
+        GLWindow glWindow = GLWindow.create(new GLCapabilities(null));
+        Assert.assertNotNull(glWindow);
+        glWindow.setTitle("NEWT - CHILD");
+        glWindow.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo)));
+        glWindow.addWindowListener(new TraceWindowAdapter(new WindowAction(eventFifo)));
+        GLEventListener demo = new Gears();
+        setDemoFields(demo, glWindow, false);
+        glWindow.addGLEventListener(demo);
+
+        // attach NEWT GLWindow to AWT Canvas
+        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
+        Assert.assertNotNull(newtCanvasAWT);
+        Assert.assertEquals(false, glWindow.isVisible());
+        Assert.assertEquals(false, glWindow.isNativeValid());
+        Assert.assertNull(glWindow.getParent());
+
+        Frame frame = new Frame("AWT Parent Frame");
+        Assert.assertNotNull(frame);
+        if(useLayout) {
+            frame.setLayout(new BorderLayout());
+            frame.add(new Button("North"), BorderLayout.NORTH);
+            frame.add(new Button("South"), BorderLayout.SOUTH);
+            frame.add(new Button("East"), BorderLayout.EAST);
+            frame.add(new Button("West"), BorderLayout.WEST);
+            if(!deferredPeer) {
+                frame.add(newtCanvasAWT, BorderLayout.CENTER);
+            }
+        } else {
+            if(!deferredPeer) {
+                frame.add(newtCanvasAWT);
+            }
+        }
+
+        frame.setSize(width, height);
+
+        frame.setVisible(true);
+        // X11: true, Windows: false - Assert.assertEquals(true, glWindow.isVisible());
+
+        if(deferredPeer) {
+            if(useLayout) {
+                frame.add(newtCanvasAWT, BorderLayout.CENTER);
+            } else {
+                frame.add(newtCanvasAWT);
+            }
+        }
+
+        // Since it is not defined when AWT's addNotify call happen
+        // we just have to wait for it in this junit test
+        // because we have assertions on the state.
+        // Regular application shall not need to do that.
+        do {
+            Thread.yield();
+            // 1st display .. creation
+            glWindow.display();
+        } while(!glWindow.isNativeValid()) ;
+
+        Assert.assertEquals(true, glWindow.isNativeValid());
+        Assert.assertNotNull(glWindow.getParent());
+        if(verbose) {
+            System.out.println("+++++++++++++++++++ 1st ADDED");
+        }
+        Thread.sleep(waitReparent);
+
+        if(useLayout) {
+            // test some fancy re-layout ..
+            frame.remove(newtCanvasAWT);
+            Assert.assertEquals(false, glWindow.isVisible());
+            Assert.assertEquals(true, glWindow.isNativeValid());
+            Assert.assertNull(glWindow.getParent());
+            if(verbose) {
+                System.out.println("+++++++++++++++++++ REMOVED!");
+            }
+            Thread.sleep(waitReparent);
+
+            // should recreate properly ..
+            frame.add(newtCanvasAWT, BorderLayout.CENTER);
+            glWindow.display();
+            Assert.assertEquals(true, glWindow.isVisible());
+            Assert.assertEquals(true, glWindow.isNativeValid());
+            Assert.assertNotNull(glWindow.getParent());
+            if(verbose) {
+                System.out.println("+++++++++++++++++++ 2nd ADDED");
+            }
+            Thread.sleep(waitReparent);
+        }
+
+        long duration = durationPerTest;
+        long step = 20;
+        NEWTEvent event;
+        boolean shouldQuit = false;
+
+        while (duration>0 && !shouldQuit) {
+            glWindow.display();
+            Thread.sleep(step);
+            duration -= step;
+
+            while( null != ( event = (NEWTEvent) eventFifo.get() ) ) {
+                Window source = (Window) event.getSource();
+                if(event instanceof KeyEvent) {
+                    KeyEvent keyEvent = (KeyEvent) event;
+                    switch(keyEvent.getKeyChar()) {
+                        case 'q':
+                            shouldQuit = true;
+                            break;
+                        case 'f':
+                            source.setFullscreen(!source.isFullscreen());
+                            break;
+                    }
+                } 
+            }
+        }
+        if(verbose) {
+            System.out.println("+++++++++++++++++++ END");
+        }
+        Thread.sleep(waitReparent);
+
+        glWindow.invalidate();
+        if(useLayout) {
+            frame.remove(newtCanvasAWT);
+        }
+        frame.dispose();
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);
+        Window window = glWindow.getWindow();
+        if(debug) {
+            MiscUtils.setFieldIfExists(demo, "glDebug", true);
+            MiscUtils.setFieldIfExists(demo, "glTrace", true);
+        }
+        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        verbose = true;
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            } else if(args[i].equals("-wait")) {
+                waitReparent = atoi(args[++i]);
+            }
+        }
+        String tstname = TestParenting02AWT.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java
new file mode 100644
index 0000000..b9bd2d9
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java
@@ -0,0 +1,235 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.*;
+
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.*;
+import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquare;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestParenting02NEWT extends UITestCase {
+    static int width, height;
+    static long durationPerTest = 500;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        width  = 640;
+        height = 480;
+    }
+
+    static Window createWindow(Screen screen, Capabilities caps) {
+        Assert.assertNotNull(caps);
+        Window window = NewtFactory.createWindow(screen, caps) ;
+        Assert.assertNotNull(window);
+        return window;
+    }
+
+    static Window createWindow(NativeWindow parent, Capabilities caps) {
+        Assert.assertNotNull(caps);
+        Window window = NewtFactory.createWindow(parent, caps);
+        window.setUndecorated(true);
+        Assert.assertNotNull(window);
+        return window;
+    }
+
+    static void destroyWindow(Display display, Screen screen, Window window, GLWindow glWindow) {
+        if(null!=glWindow) {
+            glWindow.destroy();
+        }
+        if(null!=window) {
+            window.destroy();
+        }
+        if(null!=screen) {
+            screen.destroy();
+        }
+        if(null!=display) {
+            display.destroy();
+        }
+    }
+
+    @Test
+    public void testWindowParenting01NewtOnNewtParentChildDraw() throws InterruptedException {
+        GLCapabilities caps = new GLCapabilities(null);
+        Assert.assertNotNull(caps);
+        Display display = NewtFactory.createDisplay(null); // local display
+        Assert.assertNotNull(display);
+        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        Assert.assertNotNull(screen);
+
+        int x = 1;
+        int y = 1;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        Window window1 = createWindow(screen, caps);
+        Assert.assertNotNull(window1);
+        GLWindow glWindow1 = GLWindow.create(window1);
+        Assert.assertNotNull(glWindow1);
+        glWindow1.setSize(width, height);
+        Assert.assertEquals(width,glWindow1.getWidth());
+        Assert.assertEquals(height,glWindow1.getHeight());
+        glWindow1.setTitle("testWindowParenting01NewtOnNewtParentChildDraw - PARENT");
+        glWindow1.setPosition(x,y);
+        glWindow1.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo)));
+        glWindow1.addWindowListener(new TraceWindowAdapter());
+
+        GLEventListener demo1 = new RedSquare();
+        setDemoFields(demo1, window1, glWindow1, false);
+        // glWindow1.addGLEventListener(demo1);
+
+        glWindow1.setVisible(true);
+        CapabilitiesImmutable capsChosen = glWindow1.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+        Assert.assertNotNull(capsChosen);
+        Assert.assertTrue(capsChosen.isOnscreen()==true);
+
+        Window window2 = createWindow(window1, caps);
+        Assert.assertNotNull(window2);
+        GLWindow glWindow2 = GLWindow.create(window2);
+        Assert.assertNotNull(glWindow2);
+        glWindow2.setSize(width/2, height/2);
+        //Assert.assertEquals(width/2,glWindow2.getWidth());
+        //Assert.assertEquals(height/2,glWindow2.getHeight());
+        glWindow2.setTitle("testWindowParenting01NewtOnNewtParentChildDraw - CHILD");
+        glWindow2.setPosition(glWindow1.getWidth()/2, glWindow1.getHeight()/2);
+        glWindow2.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo)));
+        glWindow2.addWindowListener(new TraceWindowAdapter(new WindowAction(eventFifo)));
+        // glWindow2.addMouseListener(new TraceMouseAdapter());
+
+        GLEventListener demo2 = new Gears();
+        setDemoFields(demo2, window2, glWindow2, false);
+        // glWindow2.addGLEventListener(demo2);
+
+        glWindow2.setVisible(true);
+        capsChosen = glWindow2.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+        Assert.assertNotNull(capsChosen);
+        Assert.assertTrue(capsChosen.isOnscreen()==true);
+
+        glWindow1.addGLEventListener(demo1);
+        glWindow2.addGLEventListener(demo2);
+
+        boolean shouldQuit = false;
+        long duration = durationPerTest;
+        long step = 20;
+        NEWTEvent event;
+
+        while (duration>0 && !shouldQuit) {
+            glWindow1.display();
+            glWindow2.display();
+            Thread.sleep(step);
+            duration -= step;
+            x += 1;
+            y += 1;
+            glWindow1.setPosition(x,y);
+            glWindow2.setPosition(glWindow1.getWidth()/2,glWindow1.getHeight()/2-y);
+
+            while( null != ( event = (NEWTEvent) eventFifo.get() ) ) {
+                Window source = (Window) event.getSource();
+                if(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY == event.getEventType()) {
+                    shouldQuit = true;
+                } else if(event instanceof KeyEvent) {
+                    KeyEvent keyEvent = (KeyEvent) event;
+                    switch(keyEvent.getKeyChar()) {
+                        case 'q':
+                            shouldQuit = true;
+                            break;
+                        case 'f':
+                            source.setFullscreen(!source.isFullscreen());
+                            break;
+                    }
+                } 
+            }
+        }
+        destroyWindow(null, null, window2, glWindow2);
+        destroyWindow(display, screen, window1, glWindow1);
+    }
+
+    public static void setDemoFields(GLEventListener demo, Window window, GLWindow glWindow, boolean debug) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(window);
+        if(debug) {
+            MiscUtils.setFieldIfExists(demo, "glDebug", true);
+            MiscUtils.setFieldIfExists(demo, "glTrace", true);
+        }
+        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            }
+        }
+        String tstname = TestParenting02NEWT.class.getName();
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
new file mode 100644
index 0000000..7da30cf
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
@@ -0,0 +1,203 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import java.awt.Button;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Label;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.FPSAnimator;
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.*;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestParenting03AWT extends UITestCase {
+    static Dimension size;
+    static long durationPerTest = 400;
+    static long waitAdd2nd = 200;
+    static GLCapabilities glCaps;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        size = new Dimension(400,200);
+        glCaps = new GLCapabilities(null);
+        glCaps.setAlphaBits(8);
+        glCaps.setBackgroundOpaque(false);
+    }
+
+    @Test
+    public void testWindowParenting1AWTOneNewtChild01() throws InterruptedException, InvocationTargetException {
+        testWindowParenting1AWTOneNewtChild();
+    }
+
+    public void testWindowParenting1AWTOneNewtChild() throws InterruptedException, InvocationTargetException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        glWindow1.enablePerfLog(true);
+        glWindow1.setUndecorated(true);
+        NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
+        newtCanvasAWT1.setPreferredSize(size);
+
+        GLEventListener demo1 = new Gears(1);
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+        final NewtCanvasAWT f_newtCanvasAWT1 = newtCanvasAWT1;
+        final GLWindow f_glWindow1 = glWindow1;
+        glWindow1.addKeyListener(new KeyAdapter() {
+            public void keyTyped(KeyEvent e) {
+                if(e.getKeyChar()=='d') {
+                    f_glWindow1.setUndecorated(!f_glWindow1.isUndecorated());
+                } else if(e.getKeyChar()=='f') {
+                    f_glWindow1.setFullscreen(!f_glWindow1.isFullscreen());
+                } else if(e.getKeyChar()=='r') {
+                    if(f_glWindow1.getParent()==null) {
+                        System.err.println("XXX glWin1 to home");
+                        f_glWindow1.reparentWindow(f_newtCanvasAWT1.getNativeWindow());
+                    } else {
+                        System.err.println("XXX glWin1 to TOP");
+                        f_glWindow1.reparentWindow(null);
+                    }
+                }
+            }
+        });
+        GLAnimatorControl animator1 = new Animator(glWindow1);
+        animator1.start();
+
+        Container cont1 = new Container();
+        cont1.setLayout(new BorderLayout());
+        cont1.add(newtCanvasAWT1, BorderLayout.CENTER);
+        cont1.setVisible(true);
+        final Container f_cont1 = cont1;
+
+        Frame frame1 = new Frame("AWT Parent Frame");
+        frame1.setLayout(new BorderLayout());
+        frame1.add(cont1, BorderLayout.EAST);
+        frame1.add(new Label("center"), BorderLayout.CENTER);
+        frame1.setLocation(0, 0);
+        frame1.setSize((int)size.getWidth(), (int)size.getHeight());
+        final Frame f_frame1 = frame1;
+        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                f_frame1.pack();
+                f_frame1.setVisible(true);
+            }});
+
+        Assert.assertEquals(newtCanvasAWT1.getNativeWindow(),glWindow1.getParent());
+        Assert.assertEquals(true, animator1.isAnimating());
+        Assert.assertEquals(false, animator1.isPaused());
+        Assert.assertNotNull(animator1.getThread());
+
+        Thread.sleep(durationPerTest);
+
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+        Assert.assertEquals(false, animator1.isPaused());
+        Assert.assertEquals(null, animator1.getThread());
+
+        frame1.dispose();
+        glWindow1.invalidate();
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);
+        Window window = glWindow.getWindow();
+        if(debug) {
+            MiscUtils.setFieldIfExists(demo, "glDebug", true);
+            MiscUtils.setFieldIfExists(demo, "glTrace", true);
+        }
+        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            } else if(args[i].equals("-wait")) {
+                waitAdd2nd = atoi(args[++i]);
+            }
+        }
+        String tstname = TestParenting03AWT.class.getName();
+        /*
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } ); */
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03bAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03bAWT.java
new file mode 100644
index 0000000..34d95d8
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03bAWT.java
@@ -0,0 +1,258 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+import java.lang.reflect.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+
+import java.awt.Button;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Label;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.FPSAnimator;
+import com.jogamp.newt.*;
+import com.jogamp.newt.event.*;
+import com.jogamp.newt.opengl.*;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+
+import java.io.IOException;
+
+import com.jogamp.opengl.test.junit.util.*;
+import com.jogamp.opengl.test.junit.jogl.demos.gl2.gears.Gears;
+
+public class TestParenting03bAWT extends UITestCase {
+    static Dimension size;
+    static long durationPerTest = 800;
+    static long waitAdd2nd = 500;
+    static GLCapabilities glCaps;
+
+    @BeforeClass
+    public static void initClass() {
+        GLProfile.initSingleton(true);
+        size = new Dimension(400,200);
+        glCaps = new GLCapabilities(null);
+    }
+
+    @Test
+    public void testWindowParenting1AWTTwoNewtChilds01() throws InterruptedException, InvocationTargetException {
+        testWindowParenting1AWTTwoNewtChilds();
+    }
+
+    public void testWindowParenting1AWTTwoNewtChilds() throws InterruptedException, InvocationTargetException {
+        int x = 0;
+        int y = 0;
+
+        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+
+        GLWindow glWindow1 = GLWindow.create(glCaps);
+        glWindow1.enablePerfLog(true);
+        glWindow1.setUndecorated(true);
+        NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
+        newtCanvasAWT1.setPreferredSize(size);
+
+        GLEventListener demo1 = new Gears(1);
+        setDemoFields(demo1, glWindow1, false);
+        glWindow1.addGLEventListener(demo1);
+        final NewtCanvasAWT f_newtCanvasAWT1 = newtCanvasAWT1;
+        final GLWindow f_glWindow1 = glWindow1;
+        glWindow1.addKeyListener(new KeyAdapter() {
+            public void keyTyped(KeyEvent e) {
+                if(e.getKeyChar()=='d') {
+                    f_glWindow1.setUndecorated(!f_glWindow1.isUndecorated());
+                } else if(e.getKeyChar()=='f') {
+                    f_glWindow1.setFullscreen(!f_glWindow1.isFullscreen());
+                } else if(e.getKeyChar()=='r') {
+                    if(f_glWindow1.getParent()==null) {
+                        System.err.println("XXX glWin1 to home");
+                        f_glWindow1.reparentWindow(f_newtCanvasAWT1.getNativeWindow());
+                    } else {
+                        System.err.println("XXX glWin1 to TOP");
+                        f_glWindow1.reparentWindow(null);
+                    }
+                }
+            }
+        });
+        GLAnimatorControl animator1 = new Animator(glWindow1);
+        animator1.start();
+
+        GLWindow glWindow2 = GLWindow.create(glCaps);
+        glWindow2.enablePerfLog(true);
+        glWindow2.setUndecorated(true);
+        NewtCanvasAWT newtCanvasAWT2 = new NewtCanvasAWT(glWindow2);
+        newtCanvasAWT2.setPreferredSize(size);
+
+        GLEventListener demo2 = new Gears(1);
+        setDemoFields(demo2, glWindow2, false);
+        glWindow2.addGLEventListener(demo2);
+        final NewtCanvasAWT f_newtCanvasAWT2 = newtCanvasAWT2;
+        final GLWindow f_glWindow2 = glWindow2;
+        glWindow2.addKeyListener(new KeyAdapter() {
+            public void keyTyped(KeyEvent e) {
+                if(e.getKeyChar()=='d') {
+                    f_glWindow2.setUndecorated(!f_glWindow2.isUndecorated());
+                } else if(e.getKeyChar()=='f') {
+                    f_glWindow2.setFullscreen(!f_glWindow2.isFullscreen());
+                } else if(e.getKeyChar()=='r') {
+                    if(f_glWindow2.getParent()==null) {
+                        System.err.println("XXX glWin2 to home");
+                        f_glWindow2.reparentWindow(f_newtCanvasAWT2.getNativeWindow());
+                    } else {
+                        System.err.println("XXX glWin2 to TOP");
+                        f_glWindow2.reparentWindow(null);
+                    }
+                }
+            }
+        });
+        GLAnimatorControl animator2 = new Animator(glWindow2);
+        animator2.start();
+
+        Container cont1 = new Container();
+        cont1.setLayout(new BorderLayout());
+        cont1.add(newtCanvasAWT1, BorderLayout.CENTER);
+        cont1.setVisible(true);
+        final Container f_cont1 = cont1;
+
+        Container cont2 = new Container();
+        cont2.setLayout(new BorderLayout());
+        cont2.add(newtCanvasAWT2, BorderLayout.CENTER);
+        cont2.setVisible(true);
+        final Container f_cont2 = cont2;
+
+        Frame frame1 = new Frame("AWT Parent Frame");
+        frame1.setLayout(new BorderLayout());
+        frame1.add(cont1, BorderLayout.EAST);
+        frame1.add(new Label("center"), BorderLayout.CENTER);
+        frame1.setLocation(0, 0);
+        frame1.setSize((int)size.getWidth()*2, (int)size.getHeight()*2);
+        final Frame f_frame1 = frame1;
+        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                f_frame1.pack();
+                f_frame1.setVisible(true);
+            }});
+
+        Assert.assertEquals(newtCanvasAWT1.getNativeWindow(),glWindow1.getParent());
+        Assert.assertEquals(newtCanvasAWT2.getNativeWindow(),glWindow2.getParent());
+
+        Assert.assertEquals(true, animator1.isAnimating());
+        Assert.assertEquals(false, animator1.isPaused());
+        Assert.assertNotNull(animator1.getThread());
+
+        Assert.assertEquals(true, animator2.isAnimating());
+        Assert.assertEquals(false, animator2.isPaused());
+        Assert.assertNotNull(animator2.getThread());
+
+        Thread.sleep(waitAdd2nd);
+
+        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                f_frame1.add(f_cont2, BorderLayout.WEST);
+                f_frame1.pack();
+            }});
+
+        Thread.sleep(durationPerTest);
+
+        animator1.stop();
+        Assert.assertEquals(false, animator1.isAnimating());
+        Assert.assertEquals(false, animator1.isPaused());
+        Assert.assertEquals(null, animator1.getThread());
+
+        animator2.stop();
+        Assert.assertEquals(false, animator2.isAnimating());
+        Assert.assertEquals(false, animator2.isPaused());
+        Assert.assertEquals(null, animator2.getThread());
+
+        frame1.dispose();
+        glWindow1.invalidate();
+        glWindow2.invalidate();
+    }
+
+    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+        Assert.assertNotNull(demo);
+        Assert.assertNotNull(glWindow);
+        Window window = glWindow.getWindow();
+        if(debug) {
+            MiscUtils.setFieldIfExists(demo, "glDebug", true);
+            MiscUtils.setFieldIfExists(demo, "glTrace", true);
+        }
+        if(!MiscUtils.setFieldIfExists(demo, "window", window)) {
+            MiscUtils.setFieldIfExists(demo, "glWindow", glWindow);
+        }
+    }
+
+    static int atoi(String a) {
+        int i=0;
+        try {
+            i = Integer.parseInt(a);
+        } catch (Exception ex) { ex.printStackTrace(); }
+        return i;
+    }
+
+    public static void main(String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                durationPerTest = atoi(args[++i]);
+            } else if(args[i].equals("-wait")) {
+                waitAdd2nd = atoi(args[++i]);
+            }
+        }
+        String tstname = TestParenting03bAWT.class.getName();
+        /*
+        org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
+            tstname,
+            "filtertrace=true",
+            "haltOnError=false",
+            "haltOnFailure=false",
+            "showoutput=true",
+            "outputtoformatters=true",
+            "logfailedtests=true",
+            "logtestlistenerevents=true",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
+            "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } ); */
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java
new file mode 100644
index 0000000..05793b9
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.newt.parenting;
+
+import com.jogamp.newt.event.*;
+
+class WindowAction extends WindowAdapter {
+    NEWTEventFiFo eventFifo;
+
+    public WindowAction(NEWTEventFiFo eventFifo) { 
+        this.eventFifo = eventFifo; 
+    }
+
+    public void windowDestroyNotify(WindowEvent e) {
+        eventFifo.put(e);
+    }
+    public void windowDestroyed(WindowEvent e) {
+        eventFifo.put(e);
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java
new file mode 100644
index 0000000..9e5a01e
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+
+public class AWTFocusAdapter implements EventCountAdapter, FocusListener {
+
+    String prefix;
+    int focusGained;
+    boolean wasTemporary;
+
+    public AWTFocusAdapter(String prefix) {
+        this.prefix = prefix;
+        reset();
+    }
+
+    /** @return the balance of focus gained/lost, ie should be 0 or 1 */
+    public int getCount() {
+        return focusGained;
+    }
+
+    public void reset() {
+        focusGained = 0;
+        wasTemporary = false;
+    }
+
+    /** @return true, if the last change was temporary */
+    public boolean getWasTemporary() {
+        return wasTemporary;
+    }
+
+    /* @Override */
+    public void focusGained(FocusEvent e) {
+        ++focusGained;
+        wasTemporary = e.isTemporary();
+        System.err.println("FOCUS AWT  GAINED "+(wasTemporary?"TEMP":"PERM")+" ["+focusGained+"]: "+prefix+", "+e);
+    }
+
+    /* @Override */
+    public void focusLost(FocusEvent e) {
+        --focusGained;
+        wasTemporary = e.isTemporary();
+        System.err.println("FOCUS AWT  LOST   "+(wasTemporary?"TEMP":"PERM")+" ["+focusGained+"]: "+prefix+", "+e);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java
new file mode 100644
index 0000000..ed09ecd
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+public class AWTKeyAdapter extends java.awt.event.KeyAdapter implements EventCountAdapter {
+
+    String prefix;
+    int keyTyped;
+
+    public AWTKeyAdapter(String prefix) {
+        this.prefix = prefix;
+        reset();
+    }
+
+    public int getCount() {
+        return keyTyped;
+    }
+
+    public void reset() {
+        keyTyped = 0;
+    }
+
+    public void keyTyped(java.awt.event.KeyEvent e) {
+        ++keyTyped;
+        System.err.println("KEY AWT  TYPED ["+keyTyped+"]: "+prefix+", "+e);
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java
new file mode 100644
index 0000000..7fa2015
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements EventCountAdapter {
+    String prefix;
+    int mouseClicked;
+
+    public AWTMouseAdapter(String prefix) {
+        this.prefix = prefix;
+        reset();
+    }
+
+    public int getCount() {
+        return mouseClicked;
+    }
+
+    public void reset() {
+        mouseClicked = 0;
+    }
+
+    public void mouseClicked(java.awt.event.MouseEvent e) {
+        mouseClicked+=e.getClickCount();
+        System.err.println("MOUSE AWT CLICKED ["+mouseClicked+"]: "+prefix+", "+e);
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
new file mode 100644
index 0000000..d0f9172
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
@@ -0,0 +1,497 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+import jogamp.newt.WindowImplAccess;
+import java.lang.reflect.InvocationTargetException;
+import java.awt.AWTException;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.EventQueue;
+import java.awt.KeyboardFocusManager;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.event.InputEvent;
+import javax.media.opengl.awt.GLCanvas;
+import javax.swing.JFrame;
+
+public class AWTRobotUtil {
+
+    public static int TIME_OUT = 1000; // 1s
+    public static int ROBOT_DELAY = 50; // ms
+    public static int POLL_DIVIDER = 20; // TO/20
+
+    public static Point getCenterLocation(Object obj, boolean frameTitlebar) 
+        throws InterruptedException, InvocationTargetException {
+        Component comp = null;
+        com.jogamp.newt.Window win = null;
+
+        if(obj instanceof com.jogamp.newt.Window) {
+            win = (com.jogamp.newt.Window) obj;
+        } else if(obj instanceof Component) {
+            comp = (Component) obj;
+        } else {
+            throw new RuntimeException("Neither AWT nor NEWT: "+obj);
+        }
+
+        int x0, y0;
+        if(null!=comp) {
+            Point p0 = comp.getLocationOnScreen();
+            Rectangle r0 = comp.getBounds();
+            if( frameTitlebar && comp instanceof JFrame ) {
+                JFrame jFrame = (JFrame) comp;
+                Container cont = jFrame.getContentPane();
+                Point p1 = cont.getLocationOnScreen();
+                int dx = (int) ( r0.getWidth() / 2.0 + .5 );
+                int dy = (int) ( ( p1.getY() - p0.getY() ) / 2.0 + .5 );
+                x0 = (int) ( p0.getX() + dx + .5 ) ;
+                y0 = (int) ( p0.getY() + dy + .5 ) ;
+            } else {
+                x0 = (int) ( p0.getX() + r0.getWidth()  / 2.0 + .5 ) ;
+                y0 = (int) ( p0.getY() + r0.getHeight() / 2.0 + .5 ) ;
+            }
+        } else {
+            javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null);
+            p0.translate(win.getWidth()/2, win.getHeight()/2);
+            x0 = p0.getX();
+            y0 = p0.getY();
+        }
+
+        return new Point(x0, y0);
+    }
+
+    /**
+     * toFront, call setVisible(true) and toFront(),
+     * after positioning the mouse in the middle of the window via robot.
+     * If the given robot is null, a new one is created (waitForIdle=true).
+     *
+     * @return True if the Window became the global focused Window within TIME_OUT
+     */
+    public static boolean toFront(Robot robot, final java.awt.Window window)
+        throws AWTException, InterruptedException, InvocationTargetException {
+
+        if(null == robot) {
+            robot = new Robot();
+            robot.setAutoWaitForIdle(true);
+        }
+        Point p0 = getCenterLocation(window, false);
+        System.err.println("robot pos: "+p0);
+        robot.mouseMove( (int) p0.getX(), (int) p0.getY() );
+        robot.delay(ROBOT_DELAY);
+
+        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                window.setVisible(true);
+                window.toFront();
+                window.requestFocus();
+            }});
+        robot.delay(ROBOT_DELAY);
+
+        KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
+        int wait;
+        for (wait=0; wait<POLL_DIVIDER && window != kfm.getFocusedWindow(); wait++) {
+            Thread.sleep(TIME_OUT/POLL_DIVIDER);
+        }
+        return wait<POLL_DIVIDER;
+    }
+
+    /**
+     * centerMouse
+     */
+    public static void centerMouse(Robot robot, Object obj) 
+        throws AWTException, InterruptedException, InvocationTargetException {
+
+        if(null == robot) {
+            robot = new Robot();
+            robot.setAutoWaitForIdle(true);
+        }
+
+        Point p0 = getCenterLocation(obj, false);
+        System.err.println("robot pos: "+p0);
+
+        robot.mouseMove( (int) p0.getX(), (int) p0.getY() );
+        robot.delay(ROBOT_DELAY);
+    }
+
+    /**
+     * requestFocus, if robot is valid, use mouse operation,
+     * otherwise programatic, ie call requestFocus
+     */
+    public static void requestFocus(Robot robot, Object obj) 
+        throws AWTException, InterruptedException, InvocationTargetException {
+        Component comp = null;
+        com.jogamp.newt.Window win = null;
+
+        if(obj instanceof com.jogamp.newt.Window) {
+            win = (com.jogamp.newt.Window) obj;
+        } else if(obj instanceof Component) {
+            comp = (Component) obj;
+        } else {
+            throw new RuntimeException("Neither AWT nor NEWT: "+obj);
+        }
+
+        if(null == robot) {
+            if(null!=comp) {
+                final Component f_comp = comp;
+                javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                    public void run() {
+                        f_comp.requestFocus();
+                    }});
+            } else {
+                win.requestFocus();
+            }
+            return;
+        }
+
+        centerMouse(robot, obj);
+
+        robot.delay(ROBOT_DELAY);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(ROBOT_DELAY);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        robot.delay(ROBOT_DELAY);
+    }
+
+    /**
+     *
+     * @return True if the Window became the global focused Window within TIME_OUT
+     */
+    public static boolean waitForFocus(Object obj) throws InterruptedException {
+        int wait;
+        if(obj instanceof Component) {
+            Component comp = (Component) obj;
+            KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
+            for (wait=0; wait<POLL_DIVIDER && comp != kfm.getPermanentFocusOwner(); wait++) {
+                Thread.sleep(TIME_OUT/POLL_DIVIDER);
+            }
+        } else if(obj instanceof com.jogamp.newt.Window) {
+            com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+            for (wait=0; wait<POLL_DIVIDER && !win.hasFocus(); wait++) {
+                Thread.sleep(TIME_OUT/POLL_DIVIDER);
+            }
+        } else {
+            throw new RuntimeException("Neither AWT nor NEWT: "+obj);
+        }
+        return wait<POLL_DIVIDER;
+    }
+
+    /**
+     *
+     * @return True if the Window became the global focused Window within TIME_OUT
+     */
+    public static boolean waitForFocus(Object obj, int gainT0, EventCountAdapter gain, 
+                                                   int lostT0, EventCountAdapter lost) throws InterruptedException {
+        if(!waitForFocus(obj)) {
+            return false;
+        }
+        int wait;
+        for (wait=0; wait<POLL_DIVIDER; wait++) {
+            int gainT1 = gain.getCount();
+            int lostT1 = (null!=lost) ? lost.getCount() : -1;
+            if(gainT1-gainT0==1 && lostT1-lostT0==-1) {
+                return true;
+            }
+            Thread.sleep(TIME_OUT/POLL_DIVIDER);
+        }
+        return false;
+    }
+
+    public static boolean requestFocusAndWait(Robot robot, Object requestFocus, Object waitForFocus)
+        throws AWTException, InterruptedException, InvocationTargetException {
+
+        requestFocus(robot, requestFocus);
+        return waitForFocus(waitForFocus);
+    }
+
+    public static boolean requestFocusAndWait(Robot robot, Object requestFocus, Object waitForFocus, 
+                                              EventCountAdapter gain, EventCountAdapter lost)
+        throws AWTException, InterruptedException, InvocationTargetException {
+
+        int gainT0 = gain.getCount();
+        int lostT0 = (null!=lost) ? lost.getCount() : 0;
+
+        requestFocus(robot, requestFocus);
+        return waitForFocus(waitForFocus, gainT0, gain, lostT0, lost);
+    }
+
+    /**
+     * @param keyTypedCounter shall return the number of keys typed (press + release)
+     * @return True if typeCount keys within TIME_OUT has been received
+     */
+    public static int testKeyType(Robot robot, int typeCount, Object obj, EventCountAdapter keyTypedCounter) 
+        throws AWTException, InterruptedException, InvocationTargetException {
+        Component comp = null;
+        com.jogamp.newt.Window win = null;
+
+        if(null == robot) {
+            robot = new Robot();
+            robot.setAutoWaitForIdle(true);
+        }
+
+        centerMouse(robot, obj);
+
+        int c0 = keyTypedCounter.getCount();
+
+        for(int i=0; i<typeCount; i++) {
+            robot.keyPress(java.awt.event.KeyEvent.VK_A);
+            robot.delay(ROBOT_DELAY);
+            robot.keyRelease(java.awt.event.KeyEvent.VK_A);
+            robot.delay(ROBOT_DELAY);
+        }
+
+        // Wait for the key events to be processed.
+        int wait;
+        for (wait=0; wait<POLL_DIVIDER && (keyTypedCounter.getCount()-c0)<typeCount; wait++) {
+            Thread.sleep(TIME_OUT/POLL_DIVIDER);
+        }
+        return keyTypedCounter.getCount()-c0;
+    }
+
+    /**
+     * @param mouseButton ie InputEvent.BUTTON1_MASK
+     * @param clickCount ie 1, or 2
+     * @return True if the desired clickCount within TIME_OUT has been received
+     */
+    public static int testMouseClick(Robot robot, int mouseButton, int clickCount,
+                                     Object obj, EventCountAdapter mouseClickCounter) 
+        throws AWTException, InterruptedException, InvocationTargetException {
+
+        if(null == robot) {
+            robot = new Robot();
+            robot.setAutoWaitForIdle(true);
+        }
+
+        final int clickTO = com.jogamp.newt.event.MouseEvent.getClickTimeout();
+
+        centerMouse(robot, obj);
+
+        robot.delay(2*clickTO);
+
+        int c0 = mouseClickCounter.getCount();
+
+        for(int i=0; i<clickCount; i++) {
+            robot.mousePress(mouseButton);
+            robot.delay(clickTO/4);
+            robot.mouseRelease(mouseButton);
+            robot.delay(clickTO/4);
+        }
+
+        // Wait for the key events to be processed.
+        int wait;
+        for (wait=0; wait<POLL_DIVIDER && (mouseClickCounter.getCount()-c0)<clickCount; wait++) {
+            Thread.sleep(TIME_OUT/POLL_DIVIDER);
+        }
+        return mouseClickCounter.getCount()-c0;
+    }
+
+    /**
+     *
+     * @return True if the EventCountAdapter became the desired value within TIME_OUT
+     */
+    public static boolean waitForCount(int desired, EventCountAdapter eca) throws InterruptedException {
+        for (int wait=0; wait<POLL_DIVIDER; wait++) {
+            if( eca.getCount() == desired ) {
+                return true;
+            }
+            Thread.sleep(TIME_OUT/POLL_DIVIDER);
+        }
+        return false;
+    }
+
+    /**
+     *
+     * @return True if the Component becomes <code>visible</code> within TIME_OUT
+     */
+    public static boolean waitForVisible(Object obj, boolean visible) throws InterruptedException {
+        int wait;
+        if(obj instanceof Component) {
+            Component comp = (Component) obj;
+            for (wait=0; wait<POLL_DIVIDER && visible != comp.isVisible(); wait++) {
+                Thread.sleep(TIME_OUT/POLL_DIVIDER);
+            }
+        } else if(obj instanceof com.jogamp.newt.Window) {
+            com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+            for (wait=0; wait<POLL_DIVIDER && visible != win.isVisible(); wait++) {
+                Thread.sleep(TIME_OUT/POLL_DIVIDER);
+            }
+        } else {
+            throw new RuntimeException("Neither AWT nor NEWT: "+obj);
+        }
+        return wait<POLL_DIVIDER;
+    }
+
+    /**
+     *
+     * @return True if the Component becomes realized (not displayable, native invalid) within TIME_OUT
+     */
+    public static boolean waitForRealized(Object obj, boolean realized) throws InterruptedException {
+        int wait;
+        if (obj instanceof Component) {
+            Component comp = (Component) obj;
+            for (wait=0; wait<POLL_DIVIDER && realized != comp.isDisplayable(); wait++) {
+                Thread.sleep(TIME_OUT/POLL_DIVIDER);
+            }
+            // if GLCanvas, ensure it got also painted -> drawable.setRealized(true);
+            if(wait<POLL_DIVIDER && comp instanceof GLCanvas) {
+                GLCanvas glcanvas = (GLCanvas) comp;
+                for (wait=0; wait<POLL_DIVIDER && realized != glcanvas.isRealized(); wait++) {
+                    Thread.sleep(TIME_OUT/POLL_DIVIDER);
+                }
+                if(wait>=POLL_DIVIDER) {
+                    // for some reason GLCanvas hasn't been painted yet, force it!
+                    System.err.println("XXX: FORCE REPAINT PRE - canvas: "+glcanvas);
+                    glcanvas.repaint();
+                    for (wait=0; wait<POLL_DIVIDER && realized != glcanvas.isRealized(); wait++) {
+                        Thread.sleep(TIME_OUT/POLL_DIVIDER);
+                    }
+                    System.err.println("XXX: FORCE REPAINT POST - canvas: "+glcanvas);
+                }
+                for (wait=0; wait<POLL_DIVIDER && realized != glcanvas.isRealized(); wait++) {
+                    Thread.sleep(TIME_OUT/POLL_DIVIDER);
+                }
+            }            
+        } else if(obj instanceof com.jogamp.newt.Window) {
+            com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+            for (wait=0; wait<POLL_DIVIDER && realized != win.isNativeValid(); wait++) {
+                Thread.sleep(TIME_OUT/POLL_DIVIDER);
+            }
+        } else {
+            throw new RuntimeException("Neither AWT nor NEWT: "+obj);
+        }
+        return wait<POLL_DIVIDER;
+    }
+
+    /**
+     * Programmatically issue windowClosing on AWT or NEWT.
+     * Wait until the window is closing within TIME_OUT.
+     *
+     * @param obj either an AWT Window (Frame, JFrame) or NEWT Window
+     * @param willClose indicating that the window will close, hence this method waits for the window to be closed
+     * @return True if the Window is closing and closed (if willClose is true), each within TIME_OUT
+     * @throws InterruptedException
+     */
+    public static boolean closeWindow(Object obj, boolean willClose) throws InterruptedException, InvocationTargetException {
+        WindowClosingListener closingListener = addClosingListener(obj);
+        if(obj instanceof java.awt.Window) {
+            final java.awt.Window win = (java.awt.Window) obj;
+            Toolkit tk = Toolkit.getDefaultToolkit();
+            final EventQueue evtQ = tk.getSystemEventQueue();
+            EventQueue.invokeAndWait(new Runnable() {
+                public void run() {
+                    evtQ.postEvent(new java.awt.event.WindowEvent(win, java.awt.event.WindowEvent.WINDOW_CLOSING));
+                } });
+        } else if(obj instanceof com.jogamp.newt.Window) {
+            com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+            WindowImplAccess.windowDestroyNotify(win);
+        }
+        int wait;
+        for (wait=0; wait<POLL_DIVIDER && !closingListener.isWindowClosing(); wait++) {
+            Thread.sleep(TIME_OUT/POLL_DIVIDER);
+        }
+        if(wait<POLL_DIVIDER && willClose) {
+            for (wait=0; wait<POLL_DIVIDER && !closingListener.isWindowClosed(); wait++) {
+                Thread.sleep(TIME_OUT/POLL_DIVIDER);
+            }
+        }
+        return wait<POLL_DIVIDER;
+    }
+
+    public static WindowClosingListener addClosingListener(Object obj) throws InterruptedException {
+        WindowClosingListener cl = null;
+        if(obj instanceof java.awt.Window) {
+            java.awt.Window win = (java.awt.Window) obj;
+            AWTWindowClosingAdapter acl = new AWTWindowClosingAdapter();
+            win.addWindowListener(acl);
+            cl = acl;
+        } else if(obj instanceof com.jogamp.newt.Window) {
+            com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+            NEWTWindowClosingAdapter ncl = new NEWTWindowClosingAdapter();
+            win.addWindowListener(ncl);
+            cl = ncl;
+        } else {
+            throw new RuntimeException("Neither AWT nor NEWT: "+obj);
+        }
+        return cl;
+    }
+    public static interface WindowClosingListener {
+        void reset();
+        public boolean isWindowClosing();
+        public boolean isWindowClosed();
+    }
+    static class AWTWindowClosingAdapter
+            extends java.awt.event.WindowAdapter implements WindowClosingListener
+    {
+        volatile boolean closing = false;
+        volatile boolean closed = false;
+
+        public void reset() {
+            closing = false;
+            closed = false;
+        }
+        public boolean isWindowClosing() {
+            return closing;
+        }
+        public boolean isWindowClosed() {
+            return closed;
+        }
+        public void windowClosing(java.awt.event.WindowEvent e) {
+            closing = true;
+        }
+        public void windowClosed(java.awt.event.WindowEvent e) {
+            closed = true;
+        }
+    }
+    static class NEWTWindowClosingAdapter
+            extends com.jogamp.newt.event.WindowAdapter implements WindowClosingListener
+    {
+        volatile boolean closing = false;
+        volatile boolean closed = false;
+
+        public void reset() {
+            closing = false;
+            closed = false;
+        }
+        public boolean isWindowClosing() {
+            return closing;
+        }
+        public boolean isWindowClosed() {
+            return closed;
+        }
+        public void windowDestroyNotify(com.jogamp.newt.event.WindowEvent e) {
+            closing = true;
+        }
+        public void windowDestroyed(com.jogamp.newt.event.WindowEvent e) {
+            closed = true;
+        }
+    }
+
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java b/src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java
new file mode 100644
index 0000000..e49679d
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+
+import javax.media.opengl.*;
+import com.jogamp.opengl.JoglVersion;
+
+
+public class DumpGLInfo implements GLEventListener {
+
+    public void init(GLAutoDrawable drawable) {
+        GL gl = drawable.getGL();
+        System.err.println(JoglVersion.getGLInfo(gl, null));
+    }
+
+    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    }
+
+    public void display(GLAutoDrawable drawable) {
+    }
+
+    public void dispose(GLAutoDrawable drawable) {
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java
new file mode 100644
index 0000000..105d250
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+public interface EventCountAdapter {
+
+    int getCount();
+    void reset();
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java
new file mode 100644
index 0000000..d919d7c
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+import java.util.List;
+import java.util.Iterator;
+
+public abstract class EventCountAdapterUtil {
+
+    public static void reset(EventCountAdapter[] adapters) {
+        for(int i=0; i<adapters.length; i++) {
+            adapters[i].reset();
+        }
+    }
+
+    public static void reset(List/*<EventCountAdapter>*/ adapters) {
+        for(Iterator i = adapters.iterator(); i.hasNext(); ) {
+            EventCountAdapter adapter = (EventCountAdapter) i.next();
+            adapter.reset();
+        }
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java b/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java
new file mode 100644
index 0000000..bcafc02
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java
@@ -0,0 +1,121 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.util;
+
+import com.jogamp.opengl.util.glsl.ShaderUtil;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
+import org.junit.Assert;
+
+public class GLSLSimpleProgram {
+    private int shaderProgram;
+    private int vertShader;
+    private int fragShader;
+
+    private GLSLSimpleProgram(int shaderProgram, int vertShader, int fragShader) {
+        this.shaderProgram = shaderProgram;
+        this.vertShader = vertShader;
+        this.fragShader = fragShader;
+    }
+
+    public static GLSLSimpleProgram create(GL2ES2 gl, String vertShaderCode, String fragShaderCode, boolean link) {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        PrintStream pbaos = new PrintStream(baos);
+
+        int vertShader = gl.glCreateShader(GL2ES2.GL_VERTEX_SHADER);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
+        int fragShader = gl.glCreateShader(GL2ES2.GL_FRAGMENT_SHADER);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
+        String[] vlines = new String[] { vertShaderCode };
+        int[] vlengths = new int[] { vlines[0].length() };
+        gl.glShaderSource(vertShader, vlines.length, vlines, vlengths, 0);
+        gl.glCompileShader(vertShader);
+        if(!ShaderUtil.isShaderStatusValid(gl, vertShader, gl.GL_COMPILE_STATUS, pbaos)) {
+            System.out.println("getShader:postCompile vertShader: "+baos.toString());
+            Assert.assertTrue(false);
+        }
+        pbaos.flush(); baos.reset();
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
+        
+        String[] flines = new String[] { fragShaderCode };
+        int[] flengths = new int[] { flines[0].length() };
+        gl.glShaderSource(fragShader, flines.length, flines, flengths, 0);
+        gl.glCompileShader(fragShader);
+        if(!ShaderUtil.isShaderStatusValid(gl, fragShader, gl.GL_COMPILE_STATUS, pbaos)) {
+            System.out.println("getShader:postCompile fragShader: "+baos.toString());
+            Assert.assertTrue(false);
+        }
+        pbaos.flush(); baos.reset();
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
+        int shaderProgram = gl.glCreateProgram();
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        gl.glAttachShader(shaderProgram, vertShader);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        gl.glAttachShader(shaderProgram, fragShader);
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
+        if(link) {
+            gl.glLinkProgram(shaderProgram);
+            if(!ShaderUtil.isProgramValid(gl, shaderProgram, pbaos)) {
+                System.out.println("Error (GLSL link error):  "+baos.toString());
+                Assert.assertTrue(false);
+            }
+        }
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+        GLSLSimpleProgram res = new GLSLSimpleProgram(shaderProgram, vertShader, fragShader);
+        return res;
+    }
+
+    public void release(GL2ES2 gl) {
+        gl.glUseProgram(0);
+        gl.glDetachShader(shaderProgram, vertShader);
+        gl.glDeleteShader(vertShader);
+        gl.glDetachShader(shaderProgram, fragShader);
+        gl.glDeleteShader(fragShader);
+        gl.glDeleteProgram(shaderProgram);
+    }
+
+    public int getFragShader() {
+        return fragShader;
+    }
+
+    public int getShaderProgram() {
+        return shaderProgram;
+    }
+
+    public int getVertShader() {
+        return vertShader;
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java b/src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java
new file mode 100644
index 0000000..506fe2d
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+
+package com.jogamp.opengl.test.junit.util;
+
+import java.lang.reflect.*;
+
+public class MiscUtils {
+    public static int atoi(String str, int def) {
+        try {
+            return Integer.parseInt(str);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+        return def;
+    }
+
+    public static boolean setFieldIfExists(Object instance, String fieldName, Object value) {
+        try {
+            Field f = instance.getClass().getField(fieldName);
+            if(value instanceof Boolean || f.getType().isInstance(value)) {
+                f.set(instance, value);
+                return true;
+            } else {
+                System.out.println(instance.getClass()+" '"+fieldName+"' field not assignable with "+value.getClass()+", it's a: "+f.getType());
+            }
+        } catch (IllegalAccessException ex) {
+            throw new RuntimeException(ex);
+        } catch (NoSuchFieldException nsfe) {
+            // OK - throw new RuntimeException(instance.getClass()+" has no '"+fieldName+"' field", nsfe);
+        }
+        return false;
+    }
+}
+
+
+
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java
new file mode 100644
index 0000000..9ee74ae
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java
@@ -0,0 +1,64 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+import com.jogamp.newt.event.WindowAdapter;
+import com.jogamp.newt.event.WindowEvent;
+
+public class NEWTFocusAdapter extends WindowAdapter implements EventCountAdapter {
+
+    String prefix;
+    int focusGained;
+
+    public NEWTFocusAdapter(String prefix) {
+        this.prefix = prefix;
+        reset();
+    }
+
+    public int getCount() {
+        return focusGained;
+    }
+
+    public void reset() {
+        focusGained = 0;
+    }
+
+    @Override
+    public void windowGainedFocus(WindowEvent e) {
+        ++focusGained;
+        System.err.println("FOCUS NEWT GAINED ["+focusGained+"]: "+prefix+", "+e);
+    }
+
+    @Override
+    public void windowLostFocus(WindowEvent e) {
+        --focusGained;
+        System.err.println("FOCUS NEWT LOST   ["+focusGained+"]: "+prefix+", "+e);
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java
new file mode 100644
index 0000000..ba1a2f3
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+import com.jogamp.newt.event.KeyAdapter;
+import com.jogamp.newt.event.KeyEvent;
+
+public class NEWTKeyAdapter extends KeyAdapter implements EventCountAdapter {
+
+    String prefix;
+    int keyTyped;
+
+    public NEWTKeyAdapter(String prefix) {
+        this.prefix = prefix;
+        reset();
+    }
+
+    public int getCount() {
+        return keyTyped;
+    }
+
+    public void reset() {
+        keyTyped = 0;
+    }
+
+    @Override
+    public void keyTyped(KeyEvent e) {
+        ++keyTyped;
+        System.err.println("KEY NEWT TYPED ["+keyTyped+"]: "+prefix+", "+e);
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java
new file mode 100644
index 0000000..617d951
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java
@@ -0,0 +1,57 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+import com.jogamp.newt.event.MouseAdapter;
+import com.jogamp.newt.event.MouseEvent;
+
+public class NEWTMouseAdapter extends MouseAdapter implements EventCountAdapter {
+
+    String prefix;
+    int mouseClicked;
+
+    public NEWTMouseAdapter(String prefix) {
+        this.prefix = prefix;
+        reset();
+    }
+
+    public int getCount() {
+        return mouseClicked;
+    }
+
+    public void reset() {
+        mouseClicked = 0;
+    }
+
+    public void mouseClicked(MouseEvent e) {
+        mouseClicked+=e.getClickCount();
+        System.err.println("MOUSE NEWT CLICKED ["+mouseClicked+"]: "+prefix+", "+e);
+    }
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java
new file mode 100644
index 0000000..77996bf
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java
@@ -0,0 +1,52 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+import com.jogamp.newt.event.*;
+
+public class QuitAdapter extends WindowAdapter implements WindowListener, KeyListener {
+    boolean shouldQuit = false;
+
+    public boolean shouldQuit() { return shouldQuit; }
+
+    public void windowDestroyNotify(WindowEvent e) {
+        System.out.println("QUIT Window "+Thread.currentThread());
+        shouldQuit = true;
+    }
+
+    public void keyTyped(KeyEvent e) {
+        if(e.getKeyChar()=='q') {
+            System.out.println("QUIT Key "+Thread.currentThread());
+            shouldQuit = true;
+        }
+    }
+    public void keyPressed(KeyEvent e) {}
+    public void keyReleased(KeyEvent e) {}
+}
+
diff --git a/src/test/com/jogamp/opengl/test/junit/util/SingletonInstance.java b/src/test/com/jogamp/opengl/test/junit/util/SingletonInstance.java
new file mode 100644
index 0000000..7e3b9eb
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/SingletonInstance.java
@@ -0,0 +1,143 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.nio.channels.FileLock;
+
+public class SingletonInstance {
+
+    static final boolean DEBUG = true;
+    static final String temp_file_path;
+
+    static {
+        String s = null;
+        try {
+            File tmpFile = File.createTempFile("TEST", "tst");
+            String absTmpFile = tmpFile.getCanonicalPath();
+            tmpFile.delete();
+            s = absTmpFile.substring(0, absTmpFile.lastIndexOf(File.separator));
+        } catch (IOException ex) {
+            ex.printStackTrace();
+        }
+        temp_file_path = s;
+    }
+
+    public static String getCanonicalTempPath() {
+        return temp_file_path;
+    }
+
+    public static String getCanonicalTempLockFilePath(String basename) {
+        return getCanonicalTempPath() + File.separator + basename;
+    }
+
+    public SingletonInstance(String lockFileBasename) {
+        this.file = new File ( getCanonicalTempLockFilePath ( lockFileBasename ) );
+    }
+
+    public SingletonInstance(File lockFile) {
+        this.file = lockFile ;
+    }
+
+    public synchronized void lock(long timeout_ms, long poll_ms) {
+        long i=0;
+        try {
+            do {
+                if(tryLock()) {
+                    return;
+                }
+                if(DEBUG && 0==i) {
+                    System.err.println("Wait for lock " + file);
+                }
+                i++;
+                Thread.sleep(poll_ms);
+            } while ( i < timeout_ms / poll_ms ) ;
+        } catch ( InterruptedException ie ) {
+            throw new  RuntimeException(ie);
+        }
+        throw new RuntimeException("SingletonInstance couldn't get lock within "+timeout_ms+"ms");
+    }
+
+    public synchronized boolean tryLock() {
+        try {
+            randomAccessFile = new RandomAccessFile(file, "rw");
+            fileLock = randomAccessFile.getChannel().tryLock();
+
+            if (fileLock != null) {
+                //final File f_file = file;
+                //final RandomAccessFile f_randomAccessFile = randomAccessFile;
+                //final FileLock f_fileLock = fileLock;
+                Runtime.getRuntime().addShutdownHook(new Thread() {
+                    public void run() {
+                        unlock();
+                    }
+                });
+                locked = true;
+                if(DEBUG) {
+                    System.err.println("Locked " + file);
+                }
+                return true;
+            }
+        } catch (Exception e) {
+            System.err.println("Unable to create and/or lock file: " + file);
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    public synchronized boolean unlock() {
+        if(locked) {
+            try {
+                fileLock.release();
+                randomAccessFile.close();
+                file.delete();
+                return true;
+            } catch (Exception e) {
+                System.err.println("Unable to remove lock file: " + file);
+                e.printStackTrace();
+            } finally {
+                fileLock = null;
+                randomAccessFile = null;
+                locked = false;
+            }
+        }
+        return false;
+    }
+
+    public synchronized boolean isLocked() {
+        return locked;
+    }
+
+    File file = null;
+    RandomAccessFile randomAccessFile = null;
+    FileLock fileLock = null;
+    boolean locked = false;
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
new file mode 100644
index 0000000..b01ba1b
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
@@ -0,0 +1,72 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+ 
+package com.jogamp.opengl.test.junit.util;
+
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.AfterClass;
+
+
+public abstract class UITestCase {
+
+    public static final String SINGLE_INSTANCE_LOCK_FILE = "UITestCase.lock";
+
+    static SingletonInstance singletonInstance;
+
+    protected SingletonInstance getSingletonInstance() {
+        return singletonInstance;
+    }
+
+    @BeforeClass
+    public static void oneTimeSetUp() {
+        // one-time initialization code        
+        singletonInstance = new SingletonInstance(SINGLE_INSTANCE_LOCK_FILE);
+        singletonInstance.lock(3*60*1000, 100); // wait up to 3 min, poll every 100ms
+    }
+
+    @AfterClass
+    public static void oneTimeTearDown() {
+        // one-time cleanup code
+        System.gc(); // force cleanup
+        singletonInstance.unlock();
+    }
+
+    @Before
+    public void setUp() {
+        System.err.println("++++ UITestCase.setUp: "+getClass().getName());
+    }
+
+    @After
+    public void tearDown() {
+        System.err.println("++++ UITestCase.tearDown: "+getClass().getName());
+    }
+
+}
+
diff --git a/src/test/jogamp/newt/WindowImplAccess.java b/src/test/jogamp/newt/WindowImplAccess.java
new file mode 100644
index 0000000..76d0dc0
--- /dev/null
+++ b/src/test/jogamp/newt/WindowImplAccess.java
@@ -0,0 +1,57 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ * 
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ * 
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.newt;
+
+import com.jogamp.newt.Window;
+import com.jogamp.newt.opengl.GLWindow;
+
+/**
+ * Allows access to protected methods of WindowImpl
+ */
+public class WindowImplAccess {
+    public static final void windowDestroyNotify(Window win) {
+        WindowImpl winImpl = null;
+        if(win instanceof GLWindow) {
+            GLWindow glwin = (GLWindow) win;
+            winImpl = (WindowImpl) glwin.getWindow();
+        } else if(win instanceof WindowImpl) {
+            winImpl = (WindowImpl) win;
+        } else {
+            throw new RuntimeException("Given Window not a GLWindow, not WindowImpl, but "+win.getClass());
+        }
+        final WindowImpl winImplF = winImpl;
+        winImplF.runOnEDTIfAvail(true, new Runnable() {
+            public void run() {
+                winImplF.windowDestroyNotify();
+            }
+        });        
+    }
+}
+
+
diff --git a/test/native/displayMultiple01.c b/src/test/native/displayMultiple01.c
similarity index 100%
rename from test/native/displayMultiple01.c
rename to src/test/native/displayMultiple01.c
diff --git a/test/native/displayMultiple02.c b/src/test/native/displayMultiple02.c
similarity index 100%
rename from test/native/displayMultiple02.c
rename to src/test/native/displayMultiple02.c
diff --git a/test/native/glExtensionsListGL2.c b/src/test/native/glExtensionsListGL2.c
similarity index 100%
rename from test/native/glExtensionsListGL2.c
rename to src/test/native/glExtensionsListGL2.c
diff --git a/test/native/glExtensionsListGL3.c b/src/test/native/glExtensionsListGL3.c
similarity index 100%
rename from test/native/glExtensionsListGL3.c
rename to src/test/native/glExtensionsListGL3.c
diff --git a/test/native/make.sh b/src/test/native/make.sh
similarity index 100%
rename from test/native/make.sh
rename to src/test/native/make.sh
diff --git a/test/Issue326Test1.java b/test/Issue326Test1.java
deleted file mode 100644
index adf2861..0000000
--- a/test/Issue326Test1.java
+++ /dev/null
@@ -1,92 +0,0 @@
-import java.awt.Frame;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.util.Random;
-
-import javax.media.opengl.GL2;
-import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLEventListener;
-import javax.media.opengl.awt.GLCanvas;
-import javax.media.opengl.glu.GLU;
-
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.awt.TextRenderer;
-
-/** 
- * Demonstrates corruption with older versions of TextRenderer. Two
- * problems: errors when punting from glyph-based renderer to
- * string-by-string renderer, and failure of glyph-based renderer when
- * backing store was NPOT using GL_ARB_texture_rectangle.
- *
- * @author emzic
- */
-
-public class Issue326Test1 extends Frame implements GLEventListener {
-
-    int width, height;
-
-    public static void main(String[] args) {
-        new Issue326Test1();		
-    }
-	
-    GLCanvas canvas;
-    TextRenderer tr ;
-	
-    public Issue326Test1() {
-        super("TextTest");
-        this.setSize(800, 800);
-        canvas = new GLCanvas();
-        canvas.addGLEventListener(this);
-        add(canvas);
-		
-        setVisible(true);
-        addWindowListener(new WindowAdapter() {
-                public void windowClosing(WindowEvent e) {
-                    System.exit(0);
-                }
-            });
-    }
-
-    public void display(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
-        gl.glClearColor(0, 0, 0, 0);
-        gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT);
-		
-	    
-        gl.glMatrixMode(GL2.GL_PROJECTION);
-        gl.glLoadIdentity();		
-        //new GLU().gluPerspective(45f, (float)width/(float)height, 0.1f, 1000f);
-        gl.glOrtho(0.0, 800, 0.0, 800, -100.0, 100.0);
-        gl.glMatrixMode(GL2.GL_MODELVIEW);
-        gl.glLoadIdentity();
-		
-        tr.beginRendering(800,800);
-        tr.draw( "die Marktwirtschaft. Da regelt sich � angeblich", 16, 32);
-        tr.draw( "Hello World! This text is scrambled", 16, 16);
-        tr.endRendering();
-		
-    }
-
-    public void init(GLAutoDrawable arg0) {
-        tr = new TextRenderer(new java.awt.Font("Verdana", java.awt.Font.PLAIN, 12), true, false, null, false);
-        tr.setColor(1, 1, 1 ,1);
-    }
-
-    public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) {
-        width = arg3;
-        height = arg4;
-        GL2 gl = arg0.getGL().getGL2();
-        gl.glViewport(0, 0, width, height);
-        gl.glMatrixMode(GL2.GL_PROJECTION);
-        gl.glLoadIdentity();
-        gl.glOrtho(0.0, 800, 0.0, 200, -100.0, 100.0);
-        gl.glMatrixMode(GL2.GL_MODELVIEW);
-        gl.glLoadIdentity();
-    }
-
-	public void dispose(GLAutoDrawable drawable) {}
-}
diff --git a/test/Issue326Test2.java b/test/Issue326Test2.java
deleted file mode 100644
index b87eee2..0000000
--- a/test/Issue326Test2.java
+++ /dev/null
@@ -1,71 +0,0 @@
-import java.awt.Font;
-import java.awt.Frame;
-import java.awt.event.*;
-import javax.media.opengl.GL2;
-import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLEventListener;
-import javax.media.opengl.awt.GLCanvas;
-
-import com.jogamp.opengl.util.awt.*;
-
-/**
- * Another test case demonstrating corruption with older version of
- * TextRenderer when glyphs were too big for backing store. Font and
- * text courtesy of Patrick Murris. Adapted from Issue326Test1.
- */
-
-public class Issue326Test2 extends Frame implements GLEventListener {
-
-    int width, height;
-
-    public static void main(String[] args) {
-        new Issue326Test2();		
-    }
-	
-    GLCanvas canvas;
-    TextRenderer tr;
-	
-    public Issue326Test2() {
-        super("");
-        this.setSize(800, 800);
-        canvas = new GLCanvas();
-        canvas.addGLEventListener(this);
-        add(canvas);
-		
-        setVisible(true);
-        addWindowListener(new WindowAdapter() {
-                public void windowClosing(WindowEvent e) {
-                    System.exit(0);
-                }
-            });
-    }
-
-    public void display(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
-        gl.glClearColor(0, 0, 0, 0);
-        gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT);
-	    
-        tr.beginRendering(drawable.getWidth(), drawable.getHeight());
-        tr.draw("LA CLAPI\u00c8RE \nAlt: 1100-1700m \nGlissement de terrain majeur", 16, 80);
-        tr.draw("dans la haute Tin\u00e9e, sur un flanc du Parc du Mercantour.", 16, 16);
-        tr.endRendering();
-		
-    }
-
-    public void init(GLAutoDrawable arg0) {
-        tr = new TextRenderer(Font.decode("Arial-BOLD-64"));
-        tr.setColor(1, 1, 1 ,1);
-    }
-
-    public void reshape(GLAutoDrawable arg0, int x, int y, int w, int h) {
-        GL2 gl = arg0.getGL().getGL2();
-        gl.glMatrixMode(GL2.GL_PROJECTION);
-        gl.glLoadIdentity();
-        gl.glOrtho(0.0, w, 0.0, h, -1, 1);
-        gl.glMatrixMode(GL2.GL_MODELVIEW);
-        gl.glLoadIdentity();
-    }
-
-	public void dispose(GLAutoDrawable drawable) {}
-}
-
diff --git a/test/Issue344Base.java b/test/Issue344Base.java
deleted file mode 100644
index 8d0c3b0..0000000
--- a/test/Issue344Base.java
+++ /dev/null
@@ -1,105 +0,0 @@
-import java.awt.BorderLayout;
-import java.awt.Font;
-import java.awt.Frame;
-import java.awt.event.*;
-import java.awt.geom.*;
-
-import javax.media.opengl.GL2;
-import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLEventListener;
-import javax.media.opengl.awt.GLCanvas;
-import javax.media.opengl.glu.*;
-import com.jogamp.opengl.util.awt.TextRenderer;
-
-/** Test Code adapted from TextCube.java (in JOGL demos)
- *
- * @author spiraljetty
- * @author kbr
- */
-
-public abstract class Issue344Base implements GLEventListener
-{
-    GLU glu = new GLU();
-    TextRenderer renderer;
-
-    float textScaleFactor;
-    Font font;
-    boolean useMipMaps;
-
-    protected Issue344Base() {
-        font = new Font("default", Font.PLAIN, 200);
-        useMipMaps = true; //false
-    }
-
-    protected abstract String getText();
-
-    protected void run(String[] args) {
-        Frame frame = new Frame(getClass().getName());
-        frame.setLayout(new BorderLayout());
-
-        GLCanvas canvas = new GLCanvas();
-        canvas.addGLEventListener(this);
-        frame.add(canvas, BorderLayout.CENTER);
-
-        frame.setSize(512, 512);
-        frame.addWindowListener(new WindowAdapter() {
-                public void windowClosing(WindowEvent e) {
-                    new Thread(new Runnable() {
-                            public void run() {
-                                System.exit(0);
-                            }
-                        }).start();
-                }
-            });
-        frame.setVisible(true);
-    }
-
-    public void init(GLAutoDrawable drawable)
-    {
-        GL2 gl = drawable.getGL().getGL2();
-
-        gl.glEnable(GL2.GL_DEPTH_TEST);
-
-        renderer = new TextRenderer(font, useMipMaps);
-
-        Rectangle2D bounds = renderer.getBounds(getText());
-        float w = (float) bounds.getWidth();
-        float h = (float) bounds.getHeight();
-        textScaleFactor = 2.0f / (w * 1.1f);
-        gl.setSwapInterval(0);
-    }
-
-    public void display(GLAutoDrawable drawable)
-    {
-        GL2 gl = drawable.getGL().getGL2();
-        gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
-
-        gl.glMatrixMode(GL2.GL_MODELVIEW);
-        gl.glLoadIdentity();
-        glu.gluLookAt(0, 0, 10,
-                      0, 0, 0,
-                      0, 1, 0);
-
-        renderer.begin3DRendering();
-        Rectangle2D bounds = renderer.getBounds(getText());
-        float w = (float) bounds.getWidth();
-        float h = (float) bounds.getHeight();
-        renderer.draw3D(getText(),
-                        w / -2.0f * textScaleFactor,
-                        h / -2.0f * textScaleFactor,
-                        3f,
-                        textScaleFactor);
-		
-        renderer.end3DRendering();
-    }
-
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
-    {
-        GL2 gl = drawable.getGL().getGL2();
-        gl.glMatrixMode(GL2.GL_PROJECTION);
-        gl.glLoadIdentity();
-        glu.gluPerspective(15, (float) width / (float) height, 5, 15);
-    }
-
-	public void dispose(GLAutoDrawable drawable) {}
-}
diff --git a/test/Issue344Test1.java b/test/Issue344Test1.java
deleted file mode 100644
index c0608ed..0000000
--- a/test/Issue344Test1.java
+++ /dev/null
@@ -1,10 +0,0 @@
-public class Issue344Test1 extends Issue344Base {
-    protected String getText() {
-        // test 1 - weird artifacts appear with a large font & long string 
-        return "abcdefghijklmnopqrstuvwxyz1234567890";
-    }
-
-    public static void main(String[] args) {
-        new Issue344Test1().run(args);
-    }
-}
diff --git a/test/Issue344Test2.java b/test/Issue344Test2.java
deleted file mode 100644
index b090043..0000000
--- a/test/Issue344Test2.java
+++ /dev/null
@@ -1,10 +0,0 @@
-public class Issue344Test2 extends Issue344Base {
-    protected String getText() {
-        // test 2 - unicode hangs program with a large font & long string
-        return "\u201Cabcdefghijklmnopqrstuvwxyz\u201D";
-    }
-
-    public static void main(String[] args) {
-        new Issue344Test2().run(args);
-    }
-}
diff --git a/test/Issue344Test3.java b/test/Issue344Test3.java
deleted file mode 100644
index 381bf0a..0000000
--- a/test/Issue344Test3.java
+++ /dev/null
@@ -1,10 +0,0 @@
-public class Issue344Test3 extends Issue344Base {
-    protected String getText() {
-        // test 3 - slight rendering artifacts around very large letters
-        return "abcde";
-    }
-
-    public static void main(String[] args) {
-        new Issue344Test3().run(args);
-    }
-}
diff --git a/test/Issue344Test4.java b/test/Issue344Test4.java
deleted file mode 100644
index 1e077d2..0000000
--- a/test/Issue344Test4.java
+++ /dev/null
@@ -1,10 +0,0 @@
-public class Issue344Test4 extends Issue344Base {
-    protected String getText() {
-        // test 4 - unicode letter as second-to-last is rendered incorrectly
-        return "\u201CGreetings\u201D!";
-    }
-
-    public static void main(String[] args) {
-        new Issue344Test4().run(args);
-    }
-}
diff --git a/www/index.html b/www/index.html
index 2e0512a..9790d9f 100644
--- a/www/index.html
+++ b/www/index.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
         <link href="../../style.css" rel="stylesheet" type="text/css"/>
         <title>JOGL - Java Binding for the OpenGL API</title>
-        <link href="../../SocialCoding/logo_symbol_finals/website_final_blue_favicon_symbol_16x16pel.ico" rel="shortcut icon">
+        <link href="../../SocialCoding/logo_symbol_finals/website_final_blue_favicon_symbol_16x16pel.ico" rel="shortcut icon"/>
     </head>
     <body>
         <div id="container">
@@ -65,8 +65,10 @@
                         The JOGL project hosts the development version of the
                         Java™ Binding for the OpenGL® API (<a href="http://jcp.org/en/jsr/detail?id=231">JSR-231</a>),
                         and is designed to provide hardware-supported 3D graphics to applications written in Java.
-                        JOGL provides full access to the
-                        <a href="../doc/bouml/html-svg/">APIs in the OpenGL 1.3 - 3.0, 3.1 - 3.3, ≥ 4.0, ES 1.x and ES 2.x specification</a>
+                    </p>
+                    <p>
+                        JOGL provides full access to the APIs in the OpenGL 1.3 - 3.0, 3.1 - 3.3, ≥ 4.0, ES 1.x and ES 2.x specification
+                        [<a href="../doc/bouml/html-svg/">UML diagram</a>]
                         as well as nearly all vendor extensions.
                         It integrates with the AWT and Swing widget sets, as well with custom windowing toolkits using the the NativeWindow API.
                         It is part of a suite of open-source technologies initiated by the Game Technology Group at Sun Microsystems.
@@ -80,7 +82,7 @@
                     <p>
                         The following are a few examples of projects and products using
                         JOGL. To have your project featured here, please email the
-                        <a href="mailto:mediastream [ at ] jogamp . org">project owners</a>.
+                        <a href="../../wiki/index.php/Maintainer_and_Contacts">project maintainers</a>.
                     </p>
                     
                     <table border="0" cellpadding="0" cellspacing="1" width="100%">

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libjogl2-java.git



More information about the pkg-java-commits mailing list